From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 00:08:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96DAC106568E; Sun, 15 Jan 2012 00:08: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 803FA8FC19; Sun, 15 Jan 2012 00:08:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0F08EsY054643; Sun, 15 Jan 2012 00:08:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0F08Ei7054636; Sun, 15 Jan 2012 00:08:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201150008.q0F08Ei7054636@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 15 Jan 2012 00:08: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: r230123 - in head/sys/powerpc: aim include powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 00:08:14 -0000 Author: nwhitehorn Date: Sun Jan 15 00:08:14 2012 New Revision: 230123 URL: http://svn.freebsd.org/changeset/base/230123 Log: Rework SLB trap handling so that double-faults into an SLB trap handler are possible, and double faults within an SLB trap handler are not. The result is that it possible to take an SLB fault at any time, on any address, for any reason, at any point in the kernel. This lets us do two important things. First, it removes the (soft) 16 GB RAM ceiling on PPC64 as well as any architectural limitations on KVA space. Second, it lets the kernel tolerate poorly designed hypervisors that have a tendency to fail to restore the SLB properly after a hypervisor context switch. MFC after: 6 weeks Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/slb.c head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/include/pcpu.h head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Jan 14 23:19:10 2012 (r230122) +++ head/sys/powerpc/aim/machdep.c Sun Jan 15 00:08:14 2012 (r230123) @@ -238,6 +238,7 @@ extern void *trapcode64; extern void *rstcode, *rstsize; #endif extern void *trapcode, *trapsize; +extern void *slbtrap, *slbtrapsize; extern void *alitrap, *alisize; extern void *dsitrap, *dsisize; extern void *decrint, *decrsize; @@ -490,8 +491,8 @@ powerpc_init(vm_offset_t startkernel, vm bcopy(&dsitrap, (void *)(EXC_DSI + trap_offset), (size_t)&dsisize); bcopy(generictrap, (void *)EXC_ISI, (size_t)&trapsize); #ifdef __powerpc64__ - bcopy(generictrap, (void *)EXC_DSE, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_ISE, (size_t)&trapsize); + bcopy(&slbtrap, (void *)EXC_DSE, (size_t)&slbtrapsize); + bcopy(&slbtrap, (void *)EXC_ISE, (size_t)&slbtrapsize); #endif bcopy(generictrap, (void *)EXC_EXI, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_FPU, (size_t)&trapsize); Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Sat Jan 14 23:19:10 2012 (r230122) +++ head/sys/powerpc/aim/slb.c Sun Jan 15 00:08:14 2012 (r230123) @@ -409,15 +409,11 @@ slb_alloc_tree(void) /* Lock entries mapping kernel text and stacks */ -#define SLB_SPILLABLE(slbe) \ - (((slbe & SLBE_ESID_MASK) < VM_MIN_KERNEL_ADDRESS && \ - (slbe & SLBE_ESID_MASK) > 16*SEGMENT_LENGTH) || \ - (slbe & SLBE_ESID_MASK) > VM_MAX_KERNEL_ADDRESS) void slb_insert_kernel(uint64_t slbe, uint64_t slbv) { struct slb *slbcache; - int i, j; + int i; /* We don't want to be preempted while modifying the kernel map */ critical_enter(); @@ -437,15 +433,9 @@ slb_insert_kernel(uint64_t slbe, uint64_ slbcache[USER_SLB_SLOT].slbe = 1; } - for (i = mftb() % n_slbs, j = 0; j < n_slbs; j++, i = (i+1) % n_slbs) { - if (i == USER_SLB_SLOT) - continue; - - if (SLB_SPILLABLE(slbcache[i].slbe)) - break; - } - - KASSERT(j < n_slbs, ("All kernel SLB slots locked!")); + i = mftb() % n_slbs; + if (i == USER_SLB_SLOT) + i = (i+1) % n_slbs; fillkernslb: KASSERT(i != USER_SLB_SLOT, Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Sat Jan 14 23:19:10 2012 (r230122) +++ head/sys/powerpc/aim/trap.c Sun Jan 15 00:08:14 2012 (r230123) @@ -88,7 +88,9 @@ static int handle_onfault(struct trapfra static void syscall(struct trapframe *frame); #ifdef __powerpc64__ -static int handle_slb_spill(pmap_t pm, vm_offset_t addr); + void handle_kernel_slb_spill(int, register_t, register_t); +static int handle_user_slb_spill(pmap_t pm, vm_offset_t addr); +extern int n_slbs; #endif int setfault(faultbuf); /* defined in locore.S */ @@ -191,7 +193,7 @@ trap(struct trapframe *frame) #ifdef __powerpc64__ case EXC_ISE: case EXC_DSE: - if (handle_slb_spill(&p->p_vmspace->vm_pmap, + if (handle_user_slb_spill(&p->p_vmspace->vm_pmap, (type == EXC_ISE) ? frame->srr0 : frame->cpu.aim.dar) != 0) sig = SIGSEGV; @@ -259,27 +261,20 @@ trap(struct trapframe *frame) KASSERT(cold || td->td_ucred != NULL, ("kernel trap doesn't have ucred")); switch (type) { - case EXC_DSI: - if (trap_pfault(frame, 0) == 0) - return; - break; #ifdef __powerpc64__ case EXC_DSE: if ((frame->cpu.aim.dar & SEGMENT_MASK) == USER_ADDR) { __asm __volatile ("slbmte %0, %1" :: - "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), - "r"(USER_SLB_SLBE)); + "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), + "r"(USER_SLB_SLBE)); return; } - - /* FALLTHROUGH */ - case EXC_ISE: - if (handle_slb_spill(kernel_pmap, - (type == EXC_ISE) ? frame->srr0 : - frame->cpu.aim.dar) != 0) - panic("Fault handling kernel SLB miss"); - return; + break; #endif + case EXC_DSI: + if (trap_pfault(frame, 0) == 0) + return; + break; case EXC_MCHK: if (handle_onfault(frame)) return; @@ -326,8 +321,7 @@ printtrap(u_int vector, struct trapframe printf("%s %s trap:\n", isfatal ? "fatal" : "handled", user ? "user" : "kernel"); printf("\n"); - printf(" exception = 0x%x (%s)\n", vector >> 8, - trapname(vector)); + printf(" exception = 0x%x (%s)\n", vector, trapname(vector)); switch (vector) { case EXC_DSE: case EXC_DSI: @@ -486,8 +480,54 @@ syscall(struct trapframe *frame) } #ifdef __powerpc64__ +/* Handle kernel SLB faults -- runs in real mode, all seat belts off */ +void +handle_kernel_slb_spill(int type, register_t dar, register_t srr0) +{ + struct slb *slbcache; + uint64_t slbe, slbv; + uint64_t esid, addr; + int i; + + addr = (type == EXC_ISE) ? srr0 : dar; + slbcache = PCPU_GET(slb); + esid = (uintptr_t)addr >> ADDR_SR_SHFT; + slbe = (esid << SLBE_ESID_SHIFT) | SLBE_VALID; + + /* See if the hardware flushed this somehow (can happen in LPARs) */ + for (i = 0; i < n_slbs; i++) + if (slbcache[i].slbe == (slbe | (uint64_t)i)) + return; + + /* Not in the map, needs to actually be added */ + slbv = kernel_va_to_slbv(addr); + if (slbcache[USER_SLB_SLOT].slbe == 0) { + for (i = 0; i < n_slbs; i++) { + if (i == USER_SLB_SLOT) + continue; + if (!(slbcache[i].slbe & SLBE_VALID)) + goto fillkernslb; + } + + if (i == n_slbs) + slbcache[USER_SLB_SLOT].slbe = 1; + } + + /* Sacrifice a random SLB entry that is not the user entry */ + i = mftb() % n_slbs; + if (i == USER_SLB_SLOT) + i = (i+1) % n_slbs; + +fillkernslb: + /* Write new entry */ + slbcache[i].slbv = slbv; + slbcache[i].slbe = slbe | (uint64_t)i; + + /* Trap handler will restore from cache on exit */ +} + static int -handle_slb_spill(pmap_t pm, vm_offset_t addr) +handle_user_slb_spill(pmap_t pm, vm_offset_t addr) { struct slb *user_entry; uint64_t esid; @@ -495,12 +535,6 @@ handle_slb_spill(pmap_t pm, vm_offset_t esid = (uintptr_t)addr >> ADDR_SR_SHFT; - if (pm == kernel_pmap) { - slb_insert_kernel((esid << SLBE_ESID_SHIFT) | SLBE_VALID, - kernel_va_to_slbv(addr)); - return (0); - } - PMAP_LOCK(pm); user_entry = user_va_to_slb_entry(pm, addr); Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sat Jan 14 23:19:10 2012 (r230122) +++ head/sys/powerpc/aim/trap_subr64.S Sun Jan 15 00:08:14 2012 (r230123) @@ -112,6 +112,9 @@ restore_kernsrs: * r31 scratch * r1 kernel stack * SRR0/1 as at start of trap + * + * NOTE: SPRG1 is never used while the MMU is on, making it safe to reuse + * in any real-mode fault handler, including those handling double faults. */ #define FRAME_SETUP(savearea) \ /* Have to enable translation to allow access of kernel stack: */ \ @@ -120,11 +123,11 @@ restore_kernsrs: std %r30,(savearea+CPUSAVE_SRR0)(%r31); /* save SRR0 */ \ mfsrr1 %r30; \ std %r30,(savearea+CPUSAVE_SRR1)(%r31); /* save SRR1 */ \ + mfsprg1 %r31; /* get saved SP (clears SPRG1) */ \ mfmsr %r30; \ ori %r30,%r30,(PSL_DR|PSL_IR|PSL_RI)@l; /* relocation on */ \ mtmsr %r30; /* stack can now be accessed */ \ isync; \ - mfsprg1 %r31; /* get saved SP */ \ stdu %r31,-(FRAMELEN+288)(%r1); /* save it in the callframe */ \ std %r0, FRAME_0+48(%r1); /* save r0 in the trapframe */ \ std %r31,FRAME_1+48(%r1); /* save SP " " */ \ @@ -201,7 +204,7 @@ restore_kernsrs: mtctr %r4; \ mtxer %r5; \ mtlr %r6; \ - mtsprg1 %r7; /* save cr */ \ + mtsprg2 %r7; /* save cr */ \ ld %r31,FRAME_31+48(%r1); /* restore r0-31 */ \ ld %r30,FRAME_30+48(%r1); \ ld %r29,FRAME_29+48(%r1); \ @@ -235,16 +238,15 @@ restore_kernsrs: ld %r0, FRAME_0+48(%r1); \ ld %r1, FRAME_1+48(%r1); \ /* Can't touch %r1 from here on */ \ - mtsprg2 %r2; /* save r2 & r3 */ \ - mtsprg3 %r3; \ + mtsprg3 %r3; /* save r3 */ \ /* Disable translation, machine check and recoverability: */ \ - mfmsr %r2; \ - andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ - mtmsr %r2; \ + mfmsr %r3; \ + andi. %r3,%r3,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ + mtmsr %r3; \ isync; \ /* Decide whether we return to user mode: */ \ - GET_CPUINFO(%r2); \ - ld %r3,(savearea+CPUSAVE_SRR1)(%r2); \ + GET_CPUINFO(%r3); \ + ld %r3,(savearea+CPUSAVE_SRR1)(%r3); \ mtcr %r3; \ bf 17,1f; /* branch if PSL_PR is false */ \ /* Restore user SRs */ \ @@ -262,15 +264,15 @@ restore_kernsrs: ld %r29,(savearea+CPUSAVE_R29)(%r3); \ ld %r28,(savearea+CPUSAVE_R28)(%r3); \ ld %r27,(savearea+CPUSAVE_R27)(%r3); \ -1: mfsprg1 %r2; /* restore cr */ \ - mtcr %r2; \ - GET_CPUINFO(%r2); \ - ld %r3,(savearea+CPUSAVE_SRR0)(%r2); /* restore srr0 */ \ +1: mfsprg2 %r3; /* restore cr */ \ + mtcr %r3; \ + GET_CPUINFO(%r3); \ + ld %r3,(savearea+CPUSAVE_SRR0)(%r3); /* restore srr0 */ \ mtsrr0 %r3; \ - ld %r3,(savearea+CPUSAVE_SRR1)(%r2); /* restore srr1 */ \ + GET_CPUINFO(%r3); \ + ld %r3,(savearea+CPUSAVE_SRR1)(%r3); /* restore srr1 */ \ mtsrr1 %r3; \ - mfsprg2 %r2; /* restore r2 & r3 */ \ - mfsprg3 %r3 + mfsprg3 %r3 /* restore r3 */ #ifdef SMP /* @@ -330,6 +332,151 @@ CNAME(trapcode): CNAME(trapsize) = .-CNAME(trapcode) /* + * For SLB misses: do special things for the kernel + * + * Note: SPRG1 is always safe to overwrite any time the MMU is on, which is + * the only time this can be called. + */ + .globl CNAME(slbtrap),CNAME(slbtrapsize) +CNAME(slbtrap): + mtsprg1 %r1 /* save SP */ + GET_CPUINFO(%r1) + std %r2,(PC_SLBSAVE+16)(%r1) + mfcr %r2 /* save CR */ + std %r2,(PC_SLBSAVE+104)(%r1) + mfsrr1 %r2 /* test kernel mode */ + mtcr %r2 + bf 17,1f /* branch if PSL_PR is false */ + /* User mode */ + ld %r2,(PC_SLBSAVE+104)(%r1) /* Restore CR */ + mtcr %r2 + ld %r2,(PC_SLBSAVE+16)(%r1) /* Restore R2 */ + mflr %r1 /* Save the old LR in r1 */ + mtsprg2 %r1 /* And then in SPRG2 */ + li %r1, 0x80 /* How to get the vector from LR */ + bla generictrap /* LR & SPRG3 is exception # */ +1: mflr %r2 /* Save the old LR in r2 */ + bla kern_slbtrap +CNAME(slbtrapsize) = .-CNAME(slbtrap) + +kern_slbtrap: + std %r2,(PC_SLBSAVE+136)(%r1) /* old LR */ + std %r3,(PC_SLBSAVE+24)(%r1) /* save R3 */ + + /* Check if this needs to be handled as a regular trap (userseg miss) */ + mflr %r2 + andi. %r2,%r2,0xff80 + cmpwi %r2,0x380 + bne 1f + mfdar %r2 + b 2f +1: mfsrr0 %r2 +2: /* r2 now contains the fault address */ + lis %r3,SEGMENT_MASK@highesta + ori %r3,%r3,SEGMENT_MASK@highera + sldi %r3,%r3,32 + oris %r3,%r3,SEGMENT_MASK@ha + ori %r3,%r3,SEGMENT_MASK@l + and %r2,%r2,%r3 /* R2 = segment base address */ + lis %r3,USER_ADDR@highesta + ori %r3,%r3,USER_ADDR@highera + sldi %r3,%r3,32 + oris %r3,%r3,USER_ADDR@ha + ori %r3,%r3,USER_ADDR@l + cmpd %r2,%r3 /* Compare fault base to USER_ADDR */ + bne 3f + + /* User seg miss, handle as a regular trap */ + ld %r2,(PC_SLBSAVE+104)(%r1) /* Restore CR */ + mtcr %r2 + ld %r2,(PC_SLBSAVE+16)(%r1) /* Restore R2,R3 */ + ld %r3,(PC_SLBSAVE+24)(%r1) + ld %r1,(PC_SLBSAVE+136)(%r1) /* Save the old LR in r1 */ + mtsprg2 %r1 /* And then in SPRG2 */ + li %r1, 0x80 /* How to get the vector from LR */ + b generictrap /* Retain old LR using b */ + +3: /* Real kernel SLB miss */ + std %r0,(PC_SLBSAVE+0)(%r1) /* free all volatile regs */ + mfsprg1 %r2 /* Old R1 */ + std %r2,(PC_SLBSAVE+8)(%r1) + /* R2,R3 already saved */ + std %r4,(PC_SLBSAVE+32)(%r1) + std %r5,(PC_SLBSAVE+40)(%r1) + std %r6,(PC_SLBSAVE+48)(%r1) + std %r7,(PC_SLBSAVE+56)(%r1) + std %r8,(PC_SLBSAVE+64)(%r1) + std %r9,(PC_SLBSAVE+72)(%r1) + std %r10,(PC_SLBSAVE+80)(%r1) + std %r11,(PC_SLBSAVE+88)(%r1) + std %r12,(PC_SLBSAVE+96)(%r1) + /* CR already saved */ + mfxer %r2 /* save XER */ + std %r2,(PC_SLBSAVE+112)(%r1) + mflr %r2 /* save LR (SP already saved) */ + std %r2,(PC_SLBSAVE+120)(%r1) + mfctr %r2 /* save CTR */ + std %r2,(PC_SLBSAVE+128)(%r1) + + /* Call handler */ + addi %r1,%r1,PC_SLBSTACK-48+1024 + li %r2,~15 + and %r1,%r1,%r2 + lis %r3,tocbase@ha + ld %r2,tocbase@l(%r3) + mflr %r3 + andi. %r3,%r3,0xff80 + mfdar %r4 + mfsrr0 %r5 + bl handle_kernel_slb_spill + nop + + /* Save r28-31, restore r4-r12 */ + GET_CPUINFO(%r1) + ld %r4,(PC_SLBSAVE+32)(%r1) + ld %r5,(PC_SLBSAVE+40)(%r1) + ld %r6,(PC_SLBSAVE+48)(%r1) + ld %r7,(PC_SLBSAVE+56)(%r1) + ld %r8,(PC_SLBSAVE+64)(%r1) + ld %r9,(PC_SLBSAVE+72)(%r1) + ld %r10,(PC_SLBSAVE+80)(%r1) + ld %r11,(PC_SLBSAVE+88)(%r1) + ld %r12,(PC_SLBSAVE+96)(%r1) + std %r28,(PC_SLBSAVE+64)(%r1) + std %r29,(PC_SLBSAVE+72)(%r1) + std %r30,(PC_SLBSAVE+80)(%r1) + std %r31,(PC_SLBSAVE+88)(%r1) + + /* Restore kernel mapping */ + bl restore_kernsrs + + /* Restore remaining registers */ + ld %r28,(PC_SLBSAVE+64)(%r1) + ld %r29,(PC_SLBSAVE+72)(%r1) + ld %r30,(PC_SLBSAVE+80)(%r1) + ld %r31,(PC_SLBSAVE+88)(%r1) + + ld %r2,(PC_SLBSAVE+104)(%r1) + mtcr %r2 + ld %r2,(PC_SLBSAVE+112)(%r1) + mtxer %r2 + ld %r2,(PC_SLBSAVE+120)(%r1) + mtlr %r2 + ld %r2,(PC_SLBSAVE+128)(%r1) + mtctr %r2 + ld %r2,(PC_SLBSAVE+136)(%r1) + mtlr %r2 + + /* Restore r0-r3 */ + ld %r0,(PC_SLBSAVE+0)(%r1) + ld %r2,(PC_SLBSAVE+16)(%r1) + ld %r3,(PC_SLBSAVE+24)(%r1) + mfsprg1 %r1 + + /* Back to whatever we were doing */ + rfid + +/* * For ALI: has to save DSISR and DAR */ .globl CNAME(alitrap),CNAME(alisize) Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Sat Jan 14 23:19:10 2012 (r230122) +++ head/sys/powerpc/include/pcpu.h Sun Jan 15 00:08:14 2012 (r230123) @@ -55,7 +55,9 @@ struct pmap; #define PCPU_MD_AIM64_FIELDS \ struct slb pc_slb[64]; \ - struct slb **pc_userslb; + struct slb **pc_userslb; \ + register_t pc_slbsave[18]; \ + uint8_t pc_slbstack[1024]; #ifdef __powerpc64__ #define PCPU_MD_AIM_FIELDS PCPU_MD_AIM64_FIELDS Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Sat Jan 14 23:19:10 2012 (r230122) +++ head/sys/powerpc/powerpc/genassym.c Sun Jan 15 00:08:14 2012 (r230123) @@ -107,8 +107,11 @@ ASSYM(USER_ADDR, USER_ADDR); #ifdef __powerpc64__ ASSYM(PC_KERNSLB, offsetof(struct pcpu, pc_slb)); ASSYM(PC_USERSLB, offsetof(struct pcpu, pc_userslb)); +ASSYM(PC_SLBSAVE, offsetof(struct pcpu, pc_slbsave)); +ASSYM(PC_SLBSTACK, offsetof(struct pcpu, pc_slbstack)); ASSYM(USER_SLB_SLOT, USER_SLB_SLOT); ASSYM(USER_SLB_SLBE, USER_SLB_SLBE); +ASSYM(SEGMENT_MASK, SEGMENT_MASK); #else ASSYM(PM_SR, offsetof(struct pmap, pm_sr)); ASSYM(USER_SR, USER_SR); From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 02:15:12 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CBEE106564A; Sun, 15 Jan 2012 02:15:12 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2B78FC0C; Sun, 15 Jan 2012 02:15:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0F2F7J5089333; Sun, 15 Jan 2012 06:15:07 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0F2F6Aa089332; Sun, 15 Jan 2012 06:15:06 +0400 (MSK) (envelope-from ache) Date: Sun, 15 Jan 2012 06:15:06 +0400 From: Andrey Chernov To: Xin LI Message-ID: <20120115021505.GA88927@vniz.net> Mail-Followup-To: Andrey Chernov , Xin LI , Kostik Belousov , Alexander Kabaev , John Baldwin , Colin Percival , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201112231500.pBNF0c0O071712@svn.freebsd.org> <201112231058.46642.jhb@freebsd.org> <201112231122.34436.jhb@freebsd.org> <20111223120644.75fe944d@kan.dyndns.org> <20111223175143.GJ50300@deviant.kiev.zoral.com.ua> <20111224100509.GA98136@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.ORG, John Baldwin , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Colin Percival , Kostik Belousov , Alexander Kabaev Subject: Re: svn commit: r228843 - head/contrib/telnet/libtelnet head/crypto/heimdal/appl/telnet/libtelnet head/include head/lib/libc/gen head/lib/libc/iconv head/lib/libc/include head/lib/libc/net head/libexec... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 02:15:12 -0000 On Sat, Dec 24, 2011 at 02:26:20AM -0800, Xin LI wrote: > chroot(2) can create legitimate and secure environment where dlopen(2) > is safe and necessary. It seems it is internal contradiction in your argumentation: 1) You state that chroot(2) can create legitimate environment. 2) For ftpd's you disable .so loading in any case, i.e. even for legitimate environment too and you want to do so intentionally refusing passing responsibility to chroot(2) environment creator. In that situation the only suggestion of something like public interface is setting enviroment variable like "LD_SO_DISABLE" which prevents .so loading in libc. This is more clear than your stopgap. And please don't say that enviroment variable can be overwritten by the user inside ftpd itself, it is not so. And for case when some ftpd allows to call _any_ external program, it could do anything, like with your stopgap too. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 05:58:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B105F106564A; Sun, 15 Jan 2012 05:58:35 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 941688FC0C; Sun, 15 Jan 2012 05:58:34 +0000 (UTC) Received: by lahd3 with SMTP id d3so1404946lah.13 for ; Sat, 14 Jan 2012 21:58:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=NM0rLOtQ5SdJTPho9DMVgTkERjbhdxcfb5m+rTzHBX4=; b=PuVwXtDukkrNoPhN0nCJXkKq975B5l9WIBT2Ku7EZCcij/lO4GfyBfiZz9tk0NSRZ/ 3vsXUrt804ufc5v5zECwixxyZhQksbOPRmNtgmQY+gUFVsZtSYx0lepJ4m6rCqmcTTyy ofC5YZM+gsAwyFR8k19Zg3b+EZ7o2lSj5uDV0= Received: by 10.152.106.227 with SMTP id gx3mr3459325lab.45.1326607113241; Sat, 14 Jan 2012 21:58:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.18.227 with HTTP; Sat, 14 Jan 2012 21:58:02 -0800 (PST) In-Reply-To: <201201142246.q0EMkI6P052011@svn.freebsd.org> References: <201201142246.q0EMkI6P052011@svn.freebsd.org> From: Eitan Adler Date: Sun, 15 Jan 2012 00:58:02 -0500 Message-ID: To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230118 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 05:58:35 -0000 On Sat, Jan 14, 2012 at 5:46 PM, Jilles Tjoelker wrote= : > Author: jilles > Date: Sat Jan 14 22:46:18 2012 > New Revision: 230118 > URL: http://svn.freebsd.org/changeset/base/230118 > > Log: > =C2=A0sh: Change input buffer size from 1023 to 1024. > > =C2=A0PR: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bin/161756 On Wed Oct 19 22:33:38 UTC 2011 you said in the PR: Although this change looks like an improvement, it does not seem fully satisfying. I would like to see performance numbers for the change on your slow embedded platform. Also, why use 1023 or 1024? Another buffer size may be better. But the PR does not seem to answer the question. Can you explain why you decided to act on the PR now? --=20 Eitan Adler From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 07:09:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D7D106566B; Sun, 15 Jan 2012 07:09:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32EE28FC08; Sun, 15 Jan 2012 07:09:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0F79JPm067940; Sun, 15 Jan 2012 07:09:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0F79Iif067938; Sun, 15 Jan 2012 07:09:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201150709.q0F79Iif067938@svn.freebsd.org> From: Eitan Adler Date: Sun, 15 Jan 2012 07:09: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: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 07:09:19 -0000 Author: eadler (ports committer) Date: Sun Jan 15 07:09:18 2012 New Revision: 230125 URL: http://svn.freebsd.org/changeset/base/230125 Log: - Fix undefined behavior when device_get_name is null - Make error message more informative PR: kern/149800 Submitted by: olgeni Approved by: cperciva MFC after: 1 week Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Jan 15 00:46:29 2012 (r230124) +++ head/sys/kern/subr_bus.c Sun Jan 15 07:09:18 2012 (r230125) @@ -2020,9 +2020,15 @@ device_probe_child(device_t dev, device_ if (!hasclass) { if (device_set_devclass(child, dl->driver->name) != 0) { + char const * devname = + device_get_name(child); + if (devname == NULL) + devname = "(unknown)"; printf("driver bug: Unable to set " - "devclass (devname: %s)\n", - device_get_name(child)); + "devclass (class: %s " + "devname: %s)\n", + dl->driver->name, + devname); (void)device_set_driver(child, NULL); continue; } From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 08:36:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06FB8106564A; Sun, 15 Jan 2012 08:36:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9D948FC0A; Sun, 15 Jan 2012 08:36:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0F8aPdl070697; Sun, 15 Jan 2012 08:36:25 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0F8aP1I070694; Sun, 15 Jan 2012 08:36:25 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201150836.q0F8aP1I070694@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 15 Jan 2012 08:36: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: r230127 - in head: . release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 08:36:26 -0000 Author: glebius Date: Sun Jan 15 08:36:25 2012 New Revision: 230127 URL: http://svn.freebsd.org/changeset/base/230127 Log: Restore functionality to pack several kernels into release. All kernels specified by KERNCONF are built and packed into release. The first one is packed into kernel.txz, all others to kernel.CONFIG.txz. The first one is installed on bootables in /boot. Modified: head/Makefile.inc1 head/release/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jan 15 07:48:12 2012 (r230126) +++ head/Makefile.inc1 Sun Jan 15 08:36:25 2012 (r230127) @@ -887,10 +887,21 @@ distributekernel distributekernel.debug: ${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ DESTDIR=${DESTDIR}/${DISTDIR}/kernel \ ${.TARGET:S/distributekernel/install/} +.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} + cd ${KRNLOBJDIR}/${_kernel}; \ + ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ + KERNEL=${INSTKERNNAME}.${_kernel} \ + DESTDIR=${DESTDIR}/${DISTDIR}/kernel.${_kernel} \ + ${.TARGET:S/distributekernel/install/} +.endfor packagekernel: - ${_+_}cd ${DESTDIR}/${DISTDIR}/kernel; \ + cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . +.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} + cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ + tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz . +.endfor # # doxygen Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Jan 15 07:48:12 2012 (r230126) +++ head/release/Makefile Sun Jan 15 08:36:25 2012 (r230127) @@ -75,7 +75,7 @@ base.txz: kernel.txz: -mkdir ${DISTDIR} cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${DISTDIR} - mv ${DISTDIR}/kernel.txz ${.OBJDIR} + mv ${DISTDIR}/kernel*.txz ${.OBJDIR} src.txz: -mkdir -p ${DISTDIR}/usr From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 09:27:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECAEC106566C; Sun, 15 Jan 2012 09:27:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB9AD8FC0A; Sun, 15 Jan 2012 09:27:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0F9R00e072283; Sun, 15 Jan 2012 09:27:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0F9R0I9072281; Sun, 15 Jan 2012 09:27:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201150927.q0F9R0I9072281@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 15 Jan 2012 09:27: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: r230128 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 09:27:01 -0000 Author: glebius Date: Sun Jan 15 09:27:00 2012 New Revision: 230128 URL: http://svn.freebsd.org/changeset/base/230128 Log: Use getopts instead of getopt(1). Suggested by: jilles Modified: head/release/generate-release.sh Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Sun Jan 15 08:36:25 2012 (r230127) +++ head/release/generate-release.sh Sun Jan 15 09:27:00 2012 (r230128) @@ -27,23 +27,18 @@ usage() exit 1 } -args=`getopt r: $*` -if [ $? -ne 0 ]; then - usage -fi -set -- $args REVISION= -while true; do - case "$1" in - -r) - REVISION="-r $2" - shift; shift +while getopts r: opt; do + case $opt in + r) + REVISION="-r $OPTARG" ;; - --) - shift; break + \?) + usage ;; esac done +shift $(($OPTIND - 1)) if [ $# -lt 2 ]; then usage From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 10:44:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625F0106566B; Sun, 15 Jan 2012 10:44:37 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-qw0-f47.google.com (mail-qw0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id 918DC8FC0A; Sun, 15 Jan 2012 10:44:36 +0000 (UTC) Received: by qap15 with SMTP id 15so1843555qap.13 for ; Sun, 15 Jan 2012 02:44:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=BHltgAv2wuXVYdQWO0h4ySG6MMjJda1MxX8zdagYTOE=; b=UVc9H+ICxXzAANnxw2Tvecf/0LE/O1u5ZVcqNLkC+aawOl+TyahY38UPmSIsEDPZtD cMAiy9oDY8Y6B/iohdIFk/SOH7QMJW/pIA7mGScOuGZN5j05z2XghYQNO5lgM3SjtSSn InDRWX1MxW+3yiR5MnLvgBhym7QDRYBwU0gjg= MIME-Version: 1.0 Received: by 10.224.183.81 with SMTP id cf17mr9526450qab.48.1326624275629; Sun, 15 Jan 2012 02:44:35 -0800 (PST) Received: by 10.229.162.15 with HTTP; Sun, 15 Jan 2012 02:44:35 -0800 (PST) In-Reply-To: <20120115021505.GA88927@vniz.net> References: <201112231500.pBNF0c0O071712@svn.freebsd.org> <201112231058.46642.jhb@freebsd.org> <201112231122.34436.jhb@freebsd.org> <20111223120644.75fe944d@kan.dyndns.org> <20111223175143.GJ50300@deviant.kiev.zoral.com.ua> <20111224100509.GA98136@vniz.net> <20120115021505.GA88927@vniz.net> Date: Sun, 15 Jan 2012 02:44:35 -0800 Message-ID: From: Xin LI To: Andrey Chernov , Xin LI , Kostik Belousov , Alexander Kabaev , John Baldwin , Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Subject: Re: svn commit: r228843 - head/contrib/telnet/libtelnet head/crypto/heimdal/appl/telnet/libtelnet head/include head/lib/libc/gen head/lib/libc/iconv head/lib/libc/include head/lib/libc/net head/libexec... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 10:44:37 -0000 On Sat, Jan 14, 2012 at 6:15 PM, Andrey Chernov wrote: > On Sat, Dec 24, 2011 at 02:26:20AM -0800, Xin LI wrote: >> chroot(2) can create legitimate and secure environment where dlopen(2) >> is safe and necessary. > > It seems it is internal contradiction in your argumentation: > 1) You state that chroot(2) can create legitimate environment. > 2) For ftpd's you disable .so loading in any case, i.e. even for > legitimate environment too and you want to do so intentionally refusing > passing responsibility to chroot(2) environment creator. > > In that situation the only suggestion of something like public interface > is setting enviroment variable like "LD_SO_DISABLE" which prevents .so > loading in libc. > > This is more clear than your stopgap. > > And please don't say that enviroment variable can be overwritten by the > user inside ftpd itself, it is not so. And for case when some ftpd allows > to call _any_ external program, it could do anything, like with your > stopgap too. Why you need anything if the program needs to run something inside the chroot, which means one already have set up a full chroot environment? Cheers, -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 11:35:41 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C13CC106566C; Sun, 15 Jan 2012 11:35:41 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 2551D8FC13; Sun, 15 Jan 2012 11:35:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0FBZb02006809; Sun, 15 Jan 2012 15:35:37 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0FBZatG006808; Sun, 15 Jan 2012 15:35:36 +0400 (MSK) (envelope-from ache) Date: Sun, 15 Jan 2012 15:35:35 +0400 From: Andrey Chernov To: Xin LI Message-ID: <20120115113534.GA6439@vniz.net> Mail-Followup-To: Andrey Chernov , Xin LI , Kostik Belousov , Alexander Kabaev , John Baldwin , Colin Percival , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201112231500.pBNF0c0O071712@svn.freebsd.org> <201112231058.46642.jhb@freebsd.org> <201112231122.34436.jhb@freebsd.org> <20111223120644.75fe944d@kan.dyndns.org> <20111223175143.GJ50300@deviant.kiev.zoral.com.ua> <20111224100509.GA98136@vniz.net> <20120115021505.GA88927@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.ORG, John Baldwin , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Colin Percival , Kostik Belousov , Alexander Kabaev Subject: Re: svn commit: r228843 - head/contrib/telnet/libtelnet head/crypto/heimdal/appl/telnet/libtelnet head/include head/lib/libc/gen head/lib/libc/iconv head/lib/libc/include head/lib/libc/net head/libexec... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 11:35:41 -0000 On Sun, Jan 15, 2012 at 02:44:35AM -0800, Xin LI wrote: > Why you need anything if the program needs to run something inside the > chroot, which means one already have set up a full chroot environment? 1) ftpds usually not allows to run any program by default. Max default set usualy is: ls, tar, gzip, zip, compress and date. Nobody of them can reset environment and so touch LD_SO_DISABLE. Some external programs can be added to the ftpd config, but it is responsibility of admin to add not unrar but /bin/sh there, i.e. footshooting. 2) It is interesting question: what other camps implements to prevent the problem? I mean other *BSDs and Linuxes. a) If they implement nothing, there is possibility that this artificial problem exists purely in our @secteam exalted minds, which can't review simple patch for >3 years but always are ready for some bit of ugly and unneded creativity. In that particular case it is due to unwilling to pass responsibility to admin who creates chroot() environment. b) If they implement something, why there are no any mentions of it in your list of discussed ideas? -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 12:08:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D35C106566C; Sun, 15 Jan 2012 12:08:21 +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 1B4D88FC0A; Sun, 15 Jan 2012 12:08:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FC8KVL082353; Sun, 15 Jan 2012 12:08:20 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FC8KAh082348; Sun, 15 Jan 2012 12:08:20 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201151208.q0FC8KAh082348@svn.freebsd.org> From: Martin Matuska Date: Sun, 15 Jan 2012 12:08: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: r230129 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 12:08:21 -0000 Author: mm Date: Sun Jan 15 12:08:20 2012 New Revision: 230129 URL: http://svn.freebsd.org/changeset/base/230129 Log: Introduce vn_path_to_global_path() This function updates path string to vnode's full global path and checks the size of the new path string against the pathlen argument. In vfs_domount(), sys_unmount() and kern_jail_set() this new function is used to update the supplied path argument to the respective global path. Unbreaks jailed zfs(8) with enforce_statfs set to 1. Reviewed by: kib MFC after: 1 month Modified: head/sys/kern/kern_jail.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_mount.c head/sys/sys/vnode.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun Jan 15 09:27:00 2012 (r230128) +++ head/sys/kern/kern_jail.c Sun Jan 15 12:08:20 2012 (r230129) @@ -531,6 +531,7 @@ kern_jail_set(struct thread *td, struct int gotchildmax, gotenforce, gothid, gotslevel; int fi, jid, jsys, len, level; int childmax, slevel, vfslocked; + int fullpath_disabled; #if defined(INET) || defined(INET6) int ii, ij; #endif @@ -897,30 +898,40 @@ kern_jail_set(struct thread *td, struct error = EINVAL; goto done_free; } - if (len < 2 || (len == 2 && path[0] == '/')) - path = NULL; - else { + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE, UIO_SYSSPACE, + path, td); + error = namei(&nd); + if (error) + goto done_free; + vfslocked = NDHASGIANT(&nd); + root = nd.ni_vp; + NDFREE(&nd, NDF_ONLY_PNBUF); + error = vn_path_to_global_path(td, root, path, MAXPATHLEN); + if (error == ENODEV) { + /* proceed if sysctl debug.disablefullpath == 1 */ + fullpath_disabled = 1; + if (len < 2 || (len == 2 && path[0] == '/')) + path = NULL; + } else if (error != 0) { + /* exit on other errors */ + VFS_UNLOCK_GIANT(vfslocked); + goto done_free; + } + if (root->v_type != VDIR) { + error = ENOTDIR; + vput(root); + VFS_UNLOCK_GIANT(vfslocked); + goto done_free; + } + VOP_UNLOCK(root, 0); + VFS_UNLOCK_GIANT(vfslocked); + if (fullpath_disabled) { /* Leave room for a real-root full pathname. */ if (len + (path[0] == '/' && strcmp(mypr->pr_path, "/") ? strlen(mypr->pr_path) : 0) > MAXPATHLEN) { error = ENAMETOOLONG; goto done_free; } - NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW, UIO_SYSSPACE, - path, td); - error = namei(&nd); - if (error) - goto done_free; - vfslocked = NDHASGIANT(&nd); - root = nd.ni_vp; - NDFREE(&nd, NDF_ONLY_PNBUF); - if (root->v_type != VDIR) { - error = ENOTDIR; - vrele(root); - VFS_UNLOCK_GIANT(vfslocked); - goto done_free; - } - VFS_UNLOCK_GIANT(vfslocked); } } @@ -1583,7 +1594,8 @@ kern_jail_set(struct thread *td, struct } if (path != NULL) { /* Try to keep a real-rooted full pathname. */ - if (path[0] == '/' && strcmp(mypr->pr_path, "/")) + if (fullpath_disabled && path[0] == '/' && + strcmp(mypr->pr_path, "/")) snprintf(pr->pr_path, sizeof(pr->pr_path), "%s%s", mypr->pr_path, path); else Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Jan 15 09:27:00 2012 (r230128) +++ head/sys/kern/vfs_cache.c Sun Jan 15 12:08:20 2012 (r230129) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1278,3 +1279,76 @@ vn_commname(struct vnode *vp, char *buf, buf[l] = '\0'; return (0); } + +/* + * This function updates path string to vnode's full global path + * and checks the size of the new path string against the pathlen argument. + * + * Requires a locked, referenced vnode and GIANT lock held. + * Vnode is re-locked on success or ENODEV, otherwise unlocked. + * + * If sysctl debug.disablefullpath is set, ENODEV is returned, + * vnode is left locked and path remain untouched. + * + * If vp is a directory, the call to vn_fullpath_global() always succeeds + * because it falls back to the ".." lookup if the namecache lookup fails + */ +int +vn_path_to_global_path(struct thread *td, struct vnode *vp, char *path, + u_int pathlen) +{ + struct nameidata nd; + struct vnode *vp1; + char *rpath, *fbuf; + int error, vfslocked; + + VFS_ASSERT_GIANT(vp->v_mount); + ASSERT_VOP_ELOCKED(vp, __func__); + + /* Return ENODEV if sysctl debug.disablefullpath==1 */ + if (disablefullpath) + return (ENODEV); + + /* Construct global filesystem path from vp. */ + VOP_UNLOCK(vp, 0); + error = vn_fullpath_global(td, vp, &rpath, &fbuf); + + if (error != 0) { + vrele(vp); + return (error); + } + + if (strlen(rpath) >= pathlen) { + vrele(vp); + error = ENAMETOOLONG; + goto out; + } + + /* + * Re-lookup the vnode by path to detect a possible rename. + * As a side effect, the vnode is relocked. + * If vnode was renamed, return ENOENT. + */ + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + UIO_SYSSPACE, path, td); + error = namei(&nd); + if (error != 0) { + vrele(vp); + goto out; + } + vfslocked = NDHASGIANT(&nd); + NDFREE(&nd, NDF_ONLY_PNBUF); + vp1 = nd.ni_vp; + vrele(vp); + if (vp1 == vp) + strcpy(path, rpath); + else { + vput(vp1); + error = ENOENT; + } + VFS_UNLOCK_GIANT(vfslocked); + +out: + free(fbuf, M_TEMP); + return (error); +} Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Jan 15 09:27:00 2012 (r230128) +++ head/sys/kern/vfs_mount.c Sun Jan 15 12:08:20 2012 (r230129) @@ -1085,11 +1085,14 @@ vfs_domount( NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { - error = vfs_domount_first(td, vfsp, fspath, vp, fsflags, - optlist); - } else { + error = vn_path_to_global_path(td, vp, fspath, MNAMELEN); + /* debug.disablefullpath == 1 results in ENODEV */ + if (error == 0 || error == ENODEV) { + error = vfs_domount_first(td, vfsp, fspath, vp, + fsflags, optlist); + } + } else error = vfs_domount_update(td, vp, fsflags, optlist); - } mtx_unlock(&Giant); ASSERT_VI_UNLOCKED(vp, __func__); @@ -1119,9 +1122,10 @@ sys_unmount(td, uap) int flags; } */ *uap; { + struct nameidata nd; struct mount *mp; char *pathbuf; - int error, id0, id1; + int error, id0, id1, vfslocked; AUDIT_ARG_VALUE(uap->flags); if (jailed(td->td_ucred) || usermount == 0) { @@ -1155,6 +1159,21 @@ sys_unmount(td, uap) mtx_unlock(&mountlist_mtx); } else { AUDIT_ARG_UPATH1(td, pathbuf); + /* + * Try to find global path for path argument. + */ + NDINIT(&nd, LOOKUP, + FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + UIO_SYSSPACE, pathbuf, td); + if (namei(&nd) == 0) { + vfslocked = NDHASGIANT(&nd); + NDFREE(&nd, NDF_ONLY_PNBUF); + error = vn_path_to_global_path(td, nd.ni_vp, pathbuf, + MNAMELEN); + if (error == 0 || error == ENODEV) + vput(nd.ni_vp); + VFS_UNLOCK_GIANT(vfslocked); + } mtx_lock(&mountlist_mtx); TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) { if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0) Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Jan 15 09:27:00 2012 (r230128) +++ head/sys/sys/vnode.h Sun Jan 15 12:08:20 2012 (r230129) @@ -605,6 +605,8 @@ int vn_fullpath(struct thread *td, struc int vn_fullpath_global(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf); int vn_commname(struct vnode *vn, char *buf, u_int buflen); +int vn_path_to_global_path(struct thread *td, struct vnode *vp, + char *path, u_int pathlen); int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, accmode_t accmode, struct ucred *cred, int *privused); From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 12:09:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2842C1065672; Sun, 15 Jan 2012 12:09:42 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5BE168FC1E; Sun, 15 Jan 2012 12:09:40 +0000 (UTC) Received: by bke11 with SMTP id 11so649582bke.13 for ; Sun, 15 Jan 2012 04:09:40 -0800 (PST) Received: by 10.205.122.76 with SMTP id gf12mr951924bkc.0.1326629378457; Sun, 15 Jan 2012 04:09:38 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-126-65.pppoe.spdop.ru. [95.165.126.65]) by mx.google.com with ESMTPS id ci12sm31806690bkb.13.2012.01.15.04.09.37 (version=SSLv3 cipher=OTHER); Sun, 15 Jan 2012 04:09:38 -0800 (PST) Message-ID: <4F12C1FC.6010203@zonov.org> Date: Sun, 15 Jan 2012 16:09:32 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Guy Helmer References: <201201052248.q05MmaZk059871@svn.freebsd.org> In-Reply-To: <201201052248.q05MmaZk059871@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; 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: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 12:09:42 -0000 On 06.01.2012 2:48, Guy Helmer wrote: > Author: ghelmer > Date: Thu Jan 5 22:48:36 2012 > New Revision: 229667 > URL: http://svn.freebsd.org/changeset/base/229667 > > Log: > Allow daemon(8) to run pidfile_open() before relenquishing privileges > so pid files can be written in /var/run when started as root. > > I do not expect this to cause any security issues, but if anyone objects > it could be easily reverted. You can't read pidfile by the user that you specify by '-u' flag. That's not good. IMHO, the right way to solve this problem is to create directory in /var/run from post-install script with sufficient privileges to create pidfiles. Also, the idea about close-on-exec flag is good, but not for daemon(8). Opened pidfile uses as an exclusive lock, that prevents from running any other daemon with this pidfile. > > PR: bin/159568 > MFC after: 4 weeks > > Modified: > head/usr.sbin/daemon/daemon.c > > Modified: head/usr.sbin/daemon/daemon.c > ============================================================================== > --- head/usr.sbin/daemon/daemon.c Thu Jan 5 22:31:25 2012 (r229666) > +++ head/usr.sbin/daemon/daemon.c Thu Jan 5 22:48:36 2012 (r229667) > @@ -79,9 +79,6 @@ main(int argc, char *argv[]) > if (argc == 0) > usage(); > > - if (user != NULL) > - restrict_process(user); > - > /* > * Try to open the pidfile before calling daemon(3), > * to be able to report the error intelligently > @@ -97,6 +94,9 @@ main(int argc, char *argv[]) > } > } > > + if (user != NULL) > + restrict_process(user); > + > if (daemon(nochdir, noclose) == -1) > err(1, NULL); > > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Andrey Zonov From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 12:28:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64C641065672; Sun, 15 Jan 2012 12:28:54 +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 EEF2A8FC14; Sun, 15 Jan 2012 12:28:53 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 9DF4D35C1AD; Sun, 15 Jan 2012 13:28:52 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 76BB128468; Sun, 15 Jan 2012 13:28:52 +0100 (CET) Date: Sun, 15 Jan 2012 13:28:52 +0100 From: Jilles Tjoelker To: Eitan Adler Message-ID: <20120115122852.GA63181@stack.nl> References: <201201142246.q0EMkI6P052011@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230118 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 12:28:54 -0000 On Sun, Jan 15, 2012 at 12:58:02AM -0500, Eitan Adler wrote: > On Sat, Jan 14, 2012 at 5:46 PM, Jilles Tjoelker wrote: > > Author: jilles > > Date: Sat Jan 14 22:46:18 2012 > > New Revision: 230118 > > URL: http://svn.freebsd.org/changeset/base/230118 > > > > Log: > >  sh: Change input buffer size from 1023 to 1024. > > > >  PR:           bin/161756 > On Wed Oct 19 22:33:38 UTC 2011 you said in the PR: > Although this change looks like an improvement, it does not seem > fully satisfying. I would like to see performance numbers for the > change on your slow embedded platform. Also, why use 1023 or 1024? > Another buffer size may be better. > But the PR does not seem to answer the question. Can you explain why > you decided to act on the PR now? Because the submitter did not want to run benchmarks for this, and it looked useful anyway. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 13:21:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796AE106566B; Sun, 15 Jan 2012 13:21:37 +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 659498FC0A; Sun, 15 Jan 2012 13:21:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FDLbBN084694; Sun, 15 Jan 2012 13:21:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FDLbln084687; Sun, 15 Jan 2012 13:21:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201151321.q0FDLbln084687@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Jan 2012 13:21: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: r230130 - in head: share/man/man4 sys/conf sys/dev/sound/pci/hda sys/modules/sound/driver/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 13:21:37 -0000 Author: mav Date: Sun Jan 15 13:21:36 2012 New Revision: 230130 URL: http://svn.freebsd.org/changeset/base/230130 Log: Major snd_hda driver rewrite: - Huge old hdac driver was split into three independent pieces: HDA controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function driver (hdaa). - Support for multichannel recording was added. Now, as specification defines, driver checks input associations for pins with sequence numbers 14 and 15, and if found (usually) -- works as before, mixing signals together. If it doesn't, it configures input association as multichannel. - Signal tracer was improved to look for cases where several DACs/ADCs in CODEC can work with the same audio signal. If such case found, driver registers additional playback/record stream (channel) for the pcm device. - New controller streams reservation mechanism was implemented. That allows to have more pcm devices then streams supported by the controller (usually 4 in each direction). Now it limits only number of simultaneously transferred audio streams, that is rarely reachable and properly reported if happens. - Codec pins and GPIO signals configuration was exported via set of writable sysctls. Another sysctl dev.hdaa.X.reconfig allows to trigger driver reconfiguration in run-time. - Driver now decodes pins location and connector type names. In some cases it allows to hint user where on the system case connectors, related to the pcm device, are located. Number of channels supported by pcm device, reported now (if it is not 2), should also make search easier. - Added workaround for digital mic on some Asus laptops/netbooks. MFC after: 2 months Sponsored by: iXsystems, Inc. Added: head/sys/dev/sound/pci/hda/hdaa.c (contents, props changed) head/sys/dev/sound/pci/hda/hdaa.h (contents, props changed) head/sys/dev/sound/pci/hda/hdaa_patches.c (contents, props changed) head/sys/dev/sound/pci/hda/hdac_if.m (contents, props changed) head/sys/dev/sound/pci/hda/hdacc.c (contents, props changed) Modified: head/share/man/man4/snd_hda.4 head/sys/conf/files head/sys/conf/kmod.mk head/sys/dev/sound/pci/hda/hda_reg.h head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdac_private.h head/sys/dev/sound/pci/hda/hdac_reg.h head/sys/modules/sound/driver/hda/Makefile Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Sun Jan 15 12:08:20 2012 (r230129) +++ head/share/man/man4/snd_hda.4 Sun Jan 15 13:21:36 2012 (r230130) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2010 +.Dd January 11, 2012 .Dt SND_HDA 4 .Os .Sh NAME @@ -53,8 +53,9 @@ support for several logical audio device .Pp The .Nm -driver is a HDA bus controller driver and HDA codecs audio functions bridge -driver that allows the generic audio driver, +driver includes HDA bus controller driver (hdac), HDA codec driver (hdacc) +and HDA codecs audio functions bridge driver (hdaa) that allows +the generic audio driver, .Xr sound 4 , to be used with this hardware. Only audio functions are supported by @@ -77,7 +78,9 @@ For example, one device for main rear 7. for independent headset connectors at front and one device for SPDIF or HDMI audio input/output. The assignment of audio inputs and outputs may be tuned with -.Xr device.hints 5 . +.Xr device.hints 5 +or +.Xr sysctl 8 . The driver's verbose boot messages provide a lot of information about the operation of the driver and present audio setup. .Pp @@ -92,19 +95,26 @@ The following variables are available at file: .Bl -tag -width ".Va hint.hdac.%d.config"-offset indent .It Va hint.hdac.%d.config -Configures a range of possible options. +Configures a range of possible controller options. Possible values are: +.Dq Li 64bit , .Dq Li dmapos , +.Dq Li msi . +An option prefixed with +.Dq Li no , +such as +.Dq Li nomsi , +will do the opposite and takes precedence. +Options can be separated by whitespace and commas. +.It Va hint.hdac.%d.msi +Controls MSI (Message Signaled Interrupts) support. +.It Va hint.hdac.%d.cad%d.nid%d.config +Same as +.Va hint.hdaa.%d.nid%d.config +.It Va hint.hdaa.%d.config +Configures a range of possible audio function options. +Possible values are: .Dq Li eapdinv , -.Dq Li gpio0 , -.Dq Li gpio1 , -.Dq Li gpio2 , -.Dq Li gpio3 , -.Dq Li gpio4 , -.Dq Li gpio5 , -.Dq Li gpio6 , -.Dq Li gpio7 , -.Dq Li gpioflush , .Dq Li ivref , .Dq Li ivref50 , .Dq Li ivref80 , @@ -126,22 +136,47 @@ such as will do the opposite and takes precedence. Options can be separated by whitespace and commas. .Pp +The +.Dq Li eapdinv +option inverts External Amplifier Power Down signal. +The +.Dq Li fixedrate +denies all sampling rates except 48KHz. +The +.Dq Li forcestereo +denies mono playback/recording. +The +.Dq Li senseinv +option inverts jack sensing logic. +The +.Dq Li ivref Ns Ar X +and +.Dq Li ovref Ns Ar X +options control the voltage used to power external microphones. +.It Va hint.hdaa.%d.gpio_config +Overrides audio function GPIO pins configuration set by BIOS. +May be specified as a set of space-separated +.Dq Ar num Ns = Ns Ar value +pairs, where +.Ar num +is GPIO line number, and +.Ar value +is one of: +.Dq Li keep , +.Dq Li set , +.Dq Li clear , +.Dq Li disable +and +.Dq Li input . +.Pp .Dq Li GPIO Ns s are a codec's General Purpose I/O pins which system integrators sometimes use to control external muters, amplifiers and so on. If you have no sound, or sound volume is not adequate, you may have to experiment a bit with the GPIO setup to find the optimal setup for your system. -.Pp -The -.Dq Li ivref Ns Ar X -and -.Dq Li ovref Ns Ar X -options control the voltage used to power external microphones. -.It Va hint.hdac.%d.msi -Controls MSI (Message Signaled Interrupts) support. -.It Va hint.hdac.%d.cad%d.nid%d.config -Overrides codec pin configuration set by BIOS. +.It Va hint.hdaa.%d.nid%d.config +Overrides audio function pin configuration set by BIOS. May be specified as a 32-bit hexadecimal value with a leading .Dq 0x , or as a set of space-separated @@ -165,7 +200,7 @@ The following options are supported: Association number. Associations are used to group individual pins to form a complex multi-pin device. -For example, to group 4 connectors for 7.1 output, or to treat several +For example, to group 4 connectors for 7.1 input/output, or to treat several input connectors as sources for the same input device. Association numbers can be specified as numeric values from 0 to 15. A value of 0 means disabled pin. @@ -180,16 +215,22 @@ A unique, per-association number used to particular association. Sequence numbers can be specified as numeric values from 0 to 15. .Pp -For output assotiations sequence numbers encode speaker pairs positions: -0 - Front, 1 - Center/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side. -Standard combinations are: (0) - Stereo; (0, 2), (0, 4) - Quadro; -(0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4) - 7.1. -.Pp The sequence number 15 has a special meaning for output associations. Output pins with this number and device type .Dq Ar Headphones will duplicate (with automatic mute if jack detection is supported) the first pin in that association. +.Pp +The sequence numbers 14 and 15 has a special meaning for input associations. +Their presence in association defines it as multiplexed or mixed respectively. +If none of them present and there are more then one pin in association, +the association will provide multichannel input. +.Pp +For multichannel input/output assotiations sequence numbers encode +channel pairs positions: +0 - Front, 1 - Center/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side. +Standard combinations are: (0) - Stereo; (0, 2), (0, 4) - Quadro; +(0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4) - 7.1. .It Va device Device type. Can be specified as a number from 0 to 15 or as a name: @@ -278,7 +319,11 @@ The following variables are available in addition to those available to all .Xr sound 4 devices: -.Bl -tag -width ".Va dev.hdac.%d.polling" -offset indent +.Bl -tag -width ".Va dev.hdaa.%d.nid%d_original" -offset indent +.It Va dev.hdac.%d.pindump +Setting this to a non-zero value dumps the current pin configuration, main +capabilities and jack sense status of all audio functions on the controller +to console and syslog. .It Va dev.hdac.%d.polling Enables polling mode. In this mode the driver operates by querying the device state on timer @@ -288,11 +333,30 @@ instead of interrupts. Polling is disabled by default. Do not enable it unless you are facing weird interrupt problems or if the device cannot generate interrupts at all. -.It Va dev.hdac.%d.polling_interval -Controller/Jack Sense polling interval (1-1000 ms) -.It Va dev.hdac.%d.pindump -Setting this to a non-zero value dumps the current pin configuration, main -capabilities and jack sense status to console and syslog. +.It Va dev.hdaa.%d.config +Run-time equivalent of the +.Va hint.hdaa.%d.config +tunable. +.It Va dev.hdaa.%d.gpi_state +Current state of GPI lines. +.It Va dev.hdaa.%d.gpio_state +Current state of GPIO lines. +.It Va dev.hdaa.%d.gpio_config +Run-time equivalent of the +.Va hint.hdaa.%d.gpio.config +tunable. +.It Va dev.hdaa.%d.gpo_state +Current state of GPO lines. +.It Va dev.hdaa.%d.nid%d_config +Run-time equivalent of the +.Va hint.hdaa.%d.nid%d.config +tunable. +.It Va dev.hdaa.%d.nid%d_original +Original pin configuration written by BIOS. +.It Va dev.hdaa.%d.reconfig +Setting this to a non-zero value makes driver to destroy existing pcm devices +and process new pins configuration set via +.Va dev.hdaa.%d.nid%d_config. .El .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. @@ -307,22 +371,23 @@ So high codec uniformity and flexibility different ways, depending on requested pins usage described by pins configuration. The driver reports such default pin configuration when verbose messages enabled: .Bd -literal -hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 -hdac0: nid 21 0x99130110 as 1 seq 0 Speaker Fixed jack 3 loc 25 color Unknown misc 1 -hdac0: nid 22 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 -hdac0: nid 23 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 -hdac0: nid 24 0x01a19830 as 3 seq 0 Mic Jack jack 1 loc 1 color Pink misc 8 -hdac0: nid 25 0x02a1983f as 3 seq 15 Mic Jack jack 1 loc 2 color Pink misc 8 -hdac0: nid 26 0x01813031 as 3 seq 1 Line-in Jack jack 1 loc 1 color Blue misc 0 -hdac0: nid 27 0x0221401f as 1 seq 15 Headphones Jack jack 1 loc 2 color Green misc 0 -hdac0: nid 28 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 -hdac0: nid 30 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 -hdac0: nid 31 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 +hdaa0: nid 0x as seq device conn jack loc color misc +hdaa0: 20 01014020 2 0 Line-out Jack 1/8 Rear Green 0 +hdaa0: 21 99130110 1 0 Speaker Fixed ATAPI Onboard Unknown 1 +hdaa0: 22 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA +hdaa0: 23 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA +hdaa0: 24 01a19830 3 0 Mic Jack 1/8 Rear Pink 8 +hdaa0: 25 02a1983f 3 15 Mic Jack 1/8 Front Pink 8 +hdaa0: 26 01813031 3 1 Line-in Jack 1/8 Rear Blue 0 +hdaa0: 27 0221401f 1 15 Headphones Jack 1/8 Front Green 0 +hdaa0: 28 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA +hdaa0: 30 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA +hdaa0: 31 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA .Ed .Pp Here we can see, that the nodes with ID (nid) 25 and 27 are front panel -connectors (Jack, loc 2), nids 20, 24 and 26 are rear panel connectors -(Jack, loc 1) and nid 21 is a built-in speaker (Fixed, loc 25). +connectors (Jack, Front), nids 20, 24 and 26 are rear panel connectors +(Jack, Rear) and nid 21 is a built-in speaker (Fixed, Onboard). Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None" connectivity. So the pin count and description matches to connectors that we have. @@ -330,15 +395,15 @@ we have. Using association (as) and sequence (seq) fields values pins are grouped into 3 associations: .Bd -literal -hdac0: Association 0 (1) out: -hdac0: Pin nid=21 seq=0 -hdac0: Pin nid=27 seq=15 -hdac0: Association 1 (2) out: -hdac0: Pin nid=20 seq=0 -hdac0: Association 2 (3) in: -hdac0: Pin nid=24 seq=0 -hdac0: Pin nid=26 seq=1 -hdac0: Pin nid=25 seq=15 +hdaa0: Association 0 (1) out: +hdaa0: Pin nid=21 seq=0 +hdaa0: Pin nid=27 seq=15 +hdaa0: Association 1 (2) out: +hdaa0: Pin nid=20 seq=0 +hdaa0: Association 2 (3) in: +hdaa0: Pin nid=24 seq=0 +hdaa0: Pin nid=26 seq=1 +hdaa0: Pin nid=25 seq=15 .Ed .Pp Each @@ -497,148 +562,14 @@ Most of controls use logarithmic scale. .Sh HARDWARE The .Nm -driver supports many Intel HDA compatible audio chipsets including the -following: -.Pp -.Bl -bullet -compact -.It -ATI SB450 -.It -ATI SB600 -.It -Intel 631x/632xESB -.It -Intel 82801F (ICH6) -.It -Intel 82801G (ICH7) -.It -Intel 82801H (ICH8) -.It -Intel 82801I (ICH9) -.It -Intel 82801J (ICH10) -.It -Intel US15W (SCH) -.It -nVidia MCP51 -.It -nVidia MCP55 -.It -nVidia MCP61A -.It -nVidia MCP61B -.It -nVidia MCP63 -.It -nVidia MCP65A -.It -nVidia MCP65B -.It -nVidia MCP67A -.It -nVidia MCP67B -.It -nVidia MCP68 -.It -nVidia MCP69 -.It -nVidia MCP73 -.It -nVidia MCP78 -.It -nVidia MCP79 -.It -nVidia MCP89 -.It -SiS 966 -.It -VIA VT8251/8237A -.El -.Pp -The following and many other codecs have been verified to work: +driver supports controllers having PCI class 4 (multimedia) and +subclass 3 (HDA), compatible with Intel HDA specification. .Pp -.Bl -bullet -compact -.It -Analog Devices AD1981HD -.It -Analog Devices AD1983 -.It -Analog Devices AD1984 -.It -Analog Devices AD1986A -.It -Analog Devices AD1988 -.It -Analog Devices AD1988B -.It -CMedia CMI9880 -.It -Conexant CX20549 (Venice) -.It -Conexant CX20551 (Waikiki) -.It -Conexant CX20561 (Hermosa) -.It -Realtek ALC260 -.It -Realtek ALC262 -.It -Realtek ALC268 -.It -Realtek ALC660 -.It -Realtek ALC861 -.It -Realtek ALC861VD -.It -Realtek ALC880 -.It -Realtek ALC882 -.It -Realtek ALC883 -.It -Realtek ALC885 -.It -Realtek ALC888 -.It -Realtek ALC889 -.It -Sigmatel STAC9205 -.It -Sigmatel STAC9220 -.It -Sigmatel STAC9220D / 9223D -.It -Sigmatel STAC9221 -.It -Sigmatel STAC9221D -.It -Sigmatel STAC9227D -.It -Sigmatel STAC9227X -.It -Sigmatel STAC9228D -.It -Sigmatel STAC9228X -.It -Sigmatel STAC9229D -.It -Sigmatel STAC9229X -.It -Sigmatel STAC9230D -.It -Sigmatel STAC9230X -.It -Sigmatel STAC9271D -.It -Sigmatel STAC9872AK -.It -VIA VT1708 -.It -VIA VT1708B -.It -VIA VT1709 -.El +The +.Nm +driver supports more then two hundred different controllers and CODECs. +There is no sense to list all of them here, as in most cases specific CODEC +configuration and wiring are more important then type of the CODEC itself. .Sh SEE ALSO .Xr sound 4 , .Xr snd_ich 4 , @@ -665,19 +596,17 @@ This manual page was written by and .An Giorgos Keramidas Aq keramida@FreeBSD.org . .Sh BUGS -A few Hardware/OEM vendors tend to screw up BIOS settings, thus -rendering the -.Nm -driver useless. -This usually results in a state where the +Some Hardware/OEM vendors tend to screw up BIOS settings or use custom +unusual CODEC wiring that create problems to the driver. +This may result in missing pcm devices, or a state where the .Nm driver seems to attach and work, but no sound is played. Some cases can be solved by tuning .Pa loader.conf variables. -Before trying to fix problem that way, make sure that there really is a problem -and that the PCM audio device in use really corresponds to the expected -audio connector. +But before trying to fix problem that way, make sure that there really is +a problem and that the PCM audio device in use really corresponds to the +expected audio connector. .Pp Some vendors use non-standardized General Purpose I/O (GPIO) pins of the codec to control external amplifiers. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 15 12:08:20 2012 (r230129) +++ head/sys/conf/files Sun Jan 15 13:21:36 2012 (r230130) @@ -1750,7 +1750,11 @@ dev/sound/pci/t4dwave.c optional snd_t4 dev/sound/pci/via8233.c optional snd_via8233 pci dev/sound/pci/via82c686.c optional snd_via82c686 pci dev/sound/pci/vibes.c optional snd_vibes pci +dev/sound/pci/hda/hdaa.c optional snd_hda pci +dev/sound/pci/hda/hdaa_patches.c optional snd_hda pci dev/sound/pci/hda/hdac.c optional snd_hda pci +dev/sound/pci/hda/hdac_if.m optional snd_hda pci +dev/sound/pci/hda/hdacc.c optional snd_hda pci dev/sound/pcm/ac97.c optional sound dev/sound/pcm/ac97_if.m optional sound dev/sound/pcm/ac97_patch.c optional sound Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sun Jan 15 12:08:20 2012 (r230129) +++ head/sys/conf/kmod.mk Sun Jan 15 13:21:36 2012 (r230130) @@ -345,6 +345,7 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_s dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ + dev/sound/pci/hda/hdac_if.m \ dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \ dev/sound/midi/mpu_if.m dev/sound/midi/mpufoi_if.m \ Modified: head/sys/dev/sound/pci/hda/hda_reg.h ============================================================================== --- head/sys/dev/sound/pci/hda/hda_reg.h Sun Jan 15 12:08:20 2012 (r230129) +++ head/sys/dev/sound/pci/hda/hda_reg.h Sun Jan 15 13:21:36 2012 (r230130) @@ -400,7 +400,7 @@ HDA_CMD_GET_UNSOLICITED_RESPONSE_TAG_SHIFT) #define HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE 0x80 -#define HDA_CMD_SET_UNSOLICITED_RESPONSE_TAG_MASK 0x1f +#define HDA_CMD_SET_UNSOLICITED_RESPONSE_TAG_MASK 0x3f #define HDA_CMD_SET_UNSOLICITED_RESPONSE_TAG_SHIFT 0 #define HDA_CMD_SET_UNSOLICITED_RESPONSE_TAG(param) \ @@ -418,14 +418,10 @@ (HDA_CMD_12BIT((cad), (nid), \ HDA_CMD_VERB_SET_PIN_SENSE, (payload))) -#define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT_MASK 0x80000000 -#define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT_SHIFT 31 +#define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT 0x80000000 #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE_MASK 0x7fffffff #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE_SHIFT 0 -#define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT(rsp) \ - (((rsp) & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT_MASK) >> \ - HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT_SHIFT) #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE(rsp) \ (((rsp) & HDA_CMD_GET_PIN_SENSE_IMP_SENSE_MASK) >> \ HDA_CMD_GET_PIN_SENSE_IMP_SENSE_SHIFT) Added: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sound/pci/hda/hdaa.c Sun Jan 15 13:21:36 2012 (r230130) @@ -0,0 +1,5901 @@ +/*- + * Copyright (c) 2006 Stephane E. Potvin + * Copyright (c) 2006 Ariff Abdullah + * Copyright (c) 2008-2012 Alexander Motin + * 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. + */ + +/* + * Intel High Definition Audio (Audio function) driver for FreeBSD. + */ + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + +#include + +#include +#include + +#include +#include +#include + +#include "mixer_if.h" + +SND_DECLARE_FILE("$FreeBSD$"); + +#define hdaa_lock(devinfo) snd_mtxlock((devinfo)->lock) +#define hdaa_unlock(devinfo) snd_mtxunlock((devinfo)->lock) +#define hdaa_lockassert(devinfo) snd_mtxassert((devinfo)->lock) +#define hdaa_lockowned(devinfo) mtx_owned((devinfo)->lock) + +static const struct { + char *key; + uint32_t value; +} hdaa_quirks_tab[] = { + { "softpcmvol", HDAA_QUIRK_SOFTPCMVOL }, + { "fixedrate", HDAA_QUIRK_FIXEDRATE }, + { "forcestereo", HDAA_QUIRK_FORCESTEREO }, + { "eapdinv", HDAA_QUIRK_EAPDINV }, + { "senseinv", HDAA_QUIRK_SENSEINV }, + { "ivref50", HDAA_QUIRK_IVREF50 }, + { "ivref80", HDAA_QUIRK_IVREF80 }, + { "ivref100", HDAA_QUIRK_IVREF100 }, + { "ovref50", HDAA_QUIRK_OVREF50 }, + { "ovref80", HDAA_QUIRK_OVREF80 }, + { "ovref100", HDAA_QUIRK_OVREF100 }, + { "ivref", HDAA_QUIRK_IVREF }, + { "ovref", HDAA_QUIRK_OVREF }, + { "vref", HDAA_QUIRK_VREF }, +}; +#define HDAA_QUIRKS_TAB_LEN \ + (sizeof(hdaa_quirks_tab) / sizeof(hdaa_quirks_tab[0])) + +#define HDA_BDL_MIN 2 +#define HDA_BDL_MAX 256 +#define HDA_BDL_DEFAULT HDA_BDL_MIN + +#define HDA_BLK_MIN HDA_DMA_ALIGNMENT +#define HDA_BLK_ALIGN (~(HDA_BLK_MIN - 1)) + +#define HDA_BUFSZ_MIN 4096 +#define HDA_BUFSZ_MAX 65536 +#define HDA_BUFSZ_DEFAULT 16384 + +#define HDA_PARSE_MAXDEPTH 10 + +MALLOC_DEFINE(M_HDAA, "hdaa", "HDA Audio"); + +const char *HDA_COLORS[16] = {"Unknown", "Black", "Grey", "Blue", "Green", "Red", + "Orange", "Yellow", "Purple", "Pink", "Res.A", "Res.B", "Res.C", "Res.D", + "White", "Other"}; + +const char *HDA_DEVS[16] = {"Line-out", "Speaker", "Headphones", "CD", + "SPDIF-out", "Digital-out", "Modem-line", "Modem-handset", "Line-in", + "AUX", "Mic", "Telephony", "SPDIF-in", "Digital-in", "Res.E", "Other"}; + +const char *HDA_CONNS[4] = {"Jack", "None", "Fixed", "Both"}; + +const char *HDA_CONNECTORS[16] = { + "Unknown", "1/8", "1/4", "ATAPI", "RCA", "Optical", "Digital", "Analog", + "DIN", "XLR", "RJ-11", "Combo", "0xc", "0xd", "0xe", "Other" }; + +const char *HDA_LOCS[64] = { + "0x00", "Rear", "Front", "Left", "Right", "Top", "Bottom", "Rear-panel", + "Drive-bay", "0x09", "0x0a", "0x0b", "0x0c", "0x0d", "0x0e", "0x0f", + "Internal", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "Riser", + "0x18", "Onboard", "0x1a", "0x1b", "0x1c", "0x1d", "0x1e", "0x1f", + "External", "Ext-Rear", "Ext-Front", "Ext-Left", "Ext-Right", "Ext-Top", "Ext-Bottom", "0x07", + "0x28", "0x29", "0x2a", "0x2b", "0x2c", "0x2d", "0x2e", "0x2f", + "Other", "0x31", "0x32", "0x33", "0x34", "0x35", "Other-Bott", "Lid-In", + "Lid-Out", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "0x3f" }; + +const char *HDA_GPIO_ACTIONS[8] = { + "keep", "set", "clear", "disable", "input", "0x05", "0x06", "0x07"}; + +/* Default */ +static uint32_t hdaa_fmt[] = { + SND_FORMAT(AFMT_S16_LE, 2, 0), + 0 +}; + +static struct pcmchan_caps hdaa_caps = {48000, 48000, hdaa_fmt, 0}; + +static const struct { + uint32_t rate; + int valid; + uint16_t base; + uint16_t mul; + uint16_t div; +} hda_rate_tab[] = { + { 8000, 1, 0x0000, 0x0000, 0x0500 }, /* (48000 * 1) / 6 */ + { 9600, 0, 0x0000, 0x0000, 0x0400 }, /* (48000 * 1) / 5 */ + { 12000, 0, 0x0000, 0x0000, 0x0300 }, /* (48000 * 1) / 4 */ + { 16000, 1, 0x0000, 0x0000, 0x0200 }, /* (48000 * 1) / 3 */ + { 18000, 0, 0x0000, 0x1000, 0x0700 }, /* (48000 * 3) / 8 */ + { 19200, 0, 0x0000, 0x0800, 0x0400 }, /* (48000 * 2) / 5 */ + { 24000, 0, 0x0000, 0x0000, 0x0100 }, /* (48000 * 1) / 2 */ + { 28800, 0, 0x0000, 0x1000, 0x0400 }, /* (48000 * 3) / 5 */ + { 32000, 1, 0x0000, 0x0800, 0x0200 }, /* (48000 * 2) / 3 */ + { 36000, 0, 0x0000, 0x1000, 0x0300 }, /* (48000 * 3) / 4 */ + { 38400, 0, 0x0000, 0x1800, 0x0400 }, /* (48000 * 4) / 5 */ + { 48000, 1, 0x0000, 0x0000, 0x0000 }, /* (48000 * 1) / 1 */ + { 64000, 0, 0x0000, 0x1800, 0x0200 }, /* (48000 * 4) / 3 */ + { 72000, 0, 0x0000, 0x1000, 0x0100 }, /* (48000 * 3) / 2 */ + { 96000, 1, 0x0000, 0x0800, 0x0000 }, /* (48000 * 2) / 1 */ + { 144000, 0, 0x0000, 0x1000, 0x0000 }, /* (48000 * 3) / 1 */ + { 192000, 1, 0x0000, 0x1800, 0x0000 }, /* (48000 * 4) / 1 */ + { 8820, 0, 0x4000, 0x0000, 0x0400 }, /* (44100 * 1) / 5 */ + { 11025, 1, 0x4000, 0x0000, 0x0300 }, /* (44100 * 1) / 4 */ + { 12600, 0, 0x4000, 0x0800, 0x0600 }, /* (44100 * 2) / 7 */ + { 14700, 0, 0x4000, 0x0000, 0x0200 }, /* (44100 * 1) / 3 */ + { 17640, 0, 0x4000, 0x0800, 0x0400 }, /* (44100 * 2) / 5 */ + { 18900, 0, 0x4000, 0x1000, 0x0600 }, /* (44100 * 3) / 7 */ + { 22050, 1, 0x4000, 0x0000, 0x0100 }, /* (44100 * 1) / 2 */ + { 25200, 0, 0x4000, 0x1800, 0x0600 }, /* (44100 * 4) / 7 */ + { 26460, 0, 0x4000, 0x1000, 0x0400 }, /* (44100 * 3) / 5 */ + { 29400, 0, 0x4000, 0x0800, 0x0200 }, /* (44100 * 2) / 3 */ + { 33075, 0, 0x4000, 0x1000, 0x0300 }, /* (44100 * 3) / 4 */ + { 35280, 0, 0x4000, 0x1800, 0x0400 }, /* (44100 * 4) / 5 */ + { 44100, 1, 0x4000, 0x0000, 0x0000 }, /* (44100 * 1) / 1 */ + { 58800, 0, 0x4000, 0x1800, 0x0200 }, /* (44100 * 4) / 3 */ + { 66150, 0, 0x4000, 0x1000, 0x0100 }, /* (44100 * 3) / 2 */ + { 88200, 1, 0x4000, 0x0800, 0x0000 }, /* (44100 * 2) / 1 */ + { 132300, 0, 0x4000, 0x1000, 0x0000 }, /* (44100 * 3) / 1 */ + { 176400, 1, 0x4000, 0x1800, 0x0000 }, /* (44100 * 4) / 1 */ +}; +#define HDA_RATE_TAB_LEN (sizeof(hda_rate_tab) / sizeof(hda_rate_tab[0])) + +/**************************************************************************** + * Function prototypes + ****************************************************************************/ +static int hdaa_pcmchannel_setup(struct hdaa_chan *); + +static void hdaa_widget_connection_select(struct hdaa_widget *, uint8_t); +static void hdaa_audio_ctl_amp_set(struct hdaa_audio_ctl *, + uint32_t, int, int); +static struct hdaa_audio_ctl *hdaa_audio_ctl_amp_get(struct hdaa_devinfo *, + nid_t, int, int, int); +static void hdaa_audio_ctl_amp_set_internal(struct hdaa_devinfo *, + nid_t, int, int, int, int, int, int); + +static void hdaa_dump_pin_config(struct hdaa_widget *w, uint32_t conf); + +static char * +hdaa_audio_ctl_ossmixer_mask2allname(uint32_t mask, char *buf, size_t len) +{ + static char *ossname[] = SOUND_DEVICE_NAMES; + int i, first = 1; + + bzero(buf, len); + for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + if (mask & (1 << i)) { + if (first == 0) + strlcat(buf, ", ", len); + strlcat(buf, ossname[i], len); + first = 0; + } + } + return (buf); +} + +static struct hdaa_audio_ctl * +hdaa_audio_ctl_each(struct hdaa_devinfo *devinfo, int *index) +{ + if (devinfo == NULL || + index == NULL || devinfo->ctl == NULL || + devinfo->ctlcnt < 1 || + *index < 0 || *index >= devinfo->ctlcnt) + return (NULL); + return (&devinfo->ctl[(*index)++]); +} + +static struct hdaa_audio_ctl * +hdaa_audio_ctl_amp_get(struct hdaa_devinfo *devinfo, nid_t nid, int dir, + int index, int cnt) +{ + struct hdaa_audio_ctl *ctl; + int i, found = 0; + + if (devinfo == NULL || devinfo->ctl == NULL) + return (NULL); + + i = 0; + while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { + if (ctl->enable == 0) + continue; + if (ctl->widget->nid != nid) + continue; + if (dir && ctl->ndir != dir) + continue; + if (index >= 0 && ctl->ndir == HDAA_CTL_IN && + ctl->dir == ctl->ndir && ctl->index != index) + continue; + found++; + if (found == cnt || cnt <= 0) + return (ctl); + } + + return (NULL); +} + +/* + * Jack detection (Speaker/HP redirection) event handler. + */ +static void +hdaa_hp_switch_handler(struct hdaa_devinfo *devinfo, int asid) +{ + struct hdaa_audio_as *as; + struct hdaa_widget *w; + struct hdaa_audio_ctl *ctl; + uint32_t val, res; + int j; + + as = &devinfo->as[asid]; + if (as->hpredir < 0) + return; + + w = hdaa_widget_get(devinfo, as->pins[15]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + return; + + res = hda_command(devinfo->dev, + HDA_CMD_GET_PIN_SENSE(0, as->pins[15])); + + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x", + as->pins[15], res); + ); + + res = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; + if (devinfo->quirks & HDAA_QUIRK_SENSEINV) + res ^= 1; + + HDA_BOOTVERBOSE( + printf(" %sconnected\n", res == 0 ? "dis" : ""); + ); + + /* (Un)Mute headphone pin. */ + ctl = hdaa_audio_ctl_amp_get(devinfo, + as->pins[15], HDAA_CTL_IN, -1, 1); + if (ctl != NULL && ctl->mute) { + /* If pin has muter - use it. */ + val = (res != 0) ? 0 : 1; + if (val != ctl->forcemute) { + ctl->forcemute = val; + hdaa_audio_ctl_amp_set(ctl, + HDAA_AMP_MUTE_DEFAULT, + HDAA_AMP_VOL_DEFAULT, HDAA_AMP_VOL_DEFAULT); + } + } else { + /* If there is no muter - disable pin output. */ + w = hdaa_widget_get(devinfo, as->pins[15]); + if (w != NULL && w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + if (res != 0) + val = w->wclass.pin.ctrl | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + else + val = w->wclass.pin.ctrl & + ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + if (val != w->wclass.pin.ctrl) { + w->wclass.pin.ctrl = val; + hda_command(devinfo->dev, + HDA_CMD_SET_PIN_WIDGET_CTRL(0, + w->nid, w->wclass.pin.ctrl)); + } + } + } + /* (Un)Mute other pins. */ + for (j = 0; j < 15; j++) { + if (as->pins[j] <= 0) + continue; + ctl = hdaa_audio_ctl_amp_get(devinfo, + as->pins[j], HDAA_CTL_IN, -1, 1); + if (ctl != NULL && ctl->mute) { + /* If pin has muter - use it. */ + val = (res != 0) ? 1 : 0; + if (val == ctl->forcemute) + continue; + ctl->forcemute = val; + hdaa_audio_ctl_amp_set(ctl, + HDAA_AMP_MUTE_DEFAULT, + HDAA_AMP_VOL_DEFAULT, HDAA_AMP_VOL_DEFAULT); + continue; + } + /* If there is no muter - disable pin output. */ + w = hdaa_widget_get(devinfo, as->pins[j]); + if (w != NULL && w->type == + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { + if (res != 0) + val = w->wclass.pin.ctrl & + ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + else + val = w->wclass.pin.ctrl | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + if (val != w->wclass.pin.ctrl) { + w->wclass.pin.ctrl = val; + hda_command(devinfo->dev, + HDA_CMD_SET_PIN_WIDGET_CTRL(0, + w->nid, w->wclass.pin.ctrl)); + } + } + } +} + +/* + * Callback for poll based jack detection. + */ +static void +hdaa_jack_poll_callback(void *arg) +{ + struct hdaa_devinfo *devinfo = arg; + int i; + + hdaa_lock(devinfo); + if (devinfo->poll_ival == 0) { + hdaa_unlock(devinfo); + return; + } + for (i = 0; i < devinfo->ascnt; i++) { + if (devinfo->as[i].hpredir < 0) + continue; + hdaa_hp_switch_handler(devinfo, i); + } + callout_reset(&devinfo->poll_jack, devinfo->poll_ival, + hdaa_jack_poll_callback, devinfo); + hdaa_unlock(devinfo); +} + +/* + * Jack detection initializer. + */ +static void +hdaa_hp_switch_init(struct hdaa_devinfo *devinfo) +{ + struct hdaa_audio_as *as = devinfo->as; + struct hdaa_widget *w; + int i, poll = 0; + + for (i = 0; i < devinfo->ascnt; i++) { + if (as[i].hpredir < 0) + continue; + + w = hdaa_widget_get(devinfo, as[i].pins[15]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) { + device_printf(devinfo->dev, + "No jack detection support at pin %d\n", + as[i].pins[15]); + continue; + } + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) { + as[i].unsol = HDAC_UNSOL_ALLOC( + device_get_parent(devinfo->dev), devinfo->dev, + w->nid); + hda_command(devinfo->dev, + HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, + HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | + as[i].unsol)); + } else + poll = 1; + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Headphones redirection " + "for as=%d nid=%d using %s.\n", + i, w->nid, + (poll != 0) ? "polling" : "unsolicited responses"); + ); + hdaa_hp_switch_handler(devinfo, i); + } + if (poll) { + callout_reset(&devinfo->poll_jack, 1, + hdaa_jack_poll_callback, devinfo); + } +} + +static void +hdaa_hp_switch_deinit(struct hdaa_devinfo *devinfo) +{ + struct hdaa_audio_as *as = devinfo->as; + struct hdaa_widget *w; + int i; + + for (i = 0; i < devinfo->ascnt; i++) { + if (as[i].unsol < 0) + continue; + w = hdaa_widget_get(devinfo, as[i].pins[15]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + hda_command(devinfo->dev, + HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, 0)); + HDAC_UNSOL_FREE( + device_get_parent(devinfo->dev), devinfo->dev, + as[i].unsol); + as[i].unsol = -1; + } +} + +uint32_t +hdaa_widget_pin_patch(uint32_t config, const char *str) +{ + char buf[256]; + char *key, *value, *rest, *bad; + int ival, i; + + strlcpy(buf, str, sizeof(buf)); + rest = buf; + while ((key = strsep(&rest, "=")) != NULL) { + value = strsep(&rest, " \t"); + if (value == NULL) + break; + ival = strtol(value, &bad, 10); + if (strcmp(key, "seq") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_SEQUENCE_MASK; + config |= ((ival << HDA_CONFIG_DEFAULTCONF_SEQUENCE_SHIFT) & + HDA_CONFIG_DEFAULTCONF_SEQUENCE_MASK); + } else if (strcmp(key, "as") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_ASSOCIATION_MASK; + config |= ((ival << HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT) & + HDA_CONFIG_DEFAULTCONF_ASSOCIATION_MASK); + } else if (strcmp(key, "misc") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_MISC_MASK; + config |= ((ival << HDA_CONFIG_DEFAULTCONF_MISC_SHIFT) & + HDA_CONFIG_DEFAULTCONF_MISC_MASK); + } else if (strcmp(key, "color") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_COLOR_MASK; + if (bad[0] == 0) { + config |= ((ival << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT) & + HDA_CONFIG_DEFAULTCONF_COLOR_MASK); + }; + for (i = 0; i < 16; i++) { + if (strcasecmp(HDA_COLORS[i], value) == 0) { + config |= (i << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT); + break; + } + } + } else if (strcmp(key, "ctype") == 0) { + config &= ~HDA_CONFIG_DEFAULTCONF_CONNECTION_TYPE_MASK; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 13:23:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB47E106564A; Sun, 15 Jan 2012 13:23:01 +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 A8B2F8FC0A; Sun, 15 Jan 2012 13:23:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FDN1wR084788; Sun, 15 Jan 2012 13:23:01 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FDN1YK084786; Sun, 15 Jan 2012 13:23:01 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201151323.q0FDN1YK084786@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 15 Jan 2012 13:23: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: r230131 - head/games/morse X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 13:23:01 -0000 Author: uqs Date: Sun Jan 15 13:23:01 2012 New Revision: 230131 URL: http://svn.freebsd.org/changeset/base/230131 Log: Reencode morse.c to UTF-8. This does not make it Unicode aware. No changes in resulting object file. Moved user-visible symbols into comment table, so you can see all chars, not just the ones matching your (fallback) locale. Modified: head/games/morse/morse.c Modified: head/games/morse/morse.c ============================================================================== --- head/games/morse/morse.c Sun Jan 15 13:21:36 2012 (r230130) +++ head/games/morse/morse.c Sun Jan 15 13:23:01 2012 (r230131) @@ -143,26 +143,31 @@ static const struct morsetab mtab[] = { {'\0', ""} }; - +/* + * Code-points for some Latin1 chars in ISO-8859-1 encoding. + * UTF-8 encoded chars in the comments. + */ static const struct morsetab iso8859_1tab[] = { - {'á', ".--.-"}, - {'à', ".--.-"}, - {'â', ".--.-"}, - {'ä', ".-.-"}, - {'ç', "-.-.."}, - {'é', "..-.."}, - {'è', "..-.."}, - {'ê', "-..-."}, - {'ö', "---."}, - {'ü', "..--"}, + {'\340', ".--.-"}, /* à */ + {'\341', ".--.-"}, /* á */ + {'\342', ".--.-"}, /* â */ + {'\344', ".-.-"}, /* ä */ + {'\347', "-.-.."}, /* ç */ + {'\350', "..-.."}, /* è */ + {'\351', "..-.."}, /* é */ + {'\352', "-..-."}, /* ê */ + {'\366', "---."}, /* ö */ + {'\374', "..--"}, /* ü */ {'\0', ""} }; +/* + * Code-points for some Greek chars in ISO-8859-7 encoding. + * UTF-8 encoded chars in the comments. + */ static const struct morsetab iso8859_7tab[] = { /* - * The Greek alphabet; you'll need an ISO8859-7 font in order - * to see the actual characters. * This table does not implement: * - the special sequences for the seven diphthongs, * - the punctuation differences. @@ -180,83 +185,83 @@ static const struct morsetab iso8859_7ta * ; ..-.- * ! --..-- */ - {'á', ".-"}, /* alpha */ - {'Ü', ".-"}, /* alpha with acute */ - {'â', "-..."}, /* beta */ - {'ã', "--."}, /* gamma */ - {'ä', "-.."}, /* delta */ - {'å', "."}, /* epsilon */ - {'Ý', "."}, /* epsilon with acute */ - {'æ', "--.."}, /* zeta */ - {'ç', "...."}, /* eta */ - {'Þ', "...."}, /* eta with acute */ - {'è', "-.-."}, /* theta */ - {'é', ".."}, /* iota */ - {'ß', ".."}, /* iota with acute */ - {'ú', ".."}, /* iota with diaeresis */ - {'À', ".."}, /* iota with acute and diaeresis */ - {'ê', "-.-"}, /* kappa */ - {'ë', ".-.."}, /* lambda */ - {'ì', "--"}, /* mu */ - {'í', "-."}, /* nu */ - {'î', "-..-"}, /* xi */ - {'ï', "---"}, /* omicron */ - {'ü', "---"}, /* omicron with acute */ - {'ð', ".--."}, /* pi */ - {'ñ', ".-."}, /* rho */ - {'ó', "..."}, /* sigma */ - {'ò', "..."}, /* final sigma */ - {'ô', "-"}, /* tau */ - {'õ', "-.--"}, /* upsilon */ - {'ý', "-.--"}, /* upsilon with acute */ - {'û', "-.--"}, /* upsilon and diaeresis */ - {'à', "-.--"}, /* upsilon with acute and diaeresis */ - {'ö', "..-."}, /* phi */ - {'÷', "----"}, /* chi */ - {'ø', "--.-"}, /* psi */ - {'ù', ".--"}, /* omega */ - {'þ', ".--"}, /* omega with acute */ + {'\341', ".-"}, /* α, alpha */ + {'\334', ".-"}, /* ά, alpha with acute */ + {'\342', "-..."}, /* β, beta */ + {'\343', "--."}, /* γ, gamma */ + {'\344', "-.."}, /* δ, delta */ + {'\345', "."}, /* ε, epsilon */ + {'\335', "."}, /* έ, epsilon with acute */ + {'\346', "--.."}, /* ζ, zeta */ + {'\347', "...."}, /* η, eta */ + {'\336', "...."}, /* ή, eta with acute */ + {'\350', "-.-."}, /* θ, theta */ + {'\351', ".."}, /* ι, iota */ + {'\337', ".."}, /* ί, iota with acute */ + {'\372', ".."}, /* ÏŠ, iota with diaeresis */ + {'\300', ".."}, /* Î, iota with acute and diaeresis */ + {'\352', "-.-"}, /* κ, kappa */ + {'\353', ".-.."}, /* λ, lambda */ + {'\354', "--"}, /* μ, mu */ + {'\355', "-."}, /* ν, nu */ + {'\356', "-..-"}, /* ξ, xi */ + {'\357', "---"}, /* ο, omicron */ + {'\374', "---"}, /* ÏŒ, omicron with acute */ + {'\360', ".--."}, /* Ï€, pi */ + {'\361', ".-."}, /* Ï, rho */ + {'\363', "..."}, /* σ, sigma */ + {'\362', "..."}, /* Ï‚, final sigma */ + {'\364', "-"}, /* Ï„, tau */ + {'\365', "-.--"}, /* Ï…, upsilon */ + {'\375', "-.--"}, /* Ï, upsilon with acute */ + {'\373', "-.--"}, /* Ï‹, upsilon and diaeresis */ + {'\340', "-.--"}, /* ΰ, upsilon with acute and diaeresis */ + {'\366', "..-."}, /* φ, phi */ + {'\367', "----"}, /* χ, chi */ + {'\370', "--.-"}, /* ψ, psi */ + {'\371', ".--"}, /* ω, omega */ + {'\376', ".--"}, /* ÏŽ, omega with acute */ {'\0', ""} }; +/* + * Code-points for the Cyrillic alphabet in KOI8-R encoding. + * UTF-8 encoded chars in the comments. + */ static const struct morsetab koi8rtab[] = { - /* - * The Cyrillic alphabet; you'll need a KOI8-R font in order - * to see the actual characters - */ - {'Á', ".-"}, /* a */ - {'Â', "-..."}, /* be */ - {'×', ".--"}, /* ve */ - {'Ç', "--."}, /* ge */ - {'Ä', "-.."}, /* de */ - {'Å', "."}, /* ye */ - {'£', "."}, /* yo, the same as ye */ - {'Ö', "...-"}, /* she */ - {'Ú', "--.."}, /* ze */ - {'É', ".."}, /* i */ - {'Ê', ".---"}, /* i kratkoye */ - {'Ë', "-.-"}, /* ka */ - {'Ì', ".-.."}, /* el */ - {'Í', "--"}, /* em */ - {'Î', "-."}, /* en */ - {'Ï', "---"}, /* o */ - {'Ð', ".--."}, /* pe */ - {'Ò', ".-."}, /* er */ - {'Ó', "..."}, /* es */ - {'Ô', "-"}, /* te */ - {'Õ', "..-"}, /* u */ - {'Æ', "..-."}, /* ef */ - {'È', "...."}, /* kha */ - {'Ã', "-.-."}, /* ce */ - {'Þ', "---."}, /* che */ - {'Û', "----"}, /* sha */ - {'Ý', "--.-"}, /* shcha */ - {'Ù', "-.--"}, /* yi */ - {'Ø', "-..-"}, /* myakhkij znak */ - {'Ü', "..-.."}, /* ae */ - {'À', "..--"}, /* yu */ - {'Ñ', ".-.-"}, /* ya */ + {'\301', ".-"}, /* а, a */ + {'\302', "-..."}, /* б, be */ + {'\327', ".--"}, /* в, ve */ + {'\307', "--."}, /* г, ge */ + {'\304', "-.."}, /* д, de */ + {'\305', "."}, /* е, ye */ + {'\243', "."}, /* Ñ‘, yo, the same as ye */ + {'\326', "...-"}, /* ж, she */ + {'\332', "--.."}, /* з, ze */ + {'\311', ".."}, /* и, i */ + {'\312', ".---"}, /* й, i kratkoye */ + {'\313', "-.-"}, /* к, ka */ + {'\314', ".-.."}, /* л, el */ + {'\315', "--"}, /* м, em */ + {'\316', "-."}, /* н, en */ + {'\317', "---"}, /* о, o */ + {'\320', ".--."}, /* п, pe */ + {'\322', ".-."}, /* Ñ€, er */ + {'\323', "..."}, /* Ñ, es */ + {'\324', "-"}, /* Ñ‚, te */ + {'\325', "..-"}, /* у, u */ + {'\306', "..-."}, /* Ñ„, ef */ + {'\310', "...."}, /* Ñ…, kha */ + {'\303', "-.-."}, /* ц, ce */ + {'\336', "---."}, /* ч, che */ + {'\333', "----"}, /* ш, sha */ + {'\335', "--.-"}, /* щ, shcha */ + {'\331', "-.--"}, /* Ñ‹, yi */ + {'\330', "-..-"}, /* ÑŒ, myakhkij znak */ + {'\334', "..-.."}, /* Ñ, ae */ + {'\300', "..--"}, /* ÑŽ, yu */ + {'\321', ".-.-"}, /* Ñ, ya */ {'\0', ""} }; From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 13:23:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B37B0106564A; Sun, 15 Jan 2012 13:23:20 +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 9E18C8FC13; Sun, 15 Jan 2012 13:23:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FDNKPq084938; Sun, 15 Jan 2012 13:23:20 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FDNJDI084830; Sun, 15 Jan 2012 13:23:19 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201151323.q0FDNJDI084830@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 15 Jan 2012 13:23: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: r230132 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/ahci dev/ata dev/ata/chipsets dev/ex dev/fb dev/pst dev/syscons dev/syscons/blank dev/syscons/fade dev/syscons/green de... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 13:23:20 -0000 Author: uqs Date: Sun Jan 15 13:23:18 2012 New Revision: 230132 URL: http://svn.freebsd.org/changeset/base/230132 Log: Convert files to UTF-8 Modified: head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ipc.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_signal.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_stats.c head/sys/compat/svr4/imgact_svr4.c head/sys/dev/ahci/ahci.h head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-card.c head/sys/dev/ata/ata-cbus.c head/sys/dev/ata/ata-disk.c head/sys/dev/ata/ata-disk.h head/sys/dev/ata/ata-dma.c head/sys/dev/ata/ata-isa.c head/sys/dev/ata/ata-lowlevel.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/ata-queue.c head/sys/dev/ata/ata-raid.c head/sys/dev/ata/ata-raid.h head/sys/dev/ata/ata-sata.c head/sys/dev/ata/ata_if.m head/sys/dev/ata/atapi-cd.c head/sys/dev/ata/atapi-cd.h head/sys/dev/ata/atapi-fd.c head/sys/dev/ata/atapi-fd.h head/sys/dev/ata/atapi-tape.c head/sys/dev/ata/atapi-tape.h head/sys/dev/ata/chipsets/ata-acard.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-adaptec.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-amd.c head/sys/dev/ata/chipsets/ata-ati.c head/sys/dev/ata/chipsets/ata-cenatek.c head/sys/dev/ata/chipsets/ata-cypress.c head/sys/dev/ata/chipsets/ata-cyrix.c head/sys/dev/ata/chipsets/ata-highpoint.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-ite.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-micron.c head/sys/dev/ata/chipsets/ata-national.c head/sys/dev/ata/chipsets/ata-netcell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-serverworks.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c head/sys/dev/ex/if_ex.c head/sys/dev/ex/if_exreg.h head/sys/dev/fb/splash_pcx.c head/sys/dev/fb/vga.c head/sys/dev/pst/pst-iop.c head/sys/dev/pst/pst-iop.h head/sys/dev/pst/pst-pci.c head/sys/dev/pst/pst-raid.c head/sys/dev/syscons/blank/blank_saver.c head/sys/dev/syscons/fade/fade_saver.c head/sys/dev/syscons/green/green_saver.c head/sys/dev/syscons/logo/logo_saver.c head/sys/dev/syscons/rain/rain_saver.c head/sys/dev/syscons/schistory.c head/sys/dev/syscons/snake/snake_saver.c head/sys/dev/syscons/star/star_saver.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h head/sys/dev/syscons/warp/warp_saver.c head/sys/dev/usb/serial/ucycom.c head/sys/fs/procfs/procfs.c head/sys/fs/procfs/procfs_ioctl.c head/sys/fs/pseudofs/pseudofs.c head/sys/fs/pseudofs/pseudofs.h head/sys/fs/pseudofs/pseudofs_fileno.c head/sys/fs/pseudofs/pseudofs_internal.h head/sys/fs/pseudofs/pseudofs_vncache.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/gnu/fs/reiserfs/reiserfs_fs.h head/sys/gnu/fs/reiserfs/reiserfs_fs_i.h head/sys/gnu/fs/reiserfs/reiserfs_fs_sb.h head/sys/gnu/fs/reiserfs/reiserfs_hashes.c head/sys/gnu/fs/reiserfs/reiserfs_inode.c head/sys/gnu/fs/reiserfs/reiserfs_item_ops.c head/sys/gnu/fs/reiserfs/reiserfs_mount.h head/sys/gnu/fs/reiserfs/reiserfs_namei.c head/sys/gnu/fs/reiserfs/reiserfs_prints.c head/sys/gnu/fs/reiserfs/reiserfs_stree.c head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c head/sys/gnu/fs/reiserfs/reiserfs_vnops.c head/sys/i386/ibcs2/coff.h head/sys/i386/ibcs2/ibcs2_isc.c head/sys/i386/ibcs2/ibcs2_sysi86.c head/sys/i386/ibcs2/ibcs2_xenix.c head/sys/i386/ibcs2/imgact_coff.c head/sys/i386/include/pcaudioio.h head/sys/i386/linux/imgact_linux.c head/sys/i386/linux/linux.h head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_elf.c head/sys/sys/ata.h head/sys/sys/cdrio.h head/sys/sys/consio.h head/sys/sys/dvdio.h head/sys/sys/imgact_elf.h Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/amd64/linux32/linux.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2004 Tim J. Robbins * Copyright (c) 2001 Doug Rabson - * Copyright (c) 1994-1996 Søren Schmidt + * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/amd64/linux32/linux32_dummy.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994-1995 Søren Schmidt + * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Jan 15 13:23:18 2012 (r230132) @@ -3,7 +3,7 @@ * Copyright (c) 2003 Peter Wemm * Copyright (c) 2002 Doug Rabson * Copyright (c) 1998-1999 Andrew Gallatin - * Copyright (c) 1994-1996 Søren Schmidt + * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/compat/linux/linux_file.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994-1995 Søren Schmidt + * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/compat/linux/linux_ioctl.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994-1995 Søren Schmidt + * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/compat/linux/linux_ipc.c ============================================================================== --- head/sys/compat/linux/linux_ipc.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/compat/linux/linux_ipc.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994-1995 Søren Schmidt + * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/compat/linux/linux_misc.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2002 Doug Rabson - * Copyright (c) 1994-1995 Søren Schmidt + * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/compat/linux/linux_signal.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994-1995 Søren Schmidt + * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/compat/linux/linux_socket.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1995 Søren Schmidt + * Copyright (c) 1995 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/compat/linux/linux_stats.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994-1995 Søren Schmidt + * Copyright (c) 1994-1995 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/compat/svr4/imgact_svr4.c ============================================================================== --- head/sys/compat/svr4/imgact_svr4.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/compat/svr4/imgact_svr4.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1998 Mark Newton - * Copyright (c) 1994-1996 Søren Schmidt + * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. * * Based heavily on /sys/kern/imgact_aout.c which is: Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ahci/ahci.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * Copyright (c) 2009 Alexander Motin * All rights reserved. * Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-all.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-all.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-card.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-cbus.c ============================================================================== --- head/sys/dev/ata/ata-cbus.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-cbus.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 - 2008 Søren Schmidt + * Copyright (c) 2002 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-disk.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-disk.h ============================================================================== --- head/sys/dev/ata/ata-disk.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-disk.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-dma.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-isa.c ============================================================================== --- head/sys/dev/ata/ata-isa.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-isa.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-lowlevel.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-pci.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-pci.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 - 2008 Søren Schmidt + * Copyright (c) 2003 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-queue.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-raid.c ============================================================================== --- head/sys/dev/ata/ata-raid.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-raid.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000 - 2008 Søren Schmidt + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -595,11 +595,11 @@ ata_raid_strategy(struct bio *bp) } if (bp->bio_cmd == BIO_WRITE) { ata_raid_send_request(request); - // sikre at læs-modify-skriv til hver disk er atomarisk. + // sikre at læs-modify-skriv til hver disk er atomarisk. // par kopi af request - // læse orgdata fra drv + // læse orgdata fra drv // skriv nydata til drv - // læse parorgdata fra par + // læse parorgdata fra par // skriv orgdata xor parorgdata xor nydata til par } } Modified: head/sys/dev/ata/ata-raid.h ============================================================================== --- head/sys/dev/ata/ata-raid.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-raid.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000 - 2008 Søren Schmidt + * Copyright (c) 2000 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata-sata.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/ata_if.m ============================================================================== --- head/sys/dev/ata/ata_if.m Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/ata_if.m Sun Jan 15 13:23:18 2012 (r230132) @@ -1,4 +1,4 @@ -# Copyright (c) 2004 - 2008 Søren Schmidt +# Copyright (c) 2004 - 2008 Søren Schmidt # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/atapi-cd.c ============================================================================== --- head/sys/dev/ata/atapi-cd.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/atapi-cd.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/atapi-cd.h ============================================================================== --- head/sys/dev/ata/atapi-cd.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/atapi-cd.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/atapi-fd.c ============================================================================== --- head/sys/dev/ata/atapi-fd.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/atapi-fd.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/atapi-fd.h ============================================================================== --- head/sys/dev/ata/atapi-fd.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/atapi-fd.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/atapi-tape.c ============================================================================== --- head/sys/dev/ata/atapi-tape.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/atapi-tape.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/atapi-tape.h ============================================================================== --- head/sys/dev/ata/atapi-tape.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/atapi-tape.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acard.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-acard.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-adaptec.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-adaptec.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-adaptec.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-amd.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-amd.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-ati.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-cenatek.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-cenatek.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-cenatek.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-cypress.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-cypress.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-cypress.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-cyrix.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-cyrix.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-cyrix.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-highpoint.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-highpoint.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-intel.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ite.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-ite.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-marvell.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-micron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-micron.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-micron.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-national.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-national.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-national.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-netcell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-netcell.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-netcell.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-promise.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-sis.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ata/chipsets/ata-via.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 - 2008 Søren Schmidt + * Copyright (c) 1998 - 2008 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ex/if_ex.c ============================================================================== --- head/sys/dev/ex/if_ex.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ex/if_ex.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es) + * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es) * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ex/if_exreg.h ============================================================================== --- head/sys/dev/ex/if_exreg.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/ex/if_exreg.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es) + * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es) * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/fb/splash_pcx.c ============================================================================== --- head/sys/dev/fb/splash_pcx.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/fb/splash_pcx.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,7 +1,7 @@ /*- * Copyright (c) 1999 Michael Smith * Copyright (c) 1999 Kazutaka YOKOTA - * Copyright (c) 1999 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1999 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/fb/vga.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1999 Kazutaka YOKOTA - * Copyright (c) 1992-1998 Søren Schmidt + * Copyright (c) 1992-1998 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/pst/pst-iop.c ============================================================================== --- head/sys/dev/pst/pst-iop.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/pst/pst-iop.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001,2002,2003 Søren Schmidt + * Copyright (c) 2001,2002,2003 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/pst/pst-iop.h ============================================================================== --- head/sys/dev/pst/pst-iop.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/pst/pst-iop.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001,2002,2003 Søren Schmidt + * Copyright (c) 2001,2002,2003 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/pst/pst-pci.c ============================================================================== --- head/sys/dev/pst/pst-pci.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/pst/pst-pci.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001,2002,2003 Søren Schmidt + * Copyright (c) 2001,2002,2003 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/pst/pst-raid.c ============================================================================== --- head/sys/dev/pst/pst-raid.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/pst/pst-raid.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001,2002,2003 Søren Schmidt + * Copyright (c) 2001,2002,2003 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/blank/blank_saver.c ============================================================================== --- head/sys/dev/syscons/blank/blank_saver.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/blank/blank_saver.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1995-1998 Søren Schmidt + * Copyright (c) 1995-1998 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/fade/fade_saver.c ============================================================================== --- head/sys/dev/syscons/fade/fade_saver.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/fade/fade_saver.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1995-1998 Søren Schmidt + * Copyright (c) 1995-1998 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/green/green_saver.c ============================================================================== --- head/sys/dev/syscons/green/green_saver.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/green/green_saver.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1995-1998 Søren Schmidt + * Copyright (c) 1995-1998 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/logo/logo_saver.c ============================================================================== --- head/sys/dev/syscons/logo/logo_saver.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/logo/logo_saver.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/rain/rain_saver.c ============================================================================== --- head/sys/dev/syscons/rain/rain_saver.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/rain/rain_saver.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/schistory.c ============================================================================== --- head/sys/dev/syscons/schistory.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/schistory.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1999 Kazutaka YOKOTA - * Copyright (c) 1992-1998 Søren Schmidt + * Copyright (c) 1992-1998 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/snake/snake_saver.c ============================================================================== --- head/sys/dev/syscons/snake/snake_saver.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/snake/snake_saver.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1995-1998 Søren Schmidt + * Copyright (c) 1995-1998 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/star/star_saver.c ============================================================================== --- head/sys/dev/syscons/star/star_saver.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/star/star_saver.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1995-1998 Søren Schmidt + * Copyright (c) 1995-1998 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/syscons.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1992-1998 Søren Schmidt + * Copyright (c) 1992-1998 Søren Schmidt * All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/syscons.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1995-1998 Søren Schmidt + * Copyright (c) 1995-1998 Søren Schmidt * All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/syscons/warp/warp_saver.c ============================================================================== --- head/sys/dev/syscons/warp/warp_saver.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/syscons/warp/warp_saver.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav + * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/usb/serial/ucycom.c ============================================================================== --- head/sys/dev/usb/serial/ucycom.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/dev/usb/serial/ucycom.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ __FBSDID("$FreeBSD$"); /*- - * Copyright (c) 2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2004 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/fs/procfs/procfs.c ============================================================================== --- head/sys/fs/procfs/procfs.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/fs/procfs/procfs.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Dag-Erling Smørgrav + * Copyright (c) 2001 Dag-Erling Smørgrav * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. Modified: head/sys/fs/procfs/procfs_ioctl.c ============================================================================== --- head/sys/fs/procfs/procfs_ioctl.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/fs/procfs/procfs_ioctl.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/fs/pseudofs/pseudofs.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/fs/pseudofs/pseudofs.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/fs/pseudofs/pseudofs.h ============================================================================== --- head/sys/fs/pseudofs/pseudofs.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/fs/pseudofs/pseudofs.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/fs/pseudofs/pseudofs_fileno.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_fileno.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/fs/pseudofs/pseudofs_fileno.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/fs/pseudofs/pseudofs_internal.h ============================================================================== --- head/sys/fs/pseudofs/pseudofs_internal.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/fs/pseudofs/pseudofs_internal.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vncache.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/fs/pseudofs/pseudofs_vncache.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2001 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/gnu/fs/reiserfs/reiserfs_fs.h ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_fs.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_fs.h Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_fs_i.h ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_fs_i.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_fs_i.h Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_fs_sb.h ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_fs_sb.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_fs_sb.h Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_hashes.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_hashes.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_hashes.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_inode.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_inode.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_inode.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_item_ops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_item_ops.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_item_ops.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_mount.h ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_mount.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_mount.h Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_namei.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_namei.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_namei.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_prints.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_prints.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_prints.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_stree.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_stree.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_stree.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ @@ -321,7 +321,7 @@ key_in_buffer( } #if 0 -/* XXX Il ne semble pas y avoir de compteur de référence dans struct buf */ +/* XXX Il ne semble pas y avoir de compteur de référence dans struct buf */ inline void decrement_bcount(struct buf *p_s_bp) { Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_vnops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vnops.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/gnu/fs/reiserfs/reiserfs_vnops.c Sun Jan 15 13:23:18 2012 (r230132) @@ -2,7 +2,7 @@ * Copyright 2000 Hans Reiser * See README for licensing and copyright details * - * Ported to FreeBSD by Jean-Sébastien Pédron + * Ported to FreeBSD by Jean-Sébastien Pédron * * $FreeBSD$ */ Modified: head/sys/i386/ibcs2/coff.h ============================================================================== --- head/sys/i386/ibcs2/coff.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/i386/ibcs2/coff.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1994 Sean Eric Fagan - * Copyright (c) 1994 Søren Schmidt + * Copyright (c) 1994 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/i386/ibcs2/ibcs2_isc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_isc.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/i386/ibcs2/ibcs2_isc.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994 Søren Schmidt + * Copyright (c) 1994 Søren Schmidt * Copyright (c) 1994 Sean Eric Fagan * Copyright (c) 1995 Steven Wallace * All rights reserved. Modified: head/sys/i386/ibcs2/ibcs2_sysi86.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysi86.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/i386/ibcs2/ibcs2_sysi86.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994 Søren Schmidt + * Copyright (c) 1994 Søren Schmidt * Copyright (c) 1995 Steven Wallace * All rights reserved. * Modified: head/sys/i386/ibcs2/ibcs2_xenix.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_xenix.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/i386/ibcs2/ibcs2_xenix.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1994 Sean Eric Fagan - * Copyright (c) 1994 Søren Schmidt + * Copyright (c) 1994 Søren Schmidt * Copyright (c) 1995 Steven Wallace * All rights reserved. * Modified: head/sys/i386/ibcs2/imgact_coff.c ============================================================================== --- head/sys/i386/ibcs2/imgact_coff.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/i386/ibcs2/imgact_coff.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1994 Sean Eric Fagan - * Copyright (c) 1994 Søren Schmidt + * Copyright (c) 1994 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/i386/include/pcaudioio.h ============================================================================== --- head/sys/i386/include/pcaudioio.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/i386/include/pcaudioio.h Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994 Søren Schmidt + * Copyright (c) 1994 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/i386/linux/imgact_linux.c ============================================================================== --- head/sys/i386/linux/imgact_linux.c Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/i386/linux/imgact_linux.c Sun Jan 15 13:23:18 2012 (r230132) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1994-1996 Søren Schmidt + * Copyright (c) 1994-1996 Søren Schmidt * All rights reserved. * * Based heavily on /sys/kern/imgact_aout.c which is: Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Sun Jan 15 13:23:01 2012 (r230131) +++ head/sys/i386/linux/linux.h Sun Jan 15 13:23:18 2012 (r230132) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 13:23:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD301065672; Sun, 15 Jan 2012 13:23:34 +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 27C418FC13; Sun, 15 Jan 2012 13:23:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FDNYT8084989; Sun, 15 Jan 2012 13:23:34 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FDNXOW084980; Sun, 15 Jan 2012 13:23:33 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201151323.q0FDNXOW084980@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 15 Jan 2012 13:23: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: r230133 - in head/sys: arm/at91 arm/sa11x0 dev/bxe dev/hpt27xx dev/hptmv dev/nxge/include dev/nxge/xgehal dev/sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 13:23:34 -0000 Author: uqs Date: Sun Jan 15 13:23:33 2012 New Revision: 230133 URL: http://svn.freebsd.org/changeset/base/230133 Log: Remove spurious 8bit chars, turning files into plain ASCII. Modified: head/sys/arm/at91/at91_st.c head/sys/arm/sa11x0/sa11x0_ost.c head/sys/dev/bxe/bxe_hsi.h head/sys/dev/hpt27xx/README head/sys/dev/hptmv/readme.txt head/sys/dev/nxge/include/xgehal-channel.h head/sys/dev/nxge/xgehal/xgehal-fifo-fp.c head/sys/dev/sound/pci/ds1-fw.h Modified: head/sys/arm/at91/at91_st.c ============================================================================== --- head/sys/arm/at91/at91_st.c Sun Jan 15 13:23:18 2012 (r230132) +++ head/sys/arm/at91/at91_st.c Sun Jan 15 13:23:33 2012 (r230133) @@ -200,7 +200,7 @@ cpu_initclocks(void) hz = 32768 / rel_value; tick = 1000000 / hz; } - /* Disable all interrupts. */ + /* Disable all interrupts. */ WR4(ST_IDR, 0xffffffff); /* The system timer shares the system irq (1) */ irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 1, 1, 1, Modified: head/sys/arm/sa11x0/sa11x0_ost.c ============================================================================== --- head/sys/arm/sa11x0/sa11x0_ost.c Sun Jan 15 13:23:18 2012 (r230132) +++ head/sys/arm/sa11x0/sa11x0_ost.c Sun Jan 15 13:23:33 2012 (r230133) @@ -251,7 +251,7 @@ cpu_initclocks() stathz = STATHZ; profhz = stathz; #if 0 - mtx_init(&clock_lock, "SA1110 Clock locké", NULL, MTX_SPIN); + mtx_init(&clock_lock, "SA1110 Clock locked", NULL, MTX_SPIN); #endif saost_sc->sc_statclock_step = TIMER_FREQUENCY / stathz; struct resource *irq1, *irq2; Modified: head/sys/dev/bxe/bxe_hsi.h ============================================================================== --- head/sys/dev/bxe/bxe_hsi.h Sun Jan 15 13:23:18 2012 (r230132) +++ head/sys/dev/bxe/bxe_hsi.h Sun Jan 15 13:23:33 2012 (r230133) @@ -282,7 +282,7 @@ struct port_hw_cfg { /* port 0: 0x12c * 4 times 16 bits for all 4 lanes. In case external PHY is present * (not direct mode), those values will not take effect on the 4 XGXS * lanes. For some external PHYs (such as 8706 and 8726) the values - * will be used to configure the external PHY – in those cases, not + * will be used to configure the external PHY -- in those cases, not * all 4 values are needed. */ uint16_t xgxs_config_rx[4]; /* 0x198 */ Modified: head/sys/dev/hpt27xx/README ============================================================================== --- head/sys/dev/hpt27xx/README Sun Jan 15 13:23:18 2012 (r230132) +++ head/sys/dev/hpt27xx/README Sun Jan 15 13:23:33 2012 (r230133) @@ -154,7 +154,7 @@ Revision History: /kernel text=0x24f1db data=0x3007ec+0x2062c - Hit [Enter] to boot immediagely, or any other key for command prompt. - Booting [kernel] in 9 seconds¡­ + Booting [kernel] in 9 seconds <-- press SPACE key here Type '?' for a list of commands, 'help' for more detailed help. Modified: head/sys/dev/hptmv/readme.txt ============================================================================== --- head/sys/dev/hptmv/readme.txt Sun Jan 15 13:23:18 2012 (r230132) +++ head/sys/dev/hptmv/readme.txt Sun Jan 15 13:23:33 2012 (r230133) @@ -184,7 +184,7 @@ Revision History: /kernel text=0x24f1db data=0x3007ec+0x2062c - Hit [Enter] to boot immediagely, or any other key for command prompt. - Booting [kernel] in 9 seconds¡­ + Booting [kernel] in 9 seconds <-- press SPACE key here Type '?' for a list of commands, 'help' for more detailed help. Modified: head/sys/dev/nxge/include/xgehal-channel.h ============================================================================== --- head/sys/dev/nxge/include/xgehal-channel.h Sun Jan 15 13:23:18 2012 (r230132) +++ head/sys/dev/nxge/include/xgehal-channel.h Sun Jan 15 13:23:33 2012 (r230133) @@ -139,7 +139,7 @@ typedef enum xge_hal_channel_reopen_e { * Channel callback gets called by HAL if, and only if, there is at least * one new completion on a given ring or fifo channel. Upon processing the * first @dtrh ULD is _supposed_ to continue consuming completions - * usingáone of the following HAL APIs: + * using one of the following HAL APIs: * - xge_hal_fifo_dtr_next_completed() * or * - xge_hal_ring_dtr_next_completed(). Modified: head/sys/dev/nxge/xgehal/xgehal-fifo-fp.c ============================================================================== --- head/sys/dev/nxge/xgehal/xgehal-fifo-fp.c Sun Jan 15 13:23:18 2012 (r230132) +++ head/sys/dev/nxge/xgehal/xgehal-fifo-fp.c Sun Jan 15 13:23:33 2012 (r230133) @@ -794,7 +794,7 @@ xge_hal_fifo_dtr_free(xge_hal_channel_h * in fifo descriptor. * @channelh: Channel handle. * @dtrh: Descriptor handle. - * @frag_idx: Index of the data buffer in the caller's scatter-gather listá + * @frag_idx: Index of the data buffer in the caller's scatter-gather list * (of buffers). * @vaddr: Virtual address of the data buffer. * @dma_pointer: DMA address of the data buffer referenced by @frag_idx. @@ -1015,7 +1015,7 @@ xge_hal_fifo_dtr_buffer_finalize(xge_hal * descriptor. * @channelh: Channel handle. * @dtrh: Descriptor handle. - * @frag_idx: Index of the data buffer in the caller's scatter-gather listá + * @frag_idx: Index of the data buffer in the caller's scatter-gather list * (of buffers). * @dma_pointer: DMA address of the data buffer referenced by @frag_idx. * @size: Size of the data buffer (in bytes). Modified: head/sys/dev/sound/pci/ds1-fw.h ============================================================================== --- head/sys/dev/sound/pci/ds1-fw.h Sun Jan 15 13:23:18 2012 (r230132) +++ head/sys/dev/sound/pci/ds1-fw.h Sun Jan 15 13:23:33 2012 (r230133) @@ -822,9 +822,9 @@ static u_int32_t CntrlInst[] = { 1999/06/21 Buf441 slot is Enabled. -------------------------------------------- - 04/09@creat + 04/09 @creat 04/12 stop nise fix - 06/21@WorkingOff timming + 06/21 @WorkingOff timming */ static u_int32_t CntrlInst1E[] = { From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 13:23:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71BA910658E5; Sun, 15 Jan 2012 13:23:44 +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 5E50C8FC12; Sun, 15 Jan 2012 13:23:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FDNi3O085036; Sun, 15 Jan 2012 13:23:44 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FDNilv085029; Sun, 15 Jan 2012 13:23:44 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201151323.q0FDNilv085029@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 15 Jan 2012 13:23:44 +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: r230134 - in head/sys/dev: fb ieee488 nxge/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 13:23:44 -0000 Author: uqs Date: Sun Jan 15 13:23:43 2012 New Revision: 230134 URL: http://svn.freebsd.org/changeset/base/230134 Log: Convert files to UTF-8 Modified: head/sys/dev/fb/boot_font.c head/sys/dev/ieee488/ibfoo.c head/sys/dev/ieee488/pcii.c head/sys/dev/ieee488/upd7210.c head/sys/dev/ieee488/upd7210.h head/sys/dev/nxge/include/xgehal-config.h Modified: head/sys/dev/fb/boot_font.c ============================================================================== --- head/sys/dev/fb/boot_font.c Sun Jan 15 13:23:33 2012 (r230133) +++ head/sys/dev/fb/boot_font.c Sun Jan 15 13:23:43 2012 (r230134) @@ -34,8 +34,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ /*- - * This font lives in the public domain. It is a PC font, IBM encoding, - * which was designed for use with syscons. + * This font lives in the public domain. It is a PC font, IBM encoding + * (CP437), which was designed for use with syscons. * * Copyright (c) 2000 Andrew Miklic */ @@ -2931,7 +2931,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /*   */ + /* á */ 0x00, /* ........ */ 0x06, /* .....**. */ 0x0c, /* ....**.. */ @@ -2949,7 +2949,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¡ */ + /* í */ 0x00, /* ........ */ 0x06, /* .....**. */ 0x0c, /* ....**.. */ @@ -2967,7 +2967,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¢ */ + /* ó */ 0x00, /* ........ */ 0x06, /* .....**. */ 0x0c, /* ....**.. */ @@ -2985,7 +2985,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* £ */ + /* ú */ 0x00, /* ........ */ 0x0c, /* ....**.. */ 0x18, /* ...**... */ @@ -3003,7 +3003,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¤ */ + /* ñ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x76, /* .***.**. */ @@ -3021,7 +3021,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¥ */ + /* Ñ */ 0x76, /* .***.**. */ 0xdc, /* **.***.. */ 0x00, /* ........ */ @@ -3039,7 +3039,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¦ */ + /* ª */ 0x00, /* ........ */ 0x00, /* ........ */ 0x7c, /* .*****.. */ @@ -3057,7 +3057,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* § */ + /* º */ 0x00, /* ........ */ 0x00, /* ........ */ 0x7c, /* .*****.. */ @@ -3075,7 +3075,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¨ */ + /* ¿ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x18, /* ...**... */ @@ -3093,7 +3093,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* © */ + /* ⌠*/ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3111,7 +3111,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ª */ + /* ¬ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3129,7 +3129,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* « */ + /* ½ */ 0x00, /* ........ */ 0x18, /* ...**... */ 0x38, /* ..***... */ @@ -3147,7 +3147,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¬ */ + /* ¼ */ 0x00, /* ........ */ 0x18, /* ...**... */ 0x38, /* ..***... */ @@ -3165,7 +3165,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ­ */ + /* ¡ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x18, /* ...**... */ @@ -3183,7 +3183,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ® */ + /* « */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3201,7 +3201,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¯ */ + /* » */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3219,7 +3219,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ° */ + /* â–‘ */ 0x82, /* *.....*. */ 0x10, /* ...*.... */ 0x82, /* *.....*. */ @@ -3237,7 +3237,7 @@ const struct gfb_font bold8x16 = { 0x82, /* *.....*. */ 0x10, /* ...*.... */ - /* ± */ + /* â–’ */ 0x00, /* ........ */ 0x95, /* *..*.*.* */ 0x00, /* ........ */ @@ -3255,7 +3255,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0xa9, /* *.*.*..* */ - /* ² */ + /* â–“ */ 0x92, /* *..*..*. */ 0x49, /* .*..*..* */ 0x92, /* *..*..*. */ @@ -3273,7 +3273,7 @@ const struct gfb_font bold8x16 = { 0x92, /* *..*..*. */ 0x49, /* .*..*..* */ - /* ³ */ + /* │ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3291,7 +3291,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* ´ */ + /* ┤ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3309,7 +3309,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* µ */ + /* â•¡ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3327,7 +3327,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* ¶ */ + /* â•¢ */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3345,7 +3345,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* · */ + /* â•– */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3363,7 +3363,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* ¸ */ + /* â•• */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3381,7 +3381,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* ¹ */ + /* â•£ */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3399,7 +3399,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* º */ + /* â•‘ */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3417,7 +3417,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* » */ + /* â•— */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3435,7 +3435,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* ¼ */ + /* â• */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3453,7 +3453,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ½ */ + /* â•œ */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3471,7 +3471,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¾ */ + /* â•› */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3489,7 +3489,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ¿ */ + /* â” */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3507,7 +3507,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* À */ + /* â”” */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3525,7 +3525,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Á */ + /* â”´ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3543,7 +3543,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /*  */ + /* ┬ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3561,7 +3561,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* à */ + /* ├ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3579,7 +3579,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* Ä */ + /* ─ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3597,7 +3597,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Å */ + /* ┼ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3615,7 +3615,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* Æ */ + /* â•ž */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3633,7 +3633,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* Ç */ + /* â•Ÿ */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3651,7 +3651,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* È */ + /* â•š */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3669,7 +3669,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* É */ + /* â•” */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3687,7 +3687,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* Ê */ + /* â•© */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3705,7 +3705,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Ë */ + /* ╦ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3723,7 +3723,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* Ì */ + /* â•  */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3741,7 +3741,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* Í */ + /* â• */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3759,7 +3759,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Î */ + /* ╬ */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3777,7 +3777,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* Ï */ + /* ╧ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3795,7 +3795,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Ð */ + /* ╨ */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3813,7 +3813,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Ñ */ + /* ╤ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3831,7 +3831,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* Ò */ + /* â•¥ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3849,7 +3849,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* Ó */ + /* â•™ */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3867,7 +3867,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Ô */ + /* ╘ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3885,7 +3885,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Õ */ + /* â•’ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3903,7 +3903,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* Ö */ + /* â•“ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3921,7 +3921,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* × */ + /* â•« */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ @@ -3939,7 +3939,7 @@ const struct gfb_font bold8x16 = { 0x3c, /* ..****.. */ 0x3c, /* ..****.. */ - /* Ø */ + /* ╪ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3957,7 +3957,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* Ù */ + /* ┘ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -3975,7 +3975,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* Ú */ + /* ┌ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -3993,7 +3993,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* Û */ + /* â–ˆ */ 0xff, /* ******** */ 0xff, /* ******** */ 0xff, /* ******** */ @@ -4011,7 +4011,7 @@ const struct gfb_font bold8x16 = { 0xff, /* ******** */ 0xff, /* ******** */ - /* Ü */ + /* â–„ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4029,7 +4029,7 @@ const struct gfb_font bold8x16 = { 0xff, /* ******** */ 0xff, /* ******** */ - /* Ý */ + /* â–Œ */ 0xf0, /* ****.... */ 0xf0, /* ****.... */ 0xf0, /* ****.... */ @@ -4047,7 +4047,7 @@ const struct gfb_font bold8x16 = { 0xf0, /* ****.... */ 0xf0, /* ****.... */ - /* Þ */ + /* â– */ 0x0f, /* ....**** */ 0x0f, /* ....**** */ 0x0f, /* ....**** */ @@ -4065,7 +4065,7 @@ const struct gfb_font bold8x16 = { 0x0f, /* ....**** */ 0x0f, /* ....**** */ - /* ß */ + /* â–€ */ 0xff, /* ******** */ 0xff, /* ******** */ 0xff, /* ******** */ @@ -4083,7 +4083,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* à */ + /* α */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4101,7 +4101,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* á */ + /* ß */ 0x00, /* ........ */ 0x00, /* ........ */ 0x7c, /* .*****.. */ @@ -4119,7 +4119,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* â */ + /* Γ */ 0x00, /* ........ */ 0x00, /* ........ */ 0xfe, /* *******. */ @@ -4137,7 +4137,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ã */ + /* Ï€ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4155,7 +4155,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ä */ + /* Σ */ 0x00, /* ........ */ 0x00, /* ........ */ 0xfe, /* *******. */ @@ -4173,7 +4173,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* å */ + /* σ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4191,7 +4191,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* æ */ + /* µ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4209,7 +4209,7 @@ const struct gfb_font bold8x16 = { 0xc0, /* **...... */ 0x00, /* ........ */ - /* ç */ + /* Ï„ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4227,7 +4227,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* è */ + /* Φ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x18, /* ...**... */ @@ -4245,7 +4245,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* é */ + /* Θ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x38, /* ..***... */ @@ -4263,7 +4263,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ê */ + /* Ω */ 0x00, /* ........ */ 0x00, /* ........ */ 0x3c, /* ..****.. */ @@ -4281,7 +4281,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ë */ + /* δ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x1e, /* ...****. */ @@ -4299,7 +4299,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ì */ + /* ∞ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4317,7 +4317,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* í */ + /* φ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4335,7 +4335,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* î */ + /* ε */ 0x00, /* ........ */ 0x00, /* ........ */ 0x1c, /* ...***.. */ @@ -4353,7 +4353,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ï */ + /* ∩ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4371,7 +4371,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ð */ + /* ≡ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4389,7 +4389,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ñ */ + /* ± */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4407,7 +4407,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ò */ + /* ≥ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4425,7 +4425,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ó */ + /* ≤ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4443,7 +4443,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ô */ + /* ⌠ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4461,7 +4461,7 @@ const struct gfb_font bold8x16 = { 0x18, /* ...**... */ 0x18, /* ...**... */ - /* õ */ + /* ⌡ */ 0x18, /* ...**... */ 0x18, /* ...**... */ 0x18, /* ...**... */ @@ -4479,7 +4479,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ö */ + /* ÷ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4497,7 +4497,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ÷ */ + /* ≈ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4515,7 +4515,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ø */ + /* ° */ 0x00, /* ........ */ 0x00, /* ........ */ 0x38, /* ..***... */ @@ -4533,7 +4533,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ù */ + /* ∙ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4551,7 +4551,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ú */ + /* · */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ @@ -4569,7 +4569,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* û */ + /* √ */ 0x00, /* ........ */ 0x00, /* ........ */ 0x03, /* ......** */ @@ -4587,7 +4587,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ü */ + /* â¿ */ 0x00, /* ........ */ 0x00, /* ........ */ 0xd8, /* **.**... */ @@ -4605,7 +4605,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* ý */ + /* ² */ 0x00, /* ........ */ 0x00, /* ........ */ 0x78, /* .****... */ @@ -4623,7 +4623,7 @@ const struct gfb_font bold8x16 = { 0x00, /* ........ */ 0x00, /* ........ */ - /* þ */ + /* â–  */ 0x00, /* ........ */ 0x00, /* ........ */ 0x00, /* ........ */ Modified: head/sys/dev/ieee488/ibfoo.c ============================================================================== --- head/sys/dev/ieee488/ibfoo.c Sun Jan 15 13:23:33 2012 (r230133) +++ head/sys/dev/ieee488/ibfoo.c Sun Jan 15 13:23:43 2012 (r230134) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * High-level driver for µPD7210 based GPIB cards. + * High-level driver for µPD7210 based GPIB cards. * */ Modified: head/sys/dev/ieee488/pcii.c ============================================================================== --- head/sys/dev/ieee488/pcii.c Sun Jan 15 13:23:33 2012 (r230133) +++ head/sys/dev/ieee488/pcii.c Sun Jan 15 13:23:43 2012 (r230134) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Driver for GPIB cards based on NEC µPD7210 and compatibles. + * Driver for GPIB cards based on NEC µPD7210 and compatibles. * * This driver just hooks up to the hardware and leaves all the interesting * stuff to upd7210.c. @@ -116,14 +116,14 @@ pcii_probe(device_t dev) /* * The PCIIA decodes a fixed pattern of 0x2e1 for the lower 10 * address bits A0 ... A9. Bits A10 through A12 are used by - * the µPD7210 register select lines. This makes the + * the µPD7210 register select lines. This makes the * individual 7210 register being 0x400 bytes apart in the ISA * bus address space. Address bits A13 and A14 are compared * to a DIP switch setting on the card, allowing for up to 4 * different cards being installed (at base addresses 0x2e1, * 0x22e1, 0x42e1, and 0x62e1, respectively). A15 has been * used to select an optional on-board time-of-day clock chip - * (MM58167A) on the original PCIIA rather than the µPD7210 + * (MM58167A) on the original PCIIA rather than the µPD7210 * (which is not implemented on later boards). The * documentation states the respective addresses for that chip * should be handled as reserved addresses, which we don't do @@ -174,7 +174,7 @@ pcii_probe(device_t dev) } error = ENXIO; /* - * Perform some basic tests on the µPD7210 registers. At + * Perform some basic tests on the µPD7210 registers. At * least *some* register must read different from 0x00 or * 0xff. */ Modified: head/sys/dev/ieee488/upd7210.c ============================================================================== --- head/sys/dev/ieee488/upd7210.c Sun Jan 15 13:23:33 2012 (r230133) +++ head/sys/dev/ieee488/upd7210.c Sun Jan 15 13:23:43 2012 (r230134) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * High-level driver for µPD7210 based GPIB cards. + * High-level driver for µPD7210 based GPIB cards. * */ @@ -252,7 +252,7 @@ gpib_l_open(struct cdev *dev, int oflags bus_write_1(u->reg_res[0], cmdr, 0x04); /* GO */ bus_write_1(u->reg_res[0], imr3, 0x04); /* NEF IE */ } else { - /* µPD7210/NAT7210, or TNT4882 in non-FIFO mode */ + /* µPD7210/NAT7210, or TNT4882 in non-FIFO mode */ upd7210_wr(u, IMR1, 0x01); /* data in interrupt enable */ } return (0); Modified: head/sys/dev/ieee488/upd7210.h ============================================================================== --- head/sys/dev/ieee488/upd7210.h Sun Jan 15 13:23:33 2012 (r230133) +++ head/sys/dev/ieee488/upd7210.h Sun Jan 15 13:23:43 2012 (r230134) @@ -26,13 +26,13 @@ * * $FreeBSD$ * - * Locating an actual µPD7210 data book has proven quite impossible for me. - * There are a fair number of newer chips which are supersets of the µPD7210 + * Locating an actual µPD7210 data book has proven quite impossible for me. + * There are a fair number of newer chips which are supersets of the µPD7210 * but they are particular eager to comprehensively mark what the extensions * are and what is in the base set. Some even give the registers and their * bits new names. * - * The following information is based on a description of the µPD7210 found + * The following information is based on a description of the µPD7210 found * in an old manual for a VME board which used the chip. */ Modified: head/sys/dev/nxge/include/xgehal-config.h ============================================================================== --- head/sys/dev/nxge/include/xgehal-config.h Sun Jan 15 13:23:33 2012 (r230133) +++ head/sys/dev/nxge/include/xgehal-config.h Sun Jan 15 13:23:43 2012 (r230134) @@ -621,7 +621,7 @@ typedef struct xge_hal_mac_config_t { * stable in order for the adapter to declare "LINK UP". * The enumerated settings (see Xframe-II UG) are: * 0 ........... instantaneous - * 1 ........... 500 ³s + * 1 ........... 500 μs * 2 ........... 1 ms * 3 ........... 64 ms * 4 ........... 256 ms From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 13:23:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6376B1065846; Sun, 15 Jan 2012 13:23:55 +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 4EEBB8FC12; Sun, 15 Jan 2012 13:23:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FDNtT4085083; Sun, 15 Jan 2012 13:23:55 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FDNsiZ085076; Sun, 15 Jan 2012 13:23:54 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201201151323.q0FDNsiZ085076@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 15 Jan 2012 13:23: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: r230135 - in head/sys: contrib/dev/npe contrib/dev/nve/amd64 contrib/dev/nve/i386 dev/vxge/include ofed/drivers/infiniband/core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 13:23:55 -0000 Author: uqs Date: Sun Jan 15 13:23:54 2012 New Revision: 230135 URL: http://svn.freebsd.org/changeset/base/230135 Log: Remove spurious 8bit chars, turning files into plain ASCII. Modified: head/sys/contrib/dev/npe/LICENSE head/sys/contrib/dev/nve/amd64/nvenetlib.README head/sys/contrib/dev/nve/i386/nvenetlib.README head/sys/dev/vxge/include/vxgehal-ll.h head/sys/ofed/drivers/infiniband/core/local_sa.c head/sys/ofed/drivers/infiniband/core/notice.c Modified: head/sys/contrib/dev/npe/LICENSE ============================================================================== --- head/sys/contrib/dev/npe/LICENSE Sun Jan 15 13:23:43 2012 (r230134) +++ head/sys/contrib/dev/npe/LICENSE Sun Jan 15 13:23:54 2012 (r230135) @@ -8,5 +8,5 @@ Redistribution. Redistribution and use i - Neither the name of Intel Corporation nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission. - No reverse engineering, decompilation, or disassembly of this software is permitted. -Limited patent license. Intel Corporation grants a world-wide, royalty-free, non-exclusive license under patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell (¿Utilize¿) this software, but solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software. No hardware per se is licensed hereunder. +Limited patent license. Intel Corporation grants a world-wide, royalty-free, non-exclusive license under patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software, but solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software. No hardware per se is licensed hereunder. DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. Modified: head/sys/contrib/dev/nve/amd64/nvenetlib.README ============================================================================== --- head/sys/contrib/dev/nve/amd64/nvenetlib.README Sun Jan 15 13:23:43 2012 (r230134) +++ head/sys/contrib/dev/nve/amd64/nvenetlib.README Sun Jan 15 13:23:54 2012 (r230135) @@ -4,7 +4,7 @@ The installation and use of this softwar License For Customer Use of NVIDIA Software -IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries (“NVIDIA”) enclosed herewith, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download, install or use the SOFTWARE. +IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries ("NVIDIA") enclosed herewith, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download, install or use the SOFTWARE. RECITALS Use of NVIDIA's products requires three elements: the SOFTWARE, the hardware on a computer motherboard, and a personal computer. The SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is not sold, and instead is only licensed for use, strictly in accordance with this document. The hardware is protected by various patents, and is sold, but this agreement does not cover that sale, since it may not necessarily be sold as a package with the SOFTWARE. This agreement sets forth the terms and conditions of the SOFTWARE LICENSE only. Modified: head/sys/contrib/dev/nve/i386/nvenetlib.README ============================================================================== --- head/sys/contrib/dev/nve/i386/nvenetlib.README Sun Jan 15 13:23:43 2012 (r230134) +++ head/sys/contrib/dev/nve/i386/nvenetlib.README Sun Jan 15 13:23:54 2012 (r230135) @@ -4,7 +4,7 @@ The installation and use of this softwar License For Customer Use of NVIDIA Software -IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries (“NVIDIA”) enclosed herewith, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download, install or use the SOFTWARE. +IMPORTANT NOTICE -- READ CAREFULLY: This License For Customer Use of NVIDIA Software ("LICENSE") is the agreement which governs use of the software of NVIDIA Corporation and its subsidiaries ("NVIDIA") enclosed herewith, including computer software and associated printed materials ("SOFTWARE"). By downloading, installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms of this LICENSE. If you do not agree to the terms of this LICENSE, do not download, install or use the SOFTWARE. RECITALS Use of NVIDIA's products requires three elements: the SOFTWARE, the hardware on a computer motherboard, and a personal computer. The SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is not sold, and instead is only licensed for use, strictly in accordance with this document. The hardware is protected by various patents, and is sold, but this agreement does not cover that sale, since it may not necessarily be sold as a package with the SOFTWARE. This agreement sets forth the terms and conditions of the SOFTWARE LICENSE only. Modified: head/sys/dev/vxge/include/vxgehal-ll.h ============================================================================== --- head/sys/dev/vxge/include/vxgehal-ll.h Sun Jan 15 13:23:43 2012 (r230134) +++ head/sys/dev/vxge/include/vxgehal-ll.h Sun Jan 15 13:23:54 2012 (r230135) @@ -367,23 +367,23 @@ typedef enum vxge_hal_frame_proto_e { * configuration mismatch. * @VXGE_HAL_RING_T_CODE_L3_L4_CKSUM_MISMATCH: Layer 3 and Layer 4 checksum * presentation configuration mismatch. - * @VXGE_HAL_RING_T_CODE_L3_PKT_ERR: Layer 3 error¸unparseable packet, + * @VXGE_HAL_RING_T_CODE_L3_PKT_ERR: Layer 3 error: unparseable packet, * such as unknown IPv6 header. - * @VXGE_HAL_RING_T_CODE_L2_FRM_ERR: Layer 2 error¸frame integrity + * @VXGE_HAL_RING_T_CODE_L2_FRM_ERR: Layer 2 error: frame integrity * error, such as FCS or ECC). - * @VXGE_HAL_RING_T_CODE_BUF_SIZE_ERR: Buffer size error¸the RxD buffer( - * s) were not appropriately sized and data loss occurred. - * @VXGE_HAL_RING_T_CODE_INT_ECC_ERR: Internal ECC error¸RxD corrupted. - * @VXGE_HAL_RING_T_CODE_BENIGN_OVFLOW: Benign overflow¸the contents of + * @VXGE_HAL_RING_T_CODE_BUF_SIZE_ERR: Buffer size error: the RxD buffer(s) + * were not appropriately sized and data loss occurred. + * @VXGE_HAL_RING_T_CODE_INT_ECC_ERR: Internal ECC error: RxD corrupted. + * @VXGE_HAL_RING_T_CODE_BENIGN_OVFLOW: Benign overflow: the contents of * Segment1 exceeded the capacity of Buffer1 and the remainder * was placed in Buffer2. Segment2 now starts in Buffer3. * No data loss or errors occurred. - * @VXGE_HAL_RING_T_CODE_ZERO_LEN_BUFF: Buffer size 0¸one of the RxDs + * @VXGE_HAL_RING_T_CODE_ZERO_LEN_BUFF: Buffer size 0: one of the RxDs * assigned buffers has a size of 0 bytes. - * @VXGE_HAL_RING_T_CODE_FRM_DROP: Frame dropped¸either due to + * @VXGE_HAL_RING_T_CODE_FRM_DROP: Frame dropped: either due to * VPath Reset or because of a VPIN mismatch. * @VXGE_HAL_RING_T_CODE_UNUSED: Unused - * @VXGE_HAL_RING_T_CODE_MULTI_ERR: Multiple errors¸more than one + * @VXGE_HAL_RING_T_CODE_MULTI_ERR: Multiple errors: more than one * transfer code condition occurred. * * Transfer codes returned by adapter. @@ -2535,7 +2535,7 @@ void vxge_hal_fifo_txdl_vlan_set( * descriptor. * @vpath_handle: virtual path handle. * @txdlh: Descriptor handle. - * @frag_idx: Index of the data buffer in the caller's scatter-gather list¤ + * @frag_idx: Index of the data buffer in the caller's scatter-gather list * (of buffers). * @dma_pointer: DMA address of the data buffer referenced by @frag_idx. * @size: Size of the data buffer (in bytes). @@ -2560,7 +2560,7 @@ vxge_hal_fifo_txdl_buffer_set( * in fifo descriptor. * @vpath_handle: Virtual path handle. * @txdlh: Descriptor handle. - * @frag_idx: Index of the data buffer in the caller's scatter-gather list¤ + * @frag_idx: Index of the data buffer in the caller's scatter-gather list * (of buffers). * @vaddr: Virtual address of the data buffer. * @dma_pointer: DMA address of the data buffer referenced by @frag_idx. Modified: head/sys/ofed/drivers/infiniband/core/local_sa.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/local_sa.c Sun Jan 15 13:23:43 2012 (r230134) +++ head/sys/ofed/drivers/infiniband/core/local_sa.c Sun Jan 15 13:23:54 2012 (r230135) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006 Intel Corporation.  All rights reserved. + * Copyright (c) 2006 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU Modified: head/sys/ofed/drivers/infiniband/core/notice.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/notice.c Sun Jan 15 13:23:43 2012 (r230134) +++ head/sys/ofed/drivers/infiniband/core/notice.c Sun Jan 15 13:23:54 2012 (r230135) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006 Intel Corporation.  All rights reserved. + * Copyright (c) 2006 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 13:35:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4AA21065676; Sun, 15 Jan 2012 13:35:55 +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 C3C868FC13; Sun, 15 Jan 2012 13:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FDZt7m085508; Sun, 15 Jan 2012 13:35:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FDZtOs085505; Sun, 15 Jan 2012 13:35:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201151335.q0FDZtOs085505@svn.freebsd.org> From: Michael Tuexen Date: Sun, 15 Jan 2012 13:35: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: r230136 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 13:35:55 -0000 Author: tuexen Date: Sun Jan 15 13:35:55 2012 New Revision: 230136 URL: http://svn.freebsd.org/changeset/base/230136 Log: Two cleanups. No functional change. Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jan 15 13:23:54 2012 (r230135) +++ head/sys/netinet/sctp_output.c Sun Jan 15 13:35:55 2012 (r230136) @@ -12839,9 +12839,9 @@ sctp_lower_sosend(struct socket *so, goto out_unlocked; } } - if ((SCTP_SO_IS_NBIO(so) + if (SCTP_SO_IS_NBIO(so) || (flags & MSG_NBIO) - )) { + ) { non_blocking = 1; } /* would we block? */ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jan 15 13:23:54 2012 (r230135) +++ head/sys/netinet/sctputil.c Sun Jan 15 13:35:55 2012 (r230136) @@ -6373,7 +6373,7 @@ sctp_bindx_delete_address(struct sctp_in return; } addr_touse = sa; -#if defined(INET6) && !defined(__Userspace__) /* TODO port in6_sin6_2_sin */ +#if defined(INET6) if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 13:36:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7945B106564A; Sun, 15 Jan 2012 13:36:48 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6825F8FC0C; Sun, 15 Jan 2012 13:36:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FDamgZ085570; Sun, 15 Jan 2012 13:36:48 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FDamIt085568; Sun, 15 Jan 2012 13:36:48 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201201151336.q0FDamIt085568@svn.freebsd.org> From: Joel Dahl Date: Sun, 15 Jan 2012 13:36: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: r230137 - head/sys/dev/sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 13:36:48 -0000 Author: joel (doc committer) Date: Sun Jan 15 13:36:47 2012 New Revision: 230137 URL: http://svn.freebsd.org/changeset/base/230137 Log: Fix a few comment typos. Modified: head/sys/dev/sound/pci/emu10kx.c Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Sun Jan 15 13:35:55 2012 (r230136) +++ head/sys/dev/sound/pci/emu10kx.c Sun Jan 15 13:36:47 2012 (r230137) @@ -158,7 +158,7 @@ #define OUT_ADC_REC OUT_ADC_REC_L #define OUT_MIC_CAP 0x0c -/* Live! 5.1 Digital, non-standart 5.1 (center & sub) outputs */ +/* Live! 5.1 Digital, non-standard 5.1 (center & sub) outputs */ #define OUT_A_CENTER 0x11 #define OUT_A_SUB 0x12 @@ -806,7 +806,7 @@ emu_enable_ir(struct emu_sc_info *sc) /* - * emu_timer_ - HW timer managment + * emu_timer_ - HW timer management */ int emu_timer_create(struct emu_sc_info *sc) @@ -913,7 +913,7 @@ emu_timer_clear(struct emu_sc_info *sc, } /* - * emu_intr_ - HW interrupt handler managment + * emu_intr_ - HW interrupt handler management */ int emu_intr_register(struct emu_sc_info *sc, uint32_t inte_mask, uint32_t intr_mask, uint32_t(*func) (void *softc, uint32_t irq), void *isc) @@ -1012,7 +1012,7 @@ emu_intr(void *p) if (sc->dbg_level > 1) device_printf(sc->dev, "EMU_IPR2: %08x\n", stat); - break; /* to avoid infinite loop. shoud be removed + break; /* to avoid infinite loop. should be removed * after completion of P16V interface. */ } From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 14:03:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C447D106564A; Sun, 15 Jan 2012 14:03:05 +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 995108FC13; Sun, 15 Jan 2012 14:03:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FE3599086393; Sun, 15 Jan 2012 14:03:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FE35ob086391; Sun, 15 Jan 2012 14:03:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201151403.q0FE35ob086391@svn.freebsd.org> From: Michael Tuexen Date: Sun, 15 Jan 2012 14:03: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: r230138 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 14:03:05 -0000 Author: tuexen Date: Sun Jan 15 14:03:05 2012 New Revision: 230138 URL: http://svn.freebsd.org/changeset/base/230138 Log: Small cleanup, no functional change. Modified: head/sys/netinet6/sctp6_var.h Modified: head/sys/netinet6/sctp6_var.h ============================================================================== --- head/sys/netinet6/sctp6_var.h Sun Jan 15 13:36:47 2012 (r230137) +++ head/sys/netinet6/sctp6_var.h Sun Jan 15 14:03:05 2012 (r230138) @@ -37,7 +37,6 @@ #include __FBSDID("$FreeBSD$"); -/* TODO __Userspace__ IPv6 stuff... */ #if defined(_KERNEL) SYSCTL_DECL(_net_inet6_sctp6); From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 16:57:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9C06106567B; Sun, 15 Jan 2012 16:57:18 +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 D89098FC0A; Sun, 15 Jan 2012 16:57:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FGvIAN091659; Sun, 15 Jan 2012 16:57:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FGvIh1091657; Sun, 15 Jan 2012 16:57:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201151657.q0FGvIh1091657@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 15 Jan 2012 16:57: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: r230139 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 16:57:19 -0000 Author: nwhitehorn Date: Sun Jan 15 16:57:18 2012 New Revision: 230139 URL: http://svn.freebsd.org/changeset/base/230139 Log: Now that we can tolerate LPAR context switches on the PS3 hypervisor, going to hypervisor-idle on both threads will not hang the kernel. Modified: head/sys/powerpc/ps3/platform_ps3.c Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Sun Jan 15 14:03:05 2012 (r230138) +++ head/sys/powerpc/ps3/platform_ps3.c Sun Jan 15 16:57:18 2012 (r230139) @@ -247,16 +247,6 @@ ps3_real_maxaddr(platform_t plat) static void ps3_cpu_idle(void) { - static volatile int pausing = 0; - - /* - * XXX: It appears that the PS3 can livelock if both threads - * call lv1_pause(0) simultaneously. - */ - if (!atomic_cmpset_int(&pausing, 0, 1)) - return; - lv1_pause(0); - pausing = 0; } From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 16:58:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F321106566B; Sun, 15 Jan 2012 16:58:45 +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 F215B8FC15; Sun, 15 Jan 2012 16:58:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FGwirZ091736; Sun, 15 Jan 2012 16:58:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FGwirM091734; Sun, 15 Jan 2012 16:58:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201151658.q0FGwirM091734@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 15 Jan 2012 16:58:44 +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: r230140 - head/sys/boot/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 16:58:45 -0000 Author: nwhitehorn Date: Sun Jan 15 16:58:44 2012 New Revision: 230140 URL: http://svn.freebsd.org/changeset/base/230140 Log: Fix some unreliability problems related to MSR bits inherited from kboot by setting an absolute MSR when during on the MMU. This prevents delay(), in particular, from intermittently malfunctioning. Modified: head/sys/boot/powerpc/ps3/ps3mmu.c Modified: head/sys/boot/powerpc/ps3/ps3mmu.c ============================================================================== --- head/sys/boot/powerpc/ps3/ps3mmu.c Sun Jan 15 16:57:18 2012 (r230139) +++ head/sys/boot/powerpc/ps3/ps3mmu.c Sun Jan 15 16:58:44 2012 (r230140) @@ -113,7 +113,7 @@ ps3mmu_init(int maxmem) "r"(1 << SLBV_VSID_SHIFT), "r"((1 << SLBE_ESID_SHIFT) | SLBE_VALID | 1)); - mtmsr(mfmsr() | PSL_IR | PSL_DR | PSL_RI | PSL_ME); + mtmsr(PSL_IR | PSL_DR | PSL_RI | PSL_ME); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 17:01:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 416C21065673; Sun, 15 Jan 2012 17:01:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30BFF8FC18; Sun, 15 Jan 2012 17:01:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FH1Tg8091900; Sun, 15 Jan 2012 17:01:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FH1Ti6091898; Sun, 15 Jan 2012 17:01:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201151701.q0FH1Ti6091898@svn.freebsd.org> From: Eitan Adler Date: Sun, 15 Jan 2012 17:01: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: r230141 - head/usr.bin/grep X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 17:01:29 -0000 Author: eadler (ports committer) Date: Sun Jan 15 17:01:28 2012 New Revision: 230141 URL: http://svn.freebsd.org/changeset/base/230141 Log: Remove duplicate line from usage PR: bin/164139 Submitted by: Yuri Pankov Approved by: nwhitehorn MFC after: 3 days Modified: head/usr.bin/grep/grep.c Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Sun Jan 15 16:58:44 2012 (r230140) +++ head/usr.bin/grep/grep.c Sun Jan 15 17:01:28 2012 (r230141) @@ -158,7 +158,6 @@ usage(void) { fprintf(stderr, getstr(4), getprogname()); fprintf(stderr, "%s", getstr(5)); - fprintf(stderr, "%s", getstr(5)); fprintf(stderr, "%s", getstr(6)); fprintf(stderr, "%s", getstr(7)); exit(2); From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 18:08:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53D3D106564A; Sun, 15 Jan 2012 18:08:16 +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 3EE398FC08; Sun, 15 Jan 2012 18:08:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FI8Gjn093957; Sun, 15 Jan 2012 18:08:16 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FI8GA8093954; Sun, 15 Jan 2012 18:08:16 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201151808.q0FI8GA8093954@svn.freebsd.org> From: Martin Matuska Date: Sun, 15 Jan 2012 18:08: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: r230143 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 18:08:16 -0000 Author: mm Date: Sun Jan 15 18:08:15 2012 New Revision: 230143 URL: http://svn.freebsd.org/changeset/base/230143 Log: Fix missing in r230129: kern_jail.c: initialize fullpath_disabled to zero vfs_cache.c: add missing dot in comment Reported by: kib MFC after: 1 month Modified: head/sys/kern/kern_jail.c head/sys/kern/vfs_cache.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun Jan 15 17:04:39 2012 (r230142) +++ head/sys/kern/kern_jail.c Sun Jan 15 18:08:15 2012 (r230143) @@ -881,6 +881,7 @@ kern_jail_set(struct thread *td, struct } #endif + fullpath_disabled = 0; root = NULL; error = vfs_getopt(opts, "path", (void **)&path, &len); if (error == ENOENT) Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Jan 15 17:04:39 2012 (r230142) +++ head/sys/kern/vfs_cache.c Sun Jan 15 18:08:15 2012 (r230143) @@ -1291,7 +1291,7 @@ vn_commname(struct vnode *vp, char *buf, * vnode is left locked and path remain untouched. * * If vp is a directory, the call to vn_fullpath_global() always succeeds - * because it falls back to the ".." lookup if the namecache lookup fails + * because it falls back to the ".." lookup if the namecache lookup fails. */ int vn_path_to_global_path(struct thread *td, struct vnode *vp, char *path, From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 18:26:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B639106566B; Sun, 15 Jan 2012 18:26:44 +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 2B8FC8FC08; Sun, 15 Jan 2012 18:26:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FIQixh094601; Sun, 15 Jan 2012 18:26:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FIQi5w094599; Sun, 15 Jan 2012 18:26:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201151826.q0FIQi5w094599@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 15 Jan 2012 18:26:44 +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: r230144 - head/sys/powerpc/ps3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 18:26:44 -0000 Author: nwhitehorn Date: Sun Jan 15 18:26:43 2012 New Revision: 230144 URL: http://svn.freebsd.org/changeset/base/230144 Log: Pick a constant high IRQ value for the PS3 IPI, which lets PS3 devices be usefully loaded and unloaded as modules. Submitted by: geoffrey dot levand at mail dot ru MFC after: 2 weeks Modified: head/sys/powerpc/ps3/ps3pic.c Modified: head/sys/powerpc/ps3/ps3pic.c ============================================================================== --- head/sys/powerpc/ps3/ps3pic.c Sun Jan 15 18:08:15 2012 (r230143) +++ head/sys/powerpc/ps3/ps3pic.c Sun Jan 15 18:26:43 2012 (r230144) @@ -62,6 +62,7 @@ struct ps3pic_softc { volatile uint64_t *mask_thread1; uint64_t sc_ipi_outlet[2]; + uint64_t sc_ipi_virq; int sc_vector[64]; }; @@ -131,22 +132,23 @@ ps3pic_attach(device_t dev) thread = 32 - fls(mfctrl()); lv1_configure_irq_state_bitmap(ppe, thread, vtophys(sc->bitmap_thread0)); + + sc->sc_ipi_virq = 63; + #ifdef SMP lv1_configure_irq_state_bitmap(ppe, !thread, vtophys(sc->bitmap_thread1)); /* Map both IPIs to the same VIRQ to avoid changes in intr_machdep */ lv1_construct_event_receive_port(&sc->sc_ipi_outlet[0]); - lv1_connect_irq_plug_ext(ppe, thread, sc->sc_ipi_outlet[0], + lv1_connect_irq_plug_ext(ppe, thread, sc->sc_ipi_virq, sc->sc_ipi_outlet[0], 0); lv1_construct_event_receive_port(&sc->sc_ipi_outlet[1]); - lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_outlet[0], + lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_virq, sc->sc_ipi_outlet[1], 0); -#else - sc->sc_ipi_outlet[0] = sc->sc_ipi_outlet[1] = 63; #endif - powerpc_register_pic(dev, 0, sc->sc_ipi_outlet[0], 1, FALSE); + powerpc_register_pic(dev, 0, sc->sc_ipi_virq, 1, FALSE); return (0); } @@ -218,7 +220,7 @@ ps3pic_mask(device_t dev, u_int irq) sc = device_get_softc(dev); /* Do not mask IPIs! */ - if (irq == sc->sc_ipi_outlet[0]) + if (irq == sc->sc_ipi_virq) return; atomic_clear_64(&sc->mask_thread0[0], 1UL << (63 - irq)); From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 18:47:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA728106564A; Sun, 15 Jan 2012 18:47:24 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3FE78FC14; Sun, 15 Jan 2012 18:47:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FIlOkD095245; Sun, 15 Jan 2012 18:47:24 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FIlOXg095240; Sun, 15 Jan 2012 18:47:24 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201151847.q0FIlOXg095240@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 15 Jan 2012 18:47: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: r230145 - in head/sys: compat/linprocfs fs/procfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 18:47:25 -0000 Author: trociny Date: Sun Jan 15 18:47:24 2012 New Revision: 230145 URL: http://svn.freebsd.org/changeset/base/230145 Log: Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always want to read strings completely to know the actual size. As a side effect it fixes the issue with kern.proc.args and kern.proc.env sysctls, which didn't return the size of available data when calling sysctl(3) with the NULL argument for oldp. Note, in get_ps_strings(), which does actual work for proc_getargv() and proc_getenvv(), we still have a safety limit on the size of data read in case of a corrupted procces stack. Suggested by: kib MFC after: 3 days Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs_status.c head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun Jan 15 18:26:43 2012 (r230144) +++ head/sys/compat/linprocfs/linprocfs.c Sun Jan 15 18:47:24 2012 (r230145) @@ -954,7 +954,7 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); - ret = proc_getargv(td, p, sb, ARG_MAX); + ret = proc_getargv(td, p, sb); return (ret); } @@ -988,7 +988,7 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) PROC_UNLOCK(p); - ret = proc_getenvv(td, p, sb, ARG_MAX); + ret = proc_getenvv(td, p, sb); return (ret); } Modified: head/sys/fs/procfs/procfs_status.c ============================================================================== --- head/sys/fs/procfs/procfs_status.c Sun Jan 15 18:26:43 2012 (r230144) +++ head/sys/fs/procfs/procfs_status.c Sun Jan 15 18:47:24 2012 (r230145) @@ -193,5 +193,5 @@ procfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); - return (proc_getargv(td, p, sb, ARG_MAX)); + return (proc_getargv(td, p, sb)); } Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Jan 15 18:26:43 2012 (r230144) +++ head/sys/kern/kern_proc.c Sun Jan 15 18:47:24 2012 (r230145) @@ -1631,20 +1631,19 @@ get_proc_vector(struct thread *td, struc static int get_ps_strings(struct thread *td, struct proc *p, struct sbuf *sb, - enum proc_vector_type type, size_t nchr) + enum proc_vector_type type) { - size_t done, len, vsize; + size_t done, len, nchr, vsize; int error, i; char **proc_vector, *sptr; char pss_string[GET_PS_STRINGS_CHUNK_SZ]; PROC_ASSERT_HELD(p); - /* - * We are not going to read more than 2 * (PATH_MAX + ARG_MAX) bytes. - */ - if (nchr > 2 * (PATH_MAX + ARG_MAX)) - nchr = 2 * (PATH_MAX + ARG_MAX); + /* + * We are not going to read more than 2 * (PATH_MAX + ARG_MAX) bytes. + */ + nchr = 2 * (PATH_MAX + ARG_MAX); error = get_proc_vector(td, p, &proc_vector, &vsize, type); if (error != 0) @@ -1679,17 +1678,17 @@ done: } int -proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb, size_t nchr) +proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb) { - return (get_ps_strings(curthread, p, sb, PROC_ARG, nchr)); + return (get_ps_strings(curthread, p, sb, PROC_ARG)); } int -proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb, size_t nchr) +proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb) { - return (get_ps_strings(curthread, p, sb, PROC_ENV, nchr)); + return (get_ps_strings(curthread, p, sb, PROC_ENV)); } /* @@ -1728,7 +1727,7 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARG _PHOLD(p); PROC_UNLOCK(p); sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); - error = proc_getargv(curthread, p, &sb, req->oldlen); + error = proc_getargv(curthread, p, &sb); error2 = sbuf_finish(&sb); PRELE(p); sbuf_delete(&sb); @@ -1780,7 +1779,7 @@ sysctl_kern_proc_env(SYSCTL_HANDLER_ARGS } sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); - error = proc_getenvv(curthread, p, &sb, req->oldlen); + error = proc_getenvv(curthread, p, &sb); error2 = sbuf_finish(&sb); PRELE(p); sbuf_delete(&sb); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Jan 15 18:26:43 2012 (r230144) +++ head/sys/sys/proc.h Sun Jan 15 18:47:24 2012 (r230145) @@ -859,10 +859,8 @@ int p_canwait(struct thread *td, struct struct pargs *pargs_alloc(int len); void pargs_drop(struct pargs *pa); void pargs_hold(struct pargs *pa); -int proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb, - size_t nchr); -int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb, - size_t nchr); +int proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb); +int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb); void procinit(void); void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 18:51:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FC2C1065670; Sun, 15 Jan 2012 18:51:08 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E564A8FC12; Sun, 15 Jan 2012 18:51:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FIp7sF095392; Sun, 15 Jan 2012 18:51:07 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FIp7GC095390; Sun, 15 Jan 2012 18:51:07 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201151851.q0FIp7GC095390@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 15 Jan 2012 18:51: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: r230146 - head/lib/libkvm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 18:51:08 -0000 Author: trociny Date: Sun Jan 15 18:51:07 2012 New Revision: 230146 URL: http://svn.freebsd.org/changeset/base/230146 Log: In kvm_argv(), the case when the supplied buffer was too short to hold the requested value was handled incorrectly, and the function retuned NULL instead of the truncated result. Fix this and also remove unnecessary check for buf != NULL, which alway retuns true. MFC after: 3 days Modified: head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Sun Jan 15 18:47:24 2012 (r230145) +++ head/lib/libkvm/kvm_proc.c Sun Jan 15 18:51:07 2012 (r230146) @@ -658,30 +658,38 @@ kvm_argv(kvm_t *kd, const struct kinfo_p buflen = nchr; } } - if (buf != NULL) { - oid[0] = CTL_KERN; - oid[1] = KERN_PROC; - oid[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; - oid[3] = kp->ki_pid; - bufsz = buflen; - i = sysctl(oid, 4, buf, &bufsz, 0, 0); - if (i == 0 && bufsz > 0) { - i = 0; - p = buf; - do { - bufp[i++] = p; - p += strlen(p) + 1; - if (i >= argc) { - argc += argc; - bufp = realloc(bufp, - sizeof(char *) * argc); - } - } while (p < buf + bufsz); - bufp[i++] = 0; - return (bufp); - } + oid[0] = CTL_KERN; + oid[1] = KERN_PROC; + oid[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; + oid[3] = kp->ki_pid; + bufsz = buflen; + if (sysctl(oid, 4, buf, &bufsz, 0, 0) == -1) { + /* + * If the supplied buf is too short to hold the requested + * value the sysctl returns with ENOMEM. The buf is filled + * with the truncated value and the returned bufsz is equal + * to the requested len. + */ + if (errno != ENOMEM || bufsz != (size_t)buflen) + return (0); + buf[bufsz - 1] = '\0'; + errno = 0; + } else if (bufsz == 0) { + return (0); } - return (NULL); + i = 0; + p = buf; + do { + bufp[i++] = p; + p += strlen(p) + 1; + if (i >= argc) { + argc += argc; + bufp = realloc(bufp, + sizeof(char *) * argc); + } + } while (p < buf + bufsz); + bufp[i++] = 0; + return (bufp); } char ** From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 18:54:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C440106566C; Sun, 15 Jan 2012 18:54:10 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 875888FC08; Sun, 15 Jan 2012 18:54:09 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 1552640002; Sun, 15 Jan 2012 19:54:08 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 0A0F440008; Sun, 15 Jan 2012 19:54:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id AF68C40002; Sun, 15 Jan 2012 19:54:07 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 458FC119D3D; Sun, 15 Jan 2012 19:54:07 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([IPv6:2001:470:dca9:0:1::3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [2001:470:dca9:0:1::6]) (amavisd-new, port 10025) with ESMTPS id BE8tAYuVkV6Q; Sun, 15 Jan 2012 19:54:04 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id C17A1119D3C; Sun, 15 Jan 2012 19:54:04 +0100 (CET) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id A4C2412B089; Sun, 15 Jan 2012 19:54:04 +0100 (CET) Message-ID: <4F1320CC.5040309@daemonic.se> Date: Sun, 15 Jan 2012 19:54:04 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Alexander Motin References: <201201151321.q0FDLbln084687@svn.freebsd.org> In-Reply-To: <201201151321.q0FDLbln084687@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230130 - in head: share/man/man4 sys/conf sys/dev/sound/pci/hda sys/modules/sound/driver/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 18:54:10 -0000 On 2012-01-15 14:21, Alexander Motin wrote: > Author: mav > Date: Sun Jan 15 13:21:36 2012 > New Revision: 230130 > URL: http://svn.freebsd.org/changeset/base/230130 > > Log: > Major snd_hda driver rewrite: > - Huge old hdac driver was split into three independent pieces: HDA > controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function > driver (hdaa). > - Support for multichannel recording was added. Now, as specification > defines, driver checks input associations for pins with sequence numbers > 14 and 15, and if found (usually) -- works as before, mixing signals > together. If it doesn't, it configures input association as multichannel. > - Signal tracer was improved to look for cases where several DACs/ADCs in > CODEC can work with the same audio signal. If such case found, driver > registers additional playback/record stream (channel) for the pcm device. > - New controller streams reservation mechanism was implemented. That > allows to have more pcm devices then streams supported by the controller > (usually 4 in each direction). Now it limits only number of simultaneously > transferred audio streams, that is rarely reachable and properly reported > if happens. > - Codec pins and GPIO signals configuration was exported via set of > writable sysctls. Another sysctl dev.hdaa.X.reconfig allows to trigger > driver reconfiguration in run-time. > - Driver now decodes pins location and connector type names. In some cases > it allows to hint user where on the system case connectors, related to the > pcm device, are located. Number of channels supported by pcm device, > reported now (if it is not 2), should also make search easier. > - Added workaround for digital mic on some Asus laptops/netbooks. > > MFC after: 2 months > Sponsored by: iXsystems, Inc. Just a question. Does this need any changes to the kernel config, such as adding different "device hdac" etc. or is the default device hda still ok? Regards! -- Niclas From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 18:58:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9B841065782; Sun, 15 Jan 2012 18:58:08 +0000 (UTC) (envelope-from mavbsd@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 EE6918FC1A; Sun, 15 Jan 2012 18:58:07 +0000 (UTC) Received: by eaai10 with SMTP id i10so252652eaa.13 for ; Sun, 15 Jan 2012 10:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=+sQTDqmAMHfBJvqltesU6o1FQXg41VvVnGWrMeM6Gu0=; b=iLGGhRslsozmTQZXTDrtnMiRoaqD+mDe+wIHinS+hNjFxkwv+tzWRylVIuH6ubi72L DNWq4yLXjOa9aw/TuvX4CzlJNiYPr/aQc2I6JpWJ775zmMBlqfdleVLzSZaDw/crNrl4 FeLFFrgqsBZrRd5CA/BuMeEA+HIWxuy/tChnY= Received: by 10.213.34.66 with SMTP id k2mr2020696ebd.73.1326653886706; Sun, 15 Jan 2012 10:58:06 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id t59sm61892815eeh.10.2012.01.15.10.58.04 (version=SSLv3 cipher=OTHER); Sun, 15 Jan 2012 10:58:05 -0800 (PST) Sender: Alexander Motin Message-ID: <4F1321B3.8020409@FreeBSD.org> Date: Sun, 15 Jan 2012 20:57:55 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: Niclas Zeising References: <201201151321.q0FDLbln084687@svn.freebsd.org> <4F1320CC.5040309@daemonic.se> In-Reply-To: <4F1320CC.5040309@daemonic.se> Content-Type: text/plain; charset=KOI8-R; 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: r230130 - in head: share/man/man4 sys/conf sys/dev/sound/pci/hda sys/modules/sound/driver/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 18:58:09 -0000 On 15.01.2012 20:54, Niclas Zeising wrote: > On 2012-01-15 14:21, Alexander Motin wrote: >> Author: mav >> Date: Sun Jan 15 13:21:36 2012 >> New Revision: 230130 >> URL: http://svn.freebsd.org/changeset/base/230130 >> >> Log: >> Major snd_hda driver rewrite: >> - Huge old hdac driver was split into three independent pieces: HDA >> controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function >> driver (hdaa). >> - Support for multichannel recording was added. Now, as specification >> defines, driver checks input associations for pins with sequence numbers >> 14 and 15, and if found (usually) -- works as before, mixing signals >> together. If it doesn't, it configures input association as multichannel. >> - Signal tracer was improved to look for cases where several DACs/ADCs in >> CODEC can work with the same audio signal. If such case found, driver >> registers additional playback/record stream (channel) for the pcm device. >> - New controller streams reservation mechanism was implemented. That >> allows to have more pcm devices then streams supported by the controller >> (usually 4 in each direction). Now it limits only number of simultaneously >> transferred audio streams, that is rarely reachable and properly reported >> if happens. >> - Codec pins and GPIO signals configuration was exported via set of >> writable sysctls. Another sysctl dev.hdaa.X.reconfig allows to trigger >> driver reconfiguration in run-time. >> - Driver now decodes pins location and connector type names. In some cases >> it allows to hint user where on the system case connectors, related to the >> pcm device, are located. Number of channels supported by pcm device, >> reported now (if it is not 2), should also make search easier. >> - Added workaround for digital mic on some Asus laptops/netbooks. >> >> MFC after: 2 months >> Sponsored by: iXsystems, Inc. > > Just a question. Does this need any changes to the kernel config, such > as adding different "device hdac" etc. or is the default device hda > still ok? Nothing changed there. `device snd_hda` and snd_hda kernel module include all parts. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 19:22:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53771106566B; Sun, 15 Jan 2012 19:22:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2B48FC1A; Sun, 15 Jan 2012 19:22:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FJMZst096365; Sun, 15 Jan 2012 19:22:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FJMZPO096358; Sun, 15 Jan 2012 19:22:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201151922.q0FJMZPO096358@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2012 19: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: r230147 - in head/sys/dev/ath/ath_hal: . ar9001 ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 19:22:35 -0000 Author: adrian Date: Sun Jan 15 19:22:34 2012 New Revision: 230147 URL: http://svn.freebsd.org/changeset/base/230147 Log: Break out the "memory" EEPROM data read method from being AR9130 specific to being more generic. Other embedded SoCs also throw the configuration/PCI register info into flash. For now I'm just hard-coding the AR9280 option (for on-board AR9220's on AP94 and commercial designs (eg D-Link DIR-825.)) TODO: * Figure out how to support it for all 11n SoC NICs by doing it in ar5416InitState(); * Don't hard-code the EEPROM size - add another field which is set by the relevant chip initialisation code. * 'owl_eep_start_loc' may need to be overridden in some cases to 0x0. I need to do some further digging. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.c head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.h head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Sun Jan 15 18:51:07 2012 (r230146) +++ head/sys/dev/ath/ath_hal/ah.c Sun Jan 15 19:22:34 2012 (r230147) @@ -1266,3 +1266,27 @@ ath_hal_getcca(struct ath_hal *ah) return 1; return ((diag & 0x500000) == 0); } + +/* + * This routine is only needed when supporting EEPROM-in-RAM setups + * (eg embedded SoCs and on-board PCI/PCIe devices.) + */ +/* NB: This is in 16 bit words; not bytes */ +/* XXX This doesn't belong here! */ +#define ATH_DATA_EEPROM_SIZE 2048 + +HAL_BOOL +ath_hal_EepromDataRead(struct ath_hal *ah, u_int off, uint16_t *data) +{ + if (ah->ah_eepromdata == AH_NULL) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: no eeprom data!\n", __func__); + return AH_FALSE; + } + if (off > ATH_DATA_EEPROM_SIZE) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: offset %x > %x\n", + __func__, off, ATH_DATA_EEPROM_SIZE); + return AH_FALSE; + } + (*data) = ah->ah_eepromdata[off]; + return AH_TRUE; +} Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sun Jan 15 18:51:07 2012 (r230146) +++ head/sys/dev/ath/ath_hal/ah.h Sun Jan 15 19:22:34 2012 (r230147) @@ -1169,4 +1169,10 @@ void __ahdecl ath_hal_setcca(struct ath_ */ int __ahdecl ath_hal_getcca(struct ath_hal *ah); +/* + * Read EEPROM data from ah_eepromdata + */ +HAL_BOOL __ahdecl ath_hal_EepromDataRead(struct ath_hal *ah, + u_int off, uint16_t *data); + #endif /* _ATH_AH_H_ */ Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Sun Jan 15 18:51:07 2012 (r230146) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Sun Jan 15 19:22:34 2012 (r230147) @@ -119,11 +119,11 @@ ar9130Attach(uint16_t devid, HAL_SOFTC s /* * Use the "local" EEPROM data given to us by the higher layers. - * This is a private copy out of system flash. The Linux ath9k - * commit for the initial AR9130 support mentions MMIO flash - * access is "unreliable." -adrian + * This is a private copy out of system flash. + * By this stage the SoC SPI flash may have disabled the memory- + * mapping and rely purely on port-based SPI IO. */ - AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; + AH_PRIVATE((ah))->ah_eepromRead = ath_hal_EepromDataRead; AH_PRIVATE((ah))->ah_eepromWrite = NULL; ah->ah_eepromdata = eepromdata; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.c Sun Jan 15 18:51:07 2012 (r230146) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.c Sun Jan 15 19:22:34 2012 (r230147) @@ -16,28 +16,3 @@ * * $FreeBSD$ */ -#include "opt_ah.h" - -#include "ah.h" -#include "ah_internal.h" - -#include "ar9001/ar9130_eeprom.h" - -/* XXX this shouldn't be done here */ -/* This is in 16 bit words; not bytes -adrian */ -#define ATH_DATA_EEPROM_SIZE 2048 - -HAL_BOOL -ar9130EepromRead(struct ath_hal *ah, u_int off, uint16_t *data) -{ - if (ah->ah_eepromdata == AH_NULL) { - HALDEBUG(ah, HAL_DEBUG_ANY, "%s: no eeprom data!\n", __func__); - return AH_FALSE; - } - if (off > ATH_DATA_EEPROM_SIZE) { - HALDEBUG(ah, HAL_DEBUG_ANY, "ar9130EepromRead: offset %x > %x\n", off, ATH_DATA_EEPROM_SIZE); - return AH_FALSE; - } - (*data) = ah->ah_eepromdata[off]; - return AH_TRUE; -} Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.h Sun Jan 15 18:51:07 2012 (r230146) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.h Sun Jan 15 19:22:34 2012 (r230147) @@ -19,6 +19,4 @@ #ifndef __AR9130_EEPROM_H__ #define __AR9130_EEPROM_H__ -extern HAL_BOOL ar9130EepromRead(struct ath_hal *ah, u_int off, uint16_t *data); - #endif Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sun Jan 15 18:51:07 2012 (r230146) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sun Jan 15 19:22:34 2012 (r230147) @@ -169,6 +169,19 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s ar5416InitState(AH5416(ah), devid, sc, st, sh, status); + + /* + * Use the "local" EEPROM data given to us by the higher layers. + * This is a private copy out of system flash. The Linux ath9k + * commit for the initial AR9130 support mentions MMIO flash + * access is "unreliable." -adrian + */ + if (eepromdata != AH_NULL) { + AH_PRIVATE((ah))->ah_eepromRead = ath_hal_EepromDataRead; + AH_PRIVATE((ah))->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + /* XXX override with 9280 specific state */ /* override 5416 methods for our needs */ AH5416(ah)->ah_initPLL = ar9280InitPLL; From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 19:29:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 746801065673; Sun, 15 Jan 2012 19:29:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC378FC12; Sun, 15 Jan 2012 19:29:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FJTXSY096595; Sun, 15 Jan 2012 19:29:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FJTXRa096593; Sun, 15 Jan 2012 19:29:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201151929.q0FJTXRa096593@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2012 19:29: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: r230148 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 19:29:33 -0000 Author: adrian Date: Sun Jan 15 19:29:33 2012 New Revision: 230148 URL: http://svn.freebsd.org/changeset/base/230148 Log: Some of the atheros based embedded devices use one or more PCI NICs on-board, glued to the AR71xx CPU. These may forgo separate WMAC EEPROMs (which store configuration and calibration data) and instead store it in the main board SPI flash. Normally the NIC reads the EEPROM attached to it to setup various PCI configuration registers. If this isn't done, the device will probe as something different (eg 0x168c:abcd, or 0x168c:ff??.) Other setup registers are also written to which may control important functions. This introduces a new compile option, AR71XX_ATH_EEPROM, which enables the use of this particular code. The ART offset in the SPI flash can be specified as a hint against the relevant slot/device number, for example: hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000 hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1fff5000 TODO: * Think of a better name; * Make the PCIe version of this fixup code also use this option; * Maybe also check slot 19; * This has to happen _before_ the SPI flash is set from memory-mapped to SPI-IO - so document that somewhere. Modified: head/sys/mips/atheros/ar71xx_pci.c Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Sun Jan 15 19:22:34 2012 (r230147) +++ head/sys/mips/atheros/ar71xx_pci.c Sun Jan 15 19:29:33 2012 (r230148) @@ -248,6 +248,77 @@ ar71xx_pci_write_config(device_t dev, u_ } } +#ifdef AR71XX_ATH_EEPROM +/* + * Some embedded boards (eg AP94) have the MAC attached via PCI but they + * don't have the MAC-attached EEPROM. The register initialisation + * values and calibration data are stored in the on-board flash. + * This routine initialises the NIC via the EEPROM register contents + * before the probe/attach routines get a go at things. + */ +static void +ar71xx_pci_fixup(device_t dev, u_int bus, u_int slot, u_int func, + long flash_addr) +{ + uint16_t *cal_data = (uint16_t *) MIPS_PHYS_TO_KSEG1(flash_addr); + uint32_t reg, val, bar0; + + printf("%s: flash_addr=%lx, cal_data=%p\n", + __func__, flash_addr, cal_data); + + /* XXX check 0xa55a */ + /* Save bar(0) address - just to flush bar(0) (SoC WAR) ? */ + bar0 = ar71xx_pci_read_config(dev, bus, slot, func, PCIR_BAR(0), 4); + ar71xx_pci_write_config(dev, bus, slot, func, PCIR_BAR(0), + AR71XX_PCI_MEM_BASE, 4); + + val = ar71xx_pci_read_config(dev, bus, slot, func, PCIR_COMMAND, 2); + val |= (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); + ar71xx_pci_write_config(dev, bus, slot, func, PCIR_COMMAND, val, 2); + + cal_data += 3; + while (*cal_data != 0xffff) { + reg = *cal_data++; + val = *cal_data++; + val |= (*cal_data++) << 16; + printf(" reg: %x, val=%x\n", reg, val); + + /* Write eeprom fixup data to device memory */ + ATH_WRITE_REG(AR71XX_PCI_MEM_BASE + reg, val); + DELAY(100); + } + + val = ar71xx_pci_read_config(dev, bus, slot, func, PCIR_COMMAND, 2); + val &= ~(PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); + ar71xx_pci_write_config(dev, bus, slot, func, PCIR_COMMAND, val, 2); + + /* Write the saved bar(0) address */ + ar71xx_pci_write_config(dev, bus, slot, func, PCIR_BAR(0), bar0, 4); +} + +static void +ar71xx_pci_slot_fixup(device_t dev, u_int bus, u_int slot, u_int func) +{ + long int flash_addr; + char buf[32]; + + /* + * Check whether the given slot has a hint to poke. + */ + printf("%s: checking dev %s, %d/%d/%d\n", + __func__, device_get_nameunit(dev), bus, slot, func); + snprintf(buf, sizeof(buf), "bus.%d.%d.%d.ath_fixup_addr", + bus, slot, func); + + if (resource_long_value(device_get_name(dev), device_get_unit(dev), + buf, &flash_addr) == 0) { + printf("%s: found fixupaddr at %lx: updating\n", + __func__, flash_addr); + ar71xx_pci_fixup(dev, bus, slot, func, flash_addr); + } +} +#endif /* AR71XX_ATH_EEPROM */ + static int ar71xx_pci_probe(device_t dev) { @@ -321,6 +392,16 @@ ar71xx_pci_attach(device_t dev) | PCIM_CMD_SERRESPEN | PCIM_CMD_BACKTOBACK | PCIM_CMD_PERRESPEN | PCIM_CMD_MWRICEN, 2); +#ifdef AR71XX_ATH_EEPROM + /* + * Hard-code a check for slot 17 and 18 - these are + * the two PCI slots which may have a PCI device that + * requires "fixing". + */ + ar71xx_pci_slot_fixup(dev, 0, 17, 0); + ar71xx_pci_slot_fixup(dev, 0, 18, 0); +#endif /* AR71XX_ATH_EEPROM */ + device_add_child(dev, "pci", busno); return (bus_generic_attach(dev)); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 19:30:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE397106566B; Sun, 15 Jan 2012 19:30:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BECE28FC18; Sun, 15 Jan 2012 19:30:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FJUWZJ096676; Sun, 15 Jan 2012 19:30:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FJUWUt096674; Sun, 15 Jan 2012 19:30:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201151930.q0FJUWUt096674@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2012 19:30: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: r230149 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 19:30:33 -0000 Author: adrian Date: Sun Jan 15 19:30:32 2012 New Revision: 230149 URL: http://svn.freebsd.org/changeset/base/230149 Log: Add the new option introduced in the previous commit. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Jan 15 19:29:33 2012 (r230148) +++ head/sys/conf/options Sun Jan 15 19:30:32 2012 (r230149) @@ -902,3 +902,4 @@ RCTL opt_global.h AR71XX_REALMEM opt_global.h AR71XX_ENV_UBOOT opt_global.h AR71XX_ENV_REDBOOT opt_global.h +AR71XX_ATH_EEPROM opt_global.h From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 19:40:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84929106566B; Sun, 15 Jan 2012 19:40:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CA958FC18; Sun, 15 Jan 2012 19:40:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FJext4097024; Sun, 15 Jan 2012 19:40:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FJexi8097020; Sun, 15 Jan 2012 19:40:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201151940.q0FJexi8097020@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2012 19: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: r230150 - in head/sys/modules/gpio: . gpiobus gpioiic gpioled X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 19:40:59 -0000 Author: adrian Date: Sun Jan 15 19:40:59 2012 New Revision: 230150 URL: http://svn.freebsd.org/changeset/base/230150 Log: Allow building the GPIO bus and associated bits as modules. This is primarily done to save a few bytes here and there on embedded systems with limited flash space for kernels - a very limited (sub-1MB) space may be available for the kernel and may only support gzip encoding. The rootfs can be LZMA compressed. Added: head/sys/modules/gpio/ head/sys/modules/gpio/Makefile (contents, props changed) head/sys/modules/gpio/gpiobus/ head/sys/modules/gpio/gpiobus/Makefile (contents, props changed) head/sys/modules/gpio/gpioiic/ head/sys/modules/gpio/gpioiic/Makefile (contents, props changed) head/sys/modules/gpio/gpioled/ head/sys/modules/gpio/gpioled/Makefile (contents, props changed) Added: head/sys/modules/gpio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/gpio/Makefile Sun Jan 15 19:40:59 2012 (r230150) @@ -0,0 +1,30 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2011 Adrian Chadd. 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. +# + +SUBDIR = gpiobus gpioiic gpioled + +.include Added: head/sys/modules/gpio/gpiobus/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/gpio/gpiobus/Makefile Sun Jan 15 19:40:59 2012 (r230150) @@ -0,0 +1,40 @@ +# +# Copyright (c) 2012 Adrian Chadd, Xenion Pty Ltd +# 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, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +# redistribution must be conditioned upon including a substantially +# similar Disclaimer requirement for further binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../dev/gpio/ + +KMOD= gpiobus +SRCS= gpiobus.c +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h + +CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ + +.include Added: head/sys/modules/gpio/gpioiic/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/gpio/gpioiic/Makefile Sun Jan 15 19:40:59 2012 (r230150) @@ -0,0 +1,40 @@ +# +# Copyright (c) 2012 Adrian Chadd, Xenion Pty Ltd +# 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, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +# redistribution must be conditioned upon including a substantially +# similar Disclaimer requirement for further binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../dev/gpio/ + +KMOD= gpioiic +SRCS= gpioiic.c +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h iicbus_if.h iicbb_if.h + +CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ + +.include Added: head/sys/modules/gpio/gpioled/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/gpio/gpioled/Makefile Sun Jan 15 19:40:59 2012 (r230150) @@ -0,0 +1,40 @@ +# +# Copyright (c) 2012 Adrian Chadd, Xenion Pty Ltd +# 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, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +# redistribution must be conditioned upon including a substantially +# similar Disclaimer requirement for further binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../dev/gpio/ + +KMOD= gpioled +SRCS= gpioled.c +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h + +CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ + +.include From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 19:42:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74B5C106566B; Sun, 15 Jan 2012 19:42:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DBCD8FC08; Sun, 15 Jan 2012 19:42:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FJgtN8097114; Sun, 15 Jan 2012 19:42:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FJgt3c097111; Sun, 15 Jan 2012 19:42:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201151942.q0FJgt3c097111@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2012 19:42: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: r230151 - in head/sys/modules/ar71xx: . ar71xx_ehci ar71xx_ohci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 19:42:55 -0000 Author: adrian Date: Sun Jan 15 19:42:55 2012 New Revision: 230151 URL: http://svn.freebsd.org/changeset/base/230151 Log: Begin breaking out the AR71xx specific functional drivers into modules. The USB code as it stands includes the bus glue along _with_ the controller code. So the ohci/ehci modules actually build the USB controller code and the PCI bus glue. It'd be nice to ship separate modules for the PCI glue and the USB controller (so for example if there were a USB controller hanging off the internal SoC bus as well as an external PCI device) it could be done. This is primarily done to save a few bytes here and there on embedded systems with limited flash space for kernels - a very limited (sub-1MB) space may be available for the kernel and may only support gzip encoding. The rootfs can be LZMA compressed. Added: head/sys/modules/ar71xx/ head/sys/modules/ar71xx/Makefile (contents, props changed) head/sys/modules/ar71xx/ar71xx_ehci/ head/sys/modules/ar71xx/ar71xx_ehci/Makefile (contents, props changed) head/sys/modules/ar71xx/ar71xx_ohci/ head/sys/modules/ar71xx/ar71xx_ohci/Makefile (contents, props changed) Added: head/sys/modules/ar71xx/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ar71xx/Makefile Sun Jan 15 19:42:55 2012 (r230151) @@ -0,0 +1,30 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2011 Adrian Chadd. 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. +# + +SUBDIR = ar71xx_ehci ar71xx_ohci + +.include Added: head/sys/modules/ar71xx/ar71xx_ehci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ar71xx/ar71xx_ehci/Makefile Sun Jan 15 19:42:55 2012 (r230151) @@ -0,0 +1,43 @@ +# +# Copyright (c) 2012 Adrian Chadd, Xenion Pty Ltd +# 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, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +# redistribution must be conditioned upon including a substantially +# similar Disclaimer requirement for further binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../mips/atheros/ + +KMOD= ar71xx_ehci +SRCS= ar71xx_ehci.c +SRCS+= device_if.h bus_if.h usb_if.h opt_usb.h opt_bus.h + +.PATH: ${.CURDIR}/../../../dev/usb/controller/ +SRCS+= ehci.c + +CFLAGS+= -I. -I${.CURDIR}/../../../mips/atheros + +.include Added: head/sys/modules/ar71xx/ar71xx_ohci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ar71xx/ar71xx_ohci/Makefile Sun Jan 15 19:42:55 2012 (r230151) @@ -0,0 +1,43 @@ +# +# Copyright (c) 2012 Adrian Chadd, Xenion Pty Ltd +# 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, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any +# redistribution must be conditioned upon including a substantially +# similar Disclaimer requirement for further binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../mips/atheros/ + +KMOD= ar71xx_ohci +SRCS= ar71xx_ohci.c +SRCS+= device_if.h bus_if.h usb_if.h opt_usb.h opt_bus.h + +CFLAGS+= -I. -I${.CURDIR}/../../../mips/atheros + +.PATH: ${.CURDIR}/../../../dev/usb/controller/ +SRCS+= ohci.c + +.include From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 19:43:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50B381065672; Sun, 15 Jan 2012 19:43:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C9118FC15; Sun, 15 Jan 2012 19:43:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FJhv4Q097177; Sun, 15 Jan 2012 19:43:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FJhvFH097175; Sun, 15 Jan 2012 19:43:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201151943.q0FJhvFH097175@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2012 19:43: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: r230152 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 19:43:57 -0000 Author: adrian Date: Sun Jan 15 19:43:56 2012 New Revision: 230152 URL: http://svn.freebsd.org/changeset/base/230152 Log: Build some more things (random, bridge/gif/gre, gpio, USB) as modules as well so some embedded platform builds can use these instead of a fully monolithic kernel. Modified: head/sys/mips/conf/AR71XX_BASE Modified: head/sys/mips/conf/AR71XX_BASE ============================================================================== --- head/sys/mips/conf/AR71XX_BASE Sun Jan 15 19:42:55 2012 (r230151) +++ head/sys/mips/conf/AR71XX_BASE Sun Jan 15 19:43:56 2012 (r230152) @@ -24,8 +24,9 @@ hints "AR71XX_BASE.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -# Also build these as modules, just to ensure the build gets tested. -makeoptions MODULES_OVERRIDE="wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" +# Build these as modules so small platform builds will have the +# modules already built. +makeoptions MODULES_OVERRIDE="random gpio ar71xx if_gif if_gre if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" options DDB options KDB From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 19:45:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 705D1106566B; Sun, 15 Jan 2012 19:45:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ACAD8FC08; Sun, 15 Jan 2012 19:45:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FJjNEp097273; Sun, 15 Jan 2012 19:45:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FJjNvl097270; Sun, 15 Jan 2012 19:45:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201151945.q0FJjNvl097270@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2012 19:45: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: r230153 - in head/sys: modules/wlan net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 19:45:23 -0000 Author: adrian Date: Sun Jan 15 19:45:23 2012 New Revision: 230153 URL: http://svn.freebsd.org/changeset/base/230153 Log: Fix the situation where net80211 is built with IEEE80211_SUPPORT_TDMA but a module is used. Although the module _builds_, it fails to load because of a missing symbol from ieee80211_tdma.c. Specifics: * Always build ieee80211_tdma.c in the module; * only compile in the code if IEEE80211_SUPPORT_TDMA is defined. Modified: head/sys/modules/wlan/Makefile head/sys/net80211/ieee80211_tdma.c Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Sun Jan 15 19:43:56 2012 (r230152) +++ head/sys/modules/wlan/Makefile Sun Jan 15 19:45:23 2012 (r230153) @@ -11,7 +11,8 @@ SRCS= ieee80211.c ieee80211_action.c iee ieee80211_scan_sta.c ieee80211_radiotap.c ieee80211_ratectl.c \ ieee80211_ratectl_none.c ieee80211_regdomain.c \ ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ - ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c + ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c \ + ieee80211_tdma.c SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h opt_ipx.h opt_wlan.h \ opt_ddb.h Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Sun Jan 15 19:43:56 2012 (r230152) +++ head/sys/net80211/ieee80211_tdma.c Sun Jan 15 19:45:23 2012 (r230153) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include "opt_tdma.h" #include "opt_wlan.h" +#ifdef IEEE80211_SUPPORT_TDMA + #include #include #include @@ -820,3 +822,5 @@ restart: return ERESTART; } IEEE80211_IOCTL_SET(tdma, tdma_ioctl_set80211); + +#endif /* IEEE80211_SUPPORT_TDMA */ From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 20:04:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21875106566C; Sun, 15 Jan 2012 20:04:06 +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 E515F8FC0A; Sun, 15 Jan 2012 20:04:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FK45BJ097894; Sun, 15 Jan 2012 20:04:05 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FK45U8097889; Sun, 15 Jan 2012 20:04:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201152004.q0FK45U8097889@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jan 2012 20:04: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: r230154 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 20:04:07 -0000 Author: jilles Date: Sun Jan 15 20:04:05 2012 New Revision: 230154 URL: http://svn.freebsd.org/changeset/base/230154 Log: sh: Fix two bugs with case and exit status: * If no pattern is matched, POSIX says the exit status shall be 0 (even if there are command substitutions). * If a pattern is matched and there are no command substitutions, the first command should see the $? from before the case command, not always 0. Added: head/tools/regression/bin/sh/builtins/case14.0 (contents, props changed) head/tools/regression/bin/sh/builtins/case15.0 (contents, props changed) head/tools/regression/bin/sh/builtins/case16.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jan 15 19:45:23 2012 (r230153) +++ head/bin/sh/eval.c Sun Jan 15 20:04:05 2012 (r230154) @@ -378,7 +378,6 @@ evalcase(union node *n, int flags) setstackmark(&smark); arglist.lastp = &arglist.list; oexitstatus = exitstatus; - exitstatus = 0; expandarg(n->ncase.expr, &arglist, EXP_TILDE); for (cp = n->ncase.cases ; cp ; cp = cp->nclist.next) { for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) { @@ -392,11 +391,14 @@ evalcase(union node *n, int flags) return (NULL); cp = cp->nclist.next; } + if (cp->nclist.body == NULL) + exitstatus = 0; return (cp->nclist.body); } } } popstackmark(&smark); + exitstatus = 0; return (NULL); } Added: head/tools/regression/bin/sh/builtins/case14.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case14.0 Sun Jan 15 20:04:05 2012 (r230154) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +case `false` in +no) exit 3 ;; +esac Added: head/tools/regression/bin/sh/builtins/case15.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case15.0 Sun Jan 15 20:04:05 2012 (r230154) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +case x in +`false`) exit 3 ;; +esac Added: head/tools/regression/bin/sh/builtins/case16.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case16.0 Sun Jan 15 20:04:05 2012 (r230154) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +f() { return 42; } +f +case x in +x) [ $? = 42 ] ;; +esac From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 20:14:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 805B51065670; Sun, 15 Jan 2012 20:14:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B2328FC19; Sun, 15 Jan 2012 20:14:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FKEqUF098294; Sun, 15 Jan 2012 20:14:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FKEqvO098293; Sun, 15 Jan 2012 20:14:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201152014.q0FKEqvO098293@svn.freebsd.org> From: Eitan Adler Date: Sun, 15 Jan 2012 20:14: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: r230155 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 20:14:52 -0000 Author: eadler (ports committer) Date: Sun Jan 15 20:14:52 2012 New Revision: 230155 URL: http://svn.freebsd.org/changeset/base/230155 Log: Make man page wording more clear: PR: docs/164078 Submitted by: Taras Approved by: bcr MFC after: 3 days Modified: head/lib/libc/sys/setuid.2 Modified: head/lib/libc/sys/setuid.2 ============================================================================== --- head/lib/libc/sys/setuid.2 Sun Jan 15 20:04:05 2012 (r230154) +++ head/lib/libc/sys/setuid.2 Sun Jan 15 20:14:52 2012 (r230155) @@ -170,7 +170,7 @@ potentially sensitive data. .Pp To prevent these files from remaining open after an .Xr exec 3 -call, be sure to set the close-on-exec flag is set: +call, be sure to set the close-on-exec flag: .Bd -literal void pseudocode(void) From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 20:37:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE39C106567A; Sun, 15 Jan 2012 20:37:39 +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 993A38FC1B; Sun, 15 Jan 2012 20:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FKbdha098999; Sun, 15 Jan 2012 20:37:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FKbddF098997; Sun, 15 Jan 2012 20:37:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152037.q0FKbddF098997@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 20:37: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: r230156 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 20:37:39 -0000 Author: avg Date: Sun Jan 15 20:37:39 2012 New Revision: 230156 URL: http://svn.freebsd.org/changeset/base/230156 Log: xlocale.h: consistently use __va_list Plain 'va_list' in this header seems to cause troubles with non-base GCC which creates and uses "tortured" versions of some sysem header files including stdio.h (installed in a private 'include-fixed' directory). Reviewed by: theraven X-MFC with: r227753 Modified: head/include/xlocale.h Modified: head/include/xlocale.h ============================================================================== --- head/include/xlocale.h Sun Jan 15 20:14:52 2012 (r230155) +++ head/include/xlocale.h Sun Jan 15 20:37:39 2012 (r230156) @@ -157,9 +157,9 @@ int vfscanf_l(FILE * __restrict, locale __scanflike(3, 0); int vscanf_l(locale_t, const char * __restrict, __va_list) __scanflike(2, 0); int vsnprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, - va_list) __printflike(4, 0); + __va_list) __printflike(4, 0); int vsscanf_l(const char * __restrict, locale_t, const char * __restrict, - va_list) __scanflike(3, 0); + __va_list) __scanflike(3, 0); int dprintf_l(int, locale_t, const char * __restrict, ...) __printflike(3, 4); int vdprintf_l(int, locale_t, const char * __restrict, __va_list) __printflike(3, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 20:43:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 573431065672; Sun, 15 Jan 2012 20:43:40 +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 430958FC1A; Sun, 15 Jan 2012 20:43:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FKhep6099203; Sun, 15 Jan 2012 20:43:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FKhehf099201; Sun, 15 Jan 2012 20:43:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152043.q0FKhehf099201@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 20:43: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: r230157 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 20:43:40 -0000 Author: avg Date: Sun Jan 15 20:43:39 2012 New Revision: 230157 URL: http://svn.freebsd.org/changeset/base/230157 Log: dadump: don't leak the periph lock on i/o error Reported by: az MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sun Jan 15 20:37:39 2012 (r230156) +++ head/sys/cam/scsi/scsi_da.c Sun Jan 15 20:43:39 2012 (r230157) @@ -1148,6 +1148,7 @@ dadump(void *arg, void *virtual, vm_offs /*sense_len*/SSD_FULL_SIZE, DA_DEFAULT_TIMEOUT * 1000); xpt_polled_action((union ccb *)&csio); + cam_periph_unlock(periph); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { printf("Aborting dump due to I/O error.\n"); @@ -1159,7 +1160,6 @@ dadump(void *arg, void *virtual, vm_offs csio.ccb_h.status, csio.scsi_status); return(EIO); } - cam_periph_unlock(periph); return(0); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 21:39:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2A8E1065672; Sun, 15 Jan 2012 21:39:38 +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 C21348FC15; Sun, 15 Jan 2012 21:39:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FLdcSA001213; Sun, 15 Jan 2012 21:39:38 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FLdcIW001208; Sun, 15 Jan 2012 21:39:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201152139.q0FLdcIW001208@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Jan 2012 21:39: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: r230161 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 21:39:39 -0000 Author: jilles Date: Sun Jan 15 21:39:38 2012 New Revision: 230161 URL: http://svn.freebsd.org/changeset/base/230161 Log: sh: Fix some bugs with exit status from case containing ;&. Also, rework evalcase() to not evaluate any tree. Instead, return the NCLISTFALLTHRU node and handle it in evaltree(). Fixed bugs: * If a ;& list with non-zero exit status is followed by an empty ;; or final list, the exit status of the case command should be equal to the exit status of the ;& list, not 0. * An empty ;& case should not reset $?. Added: head/tools/regression/bin/sh/builtins/case17.0 (contents, props changed) head/tools/regression/bin/sh/builtins/case18.0 (contents, props changed) head/tools/regression/bin/sh/builtins/case19.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jan 15 20:53:50 2012 (r230160) +++ head/bin/sh/eval.c Sun Jan 15 21:39:38 2012 (r230161) @@ -89,7 +89,7 @@ int oexitstatus; /* saved exit status * static void evalloop(union node *, int); static void evalfor(union node *, int); -static union node *evalcase(union node *, int); +static union node *evalcase(union node *); static void evalsubshell(union node *, int); static void evalredir(union node *, int); static void expredir(union node *); @@ -256,7 +256,18 @@ evaltree(union node *n, int flags) evalfor(n, flags & ~EV_EXIT); break; case NCASE: - next = evalcase(n, flags); + next = evalcase(n); + break; + case NCLIST: + next = n->nclist.body; + break; + case NCLISTFALLTHRU: + if (n->nclist.body) { + evaltree(n->nclist.body, flags & ~EV_EXIT); + if (evalskip) + goto out; + } + next = n->nclist.next; break; case NDEFUN: defun(n->narg.text, n->narg.next); @@ -366,9 +377,14 @@ evalfor(union node *n, int flags) } +/* + * Evaluate a case statement, returning the selected tree. + * + * The exit status needs care to get right. + */ static union node * -evalcase(union node *n, int flags) +evalcase(union node *n) { union node *cp; union node *patp; @@ -384,13 +400,12 @@ evalcase(union node *n, int flags) if (casematch(patp, arglist.list->text)) { popstackmark(&smark); while (cp->nclist.next && - cp->type == NCLISTFALLTHRU) { - evaltree(cp->nclist.body, - flags & ~EV_EXIT); - if (evalskip != 0) - return (NULL); + cp->type == NCLISTFALLTHRU && + cp->nclist.body == NULL) cp = cp->nclist.next; - } + if (cp->nclist.next && + cp->type == NCLISTFALLTHRU) + return (cp); if (cp->nclist.body == NULL) exitstatus = 0; return (cp->nclist.body); Added: head/tools/regression/bin/sh/builtins/case17.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case17.0 Sun Jan 15 21:39:38 2012 (r230161) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +! case x in x) false ;& y) esac Added: head/tools/regression/bin/sh/builtins/case18.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case18.0 Sun Jan 15 21:39:38 2012 (r230161) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +case x$(false) in +x) ;& +y) [ $? != 0 ] ;; +z) false ;; +esac Added: head/tools/regression/bin/sh/builtins/case19.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case19.0 Sun Jan 15 21:39:38 2012 (r230161) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +[ "`case x in +x) false ;& +y) ;& +z) echo $? ;; +esac`" != 0 ] From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 23:00:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8B5A106566B; Sun, 15 Jan 2012 23:00:33 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 933598FC13; Sun, 15 Jan 2012 23:00:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FN0XY3004753; Sun, 15 Jan 2012 23:00:33 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FN0X2d004750; Sun, 15 Jan 2012 23:00:33 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201201152300.q0FN0X2d004750@svn.freebsd.org> From: Tim Kientzle Date: Sun, 15 Jan 2012 23:00: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: r230179 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 23:00:34 -0000 Author: kientzle Date: Sun Jan 15 23:00:33 2012 New Revision: 230179 URL: http://svn.freebsd.org/changeset/base/230179 Log: BeagleBone uses an FTDI chip with an altered Product ID. Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Sun Jan 15 22:47:49 2012 (r230178) +++ head/sys/dev/usb/serial/uftdi.c Sun Jan 15 23:00:33 2012 (r230179) @@ -217,6 +217,7 @@ static STRUCT_USB_HOST_ID uftdi_devs[] = UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM), + UFTDI_DEV(FTDI, BEAGLEBONE, 8U232AM), UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Jan 15 22:47:49 2012 (r230178) +++ head/sys/dev/usb/usbdevs Sun Jan 15 23:00:33 2012 (r230179) @@ -1603,6 +1603,7 @@ product FTDI SERIAL_8U232AM 0x6001 8U232 product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial +product FTDI BEAGLEBONE 0xA6D0 BeagleBone product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 23:09:09 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0083D106566B; Sun, 15 Jan 2012 23:09:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 728818FC0A; Sun, 15 Jan 2012 23:09:08 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0FN95kh003740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Jan 2012 10:09:06 +1100 Date: Mon, 16 Jan 2012 10:09:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Adrian Chadd In-Reply-To: <201201151930.q0FJUWUt096674@svn.freebsd.org> Message-ID: <20120116100653.P1150@besplex.bde.org> References: <201201151930.q0FJUWUt096674@svn.freebsd.org> 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 Subject: Re: svn commit: r230149 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 23:09:09 -0000 On Sun, 15 Jan 2012, Adrian Chadd wrote: > Log: > Add the new option introduced in the previous commit. > > Modified: > head/sys/conf/options > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Sun Jan 15 19:29:33 2012 (r230148) > +++ head/sys/conf/options Sun Jan 15 19:30:32 2012 (r230149) > @@ -902,3 +902,4 @@ RCTL opt_global.h > AR71XX_REALMEM opt_global.h > AR71XX_ENV_UBOOT opt_global.h > AR71XX_ENV_REDBOOT opt_global.h > +AR71XX_ATH_EEPROM opt_global.h Any chance of keeping the options list sorted? Bruce From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 23:28:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80ACB106564A; Sun, 15 Jan 2012 23:28:07 +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 523E18FC0A; Sun, 15 Jan 2012 23:28:07 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id E84A246B3C; Sun, 15 Jan 2012 18:28:06 -0500 (EST) Received: from John-Baldwins-MacBook-Air.local (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 54290B90E; Sun, 15 Jan 2012 18:28:06 -0500 (EST) Message-ID: <4F136109.9050004@FreeBSD.org> Date: Sun, 15 Jan 2012 18:28:09 -0500 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Eitan Adler References: <201201150709.q0F79Iif067938@svn.freebsd.org> In-Reply-To: <201201150709.q0F79Iif067938@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sun, 15 Jan 2012 18:28:06 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 23:28:07 -0000 On 1/15/12 2:09 AM, Eitan Adler wrote: > Author: eadler (ports committer) > Date: Sun Jan 15 07:09:18 2012 > New Revision: 230125 > URL: http://svn.freebsd.org/changeset/base/230125 > > Log: > - Fix undefined behavior when device_get_name is null > - Make error message more informative The in-kernel printf(9) always prints "(null)" for %s when the pointer is NULL, so that wasn't undefined behavior. Printing out the driver name is a useful change, but the "(unknown)" bits are just noise as it isn't clear that "(unknown)" is substantially better than "(null)". -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sun Jan 15 23:34:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C731F1065673 for ; Sun, 15 Jan 2012 23:34:46 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=freebsd.org@sendgrid.me) Received: from o7.shared.sendgrid.net (o7.shared.sendgrid.net [74.63.235.40]) by mx1.freebsd.org (Postfix) with SMTP id 6D4558FC18 for ; Sun, 15 Jan 2012 23:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=d09sZu+YY0b9aypjqRtX5DlEIN8=; b=Dry3NIpA52DaeIWXRAo9/W5Kq+YD kG2qZjk9QS2POGh4Mlust5S43a089ff0M2AUzGuDSFquzvBiTPFMwE991iQESZwz TMTReigOis/nA+AvBOlMlUYaTwtDkIVa89fLu7Jc0LwGSij7g07lIIq7NS9W1a+V nTgu2LdrDumpWTU= Received: by 10.41.149.155 with SMTP id f04-20.11521.4F1362575 Sun, 15 Jan 2012 23:33:43 +0000 (UTC) Received: from mail.tarsnap.com (unknown [10.41.149.212]) by i04-04 (SG) with ESMTP id 4f13608a.3ac2.2a5b9e7 for ; Sun, 15 Jan 2012 23:26:02 +0000 (UTC) Received: (qmail 56324 invoked from network); 15 Jan 2012 23:33:02 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by mail.tarsnap.com with ESMTP; 15 Jan 2012 23:33:02 -0000 Received: (qmail 75936 invoked from network); 15 Jan 2012 23:32:43 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 15 Jan 2012 23:32:43 -0000 Message-ID: <4F13621B.1060203@freebsd.org> Date: Sun, 15 Jan 2012 15:32:43 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: John Baldwin References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F136109.9050004@FreeBSD.org> In-Reply-To: <4F136109.9050004@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Sendgrid-EID: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNGk/e+ljQsb4EH2uBW+cVj3VR4rJRvePKmGeFllO+nUeimhbIDAtBiMrIENycLgAIoZsmB1UZgFslewEFWJ+XGdoLtUb5OBKHX2j66sjXH2Rccb2JiCHD8J7AbJg4UaUYw= Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 23:34:46 -0000 On 01/15/12 15:28, John Baldwin wrote: > On 1/15/12 2:09 AM, Eitan Adler wrote: >> Log: >> - Fix undefined behavior when device_get_name is null >> - Make error message more informative > > The in-kernel printf(9) always prints "(null)" for %s when the pointer is NULL, > so that wasn't undefined behavior. Printing out the driver name is a useful > change, but the "(unknown)" bits are just noise as it isn't clear that > "(unknown)" is substantially better than "(null)". I think the change from "(null)" to "(unknown)" is useful, since when I see "(null)" printed my immediate thought is "looks like there's a bug I need to track down here". -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 00:26:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B602C106566C; Mon, 16 Jan 2012 00:26:49 +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 968FE8FC13; Mon, 16 Jan 2012 00:26:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G0QnpA007384; Mon, 16 Jan 2012 00:26:49 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G0QnKf007380; Mon, 16 Jan 2012 00:26:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201160026.q0G0QnKf007380@svn.freebsd.org> From: Alan Cox Date: Mon, 16 Jan 2012 00:26: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: r230180 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 00:26:49 -0000 Author: alc Date: Mon Jan 16 00:26:49 2012 New Revision: 230180 URL: http://svn.freebsd.org/changeset/base/230180 Log: When tmpfs_write() resets an extended file to its original size after an error, we want tmpfs_reg_resize() to ignore I/O errors and unconditionally update the file's size. Reviewed by: kib MFC after: 3 weeks 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 Jan 15 23:00:33 2012 (r230179) +++ head/sys/fs/tmpfs/tmpfs.h Mon Jan 16 00:26:49 2012 (r230180) @@ -436,7 +436,7 @@ struct tmpfs_dirent * tmpfs_dir_lookupby 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_reg_resize(struct vnode *, off_t, boolean_t); int tmpfs_chflags(struct vnode *, int, struct ucred *, struct thread *); int tmpfs_chmod(struct vnode *, mode_t, struct ucred *, struct thread *); int tmpfs_chown(struct vnode *, uid_t, gid_t, struct ucred *, Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 15 23:00:33 2012 (r230179) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Jan 16 00:26:49 2012 (r230180) @@ -882,7 +882,7 @@ tmpfs_dir_whiteout_remove(struct vnode * * Returns zero on success or an appropriate error code on failure. */ int -tmpfs_reg_resize(struct vnode *vp, off_t newsize) +tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr) { struct tmpfs_mount *tmp; struct tmpfs_node *node; @@ -952,8 +952,12 @@ retry: } else { vm_page_free(m); vm_page_unlock(m); - VM_OBJECT_UNLOCK(uobj); - return (EIO); + if (ignerr) + m = NULL; + else { + VM_OBJECT_UNLOCK(uobj); + return (EIO); + } } } if (m != NULL) { @@ -1351,7 +1355,7 @@ tmpfs_truncate(struct vnode *vp, off_t l if (length > VFS_TO_TMPFS(vp->v_mount)->tm_maxfilesize) return (EFBIG); - error = tmpfs_reg_resize(vp, length); + error = tmpfs_reg_resize(vp, length, FALSE); if (error == 0) { node->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; } Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Jan 15 23:00:33 2012 (r230179) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Mon Jan 16 00:26:49 2012 (r230180) @@ -747,7 +747,8 @@ tmpfs_write(struct vop_write_args *v) extended = uio->uio_offset + uio->uio_resid > node->tn_size; if (extended) { - error = tmpfs_reg_resize(vp, uio->uio_offset + uio->uio_resid); + error = tmpfs_reg_resize(vp, uio->uio_offset + uio->uio_resid, + FALSE); if (error != 0) goto out; } @@ -773,7 +774,7 @@ tmpfs_write(struct vop_write_args *v) } if (error != 0) - (void)tmpfs_reg_resize(vp, oldsize); + (void)tmpfs_reg_resize(vp, oldsize, TRUE); out: MPASS(IMPLIES(error == 0, uio->uio_resid == 0)); From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 00:26:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A29D1065672; Mon, 16 Jan 2012 00:26:53 +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 34B688FC1B; Mon, 16 Jan 2012 00:26:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G0Qr1r007420; Mon, 16 Jan 2012 00:26:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G0QrnK007418; Mon, 16 Jan 2012 00:26:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201160026.q0G0QrnK007418@svn.freebsd.org> From: Alexander Motin Date: Mon, 16 Jan 2012 00:26: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: r230181 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 00:26:53 -0000 Author: mav Date: Mon Jan 16 00:26:52 2012 New Revision: 230181 URL: http://svn.freebsd.org/changeset/base/230181 Log: Add check to avoid assertion panic on duplicate stop. Reported by: Yuri Pankov MFC after: 2 months Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Mon Jan 16 00:26:49 2012 (r230180) +++ head/sys/dev/sound/pci/hda/hdaa.c Mon Jan 16 00:26:52 2012 (r230181) @@ -1351,6 +1351,8 @@ hdaa_channel_stop(struct hdaa_chan *ch) struct hdaa_widget *w; int i; + if ((ch->flags & HDAA_CHN_RUNNING) == 0) + return; ch->flags &= ~HDAA_CHN_RUNNING; HDAC_STREAM_STOP(device_get_parent(devinfo->dev), devinfo->dev, ch->dir == PCMDIR_PLAY ? 1 : 0, ch->sid); From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 02:38:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5E7C1065670; Mon, 16 Jan 2012 02:38:45 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D06508FC08; Mon, 16 Jan 2012 02:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G2cjfT011389; Mon, 16 Jan 2012 02:38:45 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G2cjie011387; Mon, 16 Jan 2012 02:38:45 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201201160238.q0G2cjie011387@svn.freebsd.org> From: Colin Percival Date: Mon, 16 Jan 2012 02: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: r230183 - head/sys/dev/xen/xenpci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 02:38:46 -0000 Author: cperciva Date: Mon Jan 16 02:38:45 2012 New Revision: 230183 URL: http://svn.freebsd.org/changeset/base/230183 Log: Make XENHVM work on i386. The __ffs() function counts bits starting from zero, unlike ffs(3), which starts counting from 1. Modified: head/sys/dev/xen/xenpci/evtchn.c Modified: head/sys/dev/xen/xenpci/evtchn.c ============================================================================== --- head/sys/dev/xen/xenpci/evtchn.c Mon Jan 16 01:14:07 2012 (r230182) +++ head/sys/dev/xen/xenpci/evtchn.c Mon Jan 16 02:38:45 2012 (r230183) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #if defined(__i386__) -#define __ffs(word) ffs(word) +#define __ffs(word) (ffs(word) - 1) #elif defined(__amd64__) static inline unsigned long __ffs(unsigned long word) { From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 02:42:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42015106566B; Mon, 16 Jan 2012 02:42:17 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CA888FC0C; Mon, 16 Jan 2012 02:42:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G2gHGi011543; Mon, 16 Jan 2012 02:42:17 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G2gGxX011542; Mon, 16 Jan 2012 02:42:16 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201201160242.q0G2gGxX011542@svn.freebsd.org> From: Colin Percival Date: Mon, 16 Jan 2012 02:42: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: r230184 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 02:42:17 -0000 Author: cperciva Date: Mon Jan 16 02:42:16 2012 New Revision: 230184 URL: http://svn.freebsd.org/changeset/base/230184 Log: Copy XENHVM config file from amd64, now that i386+XENHVM works. Added: - copied unchanged from r230183, head/sys/amd64/conf/XENHVM Directory Properties: head/sys/i386/conf/XENHVM (props changed) Copied: head/sys/i386/conf/XENHVM (from r230183, head/sys/amd64/conf/XENHVM) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/XENHVM Mon Jan 16 02:42:16 2012 (r230184, copy of r230183, head/sys/amd64/conf/XENHVM) @@ -0,0 +1,24 @@ +# +# XENHVM -- Xen HVM kernel configuration file for FreeBSD/amd64 +# +# $FreeBSD$ +# +include GENERIC +ident XENHVM + +makeoptions MODULES_OVERRIDE="" + +# +# Adaptive locks rely on a lock-free pointer read to determine the run state +# of the thread holding a lock when under contention; under a virtualisation +# system, the thread run state may not accurately reflect whether the thread +# (or rather its host VCPU) is actually executing. As such, disable this +# optimisation. +# +options NO_ADAPTIVE_MUTEXES +options NO_ADAPTIVE_RWLOCKS +options NO_ADAPTIVE_SX + +# Xen HVM support +options XENHVM +device xenpci From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 02:42:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D3E5106564A; Mon, 16 Jan 2012 02:42:42 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DD2C8FC22; Mon, 16 Jan 2012 02:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G2gg8U011594; Mon, 16 Jan 2012 02:42:42 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G2ggHL011592; Mon, 16 Jan 2012 02:42:42 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201201160242.q0G2ggHL011592@svn.freebsd.org> From: Colin Percival Date: Mon, 16 Jan 2012 02:42: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: r230185 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 02:42:42 -0000 Author: cperciva Date: Mon Jan 16 02:42:41 2012 New Revision: 230185 URL: http://svn.freebsd.org/changeset/base/230185 Log: s/amd64/i386/ in comment. Modified: head/sys/i386/conf/XENHVM Modified: head/sys/i386/conf/XENHVM ============================================================================== --- head/sys/i386/conf/XENHVM Mon Jan 16 02:42:16 2012 (r230184) +++ head/sys/i386/conf/XENHVM Mon Jan 16 02:42:41 2012 (r230185) @@ -1,5 +1,5 @@ # -# XENHVM -- Xen HVM kernel configuration file for FreeBSD/amd64 +# XENHVM -- Xen HVM kernel configuration file for FreeBSD/i386 # # $FreeBSD$ # From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:04:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAED9106564A; Mon, 16 Jan 2012 04:04:35 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A471D8FC17; Mon, 16 Jan 2012 04:04:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G44ZeU014504; Mon, 16 Jan 2012 04:04:35 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G44Zro014502; Mon, 16 Jan 2012 04:04:35 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160404.q0G44Zro014502@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 04:04: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: r230188 - head/lib/libc/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:04:35 -0000 Author: das Date: Mon Jan 16 04:04:35 2012 New Revision: 230188 URL: http://svn.freebsd.org/changeset/base/230188 Log: Correct some bugs that resulted from arm/_fpmath.h being blindly copied from the x86 version, which has a completely different long double format. Submitted by: Maks Verver Modified: head/lib/libc/arm/_fpmath.h Modified: head/lib/libc/arm/_fpmath.h ============================================================================== --- head/lib/libc/arm/_fpmath.h Mon Jan 16 04:00:32 2012 (r230187) +++ head/lib/libc/arm/_fpmath.h Mon Jan 16 04:04:35 2012 (r230188) @@ -55,9 +55,10 @@ union IEEEl2bits { }; #define LDBL_NBIT 0 +#define LDBL_IMPLICIT_NBIT #define mask_nbit_l(u) ((void)0) -#define LDBL_MANH_SIZE 32 +#define LDBL_MANH_SIZE 20 #define LDBL_MANL_SIZE 32 #define LDBL_TO_ARRAY32(u, a) do { \ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:05:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84EC9106567B; Mon, 16 Jan 2012 04:05:54 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EDB28FC1E; Mon, 16 Jan 2012 04:05:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G45srn014583; Mon, 16 Jan 2012 04:05:54 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G45sYK014577; Mon, 16 Jan 2012 04:05:54 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160405.q0G45sYK014577@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 04:05: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: r230189 - in head/lib/libc: arm/softfloat mips/softfloat softfloat softfloat/bits32 softfloat/bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:05:54 -0000 Author: das Date: Mon Jan 16 04:05:53 2012 New Revision: 230189 URL: http://svn.freebsd.org/changeset/base/230189 Log: Convert softfloat to use the standard exception flag and rounding macros in fenv.h instead of the non-standard and incomplete ones in ieeefp.h. Thanks to Ian Lepore for testing this patch. Modified: head/lib/libc/arm/softfloat/softfloat.h head/lib/libc/mips/softfloat/softfloat.h head/lib/libc/softfloat/bits32/softfloat.c head/lib/libc/softfloat/bits64/softfloat.c head/lib/libc/softfloat/softfloat-specialize Modified: head/lib/libc/arm/softfloat/softfloat.h ============================================================================== --- head/lib/libc/arm/softfloat/softfloat.h Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/arm/softfloat/softfloat.h Mon Jan 16 04:05:53 2012 (r230189) @@ -45,7 +45,7 @@ the `FLOAT128' macro and the quadruple-p /* #define FLOATX80 */ /* #define FLOAT128 */ -#include +#include /* ------------------------------------------------------------------------------- @@ -84,12 +84,12 @@ enum { Software IEC/IEEE floating-point rounding mode. ------------------------------------------------------------------------------- */ -extern fp_rnd_t float_rounding_mode; +extern int float_rounding_mode; enum { - float_round_nearest_even = FP_RN, - float_round_to_zero = FP_RZ, - float_round_down = FP_RM, - float_round_up = FP_RP + float_round_nearest_even = FE_TONEAREST, + float_round_to_zero = FE_TOWARDZERO, + float_round_down = FE_DOWNWARD, + float_round_up = FE_UPWARD }; /* @@ -97,14 +97,14 @@ enum { Software IEC/IEEE floating-point exception flags. ------------------------------------------------------------------------------- */ -extern fp_except float_exception_flags; -extern fp_except float_exception_mask; +extern int float_exception_flags; +extern int float_exception_mask; enum { - float_flag_inexact = FP_X_IMP, - float_flag_underflow = FP_X_UFL, - float_flag_overflow = FP_X_OFL, - float_flag_divbyzero = FP_X_DZ, - float_flag_invalid = FP_X_INV + float_flag_inexact = FE_INEXACT, + float_flag_underflow = FE_UNDERFLOW, + float_flag_overflow = FE_OVERFLOW, + float_flag_divbyzero = FE_DIVBYZERO, + float_flag_invalid = FE_INVALID }; /* @@ -113,7 +113,7 @@ Routine to raise any or all of the softw exception flags. ------------------------------------------------------------------------------- */ -void float_raise( fp_except ); +void float_raise( int ); /* ------------------------------------------------------------------------------- Modified: head/lib/libc/mips/softfloat/softfloat.h ============================================================================== --- head/lib/libc/mips/softfloat/softfloat.h Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/mips/softfloat/softfloat.h Mon Jan 16 04:05:53 2012 (r230189) @@ -45,7 +45,7 @@ the `FLOAT128' macro and the quadruple-p /* #define FLOATX80 */ /* #define FLOAT128 */ -#include +#include /* ------------------------------------------------------------------------------- @@ -84,12 +84,12 @@ enum { Software IEC/IEEE floating-point rounding mode. ------------------------------------------------------------------------------- */ -extern fp_rnd_t float_rounding_mode; +extern int float_rounding_mode; enum { - float_round_nearest_even = FP_RN, - float_round_to_zero = FP_RZ, - float_round_down = FP_RM, - float_round_up = FP_RP + float_round_nearest_even = FE_TONEAREST, + float_round_to_zero = FE_TOWARDZERO, + float_round_down = FE_DOWNWARD, + float_round_up = FE_UPWARD }; /* @@ -97,14 +97,14 @@ enum { Software IEC/IEEE floating-point exception flags. ------------------------------------------------------------------------------- */ -extern fp_except float_exception_flags; -extern fp_except float_exception_mask; +extern int float_exception_flags; +extern int float_exception_mask; enum { - float_flag_inexact = FP_X_IMP, - float_flag_underflow = FP_X_UFL, - float_flag_overflow = FP_X_OFL, - float_flag_divbyzero = FP_X_DZ, - float_flag_invalid = FP_X_INV + float_flag_inexact = FE_INEXACT, + float_flag_underflow = FE_UNDERFLOW, + float_flag_overflow = FE_OVERFLOW, + float_flag_divbyzero = FE_DIVBYZERO, + float_flag_invalid = FE_INVALID }; /* @@ -113,7 +113,7 @@ Routine to raise any or all of the softw exception flags. ------------------------------------------------------------------------------- */ -void float_raise( fp_except ); +void float_raise( int ); /* ------------------------------------------------------------------------------- Modified: head/lib/libc/softfloat/bits32/softfloat.c ============================================================================== --- head/lib/libc/softfloat/bits32/softfloat.c Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/softfloat/bits32/softfloat.c Mon Jan 16 04:05:53 2012 (r230189) @@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$"); Floating-point rounding mode and exception flags. ------------------------------------------------------------------------------- */ -fp_rnd_t float_rounding_mode = float_round_nearest_even; -fp_except float_exception_flags = 0; +int float_rounding_mode = float_round_nearest_even; +int float_exception_flags = 0; /* ------------------------------------------------------------------------------- Modified: head/lib/libc/softfloat/bits64/softfloat.c ============================================================================== --- head/lib/libc/softfloat/bits64/softfloat.c Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/softfloat/bits64/softfloat.c Mon Jan 16 04:05:53 2012 (r230189) @@ -71,8 +71,8 @@ Floating-point rounding mode, extended d and exception flags. ------------------------------------------------------------------------------- */ -fp_rnd_t float_rounding_mode = float_round_nearest_even; -fp_except float_exception_flags = 0; +int float_rounding_mode = float_round_nearest_even; +int float_exception_flags = 0; #ifdef FLOATX80 int8 floatx80_rounding_precision = 80; #endif Modified: head/lib/libc/softfloat/softfloat-specialize ============================================================================== --- head/lib/libc/softfloat/softfloat-specialize Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/softfloat/softfloat-specialize Mon Jan 16 04:05:53 2012 (r230189) @@ -58,8 +58,8 @@ substitute a result value. If traps are should be simply `float_exception_flags |= flags;'. ------------------------------------------------------------------------------- */ -fp_except float_exception_mask = 0; -void float_raise( fp_except flags ) +int float_exception_mask = 0; +void float_raise( int flags ) { float_exception_flags |= flags; From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:06:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D80106564A; Mon, 16 Jan 2012 04:06:57 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50C0F8FC14; Mon, 16 Jan 2012 04:06:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G46vgX014650; Mon, 16 Jan 2012 04:06:57 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G46vK8014647; Mon, 16 Jan 2012 04:06:57 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160406.q0G46vK8014647@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 04:06: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: r230190 - head/lib/libc/softfloat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:06:57 -0000 Author: das Date: Mon Jan 16 04:06:56 2012 New Revision: 230190 URL: http://svn.freebsd.org/changeset/base/230190 Log: Remove functions from softfloat's Symbol.map that don't need to be exported. Also use the proper number of underscores for internal names. (Changing the names should be fine, since apparently the symbols are currently unused.) Modified: head/lib/libc/softfloat/Symbol.map head/lib/libc/softfloat/softfloat-for-gcc.h Modified: head/lib/libc/softfloat/Symbol.map ============================================================================== --- head/lib/libc/softfloat/Symbol.map Mon Jan 16 04:05:53 2012 (r230189) +++ head/lib/libc/softfloat/Symbol.map Mon Jan 16 04:06:56 2012 (r230190) @@ -18,16 +18,10 @@ FBSD_1.0 { }; FBSDprivate_1.0 { - _softfloat_float_exception_flags; - _softfloat_float_exception_mask; - _softfloat_float_rounding_mode; - _softfloat_float_raise; - _softfloat_float32_eq; - _softfloat_float32_le; - _softfloat_float32_lt; - _softfloat_float64_eq; - _softfloat_float64_le; - _softfloat_float64_lt; + __softfloat_float_exception_flags; + __softfloat_float_exception_mask; + __softfloat_float_rounding_mode; + __softfloat_float_raise; __eqdf2; __eqsf2; __gedf2; Modified: head/lib/libc/softfloat/softfloat-for-gcc.h ============================================================================== --- head/lib/libc/softfloat/softfloat-for-gcc.h Mon Jan 16 04:05:53 2012 (r230189) +++ head/lib/libc/softfloat/softfloat-for-gcc.h Mon Jan 16 04:06:56 2012 (r230190) @@ -5,17 +5,17 @@ * Move private identifiers with external linkage into implementation * namespace. -- Klaus Klein , May 5, 1999 */ -#define float_exception_flags _softfloat_float_exception_flags -#define float_exception_mask _softfloat_float_exception_mask -#define float_rounding_mode _softfloat_float_rounding_mode -#define float_raise _softfloat_float_raise +#define float_exception_flags __softfloat_float_exception_flags +#define float_exception_mask __softfloat_float_exception_mask +#define float_rounding_mode __softfloat_float_rounding_mode +#define float_raise __softfloat_float_raise /* The following batch are called by GCC through wrappers */ -#define float32_eq _softfloat_float32_eq -#define float32_le _softfloat_float32_le -#define float32_lt _softfloat_float32_lt -#define float64_eq _softfloat_float64_eq -#define float64_le _softfloat_float64_le -#define float64_lt _softfloat_float64_lt +#define float32_eq __softfloat_float32_eq +#define float32_le __softfloat_float32_le +#define float32_lt __softfloat_float32_lt +#define float64_eq __softfloat_float64_eq +#define float64_le __softfloat_float64_le +#define float64_lt __softfloat_float64_lt /* * Macros to define functions with the GCC expected names From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:08:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D8FB1065670; Mon, 16 Jan 2012 04:08:30 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 578F48FC0C; Mon, 16 Jan 2012 04:08:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G48UJ6014734; Mon, 16 Jan 2012 04:08:30 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G48UrQ014730; Mon, 16 Jan 2012 04:08:30 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160408.q0G48UrQ014730@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 04:08: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: r230191 - in head: lib/libc/arm/gen sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:08:30 -0000 Author: das Date: Mon Jan 16 04:08:29 2012 New Revision: 230191 URL: http://svn.freebsd.org/changeset/base/230191 Log: Implement FLT_ROUNDS for arm. Some (all?) arm FPUs lack support for dynamic rounding modes, but FPUless chips that use softfloat can support it because everything is emulated anyway. (We presently have incomplete support for hardware FPUs.) Submitted by: Ian Lepore Added: head/lib/libc/arm/gen/flt_rounds.c (contents, props changed) Modified: head/lib/libc/arm/gen/Makefile.inc head/sys/arm/include/float.h Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Mon Jan 16 04:06:56 2012 (r230190) +++ head/lib/libc/arm/gen/Makefile.inc Mon Jan 16 04:08:29 2012 (r230191) @@ -3,4 +3,4 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ infinity.c ldexp.c makecontext.c \ - setjmp.S signalcontext.c sigsetjmp.S divsi3.S + setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c Added: head/lib/libc/arm/gen/flt_rounds.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/flt_rounds.c Mon Jan 16 04:08:29 2012 (r230191) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2012 Ian Lepore + * 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 "softfloat.h" + +int +__flt_rounds(void) +{ + +#ifndef ARM_HARD_FLOAT + /* + * Translate our rounding modes to the unnamed + * manifest constants required by C99 et. al. + */ + switch (__softfloat_float_rounding_mode) { + case FE_TOWARDZERO: + return (0); + case FE_TONEAREST: + return (1); + case FE_UPWARD: + return (2); + case FE_DOWNWARD: + return (3); + } + return (-1); +#else /* ARM_HARD_FLOAT */ + /* + * Apparently, the rounding mode is specified as part of the + * instruction format on ARM, so the dynamic rounding mode is + * indeterminate. Some FPUs may differ. + */ + return (-1); +#endif /* ARM_HARD_FLOAT */ +} Modified: head/sys/arm/include/float.h ============================================================================== --- head/sys/arm/include/float.h Mon Jan 16 04:06:56 2012 (r230190) +++ head/sys/arm/include/float.h Mon Jan 16 04:08:29 2012 (r230191) @@ -44,7 +44,11 @@ extern int __flt_rounds(void); __END_DECLS #define FLT_RADIX 2 /* b */ -#define FLT_ROUNDS -1 +#ifndef _ARM_HARD_FLOAT +#define FLT_ROUNDS __flt_rounds() +#else +#define FLT_ROUNDS (-1) +#endif #define FLT_EVAL_METHOD (-1) /* XXX */ #define DECIMAL_DIG 17 /* max precision in decimal digits */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:09:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C22051065670; Mon, 16 Jan 2012 04:09:17 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC0218FC08; Mon, 16 Jan 2012 04:09:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G49HS1014796; Mon, 16 Jan 2012 04:09:17 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G49HAL014791; Mon, 16 Jan 2012 04:09:17 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160409.q0G49HAL014791@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 04:09: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: r230192 - in head/lib/msun: . arm src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:09:17 -0000 Author: das Date: Mon Jan 16 04:09:17 2012 New Revision: 230192 URL: http://svn.freebsd.org/changeset/base/230192 Log: Add an implementation of fenv.h intended for platforms that lack an FPU and use softfloat. Thanks to Ian Lepore for testing and debugging this patch. The fenv regression tests pass (at least for Ian's arm chip) with this change. Added: head/lib/msun/src/fenv-softfloat.h (contents, props changed) Modified: head/lib/msun/Makefile head/lib/msun/arm/Makefile.inc head/lib/msun/arm/fenv.h Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Jan 16 04:08:29 2012 (r230191) +++ head/lib/msun/Makefile Mon Jan 16 04:09:17 2012 (r230192) @@ -125,7 +125,7 @@ XRINT_CFLAGS:= ${.IMPSRC:M*/s_nearbyint. SRCS= ${COMMON_SRCS} ${ARCH_SRCS} -INCS= fenv.h math.h +INCS+= fenv.h math.h MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \ ceil.3 ccos.3 ccosh.3 cexp.3 \ Modified: head/lib/msun/arm/Makefile.inc ============================================================================== --- head/lib/msun/arm/Makefile.inc Mon Jan 16 04:08:29 2012 (r230191) +++ head/lib/msun/arm/Makefile.inc Mon Jan 16 04:09:17 2012 (r230192) @@ -1,4 +1,5 @@ # $FreeBSD$ +INCS += fenv-softfloat.h LDBL_PREC = 53 SYM_MAPS += ${.CURDIR}/arm/Symbol.map Modified: head/lib/msun/arm/fenv.h ============================================================================== --- head/lib/msun/arm/fenv.h Mon Jan 16 04:08:29 2012 (r230191) +++ head/lib/msun/arm/fenv.h Mon Jan 16 04:09:17 2012 (r230192) @@ -64,13 +64,25 @@ extern const fenv_t __fe_dfl_env; #define _FPUSW_SHIFT 16 #define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT) -#ifdef ARM_HARD_FLOAT +#ifndef ARM_HARD_FLOAT +/* + * The following macros map between the softfloat emulator's flags and + * the hardware's FPSR. The hardware this file was written for doesn't + * have rounding control bits, so we stick those in the system ID byte. + */ +#define __set_env(env, flags, mask, rnd) env = ((flags) \ + | (mask)<<_FPUSW_SHIFT \ + | (rnd) << 24) +#define __env_flags(env) ((env) & FE_ALL_EXCEPT) +#define __env_mask(env) (((env) >> _FPUSW_SHIFT) \ + & FE_ALL_EXCEPT) +#define __env_round(env) (((env) >> 24) & _ROUND_MASK) +#include + +#else /* ARM_HARD_FLOAT */ + #define __rfs(__fpsr) __asm __volatile("rfs %0" : "=r" (*(__fpsr))) #define __wfs(__fpsr) __asm __volatile("wfs %0" : : "r" (__fpsr)) -#else -#define __rfs(__fpsr) -#define __wfs(__fpsr) -#endif __fenv_static inline int feclearexcept(int __excepts) @@ -218,6 +230,8 @@ fegetexcept(void) #endif /* __BSD_VISIBLE */ +#endif /* ARM_HARD_FLOAT */ + __END_DECLS #endif /* !_FENV_H_ */ Added: head/lib/msun/src/fenv-softfloat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/fenv-softfloat.h Mon Jan 16 04:09:17 2012 (r230192) @@ -0,0 +1,184 @@ +/*- + * Copyright (c) 2004-2011 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _FENV_H_ +#error "This file is meant to be included only by ." +#endif + +/* + * This file implements the functionality of on platforms that + * lack an FPU and use softfloat in libc for floating point. To use it, + * you must write an that provides the following: + * + * - a typedef for fenv_t, which may be an integer or struct type + * - a typedef for fexcept_t (XXX This file assumes fexcept_t is a + * simple integer type containing the exception mask.) + * - definitions of FE_* constants for the five exceptions and four + * rounding modes in IEEE 754, as described in fenv(3) + * - a definition, and the corresponding external symbol, for FE_DFL_ENV + * - a macro __set_env(env, flags, mask, rnd), which sets the given fenv_t + * from the exception flags, mask, and rounding mode + * - macros __env_flags(env), __env_mask(env), and __env_round(env), which + * extract fields from an fenv_t + * - a definition of __fenv_static + * + * If the architecture supports an optional FPU, it's recommended that you + * define fenv_t and fexcept_t to match the hardware ABI. Otherwise, it + * doesn't matter how you define them. + */ + +extern int __softfloat_float_exception_flags; +extern int __softfloat_float_exception_mask; +extern int __softfloat_float_rounding_mode; +void __softfloat_float_raise(int); + +__fenv_static inline int +feclearexcept(int __excepts) +{ + + __softfloat_float_exception_flags &= ~__excepts; + return (0); +} + +__fenv_static inline int +fegetexceptflag(fexcept_t *__flagp, int __excepts) +{ + + *__flagp = __softfloat_float_exception_flags & __excepts; + return (0); +} + +__fenv_static inline int +fesetexceptflag(const fexcept_t *__flagp, int __excepts) +{ + + __softfloat_float_exception_flags &= ~__excepts; + __softfloat_float_exception_flags |= *__flagp & __excepts; + return (0); +} + +__fenv_static inline int +feraiseexcept(int __excepts) +{ + + __softfloat_float_raise(__excepts); + return (0); +} + +__fenv_static inline int +fetestexcept(int __excepts) +{ + + return (__softfloat_float_exception_flags & __excepts); +} + +__fenv_static inline int +fegetround(void) +{ + + return (__softfloat_float_rounding_mode); +} + +__fenv_static inline int +fesetround(int __round) +{ + + __softfloat_float_rounding_mode = __round; + return (0); +} + +__fenv_static inline int +fegetenv(fenv_t *__envp) +{ + + __set_env(*__envp, __softfloat_float_exception_flags, + __softfloat_float_exception_mask, __softfloat_float_rounding_mode); + return (0); +} + +__fenv_static inline int +feholdexcept(fenv_t *__envp) +{ + fenv_t __env; + + fegetenv(__envp); + __softfloat_float_exception_flags = 0; + __softfloat_float_exception_mask = 0; + return (0); +} + +__fenv_static inline int +fesetenv(const fenv_t *__envp) +{ + + __softfloat_float_exception_flags = __env_flags(*__envp); + __softfloat_float_exception_mask = __env_mask(*__envp); + __softfloat_float_rounding_mode = __env_round(*__envp); + return (0); +} + +__fenv_static inline int +feupdateenv(const fenv_t *__envp) +{ + int __oflags = __softfloat_float_exception_flags; + + fesetenv(__envp); + feraiseexcept(__oflags); + return (0); +} + +#if __BSD_VISIBLE + +/* We currently provide no external definitions of the functions below. */ + +static inline int +feenableexcept(int __mask) +{ + int __omask = __softfloat_float_exception_mask; + + __softfloat_float_exception_mask |= __mask; + return (__omask); +} + +static inline int +fedisableexcept(int __mask) +{ + int __omask = __softfloat_float_exception_mask; + + __softfloat_float_exception_mask &= ~__mask; + return (__omask); +} + +static inline int +fegetexcept(void) +{ + + return (__softfloat_float_exception_mask); +} + +#endif /* __BSD_VISIBLE */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:09:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82AA01065673; Mon, 16 Jan 2012 04:09:46 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DB098FC14; Mon, 16 Jan 2012 04:09:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G49kdq014844; Mon, 16 Jan 2012 04:09:46 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G49kHt014841; Mon, 16 Jan 2012 04:09:46 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160409.q0G49kHt014841@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 04: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: r230193 - head/lib/libc/sparc64/fpu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:09:46 -0000 Author: das Date: Mon Jan 16 04:09:45 2012 New Revision: 230193 URL: http://svn.freebsd.org/changeset/base/230193 Log: Computations on NaNs are supposed to return one of the input NaNs unchanged. Fix a few places in the sparc64 floating-point emulator where this wasn't being handled properly. Submitted by: bde Modified: head/lib/libc/sparc64/fpu/fpu_emu.h head/lib/libc/sparc64/fpu/fpu_mul.c Modified: head/lib/libc/sparc64/fpu/fpu_emu.h ============================================================================== --- head/lib/libc/sparc64/fpu/fpu_emu.h Mon Jan 16 04:09:17 2012 (r230192) +++ head/lib/libc/sparc64/fpu/fpu_emu.h Mon Jan 16 04:09:45 2012 (r230193) @@ -159,7 +159,8 @@ struct fpemu { * Each of these may modify its inputs (f1,f2) and/or the temporary. * Each returns a pointer to the result and/or sets exceptions. */ -#define __fpu_sub(fe) ((fe)->fe_f2.fp_sign ^= 1, __fpu_add(fe)) +#define __fpu_sub(fe) (ISNAN(&(fe)->fe_f2) ? 0 : ((fe)->fe_f2.fp_sign ^= 1), \ + __fpu_add(fe)) #ifdef FPU_DEBUG #define FPE_INSN 0x1 Modified: head/lib/libc/sparc64/fpu/fpu_mul.c ============================================================================== --- head/lib/libc/sparc64/fpu/fpu_mul.c Mon Jan 16 04:09:17 2012 (r230192) +++ head/lib/libc/sparc64/fpu/fpu_mul.c Mon Jan 16 04:09:45 2012 (r230193) @@ -125,10 +125,8 @@ __fpu_mul(fe) * The result is x * y (XOR sign, multiply bits, add exponents). */ ORDER(x, y); - if (ISNAN(y)) { - y->fp_sign ^= x->fp_sign; + if (ISNAN(y)) return (y); - } if (ISINF(y)) { if (ISZERO(x)) return (__fpu_newnan(fe)); From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:11:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21D761065675; Mon, 16 Jan 2012 04:11:44 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id D6B268FC13; Mon, 16 Jan 2012 04:11:43 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0G4Bhil082153; Sun, 15 Jan 2012 23:11:43 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0G4BhnG082152; Sun, 15 Jan 2012 23:11:43 -0500 (EST) (envelope-from das@freebsd.org) Date: Sun, 15 Jan 2012 23:11:43 -0500 From: David Schultz To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120116041143.GA82129@zim.MIT.EDU> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201160408.q0G48UrQ014730@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201160408.q0G48UrQ014730@svn.freebsd.org> Cc: Subject: Re: svn commit: r230191 - in head: lib/libc/arm/gen sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:11:44 -0000 On Mon, Jan 16, 2012, David Schultz wrote: > Author: das > Date: Mon Jan 16 04:08:29 2012 > New Revision: 230191 > URL: http://svn.freebsd.org/changeset/base/230191 > > Log: > Implement FLT_ROUNDS for arm. Some (all?) arm FPUs lack support for > dynamic rounding modes, but FPUless chips that use softfloat can support it > because everything is emulated anyway. (We presently have incomplete > support for hardware FPUs.) > > Submitted by: Ian Lepore Incidentally, all of gcc's hooks into softfloat should probably be in the public symbol namespace instead of FBSDprivate. The compiler generates references to them, so we cannot claim that they are internal, unsupported interfaces. I assume that moving them will not break the ABI because FreeBSDprivate includes FBSD_X, but I haven't tested this. Any objections to moving them? Affects arm and mips. From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:12:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A52C6106566B; Mon, 16 Jan 2012 04:12:58 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 677EA8FC19; Mon, 16 Jan 2012 04:12:58 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0G4CvXd082161; Sun, 15 Jan 2012 23:12:57 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0G4CvDS082160; Sun, 15 Jan 2012 23:12:57 -0500 (EST) (envelope-from das@freebsd.org) Date: Sun, 15 Jan 2012 23:12:57 -0500 From: David Schultz To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120116041257.GB82129@zim.MIT.EDU> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201160409.q0G49HAL014791@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201160409.q0G49HAL014791@svn.freebsd.org> Cc: Subject: Re: svn commit: r230192 - in head/lib/msun: . arm src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:12:58 -0000 On Mon, Jan 16, 2012, David Schultz wrote: > Author: das > Date: Mon Jan 16 04:09:17 2012 > New Revision: 230192 > URL: http://svn.freebsd.org/changeset/base/230192 > > Log: > Add an implementation of fenv.h intended for platforms that lack an FPU and > use softfloat. > > Thanks to Ian Lepore for testing and debugging this patch. The fenv > regression tests pass (at least for Ian's arm chip) with this change. This should be ported to mips as well, if any mips developers have time to look at it. With the fenv-softfloat.h header already written, it should be trivial. From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:39:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5FA2106564A; Mon, 16 Jan 2012 04:39:10 +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 A15678FC14; Mon, 16 Jan 2012 04:39:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G4dA17015788; Mon, 16 Jan 2012 04:39:10 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G4dAiL015786; Mon, 16 Jan 2012 04:39:10 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201201160439.q0G4dAiL015786@svn.freebsd.org> From: David Xu Date: Mon, 16 Jan 2012 04:39: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: r230194 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:39:10 -0000 Author: davidxu Date: Mon Jan 16 04:39:10 2012 New Revision: 230194 URL: http://svn.freebsd.org/changeset/base/230194 Log: Eliminate branch and insert an explicit reader memory barrier to ensure that waiter bit is set before reading semaphore count. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Jan 16 04:09:45 2012 (r230193) +++ head/sys/kern/kern_umtx.c Mon Jan 16 04:39:10 2012 (r230194) @@ -2804,9 +2804,8 @@ do_sem_wait(struct thread *td, struct _u umtxq_insert(uq); umtxq_unlock(&uq->uq_key); - if (fuword32(__DEVOLATILE(uint32_t *, &sem->_has_waiters)) == 0) - casuword32(__DEVOLATILE(uint32_t *, &sem->_has_waiters), 0, 1); - + casuword32(__DEVOLATILE(uint32_t *, &sem->_has_waiters), 0, 1); + rmb(); count = fuword32(__DEVOLATILE(uint32_t *, &sem->_count)); if (count != 0) { umtxq_lock(&uq->uq_key); From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 05:07:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35030106564A; Mon, 16 Jan 2012 05:07:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3828FC12; Mon, 16 Jan 2012 05:07:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G57WHA016715; Mon, 16 Jan 2012 05:07:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G57WHL016710; Mon, 16 Jan 2012 05:07:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201160507.q0G57WHL016710@svn.freebsd.org> From: Adrian Chadd Date: Mon, 16 Jan 2012 05:07: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: r230195 - in head/sys: conf mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 05:07:33 -0000 Author: adrian Date: Mon Jan 16 05:07:32 2012 New Revision: 230195 URL: http://svn.freebsd.org/changeset/base/230195 Log: Stop overloading opt_global.h. Modified: head/sys/conf/options head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/atheros/ar71xx_pci.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jan 16 04:39:10 2012 (r230194) +++ head/sys/conf/options Mon Jan 16 05:07:32 2012 (r230195) @@ -899,7 +899,7 @@ RCTL opt_global.h # At least one of the AR71XX ubiquiti boards has a Redboot configuration # that "lies" about the amount of RAM it has. Until a cleaner method is # defined, this option will suffice in overriding what Redboot says. -AR71XX_REALMEM opt_global.h -AR71XX_ENV_UBOOT opt_global.h -AR71XX_ENV_REDBOOT opt_global.h -AR71XX_ATH_EEPROM opt_global.h +AR71XX_REALMEM opt_ar71xx.h +AR71XX_ENV_UBOOT opt_ar71xx.h +AR71XX_ENV_REDBOOT opt_ar71xx.h +AR71XX_ATH_EEPROM opt_ar71xx.h Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Mon Jan 16 04:39:10 2012 (r230194) +++ head/sys/mips/atheros/ar71xx_machdep.c Mon Jan 16 05:07:32 2012 (r230195) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_ar71xx.h" #include #include Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Mon Jan 16 04:39:10 2012 (r230194) +++ head/sys/mips/atheros/ar71xx_pci.c Mon Jan 16 05:07:32 2012 (r230195) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ar71xx.h" + #include #include From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 05:23:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDA80106566C; Mon, 16 Jan 2012 05:23:13 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCA288FC15; Mon, 16 Jan 2012 05:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G5NDFS017337; Mon, 16 Jan 2012 05:23:13 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G5ND8O017334; Mon, 16 Jan 2012 05:23:13 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160523.q0G5ND8O017334@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 05: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: r230198 - head/sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 05:23:14 -0000 Author: das Date: Mon Jan 16 05:23:13 2012 New Revision: 230198 URL: http://svn.freebsd.org/changeset/base/230198 Log: Fix the definition of FLT_EVAL_METHOD and some minor bugs. Modified: head/sys/arm/include/float.h Modified: head/sys/arm/include/float.h ============================================================================== --- head/sys/arm/include/float.h Mon Jan 16 05:22:18 2012 (r230197) +++ head/sys/arm/include/float.h Mon Jan 16 05:23:13 2012 (r230198) @@ -49,8 +49,10 @@ __END_DECLS #else #define FLT_ROUNDS (-1) #endif -#define FLT_EVAL_METHOD (-1) /* XXX */ +#if __ISO_C_VISIBLE >= 1999 +#define FLT_EVAL_METHOD 0 #define DECIMAL_DIG 17 /* max precision in decimal digits */ +#endif #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ @@ -73,12 +75,12 @@ __END_DECLS #define DBL_MAX_10_EXP 308 #define LDBL_MANT_DIG DBL_MANT_DIG -#define LDBL_EPSILON DBL_EPSILON +#define LDBL_EPSILON (long double)DBL_EPSILON #define LDBL_DIG DBL_DIG #define LDBL_MIN_EXP DBL_MIN_EXP -#define LDBL_MIN DBL_MIN +#define LDBL_MIN (long double)DBL_MIN #define LDBL_MIN_10_EXP DBL_MIN_10_EXP #define LDBL_MAX_EXP DBL_MAX_EXP -#define LDBL_MAX DBL_MAX +#define LDBL_MAX (long double)DBL_MAX #define LDBL_MAX_10_EXP DBL_MAX_10_EXP #endif /* _MACHINE_FLOAT_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 05:23:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21EA6106566B; Mon, 16 Jan 2012 05:23:28 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10FD68FC12; Mon, 16 Jan 2012 05:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G5NRkL017380; Mon, 16 Jan 2012 05:23:27 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G5NRfC017378; Mon, 16 Jan 2012 05:23:27 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160523.q0G5NRfC017378@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 05:23: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: r230199 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 05:23:28 -0000 Author: das Date: Mon Jan 16 05:23:27 2012 New Revision: 230199 URL: http://svn.freebsd.org/changeset/base/230199 Log: Remove a confused comment and fix some minor bugs. Modified: head/sys/mips/include/float.h Modified: head/sys/mips/include/float.h ============================================================================== --- head/sys/mips/include/float.h Mon Jan 16 05:23:13 2012 (r230198) +++ head/sys/mips/include/float.h Mon Jan 16 05:23:27 2012 (r230199) @@ -47,12 +47,11 @@ __END_DECLS #else #define FLT_ROUNDS -1 #endif -/* - * XXXMIPS: MIPS32 has both float and double type, so set FLT_EVAL_METHOD - * to 0. Check it for 64-bits systems. - */ + +#if __ISO_C_VISIBLE >= 1999 #define FLT_EVAL_METHOD 0 #define DECIMAL_DIG 17 +#endif #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ @@ -75,13 +74,13 @@ __END_DECLS #define DBL_MAX_10_EXP 308 #define LDBL_MANT_DIG DBL_MANT_DIG -#define LDBL_EPSILON DBL_EPSILON +#define LDBL_EPSILON (long double)DBL_EPSILON #define LDBL_DIG DBL_DIG #define LDBL_MIN_EXP DBL_MIN_EXP -#define LDBL_MIN DBL_MIN +#define LDBL_MIN (long double)DBL_MIN #define LDBL_MIN_10_EXP DBL_MIN_10_EXP #define LDBL_MAX_EXP DBL_MAX_EXP -#define LDBL_MAX DBL_MAX +#define LDBL_MAX (long double)DBL_MAX #define LDBL_MAX_10_EXP DBL_MAX_10_EXP #endif /* _MACHINE_FLOAT_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 06:00:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9ECA106564A; Mon, 16 Jan 2012 06:00:44 +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 C8D228FC12; Mon, 16 Jan 2012 06:00:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G60iFb019092; Mon, 16 Jan 2012 06:00:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G60iqs019090; Mon, 16 Jan 2012 06:00:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201201160600.q0G60iqs019090@svn.freebsd.org> From: Xin LI Date: Mon, 16 Jan 2012 06:00:44 +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: r230200 - head/sys/dev/tws X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 06:00:44 -0000 Author: delphij Date: Mon Jan 16 06:00:44 2012 New Revision: 230200 URL: http://svn.freebsd.org/changeset/base/230200 Log: Match surrounding style. Noticed by: avg Modified: head/sys/dev/tws/tws.c Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Mon Jan 16 05:23:27 2012 (r230199) +++ head/sys/dev/tws/tws.c Mon Jan 16 06:00:44 2012 (r230200) @@ -685,7 +685,7 @@ tws_init_reqs(struct tws_softc *sc, u_in { if (bus_dmamap_create(sc->data_tag, 0, &sc->reqs[i].dma_map)) { /* log a ENOMEM failure msg here */ - mtx_unlock(&sc->q_lock); + mtx_unlock(&sc->q_lock); return(FAILURE); } sc->reqs[i].cmd_pkt = &cmd_buf[i]; From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 06:15:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01D91065675; Mon, 16 Jan 2012 06:15:14 +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 AF0128FC25; Mon, 16 Jan 2012 06:15:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G6FEfk019545; Mon, 16 Jan 2012 06:15:14 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G6FE9r019542; Mon, 16 Jan 2012 06:15:14 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201201160615.q0G6FE9r019542@svn.freebsd.org> From: David Xu Date: Mon, 16 Jan 2012 06:15: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: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 06:15:14 -0000 Author: davidxu Date: Mon Jan 16 06:15:14 2012 New Revision: 230201 URL: http://svn.freebsd.org/changeset/base/230201 Log: Insert read memory barriers. Modified: head/lib/libc/gen/sem.c head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem.c ============================================================================== --- head/lib/libc/gen/sem.c Mon Jan 16 06:00:44 2012 (r230200) +++ head/lib/libc/gen/sem.c Mon Jan 16 06:15:14 2012 (r230201) @@ -434,7 +434,7 @@ _libc_sem_post_compat(sem_t *sem) return ksem_post((*sem)->semid); atomic_add_rel_int(&(*sem)->count, 1); - + rmb(); if ((*sem)->nwaiters) return _umtx_wake(&(*sem)->count); return (0); Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Mon Jan 16 06:00:44 2012 (r230200) +++ head/lib/libc/gen/sem_new.c Mon Jan 16 06:15:14 2012 (r230201) @@ -332,6 +332,7 @@ _sem_getvalue(sem_t * __restrict sem, in static __inline int usem_wake(struct _usem *sem) { + rmb(); if (!sem->_has_waiters) return (0); return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 07:39:42 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFE10106566B; Mon, 16 Jan 2012 07:39:42 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 60DAE8FC15; Mon, 16 Jan 2012 07:39:42 +0000 (UTC) Received: from lstewart1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 3C9537E8C6; Mon, 16 Jan 2012 18:39:41 +1100 (EST) Message-ID: <4F13D43C.2060207@freebsd.org> Date: Mon, 16 Jan 2012 18:39:40 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111016 Thunderbird/7.0.1 MIME-Version: 1.0 To: David Xu References: <201201160615.q0G6FE9r019542@svn.freebsd.org> In-Reply-To: <201201160615.q0G6FE9r019542@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 07:39:42 -0000 On 01/16/12 17:15, David Xu wrote: > Author: davidxu > Date: Mon Jan 16 06:15:14 2012 > New Revision: 230201 > URL: http://svn.freebsd.org/changeset/base/230201 > > Log: > Insert read memory barriers. > > Modified: > head/lib/libc/gen/sem.c > head/lib/libc/gen/sem_new.c Could you please provide a bit more information about why these are necessary and why they weren't there before (or how you figured out that there was a problem without them)? I learn a lot by reading commit mail, but only when the log message and any added code comments explain the "what" *and* the "why". Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 07:53:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDC37106564A; Mon, 16 Jan 2012 07:53:16 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 908EC8FC0C; Mon, 16 Jan 2012 07:53:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0G7rCsv076250; Mon, 16 Jan 2012 07:53:13 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F13D768.10307@gmail.com> Date: Mon, 16 Jan 2012 15:53:12 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Lawrence Stewart References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F13D43C.2060207@freebsd.org> In-Reply-To: <4F13D43C.2060207@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 07:53:17 -0000 On 2012/1/16 15:39, Lawrence Stewart wrote: > On 01/16/12 17:15, David Xu wrote: >> Author: davidxu >> Date: Mon Jan 16 06:15:14 2012 >> New Revision: 230201 >> URL: http://svn.freebsd.org/changeset/base/230201 >> >> Log: >> Insert read memory barriers. >> >> Modified: >> head/lib/libc/gen/sem.c >> head/lib/libc/gen/sem_new.c > > Could you please provide a bit more information about why these are > necessary and why they weren't there before (or how you figured out > that there was a problem without them)? I learn a lot by reading > commit mail, but only when the log message and any added code comments > explain the "what" *and* the "why". > > Cheers, > Lawrence > I know this is rather obscure and diffcult to understand, the problem is here we have two variables m, n, and two threads A, B. the A wants to set m, than looks n, while B is in reverse order, it should be in strict order, but since atomic.h does not have a full barrier atomic operation interface, I intend to add a rmb() here. though X86 may not need this, but other arches may not work in this way. Regards, David Xu From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 08:13:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E0B5106566C; Mon, 16 Jan 2012 08:13:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C66A8FC08; Mon, 16 Jan 2012 08:13:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G8DQrd023229; Mon, 16 Jan 2012 08:13:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G8DQgu023226; Mon, 16 Jan 2012 08:13:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201160813.q0G8DQgu023226@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Jan 2012 08:13: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: r230204 - head/sys/dev/usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 08:13:26 -0000 Author: hselasky Date: Mon Jan 16 08:13:25 2012 New Revision: 230204 URL: http://svn.freebsd.org/changeset/base/230204 Log: Export information about USB serial port unit and port numbers directly via the sysctl interface. Submitted by: Mykhaylo Yehorov PR: usb/164090 MFC after: 1 week Modified: head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Mon Jan 16 07:02:59 2012 (r230203) +++ head/sys/dev/usb/serial/usb_serial.c Mon Jan 16 08:13:25 2012 (r230204) @@ -292,6 +292,16 @@ ucom_detach(struct ucom_super_softc *ssc if (ssc->sc_subunits == 0) return; /* not initialized */ + if (ssc->sc_sysctl_ttyunit != NULL) { + sysctl_remove_oid(ssc->sc_sysctl_ttyunit, 1, 0); + ssc->sc_sysctl_ttyunit = NULL; + } + + if (ssc->sc_sysctl_ttyports != NULL) { + sysctl_remove_oid(ssc->sc_sysctl_ttyports, 1, 0); + ssc->sc_sysctl_ttyports = NULL; + } + usb_proc_drain(&ssc->sc_tq); for (subunit = 0; subunit < ssc->sc_subunits; subunit++) { @@ -420,19 +430,36 @@ ucom_detach_tty(struct ucom_softc *sc) void ucom_set_pnpinfo_usb(struct ucom_super_softc *ssc, device_t dev) { - char buf[64]; - uint8_t iface_index; - struct usb_attach_arg *uaa; - - snprintf(buf, sizeof(buf), "ttyname=%s%d ttyports=%d", - UCOM_TTY_PREFIX, ssc->sc_unit, ssc->sc_subunits); - - /* Store the PNP info in the first interface for the dev */ - uaa = device_get_ivars(dev); - iface_index = uaa->info.bIfaceIndex; + char buf[64]; + uint8_t iface_index; + struct usb_attach_arg *uaa; + + snprintf(buf, sizeof(buf), "ttyname=%s%d ttyports=%d", + UCOM_TTY_PREFIX, ssc->sc_unit, ssc->sc_subunits); + + /* Store the PNP info in the first interface for the device */ + uaa = device_get_ivars(dev); + iface_index = uaa->info.bIfaceIndex; - if (usbd_set_pnpinfo(uaa->device, iface_index, buf) != 0) - device_printf(dev, "Could not set PNP info\n"); + if (usbd_set_pnpinfo(uaa->device, iface_index, buf) != 0) + device_printf(dev, "Could not set PNP info\n"); + + /* + * The following information is also replicated in the pnp-info + * string which is registered above: + */ + if (ssc->sc_sysctl_ttyunit == NULL) { + ssc->sc_sysctl_ttyunit = SYSCTL_ADD_INT(NULL, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "ttyunit", CTLFLAG_RD, + NULL, ssc->sc_unit, "TTY unit number"); + } + if (ssc->sc_sysctl_ttyports == NULL) { + ssc->sc_sysctl_ttyports = SYSCTL_ADD_INT(NULL, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "ttyports", CTLFLAG_RD, + NULL, ssc->sc_subunits, "Number of ports"); + } } static void Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Mon Jan 16 07:02:59 2012 (r230203) +++ head/sys/dev/usb/serial/usb_serial.h Mon Jan 16 08:13:25 2012 (r230204) @@ -70,6 +70,7 @@ #include #include #include +#include /* Module interface related macros */ #define UCOM_MODVER 1 @@ -132,8 +133,10 @@ struct ucom_param_task { struct ucom_super_softc { struct usb_process sc_tq; - uint32_t sc_unit; - uint32_t sc_subunits; + int sc_unit; + int sc_subunits; + struct sysctl_oid *sc_sysctl_ttyunit; + struct sysctl_oid *sc_sysctl_ttyports; }; struct ucom_softc { From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 08:39:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F486106564A; Mon, 16 Jan 2012 08:39:48 +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 1E8228FC08; Mon, 16 Jan 2012 08:38:43 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0G8cbMs053259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Jan 2012 10:38:37 +0200 (EET) (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.5/8.14.5) with ESMTP id q0G8caFT005508; Mon, 16 Jan 2012 10:38:36 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0G8ca9P005507; Mon, 16 Jan 2012 10:38:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Jan 2012 10:38:36 +0200 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120116083836.GD31224@deviant.kiev.zoral.com.ua> References: <201201160408.q0G48UrQ014730@svn.freebsd.org> <20120116041143.GA82129@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eIl4nToEGsUQVZmC" Content-Disposition: inline In-Reply-To: <20120116041143.GA82129@zim.MIT.EDU> 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=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r230191 - in head: lib/libc/arm/gen sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 08:39:48 -0000 --eIl4nToEGsUQVZmC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 15, 2012 at 11:11:43PM -0500, David Schultz wrote: > On Mon, Jan 16, 2012, David Schultz wrote: > > Author: das > > Date: Mon Jan 16 04:08:29 2012 > > New Revision: 230191 > > URL: http://svn.freebsd.org/changeset/base/230191 > >=20 > > Log: > > Implement FLT_ROUNDS for arm. Some (all?) arm FPUs lack support for > > dynamic rounding modes, but FPUless chips that use softfloat can supp= ort it > > because everything is emulated anyway. (We presently have incomplete > > support for hardware FPUs.) > > =20 > > Submitted by: Ian Lepore >=20 > Incidentally, all of gcc's hooks into softfloat should probably be in > the public symbol namespace instead of FBSDprivate. The compiler generat= es > references to them, so we cannot claim that they are internal, unsupported > interfaces. I assume that moving them will not break the ABI because > FreeBSDprivate includes FBSD_X, but I haven't tested this. Any objections > to moving them? Affects arm and mips. Move will break the ABI. Namespace inheritance is ignored when searching the symbol match. On the other hand. FBSDprivate_1.0 is explicitely created to be changed, so removal of the symbols from this namespace if fine from the POV of the project policy. Another argument is that both MIPS and ARM are the second-tier architecture= s, and again, project policy allows ABI breakage. --eIl4nToEGsUQVZmC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8T4gwACgkQC3+MBN1Mb4grMgCcC1PIZHIEHXrmRmAnrkIX9Jdr Up8AniD2lSHE59io02BtZyxzSBJpIm12 =t15a -----END PGP SIGNATURE----- --eIl4nToEGsUQVZmC-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 09:53:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7E7106564A; Mon, 16 Jan 2012 09:53:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80ED48FC08; Mon, 16 Jan 2012 09:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G9rP0S026628; Mon, 16 Jan 2012 09:53:25 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G9rPp8026625; Mon, 16 Jan 2012 09:53:25 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201160953.q0G9rPp8026625@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 16 Jan 2012 09:53: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: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 09:53:25 -0000 Author: glebius Date: Mon Jan 16 09:53:24 2012 New Revision: 230207 URL: http://svn.freebsd.org/changeset/base/230207 Log: Drop support for SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFDSTADDR ioctl commands. PR: 163524 Reviewed by: net Modified: head/sys/netinet/in.c head/sys/sys/param.h Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Jan 16 08:31:32 2012 (r230206) +++ head/sys/netinet/in.c Mon Jan 16 09:53:24 2012 (r230207) @@ -73,7 +73,7 @@ static int in_lifaddr_ioctl(struct socke static void in_socktrim(struct sockaddr_in *); static int in_ifinit(struct ifnet *, struct in_ifaddr *, - struct sockaddr_in *, int, int, int); + struct sockaddr_in *, int, int); static void in_purgemaddrs(struct ifnet *); static VNET_DEFINE(int, nosameprefix); @@ -220,7 +220,6 @@ in_control(struct socket *so, u_long cmd struct in_addr dst; struct in_ifinfo *ii; struct in_aliasreq *ifra = (struct in_aliasreq *)data; - struct sockaddr_in oldaddr; int error, hostIsNew, iaIsNew, maskIsNew; int iaIsFirst; u_long ocmd = cmd; @@ -278,10 +277,8 @@ in_control(struct socket *so, u_long cmd case SIOCSIFBRDADDR: case SIOCSIFDSTADDR: case SIOCSIFNETMASK: - if (ifr->ifr_addr.sa_family != AF_INET || - ifr->ifr_addr.sa_len != sizeof(struct sockaddr_in)) - return (EINVAL); - break; + /* We no longer support that old commands. */ + return (EINVAL); case SIOCALIFADDR: if (td != NULL) { @@ -322,10 +319,6 @@ in_control(struct socket *so, u_long cmd */ switch (cmd) { case SIOCAIFADDR: - case SIOCSIFADDR: - case SIOCSIFBRDADDR: - case SIOCSIFNETMASK: - case SIOCSIFDSTADDR: if (td != NULL) { error = priv_check(td, PRIV_NET_ADDIFADDR); if (error) @@ -413,10 +406,6 @@ in_control(struct socket *so, u_long cmd error = EADDRNOTAVAIL; goto out; } - /* FALLTHROUGH */ - case SIOCSIFADDR: - case SIOCSIFNETMASK: - case SIOCSIFDSTADDR: if (ia == NULL) { ia = (struct in_ifaddr *) malloc(sizeof *ia, M_IFADDR, M_NOWAIT | @@ -452,7 +441,6 @@ in_control(struct socket *so, u_long cmd } break; - case SIOCSIFBRDADDR: case SIOCGIFADDR: case SIOCGIFNETMASK: case SIOCGIFDSTADDR: @@ -493,61 +481,6 @@ in_control(struct socket *so, u_long cmd *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_sockmask; goto out; - case SIOCSIFDSTADDR: - if ((ifp->if_flags & IFF_POINTOPOINT) == 0) { - error = EINVAL; - goto out; - } - oldaddr = ia->ia_dstaddr; - ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr; - if (ifp->if_ioctl != NULL) { - error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, - (caddr_t)ia); - if (error) { - ia->ia_dstaddr = oldaddr; - goto out; - } - } - if (ia->ia_flags & IFA_ROUTE) { - ia->ia_ifa.ifa_dstaddr = (struct sockaddr *)&oldaddr; - rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST); - ia->ia_ifa.ifa_dstaddr = - (struct sockaddr *)&ia->ia_dstaddr; - rtinit(&(ia->ia_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP); - } - goto out; - - case SIOCSIFBRDADDR: - if ((ifp->if_flags & IFF_BROADCAST) == 0) { - error = EINVAL; - goto out; - } - ia->ia_broadaddr = *(struct sockaddr_in *)&ifr->ifr_broadaddr; - goto out; - - case SIOCSIFADDR: - error = in_ifinit(ifp, ia, - (struct sockaddr_in *) &ifr->ifr_addr, 1, 0, 0); - if (error != 0 && iaIsNew) - break; - if (error == 0) { - ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); - if (iaIsFirst && - (ifp->if_flags & IFF_MULTICAST) != 0) { - error = in_joingroup(ifp, &allhosts_addr, - NULL, &ii->ii_allhosts); - } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); - } - error = 0; - goto out; - - case SIOCSIFNETMASK: - ia->ia_sockmask.sin_addr = ((struct sockaddr_in *) - &ifr->ifr_addr)->sin_addr; - ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr); - goto out; - case SIOCAIFADDR: maskIsNew = 0; hostIsNew = 1; @@ -579,8 +512,8 @@ in_control(struct socket *so, u_long cmd maskIsNew = 1; /* We lie; but the effect's the same */ } if (hostIsNew || maskIsNew) - error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0, - maskIsNew, (ocmd == cmd ? ifra->ifra_vhid : 0)); + error = in_ifinit(ifp, ia, &ifra->ifra_addr, maskIsNew, + (ocmd == cmd ? ifra->ifra_vhid : 0)); if (error != 0 && iaIsNew) break; @@ -863,14 +796,11 @@ in_ifscrub(struct ifnet *ifp, struct in_ */ static int in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, - int scrub, int masksupplied, int vhid) + int masksupplied, int vhid) { register u_long i = ntohl(sin->sin_addr.s_addr); int flags = RTF_UP, error = 0; - if (scrub) - in_scrubprefix(ia, LLE_STATIC); - IN_IFADDR_WLOCK(); if (ia->ia_addr.sin_family == AF_INET) LIST_REMOVE(ia, ia_hash); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jan 16 08:31:32 2012 (r230206) +++ head/sys/sys/param.h Mon Jan 16 09:53:24 2012 (r230207) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000004 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000005 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 10:25:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96B25106564A; Mon, 16 Jan 2012 10:25:23 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 860478FC17; Mon, 16 Jan 2012 10:25:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GAPNxI027695; Mon, 16 Jan 2012 10:25:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GAPNDq027693; Mon, 16 Jan 2012 10:25:23 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201161025.q0GAPNDq027693@svn.freebsd.org> From: Kevin Lo Date: Mon, 16 Jan 2012 10:25: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: r230208 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 10:25:23 -0000 Author: kevlo Date: Mon Jan 16 10:25:22 2012 New Revision: 230208 URL: http://svn.freebsd.org/changeset/base/230208 Log: Add nfs export support to tmpfs(5) Reviewed by: kib Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jan 16 09:53:24 2012 (r230207) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jan 16 10:25:22 2012 (r230208) @@ -150,10 +150,8 @@ tmpfs_mount(struct mount *mp) return (EINVAL); if (mp->mnt_flag & MNT_UPDATE) { - /* XXX: There is no support yet to update file system - * settings. Should be added. */ - - return EOPNOTSUPP; + if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) + return (0); } vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 10:42:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81279106566C; Mon, 16 Jan 2012 10:42:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65FC08FC15; Mon, 16 Jan 2012 10:42:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GAgiU7028312; Mon, 16 Jan 2012 10:42:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GAgitO028309; Mon, 16 Jan 2012 10:42:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201161042.q0GAgitO028309@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Jan 2012 10:42:44 +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: r230209 - head/sys/dev/usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 10:42:44 -0000 Author: hselasky Date: Mon Jan 16 10:42:43 2012 New Revision: 230209 URL: http://svn.freebsd.org/changeset/base/230209 Log: Export ttyname instead of ttyunit via the sysctl interface. Submitted by: Mykhaylo Yehorov PR: usb/164090 MFC after: 1 week Modified: head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Mon Jan 16 10:25:22 2012 (r230208) +++ head/sys/dev/usb/serial/usb_serial.c Mon Jan 16 10:42:43 2012 (r230209) @@ -248,10 +248,16 @@ ucom_attach(struct ucom_super_softc *ssc return (EINVAL); } + /* allocate a uniq unit number */ ssc->sc_unit = ucom_unit_alloc(); if (ssc->sc_unit == -1) return (ENOMEM); + /* generate TTY name string */ + snprintf(ssc->sc_ttyname, sizeof(ssc->sc_ttyname), + UCOM_TTY_PREFIX "%d", ssc->sc_unit); + + /* create USB request handling process */ error = usb_proc_create(&ssc->sc_tq, mtx, "ucom", USB_PRI_MED); if (error) { ucom_unit_free(ssc->sc_unit); @@ -292,9 +298,9 @@ ucom_detach(struct ucom_super_softc *ssc if (ssc->sc_subunits == 0) return; /* not initialized */ - if (ssc->sc_sysctl_ttyunit != NULL) { - sysctl_remove_oid(ssc->sc_sysctl_ttyunit, 1, 0); - ssc->sc_sysctl_ttyunit = NULL; + if (ssc->sc_sysctl_ttyname != NULL) { + sysctl_remove_oid(ssc->sc_sysctl_ttyname, 1, 0); + ssc->sc_sysctl_ttyname = NULL; } if (ssc->sc_sysctl_ttyports != NULL) { @@ -434,8 +440,8 @@ ucom_set_pnpinfo_usb(struct ucom_super_s uint8_t iface_index; struct usb_attach_arg *uaa; - snprintf(buf, sizeof(buf), "ttyname=%s%d ttyports=%d", - UCOM_TTY_PREFIX, ssc->sc_unit, ssc->sc_subunits); + snprintf(buf, sizeof(buf), "ttyname=" UCOM_TTY_PREFIX + "%d ttyports=%d", ssc->sc_unit, ssc->sc_subunits); /* Store the PNP info in the first interface for the device */ uaa = device_get_ivars(dev); @@ -445,14 +451,14 @@ ucom_set_pnpinfo_usb(struct ucom_super_s device_printf(dev, "Could not set PNP info\n"); /* - * The following information is also replicated in the pnp-info + * The following information is also replicated in the PNP-info * string which is registered above: */ - if (ssc->sc_sysctl_ttyunit == NULL) { - ssc->sc_sysctl_ttyunit = SYSCTL_ADD_INT(NULL, + if (ssc->sc_sysctl_ttyname == NULL) { + ssc->sc_sysctl_ttyname = SYSCTL_ADD_STRING(NULL, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "ttyunit", CTLFLAG_RD, - NULL, ssc->sc_unit, "TTY unit number"); + OID_AUTO, "ttyname", CTLFLAG_RD, ssc->sc_ttyname, 0, + "TTY device basename"); } if (ssc->sc_sysctl_ttyports == NULL) { ssc->sc_sysctl_ttyports = SYSCTL_ADD_INT(NULL, Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Mon Jan 16 10:25:22 2012 (r230208) +++ head/sys/dev/usb/serial/usb_serial.h Mon Jan 16 10:42:43 2012 (r230209) @@ -135,8 +135,9 @@ struct ucom_super_softc { struct usb_process sc_tq; int sc_unit; int sc_subunits; - struct sysctl_oid *sc_sysctl_ttyunit; + struct sysctl_oid *sc_sysctl_ttyname; struct sysctl_oid *sc_sysctl_ttyports; + char sc_ttyname[16]; }; struct ucom_softc { From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 10:58:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4036D106564A; Mon, 16 Jan 2012 10:58:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 151B98FC15; Mon, 16 Jan 2012 10:58:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GAwEgM031297; Mon, 16 Jan 2012 10:58:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GAwEsM031295; Mon, 16 Jan 2012 10:58:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201161058.q0GAwEsM031295@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 16 Jan 2012 10:58: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: r230210 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 10:58:15 -0000 Author: glebius Date: Mon Jan 16 10:58:14 2012 New Revision: 230210 URL: http://svn.freebsd.org/changeset/base/230210 Log: m_getzone() should return only cluster zones. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Jan 16 10:42:43 2012 (r230209) +++ head/sys/sys/mbuf.h Mon Jan 16 10:58:14 2012 (r230210) @@ -448,9 +448,6 @@ m_getzone(int size) uma_zone_t zone; switch (size) { - case MSIZE: - zone = zone_mbuf; - break; case MCLBYTES: zone = zone_clust; break; From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 10:59:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2EB31065675; Mon, 16 Jan 2012 10:59:44 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1A5A8FC0A; Mon, 16 Jan 2012 10:59:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GAxiBa031375; Mon, 16 Jan 2012 10:59:44 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GAxivJ031374; Mon, 16 Jan 2012 10:59:44 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201201161059.q0GAxivJ031374@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 16 Jan 2012 10:59:44 +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: r230211 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 10:59:44 -0000 Author: dumbbell Date: Mon Jan 16 10:59:44 2012 New Revision: 230211 URL: http://svn.freebsd.org/changeset/base/230211 Log: sh: Test EXIT trap with multiple statements in it Reviewed by: jilles MFC after: 2 weeks Added: head/tools/regression/bin/sh/builtins/trap9.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/trap9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap9.0 Mon Jan 16 10:59:44 2012 (r230211) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +test "$(trap 'printf trap; echo ped' EXIT; f() { :; }; f)" = trapped || exit 1 From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 11:07:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDC76106564A; Mon, 16 Jan 2012 11:07:46 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1C088FC1D; Mon, 16 Jan 2012 11:07:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GB7k4v031671; Mon, 16 Jan 2012 11:07:46 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GB7kY3031665; Mon, 16 Jan 2012 11:07:46 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201201161107.q0GB7kY3031665@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Mon, 16 Jan 2012 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: r230212 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 11:07:46 -0000 Author: dumbbell Date: Mon Jan 16 11:07:46 2012 New Revision: 230212 URL: http://svn.freebsd.org/changeset/base/230212 Log: sh: Fix execution of multiple statements in a trap when evalskip is set Before this fix, only the first statement of the trap was executed if evalskip was set. This is for example the case when: o "-e" is set for this shell o a trap is set on EXIT o a function returns 1 and causes the script to abort Reviewed by: jilles MFC after: 2 weeks Added: head/tools/regression/bin/sh/builtins/trap10.0 (contents, props changed) head/tools/regression/bin/sh/builtins/trap11.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/eval.h head/bin/sh/trap.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Mon Jan 16 10:59:44 2012 (r230211) +++ head/bin/sh/eval.c Mon Jan 16 11:07:46 2012 (r230212) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); int evalskip; /* set if we are skipping commands */ -static int skipcount; /* number of levels to skip */ +int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ static int builtin_flags; /* evalcommand flags for builtins */ Modified: head/bin/sh/eval.h ============================================================================== --- head/bin/sh/eval.h Mon Jan 16 10:59:44 2012 (r230211) +++ head/bin/sh/eval.h Mon Jan 16 11:07:46 2012 (r230212) @@ -60,6 +60,7 @@ void evalbackcmd(union node *, struct ba #define in_function() funcnest extern int funcnest; extern int evalskip; +extern int skipcount; /* reasons for skipping commands (see comment on breakcmd routine) */ #define SKIPBREAK 1 Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Mon Jan 16 10:59:44 2012 (r230211) +++ head/bin/sh/trap.c Mon Jan 16 11:07:46 2012 (r230212) @@ -412,7 +412,7 @@ void dotrap(void) { int i; - int savestatus; + int savestatus, prev_evalskip, prev_skipcount; in_dotrap++; for (;;) { @@ -427,10 +427,36 @@ dotrap(void) */ if (i == SIGCHLD) ignore_sigchld++; + + /* + * Backup current evalskip + * state and reset it before + * executing a trap, so that the + * trap is not disturbed by an + * ongoing break/continue/return + * statement. + */ + prev_evalskip = evalskip; + prev_skipcount = skipcount; + evalskip = 0; + last_trapsig = i; savestatus = exitstatus; evalstring(trap[i], 0); exitstatus = savestatus; + + /* + * If such a command was not + * already in progress, allow a + * break/continue/return in the + * trap action to have an effect + * outside of it. + */ + if (prev_evalskip != 0) { + evalskip = prev_evalskip; + skipcount = prev_skipcount; + } + if (i == SIGCHLD) ignore_sigchld--; } @@ -501,6 +527,11 @@ exitshell_savedstatus(void) } handler = &loc1; if ((p = trap[0]) != NULL && *p != '\0') { + /* + * Reset evalskip, or the trap on EXIT could be + * interrupted if the last command was a "return". + */ + evalskip = 0; trap[0] = NULL; evalstring(p, 0); } Added: head/tools/regression/bin/sh/builtins/trap10.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap10.0 Mon Jan 16 11:07:46 2012 (r230212) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# Check that the return statement will not break the EXIT trap, ie. all +# trap commands are executed before the script exits. + +test "$(trap 'printf trap; echo ped' EXIT; f() { return; }; f)" = trapped || exit 1 Added: head/tools/regression/bin/sh/builtins/trap11.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap11.0 Mon Jan 16 11:07:46 2012 (r230212) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +# Check that the return statement will not break the USR1 trap, ie. all +# trap commands are executed before the script resumes. + +result=$(${SH} -c 'trap "printf trap; echo ped" USR1; f() { return $(kill -USR1 $$); }; f') +test $? -eq 0 || exit 1 +test "$result" = trapped || exit 1 From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 11:14:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84C9E1065675; Mon, 16 Jan 2012 11:14:37 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (unknown [IPv6:2001:41d0:1:7018::1:3]) by mx1.freebsd.org (Postfix) with ESMTP id D60BA8FC0C; Mon, 16 Jan 2012 11:14:36 +0000 (UTC) Received: from [2001:1b48:10b:cafe:225:64ff:febe:589f] (helo=viking.yzserv.com) by mail.made4.biz with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RmkWJ-000OsV-DP; Mon, 16 Jan 2012 12:14:36 +0100 Message-ID: <4F14069B.30107@FreeBSD.org> Date: Mon, 16 Jan 2012 12:14:35 +0100 From: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111229 Thunderbird/9.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201161107.q0GB7kY3031665@svn.freebsd.org> In-Reply-To: <201201161107.q0GB7kY3031665@svn.freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r230212 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 11:14:37 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 16.01.2012 12:07, Jean-Sebastien Pedron wrote: > Author: dumbbell Date: Mon Jan 16 11:07:46 2012 New Revision: > 230212 URL: http://svn.freebsd.org/changeset/base/230212 > > Log: sh: Fix execution of multiple statements in a trap when > evalskip is set > > Before this fix, only the first statement of the trap was executed > if evalskip was set. This is for example the case when: o "-e" is > set for this shell o a trap is set on EXIT o a function returns 1 > and causes the script to abort > > Reviewed by: jilles MFC after: 2 weeks Forgot to specify: Sponsored by: Yakaz (http://www.yakaz.com) - -- Jean-Sébastien Pédron -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8UBpsACgkQa+xGJsFYOlNsRgCgzG9k2vIFo0Tiq2somDTiypYx fkUAoLLKTHUMI8v8LUahYN3d93/uVM9c =62Ik -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 11:54:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 644681065670; Mon, 16 Jan 2012 11:54:00 +0000 (UTC) (envelope-from to.my.trociny@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 8E6D68FC16; Mon, 16 Jan 2012 11:53:59 +0000 (UTC) Received: by eaai10 with SMTP id i10so466701eaa.13 for ; Mon, 16 Jan 2012 03:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=leUqLaXRQpqQLpQfMMokKQsR4DrvwoCIHpGJHvTITGw=; b=COpcuxrunVEyRK5gjmPBxMVYtPnW6pK3eC85bqD1Gy+8Q0U1C2KKSHyMJBa3sOnxVM 1Qxb+/PJHWMmquTf5xg68zQ/oEZAicEM2wZtC/ORg2LAgBtt9ynFbF1dORdCkrIC6Kd5 90o6YrhvfKtRbM1R6SET7bPuj0JU9mkDdRu1Q= Received: by 10.213.112.203 with SMTP id x11mr141221ebp.59.1326714838242; Mon, 16 Jan 2012 03:53:58 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id e12sm71386301eea.5.2012.01.16.03.53.55 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 03:53:56 -0800 (PST) From: Mikolaj Golub To: Kevin Lo Organization: TOA Ukraine References: <201201161025.q0GAPNDq027693@svn.freebsd.org> Sender: Mikolaj Golub Date: Mon, 16 Jan 2012 13:53:53 +0200 In-Reply-To: <201201161025.q0GAPNDq027693@svn.freebsd.org> (Kevin Lo's message of "Mon, 16 Jan 2012 10:25:23 +0000 (UTC)") Message-ID: <86mx9nsw1a.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (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: r230208 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 11:54:00 -0000 On Mon, 16 Jan 2012 10:25:23 +0000 (UTC) Kevin Lo wrote: KL> Author: kevlo KL> Date: Mon Jan 16 10:25:22 2012 KL> New Revision: 230208 KL> URL: http://svn.freebsd.org/changeset/base/230208 KL> Log: KL> Add nfs export support to tmpfs(5) KL> KL> Reviewed by: kib KL> Modified: KL> head/sys/fs/tmpfs/tmpfs_vfsops.c KL> Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c KL> ============================================================================== KL> --- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jan 16 09:53:24 2012 (r230207) KL> +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jan 16 10:25:22 2012 (r230208) KL> @@ -150,10 +150,8 @@ tmpfs_mount(struct mount *mp) KL> return (EINVAL); KL> KL> if (mp->mnt_flag & MNT_UPDATE) { KL> - /* XXX: There is no support yet to update file system KL> - * settings. Should be added. */ KL> - KL> - return EOPNOTSUPP; KL> + if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) KL> + return (0); Shouldn't we still return EOPNOTSUPP here? KL> } KL> KL> vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 12:12:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4F591065670; Mon, 16 Jan 2012 12:12:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 33A388FC18; Mon, 16 Jan 2012 12:12:33 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D1F3825D386D; Mon, 16 Jan 2012 12:12:31 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1C741BD94BC; Mon, 16 Jan 2012 12:12:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 8iWadJ6SID-g; Mon, 16 Jan 2012 12:12:30 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E6265BD94BB; Mon, 16 Jan 2012 12:12:29 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201201151943.q0FJhvFH097175@svn.freebsd.org> Date: Mon, 16 Jan 2012 12:12:28 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201151943.q0FJhvFH097175@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230152 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 12:12:33 -0000 On 15. Jan 2012, at 19:43 , Adrian Chadd wrote: > Author: adrian > Date: Sun Jan 15 19:43:56 2012 > New Revision: 230152 > URL: http://svn.freebsd.org/changeset/base/230152 >=20 > Log: > Build some more things (random, bridge/gif/gre, gpio, USB) as modules = as well > so some embedded platform builds can use these instead of a fully = monolithic > kernel. I would assume that it's this one together with r230150 that broke the = following kernel configs: AR71XX_BASE PB47 ROUTERSTATION ROUTERSTATION_MFS RSPRO RSPRO_MFS RSPRO_STANDALONE with: make: don't know how to make gpio_if.h. Stop Please fix. >=20 > Modified: > head/sys/mips/conf/AR71XX_BASE >=20 > Modified: head/sys/mips/conf/AR71XX_BASE > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/mips/conf/AR71XX_BASE Sun Jan 15 19:42:55 2012 = (r230151) > +++ head/sys/mips/conf/AR71XX_BASE Sun Jan 15 19:43:56 2012 = (r230152) > @@ -24,8 +24,9 @@ hints "AR71XX_BASE.hints" >=20 > makeoptions DEBUG=3D-g #Build kernel with gdb(1) debug = symbols >=20 > -# Also build these as modules, just to ensure the build gets tested. > -makeoptions MODULES_OVERRIDE=3D"wlan wlan_xauth wlan_acl wlan_wep = wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" > +# Build these as modules so small platform builds will have the > +# modules already built. > +makeoptions MODULES_OVERRIDE=3D"random gpio ar71xx if_gif if_gre = if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip = wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" >=20 > options DDB > options KDB --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 12:31:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C28D106566B; Mon, 16 Jan 2012 12:31:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AA4F8FC1A; Mon, 16 Jan 2012 12:31:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GCVYai034256; Mon, 16 Jan 2012 12:31:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GCVYem034254; Mon, 16 Jan 2012 12:31:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201161231.q0GCVYem034254@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 16 Jan 2012 12:31: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: r230213 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 12:31:34 -0000 Author: glebius Date: Mon Jan 16 12:31:33 2012 New Revision: 230213 URL: http://svn.freebsd.org/changeset/base/230213 Log: Remove some disabled NOTYET code. Probability of enabling it is low, if anyone wants, he/she can take it from svn. Modified: head/sys/netgraph/ng_socket.c Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Mon Jan 16 11:07:46 2012 (r230212) +++ head/sys/netgraph/ng_socket.c Mon Jan 16 12:31:33 2012 (r230213) @@ -64,9 +64,6 @@ #include #include #include -#ifdef NOTYET -#include -#endif #include @@ -124,9 +121,6 @@ static int ng_attach_cntl(struct socket static int ng_attach_common(struct socket *so, int type); static void ng_detach_common(struct ngpcb *pcbp, int type); static void ng_socket_free_priv(struct ngsock *priv); -#ifdef NOTYET -static int ng_internalize(struct mbuf *m, struct thread *p); -#endif static int ng_connect_data(struct sockaddr *nam, struct ngpcb *pcbp); static int ng_bind(struct sockaddr *nam, struct ngpcb *pcbp); @@ -209,19 +203,10 @@ ngc_send(struct socket *so, int flags, s int len, error = 0; struct ng_apply_info apply; -#ifdef NOTYET - if (control && (error = ng_internalize(control, td))) { - if (pcbp->sockdata == NULL) { - error = ENOTCONN; - goto release; - } - } -#else /* NOTYET */ if (control) { error = EINVAL; goto release; } -#endif /* NOTYET */ /* Require destination as there may be >= 1 hooks on this node. */ if (addr == NULL) { @@ -661,69 +646,6 @@ ng_socket_free_priv(struct ngsock *priv) mtx_unlock(&priv->mtx); } -#ifdef NOTYET -/* - * File descriptors can be passed into an AF_NETGRAPH socket. - * Note, that file descriptors cannot be passed OUT. - * Only character device descriptors are accepted. - * Character devices are useful to connect a graph to a device, - * which after all is the purpose of this whole system. - */ -static int -ng_internalize(struct mbuf *control, struct thread *td) -{ - const struct cmsghdr *cm = mtod(control, const struct cmsghdr *); - struct file *fp; - struct vnode *vn; - int oldfds; - int fd; - - if (cm->cmsg_type != SCM_RIGHTS || cm->cmsg_level != SOL_SOCKET || - cm->cmsg_len != control->m_len) { - TRAP_ERROR; - return (EINVAL); - } - - /* Check there is only one FD. XXX what would more than one signify? */ - oldfds = ((caddr_t)cm + cm->cmsg_len - (caddr_t)data) / sizeof (int); - if (oldfds != 1) { - TRAP_ERROR; - return (EINVAL); - } - - /* Check that the FD given is legit. and change it to a pointer to a - * struct file. */ - fd = CMSG_DATA(cm); - if ((error = fget(td, fd, 0, &fp)) != 0) - return (error); - - /* Depending on what kind of resource it is, act differently. For - * devices, we treat it as a file. For an AF_NETGRAPH socket, - * shortcut straight to the node. */ - switch (fp->f_type) { - case DTYPE_VNODE: - vn = fp->f_data; - if (vn && (vn->v_type == VCHR)) { - /* for a VCHR, actually reference the FILE */ - fhold(fp); - /* XXX then what :) */ - /* how to pass on to other modules? */ - } else { - fdrop(fp, td); - TRAP_ERROR; - return (EINVAL); - } - break; - default: - fdrop(fp, td); - TRAP_ERROR; - return (EINVAL); - } - fdrop(fp, td); - return (0); -} -#endif /* NOTYET */ - /* * Connect the data socket to a named control socket node. */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 12:33:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B06A106566B; Mon, 16 Jan 2012 12:33:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2918FC08; Mon, 16 Jan 2012 12:33:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GCXt9C034371; Mon, 16 Jan 2012 12:33:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GCXtna034369; Mon, 16 Jan 2012 12:33:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201161233.q0GCXtna034369@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 16 Jan 2012 12:33: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: r230214 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 12:33:56 -0000 Author: glebius Date: Mon Jan 16 12:33:55 2012 New Revision: 230214 URL: http://svn.freebsd.org/changeset/base/230214 Log: Add missing static. Modified: head/sys/netgraph/ng_ipfw.c Modified: head/sys/netgraph/ng_ipfw.c ============================================================================== --- head/sys/netgraph/ng_ipfw.c Mon Jan 16 12:31:33 2012 (r230213) +++ head/sys/netgraph/ng_ipfw.c Mon Jan 16 12:33:55 2012 (r230214) @@ -194,7 +194,7 @@ ng_ipfw_connect(hook_p hook) } /* Look up hook by name */ -hook_p +static hook_p ng_ipfw_findhook(node_p node, const char *name) { u_int16_t n; /* numeric representation of hook */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 13:23:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A804C1065670; Mon, 16 Jan 2012 13:23:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96D758FC18; Mon, 16 Jan 2012 13:23:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GDNKb1035955; Mon, 16 Jan 2012 13:23:20 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GDNKPN035953; Mon, 16 Jan 2012 13:23:20 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201161323.q0GDNKPN035953@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 16 Jan 2012 13:23: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: r230215 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 13:23:20 -0000 Author: glebius Date: Mon Jan 16 13:23:19 2012 New Revision: 230215 URL: http://svn.freebsd.org/changeset/base/230215 Log: Make panic strings in m_gettype(), m_getzone(), m_cljset() consistent. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Jan 16 12:33:55 2012 (r230214) +++ head/sys/sys/mbuf.h Mon Jan 16 13:23:19 2012 (r230215) @@ -436,7 +436,7 @@ m_gettype(int size) type = EXT_JUMBO16; break; default: - panic("%s: m_getjcl: invalid cluster size", __func__); + panic("%s: invalid cluster size", __func__); } return (type); @@ -463,7 +463,7 @@ m_getzone(int size) zone = zone_jumbo16; break; default: - panic("%s: m_getjcl: invalid cluster type", __func__); + panic("%s: invalid cluster size", __func__); } return (zone); @@ -663,7 +663,7 @@ m_cljset(struct mbuf *m, void *cl, int t zone = zone_jumbo16; break; default: - panic("unknown cluster type"); + panic("%s: unknown cluster type", __func__); break; } From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 13:26:48 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87CB7106564A; Mon, 16 Jan 2012 13:26:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 0A33B8FC13; Mon, 16 Jan 2012 13:26:47 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0GDQitS003972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Jan 2012 00:26:46 +1100 Date: Tue, 17 Jan 2012 00:26:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Schultz In-Reply-To: <201201160409.q0G49kHt014841@svn.freebsd.org> Message-ID: <20120116235547.P3191@besplex.bde.org> References: <201201160409.q0G49kHt014841@svn.freebsd.org> 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 Subject: Re: svn commit: r230193 - head/lib/libc/sparc64/fpu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 13:26:48 -0000 On Mon, 16 Jan 2012, David Schultz wrote: > Log: > Computations on NaNs are supposed to return one of the input NaNs unchanged. > Fix a few places in the sparc64 floating-point emulator where this wasn't > being handled properly. > > Submitted by: bde Thanks. The only remaining large bug that I noticed near this is that without -mhard-quad-float, signaling NaNs are not quieted and (IIRC) FE_INVALID is not raised. BTW, NetBSD in 2005 uses Hauser soft-float for long doubles on sparc64, and at least the MI parts of it are almost identical with the Hauser soft-float in FreeBSD. But FreeBSD uses a completely different version of soft-float for sparc64. It was apparently what NetBSD was using in 2002 when it was imported into FreeBSD. Perhaps the Hauser version is better (more correct or faster). However, the other version is much simpler and looks much nicer -- it was originally from Berkeley and has almost perfect KNF formatting (over 95% of lines are perfectly formatted accoring to knfom; that is much better than 4.4BSD-Lite2 sys/kern/*.c (88%) and FreeBSD-current sys/kern/*.c (89%, not counting kern_intr.c which is about 0% after a single C++ comment in it confuses indent(1)) and contrib/nvi/*/*.c (94%). Hauser soft-float has a Gnuish style with 4-char indents amd is 26% KNF (probably mainly for the the empty lines and some comments). Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 14:54:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 729D11065726; Mon, 16 Jan 2012 14:54:49 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 475428FC0C; Mon, 16 Jan 2012 14:54:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GEsn3N038943; Mon, 16 Jan 2012 14:54:49 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GEsn3N038941; Mon, 16 Jan 2012 14:54:49 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201161454.q0GEsn3N038941@svn.freebsd.org> From: Kevin Lo Date: Mon, 16 Jan 2012 14:54: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: r230218 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 14:54:49 -0000 Author: kevlo Date: Mon Jan 16 14:54:48 2012 New Revision: 230218 URL: http://svn.freebsd.org/changeset/base/230218 Log: Fix a style bug Spotted by: avg Modified: head/sys/kern/subr_mchain.c Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Mon Jan 16 14:40:22 2012 (r230217) +++ head/sys/kern/subr_mchain.c Mon Jan 16 14:54:48 2012 (r230218) @@ -139,7 +139,7 @@ mb_put_padbyte(struct mbchain *mbp) if ((unsigned long)dst & 1) return mb_put_mem(mbp, (caddr_t)&x, 1, MB_MSYSTEM); else - return 0; + return 0; } int From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 15:47:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A129B106564A; Mon, 16 Jan 2012 15:47:42 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FED98FC08; Mon, 16 Jan 2012 15:47:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GFlgMU040666; Mon, 16 Jan 2012 15:47:42 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GFlgII040664; Mon, 16 Jan 2012 15:47:42 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201201161547.q0GFlgII040664@svn.freebsd.org> From: Ivan Voras Date: Mon, 16 Jan 2012 15:47: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: r230221 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 15:47:42 -0000 Author: ivoras Date: Mon Jan 16 15:47:42 2012 New Revision: 230221 URL: http://svn.freebsd.org/changeset/base/230221 Log: Add a bit of verbosity to the comment. Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Mon Jan 16 15:38:45 2012 (r230220) +++ head/sys/ufs/ufs/ufs_dirhash.c Mon Jan 16 15:47:42 2012 (r230221) @@ -1248,7 +1248,12 @@ ufsdirhash_lowmem() { struct dirhash *dh, *dh_temp; int memfreed = 0; - /* XXX: this 10% may need to be adjusted */ + /* + * Will free a *minimum* of 10% of the dirhash, but possibly much + * more (depending on dirhashreclaimage). System with large dirhashes + * probably also need a much larger dirhashreclaimage. + * XXX: this percentage may need to be adjusted. + */ int memwanted = ufs_dirhashmem / 10; ufs_dirhashlowmemcount++; From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 17:14:59 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DB07106564A; Mon, 16 Jan 2012 17:14:59 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id CA9DF8FC16; Mon, 16 Jan 2012 17:14:58 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0GHEet5078930; Mon, 16 Jan 2012 11:14:40 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from [192.168.0.108] (173-20-105-200.client.mchsi.com [173.20.105.200]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0GHEVg1061666 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 16 Jan 2012 11:14:32 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0GHEVg1061666 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1326734073; bh=CqYWsaYHi+8WMonchWadG5ipTgKdqq01OsT6O1ypkwk=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=JcExvmZWKyaYPSkeu7DaVkqYlrO1x4MiTJvW7Dn0HyyBVEgmJcEoxGQ6hy+LpUJbD 8jeOscc0Ojth1hELDDyrfMi9q9rnE8YTYQo6SoagLFuq7NbQ2j1rCdA+i27MxuzTZ0 ziwB9REUrk6w95bqfZsLT/G34TtpbJliaA6dNaG0= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120115073823.O843@besplex.bde.org> Date: Mon, 16 Jan 2012 11:14:32 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <52A73054-9960-403B-B2FE-857C8801D129@palisadesystems.com> References: <201201122249.q0CMnaZe030200@svn.freebsd.org> <20120114204720.Q1458@besplex.bde.org> <20120114182758.GJ1694@garage.freebsd.pl> <20120115073823.O843@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Mon, 16 Jan 2012 11:14:33 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0GHEVg1061666 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.028, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, J_CHICKENPOX_73 0.60, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r230037 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 17:14:59 -0000 On Jan 14, 2012, at 3:02 PM, Bruce Evans wrote: > On Sat, 14 Jan 2012, Pawel Jakub Dawidek wrote: >=20 >> On Sat, Jan 14, 2012 at 09:59:27PM +1100, Bruce Evans wrote: >>> ... >>> It's good to declare mode_t, since pidfile_open() uses it and we = want >>> to remove the dependency on . However, this definition >>> doesn't follow KNF or the style of all the other typedef = declarations >>> in the file, since all the others follow KNF and thus have a space >>> instead of a tab after #define and also after typedef. >>=20 >> I think you mixed space with tab. All the others have a tab after >> #define and typedef. I fully agree this should be consistent. >=20 > Oops. >=20 >>>> -#ifdef _SYS_PARAM_H_ >>>> int pidfile_close(struct pidfh *_pfh); >>>> int pidfile_fileno(const struct pidfh *_pfh); >>>> struct pidfh * >>>> pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); >>>> int pidfile_remove(struct pidfh *_pfh); >>>> int pidfile_write(struct pidfh *_pfh); >>>> -#endif >>>=20 >>> Now these are unsorted, since a separate section to hold them is not >>> needed. It was used just to make the ifdef easier to read (we don't >>> want to split up the main list with blank lines around each ifdef, = and >>> without such blank lines the ifdefs are harder to read). >>=20 >> I'd prefer not to change that. All those functions are part of = pidfile(3) >> API and it would be better, IMHO, to keep them together here too. >=20 > The functions have a unique prefix, so they are grouped nicely when = sorted > into a long list. >=20 > While I'm here, I'll complain about the verboseness of that prefix = :-). > Other APIs in the file mostly use short prefixes: > - kinfo_. Should have been ki_ like its struct member names. pidfile = uses > a good prefix for its struct member names too. > - properties_/property_. Bad, like the rest of the API. > - uu_. A weird nondescriptive name for serial device locking = protocol. > Is it from uucp? But its weirdness makes it memorable, unlike a > generic English word like `property'. Better yet, I don't have to > quote it here. > - f. Stdio's prefix meaning `file'. To fit indentifiers in 8 = characters, > it can't even have an underscore. > - pw_. Old prefix/abbrieviation for `password'. It's more readable = than > `password' once you are used to it. > - gr_. Newer prefix for `group'. More verbose than the g in gid. > - quota_. At least the English word is short. >=20 > Just noticed some more disorder: the groups of the defines at the end > are in random (mostly historical) order (U*, HO*, F*, PW*, HN* (for > the last parameter of humanize_number()), HN* (for the second last > parameter...), HD*. >=20 > If the pidfile API had defines and if the API is kept in its own > section, its defines should be in that section. Most of the other = APIs > that have a man page are large enough to deserve the same treatment > if it is done for pidfile. Some like dehumanize^Wscientificize^W > humanize_number() are larger although they have fewer functions, since > they have lots of defines. >=20 > Bruce I've pasted the diff below that I think captures the majority of the = issues you have brought up. I have not attempted to tackle the = property.3/properties.3 issues, nor the objections to the prefixes that = I think would take considerably more effort to resolve -- I wanted to = concentrate on the issues that can be isolated to libutil. I hope the = diff was pasted OK, especially WRT characters. Guy Index: lib/libutil/property.3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libutil/property.3 (revision 230221) +++ lib/libutil/property.3 (working copy) @@ -36,7 +36,6 @@ .Sh LIBRARY .Lb libutil .Sh SYNOPSIS -.In sys/types.h .In libutil.h .Ft properties .Fn properties_read "int fd" Index: lib/libutil/libutil.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 --- lib/libutil/libutil.h (revision 230221) +++ lib/libutil/libutil.h (working copy) @@ -49,8 +49,8 @@ #endif =20 #ifndef _MODE_T_DECLARED -typedef __mode_t mode_t; -#define _MODE_T_DECLARED +typedef __mode_t mode_t; +#define _MODE_T_DECLARED #endif =20 #ifndef _PID_T_DECLARED @@ -68,8 +68,8 @@ #define _UID_T_DECLARED #endif =20 -#define PROPERTY_MAX_NAME 64 -#define PROPERTY_MAX_VALUE 512 +#define PROPERTY_MAX_NAME 64 +#define PROPERTY_MAX_VALUE 512 =20 /* for properties.c */ typedef struct _property { @@ -80,9 +80,6 @@ =20 /* Avoid pulling in all the include files for no need */ struct in_addr; -struct kinfo_file; -struct kinfo_proc; -struct kinfo_vmentry; struct pidfh; struct sockaddr; struct termios; @@ -114,6 +111,12 @@ int login_tty(int _fd); int openpty(int *_amaster, int *_aslave, char *_name, struct termios *_termp, struct winsize *_winp); +int pidfile_close(struct pidfh *_pfh); +int pidfile_fileno(const struct pidfh *_pfh); +struct pidfh * + pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); +int pidfile_remove(struct pidfh *_pfh); +int pidfile_write(struct pidfh *_pfh); void properties_free(properties _list); char *property_find(properties _list, const char *_name); properties @@ -170,13 +173,6 @@ int gr_tmp(int _mdf); #endif =20 -int pidfile_close(struct pidfh *_pfh); -int pidfile_fileno(const struct pidfh *_pfh); -struct pidfh * - pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); -int pidfile_remove(struct pidfh *_pfh); -int pidfile_write(struct pidfh *_pfh); - #ifdef _UFS_UFS_QUOTA_H_ struct fstab; struct quotafile; @@ -199,22 +195,6 @@ =20 __END_DECLS =20 -#define UU_LOCK_INUSE (1) -#define UU_LOCK_OK (0) -#define UU_LOCK_OPEN_ERR (-1) -#define UU_LOCK_READ_ERR (-2) -#define UU_LOCK_CREAT_ERR (-3) -#define UU_LOCK_WRITE_ERR (-4) -#define UU_LOCK_LINK_ERR (-5) -#define UU_LOCK_TRY_ERR (-6) -#define UU_LOCK_OWNER_ERR (-7) - -/* return values from realhostname() */ -#define HOSTNAME_FOUND (0) -#define HOSTNAME_INCORRECTNAME (1) -#define HOSTNAME_INVALIDADDR (2) -#define HOSTNAME_INVALIDNAME (3) - /* fparseln(3) */ #define FPARSELN_UNESCESC 0x01 #define FPARSELN_UNESCCONT 0x02 @@ -222,26 +202,43 @@ #define FPARSELN_UNESCREST 0x08 #define FPARSELN_UNESCALL 0x0f =20 -/* pw_scan() */ -#define PWSCAN_MASTER 0x01 -#define PWSCAN_WARN 0x02 - -/* humanize_number(3) */ -#define HN_DECIMAL 0x01 -#define HN_NOSPACE 0x02 -#define HN_B 0x04 -#define HN_DIVISOR_1000 0x08 -#define HN_IEC_PREFIXES 0x10 - -/* maxscale =3D 0x07 */ -#define HN_GETSCALE 0x10 -#define HN_AUTOSCALE 0x20 - -/* hexdump(3) */ +/* Flags for hexdump(3) */ #define HD_COLUMN_MASK 0xff #define HD_DELIM_MASK 0xff00 #define HD_OMIT_COUNT (1 << 16) #define HD_OMIT_HEX (1 << 17) #define HD_OMIT_CHARS (1 << 18) =20 +/* Flags for humanize_number(3) flags */ +#define HN_DECIMAL 0x01 +#define HN_NOSPACE 0x02 +#define HN_B 0x04 +#define HN_DIVISOR_1000 0x08 +#define HN_IEC_PREFIXES 0x10 + +/* Flags for humanize_number(3) scale */ +#define HN_GETSCALE 0x10 +#define HN_AUTOSCALE 0x20 + +/* return values from realhostname() */ +#define HOSTNAME_FOUND 0 +#define HOSTNAME_INCORRECTNAME 1 +#define HOSTNAME_INVALIDADDR 2 +#define HOSTNAME_INVALIDNAME 3 + +/* Flags for pw_scan() */ +#define PWSCAN_MASTER 0x01 +#define PWSCAN_WARN 0x02 + +/* Return values from uu_lock() */ +#define UU_LOCK_INUSE 1 +#define UU_LOCK_OK 0 +#define UU_LOCK_OPEN_ERR -1 +#define UU_LOCK_READ_ERR -2 +#define UU_LOCK_CREAT_ERR -3 +#define UU_LOCK_WRITE_ERR -4 +#define UU_LOCK_LINK_ERR -5 +#define UU_LOCK_TRY_ERR -6 +#define UU_LOCK_OWNER_ERR -7 + #endif /* !_LIBUTIL_H_ */ Index: lib/libutil/realhostname.3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libutil/realhostname.3 (revision 230221) +++ lib/libutil/realhostname.3 (working copy) @@ -33,8 +33,6 @@ .Sh LIBRARY .Lb libutil .Sh SYNOPSIS -.In sys/types.h -.In netinet/in.h .In libutil.h .Ft int .Fn realhostname "char *host" "size_t hsize" "const struct in_addr *ip" Index: lib/libutil/pidfile.3 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libutil/pidfile.3 (revision 230221) +++ lib/libutil/pidfile.3 (working copy) @@ -36,7 +36,6 @@ .Sh LIBRARY .Lb libutil .Sh SYNOPSIS -.In sys/param.h .In libutil.h .Ft "struct pidfh *" .Fn pidfile_open "const char *path" "mode_t mode" "pid_t *pidptr" -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 17:57:39 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07C10106566C; Mon, 16 Jan 2012 17:57:39 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A78CE8FC1A; Mon, 16 Jan 2012 17:57:38 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 6B6F15B7; Mon, 16 Jan 2012 18:57:36 +0100 (CET) Date: Mon, 16 Jan 2012 18:56:27 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120116175627.GA1674@garage.freebsd.pl> References: <201201122249.q0CMnaZe030200@svn.freebsd.org> <20120114204720.Q1458@besplex.bde.org> <20120114182758.GJ1694@garage.freebsd.pl> <20120115073823.O843@besplex.bde.org> <52A73054-9960-403B-B2FE-857C8801D129@palisadesystems.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <52A73054-9960-403B-B2FE-857C8801D129@palisadesystems.com> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r230037 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 17:57:39 -0000 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 16, 2012 at 11:14:32AM -0600, Guy Helmer wrote: > I've pasted the diff below that I think captures the majority of the issu= es you have brought up. I have not attempted to tackle the property.3/prope= rties.3 issues, nor the objections to the prefixes that I think would take = considerably more effort to resolve -- I wanted to concentrate on the issue= s that can be isolated to libutil. I hope the diff was pasted OK, especiall= y WRT characters. The patch looks mostly good, one nit mentioned below and also one question for Bruce. > +/* Flags for hexdump(3) */ > +/* Flags for humanize_number(3) flags */ > +/* Flags for humanize_number(3) scale */ > +/* return values from realhostname() */ > +/* Flags for pw_scan() */ > +/* Return values from uu_lock() */ All those sentences are missing period and one doesn't start with capital letter. I noticed also one more inconsistency: struct kinfo_file * kinfo_getfile(pid_t _pid, int *_cntp); struct passwd *pw_dup(const struct passwd *_pw); Sometimes * is on the same line as function type and sometimes it is in the line below. Former is definiately better. Guy, feel free to commit what you got now with those sentences fixed and I'll do one iterration. It is taking way too long and I'm sure you are bored by now:) We don't want to scare you off:) > +struct pidfh * > + pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); Bruce, is this your suggestion? This somehow looks weird too me. What I use and I think it is in general more widely used across FreeBSD is simply: struct pidfh *pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); when the type exceeds one tab, but the line fits into 80 chars or: struct pidfh *pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr, int _some_other_argument); when line exceeds 80 chars. Especially this one looks very strange: properties properties_read(int _fd); --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8UZMsACgkQForvXbEpPzTHSQCdHx1e9M+ukC+AYW8a6r/W5OGy IyYAn1JFpituzhEjBcHsLSD5z+DgCZzC =ZRKx -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 18:19:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC20E106564A; Mon, 16 Jan 2012 18:19:53 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB0798FC08; Mon, 16 Jan 2012 18:19:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GIJrWw045944; Mon, 16 Jan 2012 18:19:53 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GIJr3E045942; Mon, 16 Jan 2012 18:19:53 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201201161819.q0GIJr3E045942@svn.freebsd.org> From: David Chisnall Date: Mon, 16 Jan 2012 18:19: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: r230225 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 18:19:53 -0000 Author: theraven Date: Mon Jan 16 18:19:53 2012 New Revision: 230225 URL: http://svn.freebsd.org/changeset/base/230225 Log: Use the signal fence builtin in stdatomic.h when using the clang atomic builtins, rather than the __asm hack. Somehow I missed the existence of this builtin originally and only noticed that it was there when I went to implement it... Note: Trunk clang now has support for (most of) the C[++]11 atomics stuff. Please test! Approved by: brooks (mentor) Modified: head/include/stdatomic.h Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Mon Jan 16 17:31:26 2012 (r230224) +++ head/include/stdatomic.h Mon Jan 16 18:19:53 2012 (r230225) @@ -104,10 +104,7 @@ enum memory_order { * 7.17.4 Fences. */ -#if defined(__CLANG_ATOMICS) -#define atomic_thread_fence(order) __atomic_thread_fence(order) -#define atomic_signal_fence(order) __asm volatile ("" : : : "memory") -#elif defined(__GNUC_ATOMICS) +#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) #define atomic_thread_fence(order) __atomic_thread_fence(order) #define atomic_signal_fence(order) __atomic_signal_fence(order) #else From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 18:34:28 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C279B1065672; Mon, 16 Jan 2012 18:34:28 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 6AA0A8FC15; Mon, 16 Jan 2012 18:34:28 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0GIYRjP086440; Mon, 16 Jan 2012 13:34:27 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0GIYR8p086439; Mon, 16 Jan 2012 13:34:27 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Mon, 16 Jan 2012 13:34:27 -0500 From: David Schultz To: Kostik Belousov Message-ID: <20120116183427.GA86151@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201160408.q0G48UrQ014730@svn.freebsd.org> <20120116041143.GA82129@zim.MIT.EDU> <20120116083836.GD31224@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120116083836.GD31224@deviant.kiev.zoral.com.ua> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r230191 - in head: lib/libc/arm/gen sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 18:34:28 -0000 On Mon, Jan 16, 2012, Kostik Belousov wrote: > On Sun, Jan 15, 2012 at 11:11:43PM -0500, David Schultz wrote: > > On Mon, Jan 16, 2012, David Schultz wrote: > > > Author: das > > > Date: Mon Jan 16 04:08:29 2012 > > > New Revision: 230191 > > > URL: http://svn.freebsd.org/changeset/base/230191 > > > > > > Log: > > > Implement FLT_ROUNDS for arm. Some (all?) arm FPUs lack support for > > > dynamic rounding modes, but FPUless chips that use softfloat can support it > > > because everything is emulated anyway. (We presently have incomplete > > > support for hardware FPUs.) > > > > > > Submitted by: Ian Lepore > > > > Incidentally, all of gcc's hooks into softfloat should probably be in > > the public symbol namespace instead of FBSDprivate. The compiler generates > > references to them, so we cannot claim that they are internal, unsupported > > interfaces. I assume that moving them will not break the ABI because > > FreeBSDprivate includes FBSD_X, but I haven't tested this. Any objections > > to moving them? Affects arm and mips. > > Move will break the ABI. Namespace inheritance is ignored when searching > the symbol match. > > On the other hand. FBSDprivate_1.0 is explicitely created to be changed, > so removal of the symbols from this namespace if fine from the POV of > the project policy. > > Another argument is that both MIPS and ARM are the second-tier architectures, > and again, project policy allows ABI breakage. Right; it was more a question of whether it would cause anyone undue inconvenience. Actually, before we call them officially supported, another question is why all of the symbols related to floating-point emulation are coming from libc and not libgcc. From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 19:34:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA474106564A; Mon, 16 Jan 2012 19:34:21 +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 959AC8FC08; Mon, 16 Jan 2012 19:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GJYLGp048441; Mon, 16 Jan 2012 19:34:21 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GJYL2x048424; Mon, 16 Jan 2012 19:34:21 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201161934.q0GJYL2x048424@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 16 Jan 2012 19:34: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: r230226 - in head: sbin/mount sbin/mount_cd9660 sbin/mount_ext2fs sbin/mount_msdosfs sbin/mount_nfs sbin/mount_ntfs sbin/mount_nullfs sbin/mount_reiserfs sbin/mount_std sbin/mount_udf s... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 19:34:21 -0000 Author: jh Date: Mon Jan 16 19:34:21 2012 New Revision: 230226 URL: http://svn.freebsd.org/changeset/base/230226 Log: Change checkpath() to not exit on error. This is a prerequisite for fixing the mount(8) "failok" option. PR: 163668 Reviewed by: Garrett Cooper, delphij (previous version) Modified: head/sbin/mount/getmntopts.c head/sbin/mount/mntopts.h head/sbin/mount/mount.c head/sbin/mount/mount_fs.c head/sbin/mount_cd9660/mount_cd9660.c head/sbin/mount_ext2fs/mount_ext2fs.c head/sbin/mount_msdosfs/mount_msdosfs.c head/sbin/mount_nfs/mount_nfs.c head/sbin/mount_ntfs/mount_ntfs.c head/sbin/mount_nullfs/mount_nullfs.c head/sbin/mount_reiserfs/mount_reiserfs.c head/sbin/mount_std/mount_std.c head/sbin/mount_udf/mount_udf.c head/sbin/mount_unionfs/mount_unionfs.c head/usr.sbin/mount_portalfs/mount_portalfs.c Modified: head/sbin/mount/getmntopts.c ============================================================================== --- head/sbin/mount/getmntopts.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount/getmntopts.c Mon Jan 16 19:34:21 2012 (r230226) @@ -124,16 +124,20 @@ rmslashes(char *rrpin, char *rrpout) *rrpout = '\0'; } -void +int checkpath(const char *path, char *resolved) { struct stat sb; if (realpath(path, resolved) != NULL && stat(resolved, &sb) == 0) { - if (!S_ISDIR(sb.st_mode)) - errx(EX_USAGE, "%s: not a directory", resolved); + if (!S_ISDIR(sb.st_mode)) { + errno = ENOTDIR; + return (1); + } } else - errx(EX_USAGE, "%s: %s", resolved, strerror(errno)); + return (1); + + return (0); } void Modified: head/sbin/mount/mntopts.h ============================================================================== --- head/sbin/mount/mntopts.h Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount/mntopts.h Mon Jan 16 19:34:21 2012 (r230226) @@ -93,7 +93,7 @@ struct mntopt { void getmntopts(const char *, const struct mntopt *, int *, int *); void rmslashes(char *, char *); -void checkpath(const char *, char resolved_path[]); +int checkpath(const char *, char resolved_path[]); extern int getmnt_silent; void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, size_t len); void build_iovec_argf(struct iovec **iov, int *iovlen, const char *name, const char *fmt, ...); Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount/mount.c Mon Jan 16 19:34:21 2012 (r230226) @@ -539,7 +539,10 @@ mountfs(const char *vfstype, const char static struct cpa mnt_argv; /* resolve the mountpoint with realpath(3) */ - (void)checkpath(name, mntpath); + if (checkpath(name, mntpath) != 0) { + warn("%s", mntpath); + return (1); + } name = mntpath; if (mntopts == NULL) Modified: head/sbin/mount/mount_fs.c ============================================================================== --- head/sbin/mount/mount_fs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount/mount_fs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -118,7 +118,10 @@ mount_fs(const char *vfstype, int argc, dev = argv[0]; dir = argv[1]; - (void)checkpath(dir, mntpath); + if (checkpath(dir, mntpath) != 0) { + warn("%s", mntpath); + return (1); + } (void)rmslashes(dev, dev); build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); Modified: head/sbin/mount_cd9660/mount_cd9660.c ============================================================================== --- head/sbin/mount_cd9660/mount_cd9660.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_cd9660/mount_cd9660.c Mon Jan 16 19:34:21 2012 (r230226) @@ -149,7 +149,8 @@ main(int argc, char **argv) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); + if (checkpath(dir, mntpath) != 0) + err(1, "%s", mntpath); (void)rmslashes(dev, dev); if (ssector == -1) { Modified: head/sbin/mount_ext2fs/mount_ext2fs.c ============================================================================== --- head/sbin/mount_ext2fs/mount_ext2fs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_ext2fs/mount_ext2fs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -103,7 +103,8 @@ main(int argc, char *argv[]) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(fs_name, mntpath); + if (checkpath(fs_name, mntpath) != 0) + err(EX_USAGE, "%s", mntpath); (void)rmslashes(fspec, fspec); build_iovec(&iov, &iovlen, "fstype", fstype, strlen(fstype) + 1); Modified: head/sbin/mount_msdosfs/mount_msdosfs.c ============================================================================== --- head/sbin/mount_msdosfs/mount_msdosfs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_msdosfs/mount_msdosfs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -193,7 +193,8 @@ main(int argc, char **argv) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); + if (checkpath(dir, mntpath) != 0) + err(EX_USAGE, "%s", mntpath); (void)rmslashes(dev, dev); if (!set_gid || !set_uid || !set_mask) { Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_nfs/mount_nfs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -411,7 +411,8 @@ main(int argc, char *argv[]) exit(1); /* resolve the mountpoint with realpath(3) */ - (void)checkpath(name, mntpath); + if (checkpath(name, mntpath) != 0) + err(1, "%s", mntpath); build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); Modified: head/sbin/mount_ntfs/mount_ntfs.c ============================================================================== --- head/sbin/mount_ntfs/mount_ntfs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_ntfs/mount_ntfs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -163,7 +163,8 @@ main(int argc, char *argv[]) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); + if (checkpath(dir, mntpath) != 0) + err(EX_USAGE, "%s", mntpath); (void)rmslashes(dev, dev); args.fspec = dev; Modified: head/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- head/sbin/mount_nullfs/mount_nullfs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_nullfs/mount_nullfs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -90,8 +90,10 @@ main(int argc, char *argv[]) usage(); /* resolve target and source with realpath(3) */ - (void)checkpath(argv[0], target); - (void)checkpath(argv[1], source); + if (checkpath(argv[0], target) != 0) + err(EX_USAGE, "%s", target); + if (checkpath(argv[1], source) != 0) + err(EX_USAGE, "%s", source); if (subdir(target, source) || subdir(source, target)) errx(EX_USAGE, "%s (%s) and %s are not distinct paths", Modified: head/sbin/mount_reiserfs/mount_reiserfs.c ============================================================================== --- head/sbin/mount_reiserfs/mount_reiserfs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_reiserfs/mount_reiserfs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -78,7 +78,8 @@ main(int argc, char *argv[]) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); + if (checkpath(dir, mntpath) != 0) + err(EX_USAGE, "%s", mntpath); (void)rmslashes(dev, dev); /* Read-only support for now */ Modified: head/sbin/mount_std/mount_std.c ============================================================================== --- head/sbin/mount_std/mount_std.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_std/mount_std.c Mon Jan 16 19:34:21 2012 (r230226) @@ -112,7 +112,8 @@ main(int argc, char *argv[]) usage(); /* resolve the mountpoint with realpath(3) */ - (void)checkpath(argv[1], mntpath); + if (checkpath(argv[1], mntpath) != 0) + err(EX_USAGE, "%s", mntpath); iov[0].iov_base = "fstype"; iov[0].iov_len = sizeof("fstype"); Modified: head/sbin/mount_udf/mount_udf.c ============================================================================== --- head/sbin/mount_udf/mount_udf.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_udf/mount_udf.c Mon Jan 16 19:34:21 2012 (r230226) @@ -111,7 +111,8 @@ main(int argc, char **argv) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); + if (checkpath(dir, mntpath) != 0) + err(EX_USAGE, "%s", mntpath); (void)rmslashes(dev, dev); /* Modified: head/sbin/mount_unionfs/mount_unionfs.c ============================================================================== --- head/sbin/mount_unionfs/mount_unionfs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/sbin/mount_unionfs/mount_unionfs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -176,8 +176,10 @@ main(int argc, char *argv[]) usage(); /* resolve both target and source with realpath(3) */ - (void)checkpath(argv[0], target); - (void)checkpath(argv[1], source); + if (checkpath(argv[0], target) != 0) + err(EX_USAGE, "%s", target); + if (checkpath(argv[1], source) != 0) + err(EX_USAGE, "%s", source); if (subdir(target, source) || subdir(source, target)) errx(EX_USAGE, "%s (%s) and %s (%s) are not distinct paths", Modified: head/usr.sbin/mount_portalfs/mount_portalfs.c ============================================================================== --- head/usr.sbin/mount_portalfs/mount_portalfs.c Mon Jan 16 18:19:53 2012 (r230225) +++ head/usr.sbin/mount_portalfs/mount_portalfs.c Mon Jan 16 19:34:21 2012 (r230226) @@ -140,7 +140,8 @@ main(int argc, char *argv[]) } /* resolve the mountpoint with realpath(3) */ - (void)checkpath(argv[optind+1], mountpt); + if (checkpath(argv[optind+1], mountpt) != 0) + err(EX_USAGE, "%s", mountpt); /* * Construct the listening socket From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 20:04:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D914B106566C; Mon, 16 Jan 2012 20:04:20 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be [195.238.6.51]) by mx1.freebsd.org (Postfix) with ESMTP id DE2D48FC0A; Mon, 16 Jan 2012 20:04:19 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAHOAFE9bsU/o/2dsb2JhbABDhRGnH4ELgQaBcgEBBAEjMyMFCwsOBgQqAgI5HgaIDQIGpFGRIIh0BB4VAQEzAQUIBQQRBQEGAQEGAQUQCAcDAgcBAQIBAQgBAQEBAoJ9CxcCBwEBAgMNAQIDAQEDAgMCAwQBBAsIgh6BFgSnUw Received: from 232.79-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.79.232]) by relay.skynet.be with ESMTP; 16 Jan 2012 21:04:17 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q0GK4Hi9039130; Mon, 16 Jan 2012 21:04:17 +0100 (CET) (envelope-from tijl@coosemans.org) From: Tijl Coosemans To: Eitan Adler Date: Mon, 16 Jan 2012 21:04:07 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201201072315.q07NFM3v060477@svn.freebsd.org> In-Reply-To: <201201072315.q07NFM3v060477@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1980638.SMTQ9Qm2st"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201201162104.14841.tijl@coosemans.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229794 - head/usr.bin/hexdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 20:04:21 -0000 --nextPart1980638.SMTQ9Qm2st Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sunday 08 January 2012 00:15:22 Eitan Adler wrote: > Author: eadler (ports committer) > Date: Sat Jan 7 23:15:21 2012 > New Revision: 229794 > URL: http://svn.freebsd.org/changeset/base/229794 >=20 > Log: > - Fix how hexdump parses escape strings > From the NetBSD bug: > The way how hexdump(1) parses escape sequences has some bugs. > It shows up when an escape sequence is used as the non-last character > of a format string. > =20 > PR: bin/144722 > Submitted by: gcooper > Approved by: rpaulo > Obtained from: NetBSD > MFC after: 1 week >=20 > Modified: > head/usr.bin/hexdump/parse.c >=20 > Modified: head/usr.bin/hexdump/parse.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/usr.bin/hexdump/parse.c Sat Jan 7 22:29:46 2012 (r229793) > +++ head/usr.bin/hexdump/parse.c Sat Jan 7 23:15:21 2012 (r229794) > @@ -255,7 +255,9 @@ rewrite(FS *fs) > sokay =3D NOTOKAY; > } > =20 > - p2 =3D p1 + 1; /* Set end pointer. */ > + p2 =3D *p1 ? p1 + 1 : p1; /* Set end pointer -- make sure > + * that it's non-NUL/-NULL first > + * though. */ > cs[0] =3D *p1; /* Set conversion string. */ > cs[1] =3D '\0'; > =20 > @@ -449,13 +451,21 @@ escape(char *p1) > char *p2; > =20 > /* alphabetic escape sequences have to be done in place */ > - for (p2 =3D p1;; ++p1, ++p2) { > - if (!*p1) { > - *p2 =3D *p1; > - break; > - } > - if (*p1 =3D=3D '\\') > - switch(*++p1) { > + for (p2 =3D p1; *p1; p1++, p2++) { > + /*=20 > + * Let's take a peak at the next item and see whether or not > + * we need to escape the value... > + */ > + if (*p1 =3D=3D '\\') { > + > + p1++; > + > + switch(*p1) { > + /* A standalone `\' */ > + case '\0': > + *p2 =3D '\\'; > + *++p2 =3D '\0'; > + break; This chunk needs to be reworked. This case causes a buffer overflow because p1 points to the end of the string here and is then incremented and dereferenced by the for loop. Also, after the for loop p2 needs to be zero-terminated. Currently, the output has an extra "n" at the beginning of every line: 00000000 2f 2a 2d 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 |/*-. * Copyrig= ht| n00000010 20 28 63 29 20 31 39 39 30 2c 20 31 39 39 33 0a | (c) 1990, 19= 93.| n00000020 20 2a 09 54 68 65 20 52 65 67 65 6e 74 73 20 6f | *.The Regent= s o| > case 'a': > /* *p2 =3D '\a'; */ > *p2 =3D '\007'; > @@ -482,7 +492,12 @@ escape(char *p1) > *p2 =3D *p1; > break; > } > + > + } else > + *p2 =3D *p1; > + > } > + > } > =20 > void >=20 --nextPart1980638.SMTQ9Qm2st Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk8Ugr4ACgkQfoCS2CCgtivH5gD/f/Jjm2PTrKWFU02jKhwQrG8J gcMWv0OqgS3MMHtjZAwA/2diTyIxPgC42vnZHQVDFNcottAO8NyKcK9ZYPfmvPok =1XQk -----END PGP SIGNATURE----- --nextPart1980638.SMTQ9Qm2st-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 20:07:09 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D92D8106566C; Mon, 16 Jan 2012 20:07:09 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1188FC1C; Mon, 16 Jan 2012 20:07:09 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0GK78jd087457; Mon, 16 Jan 2012 15:07:08 -0500 (EST) (envelope-from das@FreeBSD.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0GK78nh087456; Mon, 16 Jan 2012 15:07:08 -0500 (EST) (envelope-from das@FreeBSD.org) Date: Mon, 16 Jan 2012 15:07:08 -0500 From: David Schultz To: Bruce Evans Message-ID: <20120116200708.GC87187@zim.MIT.EDU> Mail-Followup-To: Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201201160409.q0G49kHt014841@svn.freebsd.org> <20120116235547.P3191@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120116235547.P3191@besplex.bde.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230193 - head/lib/libc/sparc64/fpu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 20:07:09 -0000 On Tue, Jan 17, 2012, Bruce Evans wrote: > On Mon, 16 Jan 2012, David Schultz wrote: > > >Log: > > Computations on NaNs are supposed to return one of the input NaNs > > unchanged. > > Fix a few places in the sparc64 floating-point emulator where this wasn't > > being handled properly. > > > > Submitted by: bde > > Thanks. The only remaining large bug that I noticed near this is that > without -mhard-quad-float, signaling NaNs are not quieted and (IIRC) > FE_INVALID is not raised. > > BTW, NetBSD in 2005 uses Hauser soft-float for long doubles on sparc64, > and at least the MI parts of it are almost identical with the Hauser > soft-float in FreeBSD. But FreeBSD uses a completely different version > of soft-float for sparc64. It was apparently what NetBSD was using > in 2002 when it was imported into FreeBSD. Perhaps the Hauser version > is better (more correct or faster). However, the other version is > much simpler and looks much nicer -- it was originally from Berkeley > and has almost perfect KNF formatting (over 95% of lines are perfectly > formatted accoring to knfom; that is much better than 4.4BSD-Lite2 > sys/kern/*.c (88%) and FreeBSD-current sys/kern/*.c (89%, not counting > kern_intr.c which is about 0% after a single C++ comment in it confuses > indent(1)) and contrib/nvi/*/*.c (94%). Hauser soft-float has a Gnuish > style with 4-char indents amd is 26% KNF (probably mainly for the the > empty lines and some comments). softfloat is probably better. The style of contrib sources is what it is, and we have worse in the tree. That said, I don't have the cycles right now to fix what ain't broken. Moving all of the libc/quad/ floating-point routines to softfloat is more important, because that stuff *is* broken. From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 20:17:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28FAE1065672; Mon, 16 Jan 2012 20:17:30 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184618FC15; Mon, 16 Jan 2012 20:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GKHTmQ050064; Mon, 16 Jan 2012 20:17:29 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GKHTTh050062; Mon, 16 Jan 2012 20:17:29 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201162017.q0GKHTTh050062@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 20:17: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: r230228 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 20:17:30 -0000 Author: das Date: Mon Jan 16 20:17:29 2012 New Revision: 230228 URL: http://svn.freebsd.org/changeset/base/230228 Log: Change the definition of FLT_EVAL_METHOD from 1 to 0. A value of 1 implies that the compiler promotes floats to double precision in computations, but inspection of the output of a cross-compiler indicates that this isn't the case on powerpc. Modified: head/sys/powerpc/include/float.h Modified: head/sys/powerpc/include/float.h ============================================================================== --- head/sys/powerpc/include/float.h Mon Jan 16 19:41:24 2012 (r230227) +++ head/sys/powerpc/include/float.h Mon Jan 16 20:17:29 2012 (r230228) @@ -47,7 +47,7 @@ __END_DECLS #define FLT_RADIX 2 /* b */ #if __ISO_C_VISIBLE >= 1999 -#define FLT_EVAL_METHOD 1 /* operands promoted to double */ +#define FLT_EVAL_METHOD 0 #define DECIMAL_DIG 17 /* max precision in decimal digits */ #endif From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 20:17:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 137781065674; Mon, 16 Jan 2012 20:17:52 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 024C58FC1B; Mon, 16 Jan 2012 20:17:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GKHp3C050111; Mon, 16 Jan 2012 20:17:51 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GKHp5q050107; Mon, 16 Jan 2012 20:17:51 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201162017.q0GKHp5q050107@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 20:17: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: r230229 - in head/sys: arm/include mips/include powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 20:17:52 -0000 Author: das Date: Mon Jan 16 20:17:51 2012 New Revision: 230229 URL: http://svn.freebsd.org/changeset/base/230229 Log: Fix the value of float_t to match what is implied by FLT_EVAL_METHOD. Modified: head/sys/arm/include/_types.h head/sys/mips/include/_types.h head/sys/powerpc/include/_types.h Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Mon Jan 16 20:17:29 2012 (r230228) +++ head/sys/arm/include/_types.h Mon Jan 16 20:17:51 2012 (r230229) @@ -69,7 +69,7 @@ typedef unsigned long long __uint64_t; typedef __uint32_t __clock_t; /* clock()... */ typedef __int32_t __critical_t; typedef double __double_t; -typedef double __float_t; +typedef float __float_t; typedef __int32_t __intfptr_t; typedef __int64_t __intmax_t; typedef __int32_t __intptr_t; Modified: head/sys/mips/include/_types.h ============================================================================== --- head/sys/mips/include/_types.h Mon Jan 16 20:17:29 2012 (r230228) +++ head/sys/mips/include/_types.h Mon Jan 16 20:17:51 2012 (r230229) @@ -74,7 +74,7 @@ typedef unsigned long long __uint64_t; */ typedef __int32_t __clock_t; /* clock()... */ typedef double __double_t; -typedef double __float_t; +typedef float __float_t; #ifdef __mips_n64 typedef __int64_t __critical_t; typedef __int64_t __intfptr_t; Modified: head/sys/powerpc/include/_types.h ============================================================================== --- head/sys/powerpc/include/_types.h Mon Jan 16 20:17:29 2012 (r230228) +++ head/sys/powerpc/include/_types.h Mon Jan 16 20:17:51 2012 (r230229) @@ -73,7 +73,7 @@ typedef unsigned long long __uint64_t; */ typedef __uint32_t __clock_t; /* clock()... */ typedef double __double_t; -typedef double __float_t; +typedef float __float_t; #ifdef __LP64__ typedef __int64_t __critical_t; typedef __int64_t __intfptr_t; From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 20:18:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7581106568C; Mon, 16 Jan 2012 20:18:10 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96B3E8FC12; Mon, 16 Jan 2012 20:18:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GKIAMW050163; Mon, 16 Jan 2012 20:18:10 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GKIADK050161; Mon, 16 Jan 2012 20:18:10 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201162018.q0GKIADK050161@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 20:18: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: r230230 - head/sys/dev/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 20:18:10 -0000 Author: das Date: Mon Jan 16 20:18:10 2012 New Revision: 230230 URL: http://svn.freebsd.org/changeset/base/230230 Log: Generate a warning if the kernel's arc4random() is seeded with bogus entropy. Modified: head/sys/dev/random/harvest.c Modified: head/sys/dev/random/harvest.c ============================================================================== --- head/sys/dev/random/harvest.c Mon Jan 16 20:17:51 2012 (r230229) +++ head/sys/dev/random/harvest.c Mon Jan 16 20:18:10 2012 (r230230) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -48,6 +49,7 @@ static int read_random_phony(void *, int /* Structure holding the desired entropy sources */ struct harvest_select harvest = { 1, 1, 1, 0 }; +static int warned = 0; /* hold the address of the routine which is actually called if * the randomdev is loaded @@ -71,6 +73,7 @@ random_yarrow_deinit_harvester(void) { reap_func = NULL; read_func = read_random_phony; + warned = 0; } /* Entropy harvesting routine. This is supposed to be fast; do @@ -108,6 +111,11 @@ read_random_phony(void *buf, int count) u_long randval; int size, i; + if (!warned) { + log(LOG_WARNING, "random device not loaded; using insecure entropy\n"); + warned = 1; + } + /* srandom() is called in kern/init_main.c:proc0_post() */ /* Fill buf[] with random(9) output */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 20:42:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A263106564A; Mon, 16 Jan 2012 20:42:56 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7940B8FC12; Mon, 16 Jan 2012 20:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GKguG4051032; Mon, 16 Jan 2012 20:42:56 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GKguDA051030; Mon, 16 Jan 2012 20:42:56 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201162042.q0GKguDA051030@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 16 Jan 2012 20:42:56 +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: r230231 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 20:42:56 -0000 Author: pluknet Date: Mon Jan 16 20:42:56 2012 New Revision: 230231 URL: http://svn.freebsd.org/changeset/base/230231 Log: Be pedantic and change // comment to C-style one. Noticed by: Bruce Evans Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Mon Jan 16 20:18:10 2012 (r230230) +++ head/sys/kern/kern_intr.c Mon Jan 16 20:42:56 2012 (r230231) @@ -633,7 +633,7 @@ intr_event_add_handler(struct intr_event mtx_lock(&ie->ie_lock); it->it_event = ie; ih->ih_thread = it; - ithread_update(it); // XXX - do we really need this?!?!? + ithread_update(it); /* XXX - do we really need this?!?!? */ } else { /* Create the global per-event thread if we need one. */ while (ie->ie_thread == NULL && handler != NULL) { if (ie->ie_flags & IE_ADDING_THREAD) From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 21:19:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 851E8106564A; Mon, 16 Jan 2012 21:19:23 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0BD8FC08; Mon, 16 Jan 2012 21:19:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GLJNxj052252; Mon, 16 Jan 2012 21:19:23 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GLJNYj052250; Mon, 16 Jan 2012 21:19:23 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201162119.q0GLJNYj052250@svn.freebsd.org> From: Guy Helmer Date: Mon, 16 Jan 2012 21:19: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: r230233 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 21:19:23 -0000 Author: ghelmer Date: Mon Jan 16 21:19:23 2012 New Revision: 230233 URL: http://svn.freebsd.org/changeset/base/230233 Log: Fix more disorder in prototypes and constants. Fix header comments for each section of constants. Fix whitespace in #define lines. Fix unnecessary parenthesis in constants. Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Mon Jan 16 20:45:29 2012 (r230232) +++ head/lib/libutil/libutil.h Mon Jan 16 21:19:23 2012 (r230233) @@ -49,8 +49,8 @@ typedef __gid_t gid_t; #endif #ifndef _MODE_T_DECLARED -typedef __mode_t mode_t; -#define _MODE_T_DECLARED +typedef __mode_t mode_t; +#define _MODE_T_DECLARED #endif #ifndef _PID_T_DECLARED @@ -68,8 +68,8 @@ typedef __uid_t uid_t; #define _UID_T_DECLARED #endif -#define PROPERTY_MAX_NAME 64 -#define PROPERTY_MAX_VALUE 512 +#define PROPERTY_MAX_NAME 64 +#define PROPERTY_MAX_VALUE 512 /* for properties.c */ typedef struct _property { @@ -80,9 +80,6 @@ typedef struct _property { /* Avoid pulling in all the include files for no need */ struct in_addr; -struct kinfo_file; -struct kinfo_proc; -struct kinfo_vmentry; struct pidfh; struct sockaddr; struct termios; @@ -114,6 +111,12 @@ int kld_load(const char *_name); int login_tty(int _fd); int openpty(int *_amaster, int *_aslave, char *_name, struct termios *_termp, struct winsize *_winp); +int pidfile_close(struct pidfh *_pfh); +int pidfile_fileno(const struct pidfh *_pfh); +struct pidfh * + pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); +int pidfile_remove(struct pidfh *_pfh); +int pidfile_write(struct pidfh *_pfh); void properties_free(properties _list); char *property_find(properties _list, const char *_name); properties @@ -170,13 +173,6 @@ struct group int gr_tmp(int _mdf); #endif -int pidfile_close(struct pidfh *_pfh); -int pidfile_fileno(const struct pidfh *_pfh); -struct pidfh * - pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); -int pidfile_remove(struct pidfh *_pfh); -int pidfile_write(struct pidfh *_pfh); - #ifdef _UFS_UFS_QUOTA_H_ struct fstab; struct quotafile; @@ -199,22 +195,6 @@ int quota_write_usage(struct quotafile * __END_DECLS -#define UU_LOCK_INUSE (1) -#define UU_LOCK_OK (0) -#define UU_LOCK_OPEN_ERR (-1) -#define UU_LOCK_READ_ERR (-2) -#define UU_LOCK_CREAT_ERR (-3) -#define UU_LOCK_WRITE_ERR (-4) -#define UU_LOCK_LINK_ERR (-5) -#define UU_LOCK_TRY_ERR (-6) -#define UU_LOCK_OWNER_ERR (-7) - -/* return values from realhostname() */ -#define HOSTNAME_FOUND (0) -#define HOSTNAME_INCORRECTNAME (1) -#define HOSTNAME_INVALIDADDR (2) -#define HOSTNAME_INVALIDNAME (3) - /* fparseln(3) */ #define FPARSELN_UNESCESC 0x01 #define FPARSELN_UNESCCONT 0x02 @@ -222,26 +202,43 @@ __END_DECLS #define FPARSELN_UNESCREST 0x08 #define FPARSELN_UNESCALL 0x0f -/* pw_scan() */ -#define PWSCAN_MASTER 0x01 -#define PWSCAN_WARN 0x02 - -/* humanize_number(3) */ -#define HN_DECIMAL 0x01 -#define HN_NOSPACE 0x02 -#define HN_B 0x04 -#define HN_DIVISOR_1000 0x08 -#define HN_IEC_PREFIXES 0x10 - -/* maxscale = 0x07 */ -#define HN_GETSCALE 0x10 -#define HN_AUTOSCALE 0x20 - -/* hexdump(3) */ +/* Flags for hexdump(3). */ #define HD_COLUMN_MASK 0xff #define HD_DELIM_MASK 0xff00 #define HD_OMIT_COUNT (1 << 16) #define HD_OMIT_HEX (1 << 17) #define HD_OMIT_CHARS (1 << 18) +/* Flags for humanize_number(3) flags. */ +#define HN_DECIMAL 0x01 +#define HN_NOSPACE 0x02 +#define HN_B 0x04 +#define HN_DIVISOR_1000 0x08 +#define HN_IEC_PREFIXES 0x10 + +/* Flags for humanize_number(3) scale. */ +#define HN_GETSCALE 0x10 +#define HN_AUTOSCALE 0x20 + +/* return values from realhostname(). */ +#define HOSTNAME_FOUND 0 +#define HOSTNAME_INCORRECTNAME 1 +#define HOSTNAME_INVALIDADDR 2 +#define HOSTNAME_INVALIDNAME 3 + +/* Flags for pw_scan(). */ +#define PWSCAN_MASTER 0x01 +#define PWSCAN_WARN 0x02 + +/* Return values from uu_lock(). */ +#define UU_LOCK_INUSE 1 +#define UU_LOCK_OK 0 +#define UU_LOCK_OPEN_ERR -1 +#define UU_LOCK_READ_ERR -2 +#define UU_LOCK_CREAT_ERR -3 +#define UU_LOCK_WRITE_ERR -4 +#define UU_LOCK_LINK_ERR -5 +#define UU_LOCK_TRY_ERR -6 +#define UU_LOCK_OWNER_ERR -7 + #endif /* !_LIBUTIL_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 21:25:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CB2F106564A; Mon, 16 Jan 2012 21:25:42 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BCAB8FC08; Mon, 16 Jan 2012 21:25:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GLPg9h052495; Mon, 16 Jan 2012 21:25:42 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GLPfAP052491; Mon, 16 Jan 2012 21:25:41 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201162125.q0GLPfAP052491@svn.freebsd.org> From: Guy Helmer Date: Mon, 16 Jan 2012 21:25:41 +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: r230234 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 21:25:42 -0000 Author: ghelmer Date: Mon Jan 16 21:25:41 2012 New Revision: 230234 URL: http://svn.freebsd.org/changeset/base/230234 Log: Remove unnecessary includes from these libutil man pages. Requested by bde (as was the previous commit). Modified: head/lib/libutil/pidfile.3 head/lib/libutil/property.3 head/lib/libutil/realhostname.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Mon Jan 16 21:19:23 2012 (r230233) +++ head/lib/libutil/pidfile.3 Mon Jan 16 21:25:41 2012 (r230234) @@ -36,7 +36,6 @@ .Sh LIBRARY .Lb libutil .Sh SYNOPSIS -.In sys/param.h .In libutil.h .Ft "struct pidfh *" .Fn pidfile_open "const char *path" "mode_t mode" "pid_t *pidptr" Modified: head/lib/libutil/property.3 ============================================================================== --- head/lib/libutil/property.3 Mon Jan 16 21:19:23 2012 (r230233) +++ head/lib/libutil/property.3 Mon Jan 16 21:25:41 2012 (r230234) @@ -36,7 +36,6 @@ .Sh LIBRARY .Lb libutil .Sh SYNOPSIS -.In sys/types.h .In libutil.h .Ft properties .Fn properties_read "int fd" Modified: head/lib/libutil/realhostname.3 ============================================================================== --- head/lib/libutil/realhostname.3 Mon Jan 16 21:19:23 2012 (r230233) +++ head/lib/libutil/realhostname.3 Mon Jan 16 21:25:41 2012 (r230234) @@ -33,8 +33,6 @@ .Sh LIBRARY .Lb libutil .Sh SYNOPSIS -.In sys/types.h -.In netinet/in.h .In libutil.h .Ft int .Fn realhostname "char *host" "size_t hsize" "const struct in_addr *ip" From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 22:26:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7971065676; Mon, 16 Jan 2012 22:26:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEB828FC0C; Mon, 16 Jan 2012 22:26:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GMQP57054491; Mon, 16 Jan 2012 22:26:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GMQPFg054487; Mon, 16 Jan 2012 22:26:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201162226.q0GMQPFg054487@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 16 Jan 2012 22:26: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: r230238 - in head/sys/dev/usb: . quirk serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 22:26:26 -0000 Author: hselasky Date: Mon Jan 16 22:26:25 2012 New Revision: 230238 URL: http://svn.freebsd.org/changeset/base/230238 Log: Add support for more USB devices. Submitted by: pav @ MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Jan 16 22:17:12 2012 (r230237) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Jan 16 22:26:25 2012 (r230238) @@ -134,6 +134,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(QUALCOMM2, CDMA_MSM, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(CURITEL, UM150, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(CURITEL, UM175, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(VERTEX, VW110L, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), /* USB Mass Storage Class Quirks */ USB_QUIRK_VP(USB_VENDOR_ASAHIOPTICAL, 0, UQ_MSC_NO_RS_CLEAR_UA, Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Mon Jan 16 22:17:12 2012 (r230237) +++ head/sys/dev/usb/serial/u3g.c Mon Jan 16 22:26:25 2012 (r230238) @@ -354,6 +354,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QISDA, H21_2, 0), U3G_DEV(QUALCOMM2, AC8700, 0), U3G_DEV(QUALCOMM2, MF330, 0), + U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, AC2726, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jan 16 22:17:12 2012 (r230237) +++ head/sys/dev/usb/usbdevs Mon Jan 16 22:26:25 2012 (r230238) @@ -679,6 +679,7 @@ vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies +vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications vendor HAUPPAUGE2 0x2040 Hauppauge Computer Works @@ -2679,6 +2680,7 @@ product QUALCOMM2 MF330 0x6613 MF330 product QUALCOMM2 RWT_FCT 0x3100 RWT FCT-CDMA 2000 1xRTT modem product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem product QUALCOMM2 AC8700 0x6000 AC8700 +product QUALCOMM2 VW110L 0x1000 Vertex Wireless 110L modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem @@ -3374,6 +3376,9 @@ product VIA USB2IDEBRIDGE 0x6204 USB 2.0 /* Vaisala products */ product VAISALA CABLE 0x0200 USB Interface cable +/* Vertex products */ +product VERTEX VW110L 0x0100 Vertex VW110L modem + /* VidzMedia products */ product VIDZMEDIA MONSTERTV 0x4fb1 MonsterTV P2H From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 23:14:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A05106566B; Mon, 16 Jan 2012 23:14:24 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FB8F8FC0C; Mon, 16 Jan 2012 23:14:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GNEO6H056381; Mon, 16 Jan 2012 23:14:24 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GNEO8K056378; Mon, 16 Jan 2012 23:14:24 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201201162314.q0GNEO8K056378@svn.freebsd.org> From: Stanislav Sedov Date: Mon, 16 Jan 2012 23:14: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: r230242 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 23:14:24 -0000 Author: stas Date: Mon Jan 16 23:14:23 2012 New Revision: 230242 URL: http://svn.freebsd.org/changeset/base/230242 Log: - Add ID for the BeagleBone FTDI serial over usb port. MFC after: 3 days Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Mon Jan 16 23:02:37 2012 (r230241) +++ head/sys/dev/usb/serial/uftdi.c Mon Jan 16 23:14:23 2012 (r230242) @@ -221,6 +221,7 @@ static STRUCT_USB_HOST_ID uftdi_devs[] = UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), + UFTDI_DEV(FTDI, SERIAL_BEAGLEBONE, 8U232AM), UFTDI_DEV(FTDI, SEMC_DSS20, 8U232AM), UFTDI_DEV(FTDI, CFA_631, 8U232AM), UFTDI_DEV(FTDI, CFA_632, 8U232AM), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jan 16 23:02:37 2012 (r230241) +++ head/sys/dev/usb/usbdevs Mon Jan 16 23:14:23 2012 (r230242) @@ -1606,6 +1606,7 @@ product FTDI SERIAL_2232C 0x6010 FT2232C product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial product FTDI BEAGLEBONE 0xA6D0 BeagleBone product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial +product FTDI SERIAL_BEAGLEBONE 0xa6d0 BeagleBone FTDI Serial /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 00:27:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25335106566B; Tue, 17 Jan 2012 00:27:33 +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 0E6B88FC0A; Tue, 17 Jan 2012 00:27:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H0RWQF059018; Tue, 17 Jan 2012 00:27:32 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H0RWRU059016; Tue, 17 Jan 2012 00:27:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201170027.q0H0RWRU059016@svn.freebsd.org> From: Alan Cox Date: Tue, 17 Jan 2012 00:27: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: r230246 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 00:27:33 -0000 Author: alc Date: Tue Jan 17 00:27:32 2012 New Revision: 230246 URL: http://svn.freebsd.org/changeset/base/230246 Log: Improve abstraction. Eliminate direct access by elf*_load_section() to an OBJT_VNODE-specific field of the vm object. The same information can be just as easily obtained from the struct vattr that is in struct image_params if the latter is passed to elf*_load_section(). Moreover, by replacing the vmspace and vm object parameters to elf*_load_section() with a struct image_params parameter, we actually reduce the size of the object code. In collaboration with: kib Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Jan 17 00:02:45 2012 (r230245) +++ head/sys/kern/imgact_elf.c Tue Jan 17 00:27:32 2012 (r230246) @@ -86,9 +86,9 @@ static Elf_Brandinfo *__elfN(get_brandin const char *interp, int32_t *osrel); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry, size_t pagesize); -static int __elfN(load_section)(struct vmspace *vmspace, vm_object_t object, - vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, - vm_prot_t prot, size_t pagesize); +static int __elfN(load_section)(struct image_params *imgp, vm_offset_t offset, + caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, + size_t pagesize); static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); static boolean_t __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel); @@ -445,13 +445,14 @@ __elfN(map_insert)(vm_map_t map, vm_obje } static int -__elfN(load_section)(struct vmspace *vmspace, - vm_object_t object, vm_offset_t offset, - caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, - size_t pagesize) +__elfN(load_section)(struct image_params *imgp, vm_offset_t offset, + caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, + size_t pagesize) { struct sf_buf *sf; size_t map_len; + vm_map_t map; + vm_object_t object; vm_offset_t map_addr; int error, rv, cow; size_t copy_len; @@ -466,12 +467,13 @@ __elfN(load_section)(struct vmspace *vms * While I'm here, might as well check for something else that * is invalid: filsz cannot be greater than memsz. */ - if ((off_t)filsz + offset > object->un_pager.vnp.vnp_size || - filsz > memsz) { + if ((off_t)filsz + offset > imgp->attr->va_size || filsz > memsz) { uprintf("elf_load_section: truncated ELF file\n"); return (ENOEXEC); } + object = imgp->object; + map = &imgp->proc->p_vmspace->vm_map; map_addr = trunc_page_ps((vm_offset_t)vmaddr, pagesize); file_addr = trunc_page_ps(offset, pagesize); @@ -491,7 +493,7 @@ __elfN(load_section)(struct vmspace *vms cow = MAP_COPY_ON_WRITE | MAP_PREFAULT | (prot & VM_PROT_WRITE ? 0 : MAP_DISABLE_COREDUMP); - rv = __elfN(map_insert)(&vmspace->vm_map, + rv = __elfN(map_insert)(map, object, file_addr, /* file offset */ map_addr, /* virtual start */ @@ -521,8 +523,8 @@ __elfN(load_section)(struct vmspace *vms /* This had damn well better be true! */ if (map_len != 0) { - rv = __elfN(map_insert)(&vmspace->vm_map, NULL, 0, map_addr, - map_addr + map_len, VM_PROT_ALL, 0); + rv = __elfN(map_insert)(map, NULL, 0, map_addr, map_addr + + map_len, VM_PROT_ALL, 0); if (rv != KERN_SUCCESS) { return (EINVAL); } @@ -550,8 +552,8 @@ __elfN(load_section)(struct vmspace *vms * set it to the specified protection. * XXX had better undo the damage from pasting over the cracks here! */ - vm_map_protect(&vmspace->vm_map, trunc_page(map_addr), - round_page(map_addr + map_len), prot, FALSE); + vm_map_protect(map, trunc_page(map_addr), round_page(map_addr + + map_len), prot, FALSE); return (0); } @@ -580,7 +582,6 @@ __elfN(load_file)(struct proc *p, const const Elf_Ehdr *hdr = NULL; const Elf_Phdr *phdr = NULL; struct nameidata *nd; - struct vmspace *vmspace = p->p_vmspace; struct vattr *attr; struct image_params *imgp; vm_prot_t prot; @@ -672,11 +673,10 @@ __elfN(load_file)(struct proc *p, const if (phdr[i].p_type == PT_LOAD && phdr[i].p_memsz != 0) { /* Loadable segment */ prot = __elfN(trans_prot)(phdr[i].p_flags); - if ((error = __elfN(load_section)(vmspace, - imgp->object, phdr[i].p_offset, + error = __elfN(load_section)(imgp, phdr[i].p_offset, (caddr_t)(uintptr_t)phdr[i].p_vaddr + rbase, - phdr[i].p_memsz, phdr[i].p_filesz, prot, - pagesize)) != 0) + phdr[i].p_memsz, phdr[i].p_filesz, prot, pagesize); + if (error != 0) goto fail; /* * Establish the base address if this is the @@ -810,8 +810,6 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (error) return (error); - vmspace = imgp->proc->p_vmspace; - for (i = 0; i < hdr->e_phnum; i++) { switch (phdr[i].p_type) { case PT_LOAD: /* Loadable segment */ @@ -828,11 +826,11 @@ __CONCAT(exec_, __elfN(imgact))(struct i prot |= VM_PROT_EXECUTE; #endif - if ((error = __elfN(load_section)(vmspace, - imgp->object, phdr[i].p_offset, + error = __elfN(load_section)(imgp, phdr[i].p_offset, (caddr_t)(uintptr_t)phdr[i].p_vaddr + et_dyn_addr, phdr[i].p_memsz, phdr[i].p_filesz, prot, - sv->sv_pagesize)) != 0) + sv->sv_pagesize); + if (error != 0) return (error); /* @@ -901,6 +899,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i return (ENOMEM); } + vmspace = imgp->proc->p_vmspace; vmspace->vm_tsize = text_size >> PAGE_SHIFT; vmspace->vm_taddr = (caddr_t)(uintptr_t)text_addr; vmspace->vm_dsize = data_size >> PAGE_SHIFT; @@ -912,8 +911,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i * calculation is that it leaves room for the heap to grow to * its maximum allowed size. */ - addr = round_page((vm_offset_t)imgp->proc->p_vmspace->vm_daddr + - lim_max(imgp->proc, RLIMIT_DATA)); + addr = round_page((vm_offset_t)vmspace->vm_daddr + lim_max(imgp->proc, + RLIMIT_DATA)); PROC_UNLOCK(imgp->proc); imgp->entry_addr = entry; From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 00:31:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3692106564A; Tue, 17 Jan 2012 00:31: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 CDD508FC13; Tue, 17 Jan 2012 00:31:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H0V9IB059196; Tue, 17 Jan 2012 00:31:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H0V9RU059194; Tue, 17 Jan 2012 00:31:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201170031.q0H0V9RU059194@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 Jan 2012 00:31: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: r230247 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 00:31:10 -0000 Author: nwhitehorn Date: Tue Jan 17 00:31:09 2012 New Revision: 230247 URL: http://svn.freebsd.org/changeset/base/230247 Log: Revert r212360 now that PowerPC can handle large sparse arguments to pmap_remove() (changed in r228412). MFC after: 2 weeks Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Jan 17 00:27:32 2012 (r230246) +++ head/sys/vm/vm_pageout.c Tue Jan 17 00:31:09 2012 (r230247) @@ -714,11 +714,8 @@ vm_pageout_map_deactivate_pages(map, des * table pages. */ if (desired == 0 && nothingwired) { - tmpe = map->header.next; - while (tmpe != &map->header) { - pmap_remove(vm_map_pmap(map), tmpe->start, tmpe->end); - tmpe = tmpe->next; - } + pmap_remove(vm_map_pmap(map), vm_map_min(map), + vm_map_max(map)); } vm_map_unlock(map); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 01:08:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4FC8106566C; Tue, 17 Jan 2012 01:08:02 +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 8B6B38FC0C; Tue, 17 Jan 2012 01:08:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H182FU060368; Tue, 17 Jan 2012 01:08:02 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H182aY060349; Tue, 17 Jan 2012 01:08:02 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201170108.q0H182aY060349@svn.freebsd.org> From: Kirk McKusick Date: Tue, 17 Jan 2012 01:08: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: r230249 - in head/sys: compat/freebsd32 fs/cd9660 fs/fdescfs fs/hpfs fs/msdosfs fs/nfsclient fs/ntfs fs/nwfs fs/portalfs fs/pseudofs fs/smbfs gnu/fs/reiserfs kern nfsclient sys ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 01:08:02 -0000 Author: mckusick Date: Tue Jan 17 01:08:01 2012 New Revision: 230249 URL: http://svn.freebsd.org/changeset/base/230249 Log: Make sure all intermediate variables holding mount flags (mnt_flag) and that all internal kernel calls passing mount flags are declared as uint64_t so that flags in the top 32-bits are not lost. MFC after: 2 weeks Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/fs/hpfs/hpfs_vfsops.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/ntfs/ntfs_vfsops.c head/sys/fs/nwfs/nwfs_vfsops.c head/sys/fs/portalfs/portal_vfsops.c head/sys/fs/pseudofs/pseudofs.c head/sys/fs/pseudofs/pseudofs.h head/sys/fs/smbfs/smbfs_vfsops.c head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/nfsclient/nfs_vfsops.c head/sys/sys/mount.h head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 17 01:08:01 2012 (r230249) @@ -2485,9 +2485,17 @@ freebsd32_nmount(struct thread *td, } */ *uap) { struct uio *auio; + uint64_t flags; int error; - AUDIT_ARG_FFLAGS(uap->flags); + /* + * Mount flags are now 64-bits. On 32-bit archtectures only + * 32-bits are passed in, but from here on everything handles + * 64-bit flags correctly. + */ + flags = uap->flags; + + AUDIT_ARG_FFLAGS(flags); /* * Filter out MNT_ROOTFS. We do not want clients of nmount() in @@ -2496,7 +2504,7 @@ freebsd32_nmount(struct thread *td, * MNT_ROOTFS should only be set by the kernel when mounting its * root file system. */ - uap->flags &= ~MNT_ROOTFS; + flags &= ~MNT_ROOTFS; /* * check that we have an even number of iovec's @@ -2508,7 +2516,7 @@ freebsd32_nmount(struct thread *td, error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); if (error) return (error); - error = vfs_donmount(td, uap->flags, auio); + error = vfs_donmount(td, flags, auio); free(auio, M_IOV); return error; Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/cd9660/cd9660_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -95,7 +95,7 @@ static int iso_mountfs(struct vnode *dev */ static int -cd9660_cmount(struct mntarg *ma, void *data, int flags) +cd9660_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct iso_args args; struct export_args exp; Modified: head/sys/fs/fdescfs/fdesc_vfsops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -65,7 +65,7 @@ static vfs_root_t fdesc_root; * Compatibility shim for old mount(2) system call. */ int -fdesc_cmount(struct mntarg *ma, void *data, int flags) +fdesc_cmount(struct mntarg *ma, void *data, uint64_t flags) { return kernel_mount(ma, flags); } Modified: head/sys/fs/hpfs/hpfs_vfsops.c ============================================================================== --- head/sys/fs/hpfs/hpfs_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/hpfs/hpfs_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -73,7 +73,7 @@ static int hpfs_cmount ( struct mntarg *ma, void *data, - int flags) + uint64_t flags) { struct hpfs_args args; struct export_args exp; Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -197,7 +197,7 @@ update_mp(struct mount *mp, struct threa } static int -msdosfs_cmount(struct mntarg *ma, void *data, int flags) +msdosfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct msdosfs_args args; struct export_args exp; Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -1131,7 +1131,7 @@ out: */ /* ARGSUSED */ static int -nfs_cmount(struct mntarg *ma, void *data, int flags) +nfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { int error; struct nfs_args args; Modified: head/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/ntfs/ntfs_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -117,7 +117,7 @@ static int ntfs_cmount ( struct mntarg *ma, void *data, - int flags) + uint64_t flags) { struct ntfs_args args; struct export_args exp; Modified: head/sys/fs/nwfs/nwfs_vfsops.c ============================================================================== --- head/sys/fs/nwfs/nwfs_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/nwfs/nwfs_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -123,7 +123,7 @@ nwfs_initnls(struct nwmount *nmp) { return 0; } -static int nwfs_cmount(struct mntarg *ma, void *data, int flags) +static int nwfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct nwfs_args args; /* will hold data from mount request */ int error; Modified: head/sys/fs/portalfs/portal_vfsops.c ============================================================================== --- head/sys/fs/portalfs/portal_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/portalfs/portal_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -69,7 +69,7 @@ static const char *portal_opts[] = { }; static int -portal_cmount(struct mntarg *ma, void *data, int flags) +portal_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct portal_args args; int error; Modified: head/sys/fs/pseudofs/pseudofs.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/pseudofs/pseudofs.c Tue Jan 17 01:08:01 2012 (r230249) @@ -330,7 +330,7 @@ pfs_mount(struct pfs_info *pi, struct mo * Compatibility shim for old mount(2) system call */ int -pfs_cmount(struct mntarg *ma, void *data, int flags) +pfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { int error; Modified: head/sys/fs/pseudofs/pseudofs.h ============================================================================== --- head/sys/fs/pseudofs/pseudofs.h Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/pseudofs/pseudofs.h Tue Jan 17 01:08:01 2012 (r230249) @@ -242,7 +242,7 @@ struct pfs_node { * VFS interface */ int pfs_mount (struct pfs_info *pi, struct mount *mp); -int pfs_cmount (struct mntarg *ma, void *data, int flags); +int pfs_cmount (struct mntarg *ma, void *data, uint64_t flags); int pfs_unmount (struct mount *mp, int mntflags); int pfs_root (struct mount *mp, int flags, struct vnode **vpp); Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/fs/smbfs/smbfs_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -98,7 +98,7 @@ MODULE_DEPEND(smbfs, libmchain, 1, 1, 1) int smbfs_pbuf_freecnt = -1; /* start out unlimited */ static int -smbfs_cmount(struct mntarg *ma, void * data, int flags) +smbfs_cmount(struct mntarg *ma, void * data, uint64_t flags) { struct smbfs_args args; int error; Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -49,7 +49,7 @@ MALLOC_DEFINE(M_REISERFSNODE, "reiserfs_ * -------------------------------------------------------------------*/ static int -reiserfs_cmount(struct mntarg *ma, void *data, int flags) +reiserfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct reiserfs_args args; struct export_args exp; Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/kern/vfs_mount.c Tue Jan 17 01:08:01 2012 (r230249) @@ -72,8 +72,8 @@ __FBSDID("$FreeBSD$"); #define VFS_MOUNTARG_SIZE_MAX (1024 * 64) -static int vfs_domount(struct thread *td, const char *fstype, - char *fspath, int fsflags, struct vfsoptlist **optlist); +static int vfs_domount(struct thread *td, const char *fstype, char *fspath, + uint64_t fsflags, struct vfsoptlist **optlist); static void free_mntarg(struct mntarg *ma); static int usermount = 0; @@ -378,10 +378,18 @@ sys_nmount(td, uap) struct uio *auio; int error; u_int iovcnt; + uint64_t flags; - AUDIT_ARG_FFLAGS(uap->flags); + /* + * Mount flags are now 64-bits. On 32-bit archtectures only + * 32-bits are passed in, but from here on everything handles + * 64-bit flags correctly. + */ + flags = uap->flags; + + AUDIT_ARG_FFLAGS(flags); CTR4(KTR_VFS, "%s: iovp %p with iovcnt %d and flags %d", __func__, - uap->iovp, uap->iovcnt, uap->flags); + uap->iovp, uap->iovcnt, flags); /* * Filter out MNT_ROOTFS. We do not want clients of nmount() in @@ -390,7 +398,7 @@ sys_nmount(td, uap) * MNT_ROOTFS should only be set by the kernel when mounting its * root file system. */ - uap->flags &= ~MNT_ROOTFS; + flags &= ~MNT_ROOTFS; iovcnt = uap->iovcnt; /* @@ -409,7 +417,7 @@ sys_nmount(td, uap) __func__, error); return (error); } - error = vfs_donmount(td, uap->flags, auio); + error = vfs_donmount(td, flags, auio); free(auio, M_IOV); return (error); @@ -520,7 +528,7 @@ vfs_mount_destroy(struct mount *mp) } int -vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions) +vfs_donmount(struct thread *td, uint64_t fsflags, struct uio *fsoptions) { struct vfsoptlist *optlist; struct vfsopt *opt, *tmp_opt; @@ -696,9 +704,17 @@ sys_mount(td, uap) char *fstype; struct vfsconf *vfsp = NULL; struct mntarg *ma = NULL; + uint64_t flags; int error; - AUDIT_ARG_FFLAGS(uap->flags); + /* + * Mount flags are now 64-bits. On 32-bit archtectures only + * 32-bits are passed in, but from here on everything handles + * 64-bit flags correctly. + */ + flags = uap->flags; + + AUDIT_ARG_FFLAGS(flags); /* * Filter out MNT_ROOTFS. We do not want clients of mount() in @@ -707,7 +723,7 @@ sys_mount(td, uap) * MNT_ROOTFS should only be set by the kernel when mounting its * root file system. */ - uap->flags &= ~MNT_ROOTFS; + flags &= ~MNT_ROOTFS; fstype = malloc(MFSNAMELEN, M_TEMP, M_WAITOK); error = copyinstr(uap->type, fstype, MFSNAMELEN, NULL); @@ -731,11 +747,11 @@ sys_mount(td, uap) ma = mount_argsu(ma, "fstype", uap->type, MNAMELEN); ma = mount_argsu(ma, "fspath", uap->path, MNAMELEN); - ma = mount_argb(ma, uap->flags & MNT_RDONLY, "noro"); - ma = mount_argb(ma, !(uap->flags & MNT_NOSUID), "nosuid"); - ma = mount_argb(ma, !(uap->flags & MNT_NOEXEC), "noexec"); + ma = mount_argb(ma, flags & MNT_RDONLY, "noro"); + ma = mount_argb(ma, !(flags & MNT_NOSUID), "nosuid"); + ma = mount_argb(ma, !(flags & MNT_NOEXEC), "noexec"); - error = vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, uap->flags); + error = vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, flags); mtx_unlock(&Giant); return (error); } @@ -749,7 +765,7 @@ vfs_domount_first( struct vfsconf *vfsp, /* File system type. */ char *fspath, /* Mount path. */ struct vnode *vp, /* Vnode to be covered. */ - int fsflags, /* Flags common to all filesystems. */ + uint64_t fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { @@ -871,14 +887,15 @@ static int vfs_domount_update( struct thread *td, /* Calling thread. */ struct vnode *vp, /* Mount point vnode. */ - int fsflags, /* Flags common to all filesystems. */ + uint64_t fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { struct oexport_args oexport; struct export_args export; struct mount *mp; - int error, export_error, flag; + int error, export_error; + uint64_t flag; mtx_assert(&Giant, MA_OWNED); ASSERT_VOP_ELOCKED(vp, __func__); @@ -1015,7 +1032,7 @@ vfs_domount( struct thread *td, /* Calling thread. */ const char *fstype, /* Filesystem type. */ char *fspath, /* Mount path. */ - int fsflags, /* Flags common to all filesystems. */ + uint64_t fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { @@ -1216,7 +1233,7 @@ dounmount(mp, flags, td) { struct vnode *coveredvp, *fsrootvp; int error; - int async_flag; + uint64_t async_flag; int mnt_gen_r; mtx_assert(&Giant, MA_OWNED); @@ -1925,7 +1942,7 @@ free_mntarg(struct mntarg *ma) * Mount a filesystem */ int -kernel_mount(struct mntarg *ma, int flags) +kernel_mount(struct mntarg *ma, uint64_t flags) { struct uio auio; int error; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/kern/vfs_subr.c Tue Jan 17 01:08:01 2012 (r230249) @@ -2836,6 +2836,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) struct statfs *sp; struct vnode *vp; char buf[512]; + uint64_t mflags; u_int flags; if (!have_addr) { @@ -2857,13 +2858,13 @@ DB_SHOW_COMMAND(mount, db_show_mount) mp->mnt_stat.f_mntonname, mp->mnt_stat.f_fstypename); buf[0] = '\0'; - flags = mp->mnt_flag; + mflags = mp->mnt_flag; #define MNT_FLAG(flag) do { \ - if (flags & (flag)) { \ + if (mflags & (flag)) { \ if (buf[0] != '\0') \ strlcat(buf, ", ", sizeof(buf)); \ strlcat(buf, (#flag) + 4, sizeof(buf)); \ - flags &= ~(flag); \ + mflags &= ~(flag); \ } \ } while (0) MNT_FLAG(MNT_RDONLY); @@ -2901,11 +2902,11 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_FLAG(MNT_SNAPSHOT); MNT_FLAG(MNT_BYFSID); #undef MNT_FLAG - if (flags != 0) { + if (mflags != 0) { if (buf[0] != '\0') strlcat(buf, ", ", sizeof(buf)); snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "0x%08x", flags); + "0x%016jx", mflags); } db_printf(" mnt_flag = %s\n", buf); Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/nfsclient/nfs_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -1187,7 +1187,7 @@ out: */ /* ARGSUSED */ static int -nfs_cmount(struct mntarg *ma, void *data, int flags) +nfs_cmount(struct mntarg *ma, void *data, uint64_t flags) { int error; struct nfs_args args; Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/sys/mount.h Tue Jan 17 01:08:01 2012 (r230249) @@ -557,7 +557,7 @@ struct nameidata; struct sysctl_req; struct mntarg; -typedef int vfs_cmount_t(struct mntarg *ma, void *data, int flags); +typedef int vfs_cmount_t(struct mntarg *ma, void *data, uint64_t flags); typedef int vfs_unmount_t(struct mount *mp, int mntflags); typedef int vfs_root_t(struct mount *mp, int flags, struct vnode **vpp); typedef int vfs_quotactl_t(struct mount *mp, int cmds, uid_t uid, void *arg); @@ -700,7 +700,7 @@ extern char *mountrootfsname; int dounmount(struct mount *, int, struct thread *); -int kernel_mount(struct mntarg *ma, int flags); +int kernel_mount(struct mntarg *ma, uint64_t flags); int kernel_vmount(int flags, ...); struct mntarg *mount_arg(struct mntarg *ma, const char *name, const void *val, int len); struct mntarg *mount_argb(struct mntarg *ma, int flag, const char *name); @@ -737,7 +737,8 @@ int vfs_export /* process mount expor (struct mount *, struct export_args *); void vfs_allocate_syncvnode(struct mount *); void vfs_deallocate_syncvnode(struct mount *); -int vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions); +int vfs_donmount(struct thread *td, uint64_t fsflags, + struct uio *fsoptions); void vfs_getnewfsid(struct mount *); struct cdev *vfs_getrootfsid(struct mount *); struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */ Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Jan 17 00:34:16 2012 (r230248) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Jan 17 01:08:01 2012 (r230249) @@ -144,7 +144,7 @@ ffs_mount(struct mount *mp) struct fs *fs; pid_t fsckpid = 0; int error, flags; - u_int mntorflags; + uint64_t mntorflags; accmode_t accmode; struct nameidata ndp; char *fspec; @@ -571,7 +571,7 @@ ffs_mount(struct mount *mp) */ static int -ffs_cmount(struct mntarg *ma, void *data, int flags) +ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) { struct ufs_args args; struct export_args exp; From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 01:14:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 686C0106566C; Tue, 17 Jan 2012 01:14: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 52AE48FC21; Tue, 17 Jan 2012 01:14:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H1Ev5w060630; Tue, 17 Jan 2012 01:14:57 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H1Ev02060628; Tue, 17 Jan 2012 01:14:57 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201170114.q0H1Ev02060628@svn.freebsd.org> From: Kirk McKusick Date: Tue, 17 Jan 2012 01:14: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: r230250 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 01:14:57 -0000 Author: mckusick Date: Tue Jan 17 01:14:56 2012 New Revision: 230250 URL: http://svn.freebsd.org/changeset/base/230250 Log: There are several bugs/hangs when trying to take a snapshot on a UFS/FFS filesystem running with journaled soft updates. Until these problems have been tracked down, return ENOTSUPP when an attempt is made to take a snapshot on a filesystem running with journaled soft updates. MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Tue Jan 17 01:08:01 2012 (r230249) +++ head/sys/ufs/ffs/ffs_snapshot.c Tue Jan 17 01:14:56 2012 (r230250) @@ -225,10 +225,18 @@ ffs_snapshot(mp, snapfile) ump = VFSTOUFS(mp); fs = ump->um_fs; sn = NULL; + /* + * At the moment, journaled soft updates cannot support + * taking snapshots. + */ + if (MOUNTEDSUJ(mp)) { + vfs_mount_error(mp, "%s: Snapshots are not yet supported when " + "running with journaled soft updates", fs->fs_fsmnt); + return (EOPNOTSUPP); + } MNT_ILOCK(mp); flag = mp->mnt_flag; MNT_IUNLOCK(mp); - /* * Need to serialize access to snapshot code per filesystem. */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 01:25:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24E98106566B; Tue, 17 Jan 2012 01:25:54 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8628FC0A; Tue, 17 Jan 2012 01:25:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H1Prc0061060; Tue, 17 Jan 2012 01:25:53 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H1PrlJ061058; Tue, 17 Jan 2012 01:25:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201170125.q0H1PrlJ061058@svn.freebsd.org> From: Kevin Lo Date: Tue, 17 Jan 2012 01:25: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: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 01:25:54 -0000 Author: kevlo Date: Tue Jan 17 01:25:53 2012 New Revision: 230252 URL: http://svn.freebsd.org/changeset/base/230252 Log: Return EOPNOTSUPP since we only support update mounts for NFS export. Spotted by: trociny Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Jan 17 01:18:40 2012 (r230251) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Jan 17 01:25:53 2012 (r230252) @@ -150,8 +150,12 @@ tmpfs_mount(struct mount *mp) return (EINVAL); if (mp->mnt_flag & MNT_UPDATE) { + /* + * Only support update mounts for NFS export. + */ if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) return (0); + return (EOPNOTSUPP); } vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 06:23:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ECA0106564A; Tue, 17 Jan 2012 06:23:26 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78B0D8FC08; Tue, 17 Jan 2012 06:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H6NQhA070851; Tue, 17 Jan 2012 06:23:26 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H6NQIF070849; Tue, 17 Jan 2012 06:23:26 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201170623.q0H6NQIF070849@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 Jan 2012 06:23: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: r230256 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 06:23:26 -0000 Author: pluknet Date: Tue Jan 17 06:23:25 2012 New Revision: 230256 URL: http://svn.freebsd.org/changeset/base/230256 Log: Fix the "lock &zrl->zr_mtx already initialized" assertion by initializing the allocated memory before calling mtx_init(9) on mtx pointing to it. Otherwize, random contents of uninitialized memory might occasionally trigger the assertion. Reported by: Pavel Polyakov Reviewed by: pjd MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 17 04:45:11 2012 (r230255) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 17 06:23:25 2012 (r230256) @@ -1077,7 +1077,7 @@ dnode_hold_impl(objset_t *os, uint64_t o if (children_dnodes == NULL) { int i; dnode_children_t *winner; - children_dnodes = kmem_alloc(sizeof (dnode_children_t) + + children_dnodes = kmem_zalloc(sizeof (dnode_children_t) + (epb - 1) * sizeof (dnode_handle_t), KM_SLEEP); children_dnodes->dnc_count = epb; dnh = &children_dnodes->dnc_children[0]; From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 07:21:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61BF4106564A; Tue, 17 Jan 2012 07:21:24 +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 4C7928FC12; Tue, 17 Jan 2012 07:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H7LOnR072870; Tue, 17 Jan 2012 07:21:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H7LOHx072867; Tue, 17 Jan 2012 07:21:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201170721.q0H7LOHx072867@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Jan 2012 07:21: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: r230260 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 07:21:24 -0000 Author: kib Date: Tue Jan 17 07:21:23 2012 New Revision: 230260 URL: http://svn.freebsd.org/changeset/base/230260 Log: Add macro IS_BSP() to check whether the current CPU is BSP. MFC after: 1 week Modified: head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Tue Jan 17 07:01:22 2012 (r230259) +++ head/sys/amd64/include/pcpu.h Tue Jan 17 07:21:23 2012 (r230260) @@ -226,6 +226,8 @@ __curthread(void) } #define curthread (__curthread()) +#define IS_BSP() (PCPU_GET(cpuid) == 0) + #else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ #error "this file needs to be ported to your compiler" From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 07:23:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52B5E106566C; Tue, 17 Jan 2012 07:23: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 3DCD08FC14; Tue, 17 Jan 2012 07:23:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H7Ni2Z073032; Tue, 17 Jan 2012 07:23:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H7NiEJ073029; Tue, 17 Jan 2012 07:23:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201170723.q0H7NiEJ073029@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Jan 2012 07:23:44 +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: r230261 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 07:23:44 -0000 Author: kib Date: Tue Jan 17 07:23:43 2012 New Revision: 230261 URL: http://svn.freebsd.org/changeset/base/230261 Log: Add definitions related to XCR0. MFC after: 1 week Modified: head/sys/amd64/include/specialreg.h head/sys/i386/include/specialreg.h Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Tue Jan 17 07:21:23 2012 (r230260) +++ head/sys/amd64/include/specialreg.h Tue Jan 17 07:23:43 2012 (r230261) @@ -66,6 +66,7 @@ #define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. @@ -76,6 +77,18 @@ #define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ /* + * Intel Extended Features registers + */ +#define XCR0 0 /* XFEATURE_ENABLED_MASK register */ + +#define XFEATURE_ENABLED_X87 0x00000001 +#define XFEATURE_ENABLED_SSE 0x00000002 +#define XFEATURE_ENABLED_AVX 0x00000004 + +#define XFEATURE_AVX \ + (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX) + +/* * CPUID instruction features register */ #define CPUID_FPU 0x00000001 Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Tue Jan 17 07:21:23 2012 (r230260) +++ head/sys/i386/include/specialreg.h Tue Jan 17 07:23:43 2012 (r230261) @@ -66,6 +66,7 @@ #define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 07:30:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AB71106566B; Tue, 17 Jan 2012 07:30:37 +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 762558FC16; Tue, 17 Jan 2012 07:30:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H7Ubsn073272; Tue, 17 Jan 2012 07:30:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H7UbGJ073270; Tue, 17 Jan 2012 07:30:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201170730.q0H7UbGJ073270@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Jan 2012 07:30: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: r230262 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 07:30:37 -0000 Author: kib Date: Tue Jan 17 07:30:36 2012 New Revision: 230262 URL: http://svn.freebsd.org/changeset/base/230262 Log: Implement xsetbv(), xsave() and xrstor() providing C access to the similarly named CPU instructions. Since our in-tree binutils gas is not aware of the instructions, and I have to use the byte-sequence to encode them, hardcode the r/m operand as (%rdi). This way, first argument of the pseudo-function is already placed into proper register. MFC after: 1 week Modified: head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Tue Jan 17 07:23:43 2012 (r230261) +++ head/sys/amd64/include/cpufunc.h Tue Jan 17 07:30:36 2012 (r230262) @@ -669,6 +669,41 @@ intr_restore(register_t rflags) write_rflags(rflags); } +static __inline void +xsetbv(uint32_t reg, uint64_t val) +{ + uint32_t low, hi; + + low = val; + hi = val >> 32; + __asm __volatile(".byte 0x0f,0x01,0xd1" : : + "c" (reg), "a" (low), "d" (hi)); +} + +static __inline void +xsave(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + /* xsave (%rdi) */ + __asm __volatile(".byte 0x0f,0xae,0x27" : : + "a" (low), "d" (hi), "D" (addr) : "memory"); +} + +static __inline void +xrstor(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + /* xrstor (%rdi) */ + __asm __volatile(".byte 0x0f,0xae,0x2f" : : + "a" (low), "d" (hi), "D" (addr)); +} + #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ int breakpoint(void); @@ -733,6 +768,9 @@ u_int rgs(void); void wbinvd(void); void write_rflags(u_int rf); void wrmsr(u_int msr, uint64_t newval); +void xsetbv(uint32_t reg, uint64_t val); +void xsave(char *addr, uint64_t mask); +void xrstor(char *addr, uint64_t mask); #endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 08:44:48 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3780106566B; Tue, 17 Jan 2012 08:44:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 75CEA8FC12; Tue, 17 Jan 2012 08:44:47 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0H8ifKO002654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Jan 2012 19:44:44 +1100 Date: Tue, 17 Jan 2012 19:44:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Guy Helmer In-Reply-To: <52A73054-9960-403B-B2FE-857C8801D129@palisadesystems.com> Message-ID: <20120117190611.F1710@besplex.bde.org> References: <201201122249.q0CMnaZe030200@svn.freebsd.org> <20120114204720.Q1458@besplex.bde.org> <20120114182758.GJ1694@garage.freebsd.pl> <20120115073823.O843@besplex.bde.org> <52A73054-9960-403B-B2FE-857C8801D129@palisadesystems.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, Pawel Jakub Dawidek , Bruce Evans Subject: Re: svn commit: r230037 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 08:44:48 -0000 On Mon, 16 Jan 2012, Guy Helmer wrote: > On Jan 14, 2012, at 3:02 PM, Bruce Evans wrote: > ... > I've pasted the diff below that I think captures the majority of the issues you have brought up. I have not attempted to tackle the property.3/properties.3 issues, nor the objections to the prefixes that I think would take considerably more effort to resolve -- I wanted to concentrate on the issues that can be isolated to libutil. I hope the diff was pasted OK, especially WRT characters. I see you committed it. It is mostly OK, but as usual a pre-commit review would have been useful. > Index: lib/libutil/libutil.h > =================================================================== > --- lib/libutil/libutil.h (revision 230221) > +++ lib/libutil/libutil.h (working copy) > +/* Flags for hexdump(3) */ > #define HD_COLUMN_MASK 0xff > #define HD_DELIM_MASK 0xff00 > #define HD_OMIT_COUNT (1 << 16) > #define HD_OMIT_HEX (1 << 17) > #define HD_OMIT_CHARS (1 << 18) > > +/* Flags for humanize_number(3) flags */ The double "flags" is meaningful but hard to parse. > +#define HN_DECIMAL 0x01 > +#define HN_NOSPACE 0x02 > +#define HN_B 0x04 > +#define HN_DIVISOR_1000 0x08 > +#define HN_IEC_PREFIXES 0x10 > + > +/* Flags for humanize_number(3) scale */ It is only after reading this that the double "flags" starts making sense. Add " parameter" to the end of each to make more sense. Then omit the first "Flags " to make even more sense. Then consider adding some punctuation. Then add "Values" where "Flags" was. The first "Flags" was only a paraphrase of "`flags' parameter". This is most useful when the parameter's name is not `flags', and only works then there is only 1 parameter that takes flags. This results in: /* Values for humanize_number(3)'s `flags' parameter */ /* Values for humanize_number(3)'s `scale' parameter */ Perhaps you can abbreviate this a bit. "Values " is mostly tautologous but seems to improve readability. > +/* return values from realhostname() */ This one is not capitalized. > +/* Return values from uu_lock() */ > +#define UU_LOCK_INUSE 1 > +#define UU_LOCK_OK 0 > +#define UU_LOCK_OPEN_ERR -1 > +#define UU_LOCK_READ_ERR -2 > +#define UU_LOCK_CREAT_ERR -3 > +#define UU_LOCK_WRITE_ERR -4 > +#define UU_LOCK_LINK_ERR -5 > +#define UU_LOCK_TRY_ERR -6 > +#define UU_LOCK_OWNER_ERR -7 Er, the parentheses were not redundant for -N, since -N consists of 2 tokens. I just tried to find an example of why they are needed in , but could only find historical and contrived examples: - before C90, they were necessary to prevent - -1 becoming --1. Code like -UU_LOCK_OPEN_ERR isn't necessarily an error. For a non-flag macro FOO, -FOO just isn't an error, so FOO needed to be parenthesized it it was a negative integer. - now, 1(-1) is a syntax error, but 1-1 is not. Code like 1 UU_LOCK_OPEN_ERR should be a syntax error, but isn't if the macro expands to -1. This is unimportant compared with -FOO working, since the parentheses only give detection of an error. Parentheses are necessary for casts in macros even for C90 and later, since if FOO is defined as (long)1 then the useful expression `sizeof FOO' is the syntax error `sizeof(long) 1'. To avoid avoid worrying about this, expression-like macros should always be parenthesized iff they have more than 1 token. When worrying about this, you look at the C operator precedence table and notice that parentheses don't have the highest precedence, since they share precedence with some other operators. So there must be some magic for parenthesizing macros to be sufficient. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 09:58:56 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC1291065670; Tue, 17 Jan 2012 09:58:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id C762E8FC14; Tue, 17 Jan 2012 09:58:55 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0H9wmPb028755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Jan 2012 20:58:49 +1100 Date: Tue, 17 Jan 2012 20:58:48 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <20120116175627.GA1674@garage.freebsd.pl> Message-ID: <20120117201411.B1819@besplex.bde.org> References: <201201122249.q0CMnaZe030200@svn.freebsd.org> <20120114204720.Q1458@besplex.bde.org> <20120114182758.GJ1694@garage.freebsd.pl> <20120115073823.O843@besplex.bde.org> <52A73054-9960-403B-B2FE-857C8801D129@palisadesystems.com> <20120116175627.GA1674@garage.freebsd.pl> 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, Bruce Evans , Guy Helmer Subject: Re: svn commit: r230037 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 09:58:57 -0000 On Mon, 16 Jan 2012, Pawel Jakub Dawidek wrote: > On Mon, Jan 16, 2012 at 11:14:32AM -0600, Guy Helmer wrote: >> I've pasted the diff below that I think captures the majority of the issues you have brought up. I have not attempted to tackle the property.3/properties.3 issues, nor the objections to the prefixes that I think would take considerably more effort to resolve -- I wanted to concentrate on the issues that can be isolated to libutil. I hope the diff was pasted OK, especially WRT characters. > > The patch looks mostly good, one nit mentioned below and also one > question for Bruce. > >> +/* Flags for hexdump(3) */ >> +/* Flags for humanize_number(3) flags */ >> +/* Flags for humanize_number(3) scale */ >> +/* return values from realhostname() */ >> +/* Flags for pw_scan() */ >> +/* Return values from uu_lock() */ > > All those sentences are missing period and one doesn't start with > capital letter. I decided not to worry about the termination since it was fairly consistent in the file. The most recent commit fixed these, but made all the others inconsistent: % /* for properties.c */ % /* Avoid pulling in all the include files for no need */ % #ifdef _STDIO_H_ /* avoid adding new includes */ This is now the only comment to the right of code. Comments to the right of ifdefs are especially hard format nicely (the normal comment indentation to 32 or 40 columns doesn't work well; I normally use a single space; the above indents to 24 columns), so the should be avoided. The same treatment is used for 3 other includes, but there is no comment for the others. The simplest fix is to remove this comment. Otherwise, put a meta-comment about them all somewhere. It's hard to place this so that it clearly covers them all, but anywhere is better than to the right of 1 of their ifdefs. % /* fparseln(3) */ This is also missing the new, otherwise (too) uniform wording "Flags for..." > I noticed also one more inconsistency: > > struct kinfo_file * > kinfo_getfile(pid_t _pid, int *_cntp); > struct passwd > *pw_dup(const struct passwd *_pw); > > Sometimes * is on the same line as function type and sometimes it is in > the line below. Former is definiately better. Indded. > Guy, feel free to commit what you got now with those sentences fixed and > I'll do one iterration. It is taking way too long and I'm sure you are > bored by now:) We don't want to scare you off:) > >> +struct pidfh * >> + pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); > > Bruce, is this your suggestion? Yes. > This somehow looks weird too me. What I > use and I think it is in general more widely used across FreeBSD is > simply: > > struct pidfh *pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); > > when the type exceeds one tab, but the line fits into 80 chars or: > > struct pidfh *pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr, > int _some_other_argument); > > when line exceeds 80 chars. Very important headers like often use the style of lining up all function names. This can from 4.4BSD (was even in FreeBSD-1 so probably in Net/2) so I consider it Normal. I think this is easier to read. But it is harder to write and maintain, so only very important headers should do it (same for leaving an extra column for '* before function names'). libutil.h isn't important, but it already did this in many cases (including by you for humanize_number() :-), so I said to do it for all cases. A middle way would be to use the fancy formatting only when line splitting is needed to avoid long lines anyway: - short prototypes: never split - slightly longer prototypes: split at function name provided this requires only 2 lines - even longer prototypes: split after a comma in parameter list provided this requires only 2 lines - very long prototypes: split after at function name and take more than 3 lines no matter how it is split (might take 1 extra for this) But this would be even harder to write and maintain. > Especially this one looks very strange: > > properties > properties_read(int _fd); > `properties' is weird because it doesn't look like a type. indent(1) and maybe smart editors don't even understand the minimal facy formatting in . That's what I mean by "hard to write and maintain". Especially for the fancier formattings of very long prototypes which need careful fancy formatting most, it's too hard to produce and reproduce with a simple editor or formatting utility. FreeBSD indent(1) still doesn't even understand prototypes, but it manages to usually not mess up simple ones. It actually makes a big mess of , starting with the first __dead2: % __BEGIN_DECLS % void % abort(void)__dead2; % int abs(int)__pure2; % int atexit(void (*) (void)); % double atof(const char *); After removing the __dead2 and the __pure2, it gets a bit further: % __BEGIN_DECLS % void abort(void); % int abs (int); % int atexit(void (*) (void)); % double atof(const char *); % int atoi(const char *); % long atol(const char *); This looks OK, but indent has destroyed the fancy 9-char indent (1 extra for a '*' that is not used in the above). It doesn't understand the nested declaration of the function pointer in the parameter list for atexit(), but it has only added a space there. % void * % bsearch(const void *, const void *, size_t, % size_t, int (*) (const void *, const void *)); Here it is more confused by the function pointer... % void *calloc(size_t, size_t); % div_t div(int, int)__pure2; % void exit(int)__dead2; ...so that all subsequent formatting is destroyed (it thinks these prototypes are local variables or statements). Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 12:13:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A8D3106564A; Tue, 17 Jan 2012 12:13:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EE5C8FC15; Tue, 17 Jan 2012 12:13:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HCDbor089894; Tue, 17 Jan 2012 12:13:37 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HCDbfj089892; Tue, 17 Jan 2012 12:13:37 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201171213.q0HCDbfj089892@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 17 Jan 2012 12:13: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: r230264 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 12:13:37 -0000 Author: glebius Date: Tue Jan 17 12:13:36 2012 New Revision: 230264 URL: http://svn.freebsd.org/changeset/base/230264 Log: Provide a function m_get2() that allocates a minimal mbuf that would fit specified size. Returned mbuf may be a single mbuf, an mbuf with a cluster from packet zone, or an mbuf with jumbo cluster of sufficient size. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Jan 17 11:04:58 2012 (r230263) +++ head/sys/sys/mbuf.h Tue Jan 17 12:13:36 2012 (r230264) @@ -398,6 +398,8 @@ extern uma_zone_t zone_ext_refcnt; static __inline struct mbuf *m_getcl(int how, short type, int flags); static __inline struct mbuf *m_get(int how, short type); +static __inline struct mbuf *m_get2(int how, short type, int flags, + int size); static __inline struct mbuf *m_gethdr(int how, short type); static __inline struct mbuf *m_getjcl(int how, short type, int flags, int size); @@ -544,6 +546,52 @@ m_getcl(int how, short type, int flags) } /* + * m_get2() allocates minimum mbuf that would fit "size" argument. + * + * XXX: This is rather large, should be real function maybe. + */ +static __inline struct mbuf * +m_get2(int how, short type, int flags, int size) +{ + struct mb_args args; + struct mbuf *m, *n; + uma_zone_t zone; + + args.flags = flags; + args.type = type; + + if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) + return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); + if (size <= MCLBYTES) + return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); + + if (size > MJUM16BYTES) + return (NULL); + + m = uma_zalloc_arg(zone_mbuf, &args, how); + if (m == NULL) + return (NULL); + +#if MJUMPAGESIZE != MCLBYTES + if (size <= MJUMPAGESIZE) + zone = zone_jumbop; + else +#endif + if (size <= MJUM9BYTES) + zone = zone_jumbo9; + else + zone = zone_jumbo16; + + n = uma_zalloc_arg(zone, m, how); + if (n == NULL) { + uma_zfree(zone_mbuf, m); + return (NULL); + } + + return (m); +} + +/* * m_getjcl() returns an mbuf with a cluster of the specified size attached. * For size it takes MCLBYTES, MJUMPAGESIZE, MJUM9BYTES, MJUM16BYTES. * From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 12:14:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 397441065672; Tue, 17 Jan 2012 12:14:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2835A8FC16; Tue, 17 Jan 2012 12:14:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HCER0N089960; Tue, 17 Jan 2012 12:14:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HCEQm8089958; Tue, 17 Jan 2012 12:14:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201171214.q0HCEQm8089958@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 17 Jan 2012 12:14: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: r230265 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 12:14:27 -0000 Author: glebius Date: Tue Jan 17 12:14:26 2012 New Revision: 230265 URL: http://svn.freebsd.org/changeset/base/230265 Log: Allocate our mbuf with m_get2(). Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:13:36 2012 (r230264) +++ head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:14:26 2012 (r230265) @@ -2121,9 +2121,6 @@ pfsync_sendout(void) #ifdef notyet struct tdb *t; #endif -#ifdef __FreeBSD__ - size_t pktlen; -#endif int offset; int q, count = 0; @@ -2145,44 +2142,33 @@ pfsync_sendout(void) return; } - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) { #ifdef __FreeBSD__ + m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + sc->sc_len); + if (m == NULL) { sc->sc_ifp->if_oerrors++; + V_pfsyncstats.pfsyncs_onomem++; + return; + } #else + MGETHDR(m, M_DONTWAIT, MT_DATA); + if (m == NULL) { sc->sc_if.if_oerrors++; -#endif - V_pfsyncstats.pfsyncs_onomem++; + pfsyncstats.pfsyncs_onomem++; pfsync_drop(sc); return; } -#ifdef __FreeBSD__ - pktlen = max_linkhdr + sc->sc_len; - if (pktlen > MHLEN) { - /* Find the right pool to allocate from. */ - /* XXX: This is ugly. */ - m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES : -#if MJUMPAGESIZE != MCLBYTES - pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE : -#endif - pktlen <= MJUM9BYTES ? MJUM9BYTES : MJUM16BYTES); -#else if (max_linkhdr + sc->sc_len > MHLEN) { MCLGETI(m, M_DONTWAIT, NULL, max_linkhdr + sc->sc_len); -#endif if (!ISSET(m->m_flags, M_EXT)) { m_free(m); -#ifdef __FreeBSD__ - sc->sc_ifp->if_oerrors++; -#else sc->sc_if.if_oerrors++; -#endif - V_pfsyncstats.pfsyncs_onomem++; + pfsyncstats.pfsyncs_onomem++; pfsync_drop(sc); return; } } +#endif m->m_data += max_linkhdr; m->m_len = m->m_pkthdr.len = sc->sc_len; From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 12:16:03 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 784681065673; Tue, 17 Jan 2012 12:16:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id EAF378FC13; Tue, 17 Jan 2012 12:16:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0HCG1dW020438; Tue, 17 Jan 2012 16:16:01 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0HCG1i9020437; Tue, 17 Jan 2012 16:16:01 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Jan 2012 16:16:01 +0400 From: Gleb Smirnoff To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20120117121601.GF12760@FreeBSD.org> References: <201201171213.q0HCDbfj089892@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201201171213.q0HCDbfj089892@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230264 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 12:16:03 -0000 On Tue, Jan 17, 2012 at 12:13:37PM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Tue Jan 17 12:13:36 2012 T> New Revision: 230264 T> URL: http://svn.freebsd.org/changeset/base/230264 T> T> Log: T> Provide a function m_get2() that allocates a minimal mbuf that T> would fit specified size. Returned mbuf may be a single mbuf, T> an mbuf with a cluster from packet zone, or an mbuf with jumbo T> cluster of sufficient size. I am open to discussion on bikeshed color^W^W a better name for this function. I utilized it in pfsync, however there are several other places where it can be used instead of handrolled "if else if else" constructs. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 12:50:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20908106564A; Tue, 17 Jan 2012 12:50:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by mx1.freebsd.org (Postfix) with ESMTP id 949878FC14; Tue, 17 Jan 2012 12:50:22 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0HCoIQp005976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Jan 2012 23:50:20 +1100 Date: Tue, 17 Jan 2012 23:50:18 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <201201170730.q0H7UbGJ073270@svn.freebsd.org> Message-ID: <20120117234437.E2762@besplex.bde.org> References: <201201170730.q0H7UbGJ073270@svn.freebsd.org> 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 Subject: Re: svn commit: r230262 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 12:50:23 -0000 On Tue, 17 Jan 2012, Konstantin Belousov wrote: > Log: > Implement xsetbv(), xsave() and xrstor() providing C access to the > similarly named CPU instructions. Please don't add to the unsorting in this file. > Modified: head/sys/amd64/include/cpufunc.h > ============================================================================== > --- head/sys/amd64/include/cpufunc.h Tue Jan 17 07:23:43 2012 (r230261) > +++ head/sys/amd64/include/cpufunc.h Tue Jan 17 07:30:36 2012 (r230262) > #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ > > int breakpoint(void); > @@ -733,6 +768,9 @@ u_int rgs(void); > void wbinvd(void); > void write_rflags(u_int rf); > void wrmsr(u_int msr, uint64_t newval); > +void xsetbv(uint32_t reg, uint64_t val); > +void xsave(char *addr, uint64_t mask); > +void xrstor(char *addr, uint64_t mask); This matches the order of the inlines, and w < x, but e > a and s > r. > > #endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */ Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 14:33:08 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BE971065670 for ; Tue, 17 Jan 2012 14:33:08 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 63F1F8FC12 for ; Tue, 17 Jan 2012 14:33:07 +0000 (UTC) Received: (qmail 71614 invoked from network); 17 Jan 2012 12:29:29 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 17 Jan 2012 12:29:29 -0000 Message-ID: <4F15805D.3040206@freebsd.org> Date: Tue, 17 Jan 2012 15:06:21 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Gleb Smirnoff References: <201201171213.q0HCDbfj089892@svn.freebsd.org> <20120117121601.GF12760@FreeBSD.org> In-Reply-To: <20120117121601.GF12760@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; 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: r230264 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 14:33:08 -0000 On 17.01.2012 13:16, Gleb Smirnoff wrote: > On Tue, Jan 17, 2012 at 12:13:37PM +0000, Gleb Smirnoff wrote: > T> Author: glebius > T> Date: Tue Jan 17 12:13:36 2012 > T> New Revision: 230264 > T> URL: http://svn.freebsd.org/changeset/base/230264 > T> > T> Log: > T> Provide a function m_get2() that allocates a minimal mbuf that > T> would fit specified size. Returned mbuf may be a single mbuf, > T> an mbuf with a cluster from packet zone, or an mbuf with jumbo > T> cluster of sufficient size. > > I am open to discussion on bikeshed color^W^W a better name for > this function. We already have m_getm2() which does the same for mbuf chains. > I utilized it in pfsync, however there are several other places where > it can be used instead of handrolled "if else if else" constructs. Handrolled mbuf allocation isn't good. Should be all in one place. -- Andre From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 14:55:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3EE81065676; Tue, 17 Jan 2012 14:55:06 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id EF9AA8FC08; Tue, 17 Jan 2012 14:55:05 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 317192A28CC2; Tue, 17 Jan 2012 15:55:05 +0100 (CET) Date: Tue, 17 Jan 2012 15:55:05 +0100 From: Ed Schouten To: Marius Strobl Message-ID: <20120117145505.GG95413@hoeg.nl> References: <201201121755.q0CHtMA2020344@svn.freebsd.org> <20120113000057.GA23960@alchemy.franken.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tcC6YSqBgqqkz7Sb" Content-Disposition: inline In-Reply-To: <20120113000057.GA23960@alchemy.franken.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230025 - head/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 14:55:06 -0000 --tcC6YSqBgqqkz7Sb Content-Type: multipart/mixed; boundary="L+ofChggJdETEG3Y" Content-Disposition: inline --L+ofChggJdETEG3Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Marius, * Marius Strobl , 20120113 01:00: > Uhm, these are V8-specific, for V9 the C compiler frame size should > be 192 instead of 64 and the function alignment should be 32 instead > of 4 bytes (at least with GCC and US1-optimizations enabled as we > default to on sparc64), see . However, given that > these functions only seem to obtain new register window for > debugging purposes you probably alternatively could just remove > the saves and the corresponding restores completely. Any comments on the attached patch? Thanks, --=20 Ed Schouten WWW: http://80386.nl/ --L+ofChggJdETEG3Y Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sparc.diff" Content-Transfer-Encoding: quoted-printable Index: modsi3.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modsi3.S (revision 230265) +++ modsi3.S (working copy) @@ -47,13 +47,13 @@ */ #include "../assembly.h" .text - .align 4 + .align 32 DEFINE_COMPILERRT_FUNCTION(__umodsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,%g3 ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__modsi3) - save %sp,-64,%sp ! do this for debugging orcc %o1,%o0,%g0 ! are either %o0 or %o1 negative bge divide ! if not, skip this junk mov %o0,%g3 ! record sign of result in sign of %g3 @@ -324,7 +324,6 @@ got_result: tst %g3 bge 1f - restore ! answer < 0 retl ! leaf-routine return neg %o3,%o0 ! remainder <- -%o3 Index: divmod.m4 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- divmod.m4 (revision 230265) +++ divmod.m4 (working copy) @@ -59,9 +59,6 @@ =20 #include "../assembly.h" =20 -.text - .align 4 - define(DEVELOP_QUOTIENT_BITS, ` !depth $1, accumulated bits $2 bl L.$1.eval(TWOSUPN+$2) @@ -84,12 +81,14 @@ ifelse( $1, 1, `9:') ') ifelse( ANSWER, `quotient', ` +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__udivsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,SIGN ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__divsi3) - save %sp,-64,%sp ! do this for debugging orcc divisor,dividend,%g0 ! are either dividend or divisor negative bge divide ! if not, skip this junk xor divisor,dividend,SIGN ! record sign of result in sign of SIGN @@ -104,12 +103,14 @@ neg dividend ! FALL THROUGH ',` +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__umodsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,SIGN ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__modsi3) - save %sp,-64,%sp ! do this for debugging orcc divisor,dividend,%g0 ! are either dividend or divisor negative bge divide ! if not, skip this junk mov dividend,SIGN ! record sign of result in sign of SIGN @@ -235,7 +236,6 @@ got_result: tst SIGN bge 1f - restore ! answer < 0 retl ! leaf-routine return ifelse( ANSWER, `quotient', Index: divsi3.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- divsi3.S (revision 230265) +++ divsi3.S (working copy) @@ -47,13 +47,13 @@ */ #include "../assembly.h" .text - .align 4 + .align 32 DEFINE_COMPILERRT_FUNCTION(__udivsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,%g3 ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__divsi3) - save %sp,-64,%sp ! do this for debugging orcc %o1,%o0,%g0 ! are either %o0 or %o1 negative bge divide ! if not, skip this junk xor %o1,%o0,%g3 ! record sign of result in sign of %g3 @@ -324,7 +324,6 @@ got_result: tst %g3 bge 1f - restore ! answer < 0 retl ! leaf-routine return neg %o2,%o0 ! quotient <- -%o2 --L+ofChggJdETEG3Y-- --tcC6YSqBgqqkz7Sb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPFYvJAAoJEG5e2P40kaK7ZiYP+QHf/DB6spR/Fxhn6r52JOc1 7JM452dFYQfZM6FiQr3t7+u2yJwswq5ioySRCXUlFAAbSLtCM0K8l0yFNRpEh+gh uMS0/JCbjA4vvAtDeZVceCrmExoVR+tQ/r/bUUbPlKIDMEzWjtTi4uB/KhKkleGC i3BKpaL5PDnAxOzzz9EqnD250DNLm+GVohebaFbyt6QDO/tJADJJkR6EiWLpk2zg Ud1atyEEJy3Gt5++Npffv6uk4jly1xIqLvv/g3iXpH0murO8gdwu7v38UdOFTUWz PszwaO5rq2WzlqutXEef0U+1CieEzyXFYXA44kvW8q9wt4TWmjJxtaoqDYNPbC3k 61/shM17YZ4Th1k0RNt4eGGhLQnQJUo/WIIuL/4bqDmGNF+P1aAVBxqnDmGuXqCI BZGdZKQFdTFTPvyp6BGOvlBVEcnJu36JerzlR503AVfCaMXftz6533mae+H28oij KgALguNzIbe/saVzFxZ0YFjt+i/GKdsQolUrKC0ysrgbM93khWbIfYKiF2uUf2zW TeGgPB9Zjpi/0BGezgALRFEsLpA6JaR9YJrooUaUFp2jfUIZUkQEs3k9h076USW8 vAugEWlTCE3BX/gI5UW2aorZYcEpnPU4CrS63EQ0EWuVAdJ7pRksAl9kCdxHesfE 9GOF0eA8Z5qlx4UQscF4 =4kjK -----END PGP SIGNATURE----- --tcC6YSqBgqqkz7Sb-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 15:17:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2686106566B; Tue, 17 Jan 2012 15:17:18 +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 A8F1F8FC15; Tue, 17 Jan 2012 15:17:18 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6076146B23; Tue, 17 Jan 2012 10:17:18 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DB22CB95E; Tue, 17 Jan 2012 10:17:17 -0500 (EST) From: John Baldwin To: Kevin Lo Date: Tue, 17 Jan 2012 09:50:15 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201161025.q0GAPNDq027693@svn.freebsd.org> In-Reply-To: <201201161025.q0GAPNDq027693@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201170950.15267.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Jan 2012 10:17:17 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230208 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 15:17:18 -0000 On Monday, January 16, 2012 5:25:23 am Kevin Lo wrote: > Author: kevlo > Date: Mon Jan 16 10:25:22 2012 > New Revision: 230208 > URL: http://svn.freebsd.org/changeset/base/230208 > > Log: > Add nfs export support to tmpfs(5) > > Reviewed by: kib > > Modified: > head/sys/fs/tmpfs/tmpfs_vfsops.c > > Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c > ============================================================================== > --- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jan 16 09:53:24 2012 (r230207) > +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jan 16 10:25:22 2012 (r230208) > @@ -150,10 +150,8 @@ tmpfs_mount(struct mount *mp) > return (EINVAL); > > if (mp->mnt_flag & MNT_UPDATE) { > - /* XXX: There is no support yet to update file system > - * settings. Should be added. */ > - > - return EOPNOTSUPP; > + if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) > + return (0); > } Is it supposed to fall through if the 'export' option isn't in the list during an update mount? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 15:17:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FFF31065670; Tue, 17 Jan 2012 15:17:20 +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 276C98FC1A; Tue, 17 Jan 2012 15:17:20 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D2F9F46B06; Tue, 17 Jan 2012 10:17:19 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 40295B977; Tue, 17 Jan 2012 10:17:19 -0500 (EST) From: John Baldwin To: David Xu Date: Tue, 17 Jan 2012 09:57:47 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201160615.q0G6FE9r019542@svn.freebsd.org> In-Reply-To: <201201160615.q0G6FE9r019542@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201170957.47718.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Jan 2012 10:17:19 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 15:17:20 -0000 On Monday, January 16, 2012 1:15:14 am David Xu wrote: > Author: davidxu > Date: Mon Jan 16 06:15:14 2012 > New Revision: 230201 > URL: http://svn.freebsd.org/changeset/base/230201 > > Log: > Insert read memory barriers. I think using atomic_load_acq() on sem->nwaiters would be clearer as it would indicate which variable you need to ensure is read after other operations. In general I think raw rmb/wmb usage should be avoided when possible as it is does not describe the programmer's intent as well. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 15:17:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34BC8106564A; Tue, 17 Jan 2012 15:17:21 +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 0AB7C8FC0A; Tue, 17 Jan 2012 15:17:21 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id B6D1146B1A; Tue, 17 Jan 2012 10:17:20 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 22028B992; Tue, 17 Jan 2012 10:17:20 -0500 (EST) From: John Baldwin To: Colin Percival Date: Tue, 17 Jan 2012 10:08:28 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F136109.9050004@FreeBSD.org> <4F13621B.1060203@freebsd.org> In-Reply-To: <4F13621B.1060203@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201171008.28752.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Jan 2012 10:17:20 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 15:17:21 -0000 On Sunday, January 15, 2012 6:32:43 pm Colin Percival wrote: > On 01/15/12 15:28, John Baldwin wrote: > > On 1/15/12 2:09 AM, Eitan Adler wrote: > >> Log: > >> - Fix undefined behavior when device_get_name is null > >> - Make error message more informative > > > > The in-kernel printf(9) always prints "(null)" for %s when the pointer is NULL, > > so that wasn't undefined behavior. Printing out the driver name is a useful > > change, but the "(unknown)" bits are just noise as it isn't clear that > > "(unknown)" is substantially better than "(null)". > > I think the change from "(null)" to "(unknown)" is useful, since when I see > "(null)" printed my immediate thought is "looks like there's a bug I need to > track down here". The entire printf is "there's a bug I need to track down here". (null) explicitly tells me that device_get_name() is NULL when looking at the printf to see what it means. Having it be (unknown) tells me the same exact thing, but only after I've parsed an extra 2-3 lines of code to figure out what (unknown) stands for. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 15:20:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 033DC1065675; Tue, 17 Jan 2012 15:20:42 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF40C8FC16; Tue, 17 Jan 2012 15:20:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HFKfZ9095828; Tue, 17 Jan 2012 15:20:41 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HFKfTW095826; Tue, 17 Jan 2012 15:20:41 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201201171520.q0HFKfTW095826@svn.freebsd.org> From: David Chisnall Date: Tue, 17 Jan 2012 15:20:41 +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: r230267 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 15:20:42 -0000 Author: theraven Date: Tue Jan 17 15:20:41 2012 New Revision: 230267 URL: http://svn.freebsd.org/changeset/base/230267 Log: Fix clang atomic to use for atomic_is_lock_free(). Reviewed by: ed Approved by: dim (mentor) Modified: head/include/stdatomic.h Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Tue Jan 17 13:52:04 2012 (r230266) +++ head/include/stdatomic.h Tue Jan 17 15:20:41 2012 (r230267) @@ -118,7 +118,7 @@ enum memory_order { #if defined(__CLANG_ATOMICS) #define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(obj) + __atomic_is_lock_free(sizeof(obj)) #elif defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ __atomic_is_lock_free(sizeof((obj)->__val)) From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 16:10:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5E75106566B; Tue, 17 Jan 2012 16:10:42 +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 7CAF08FC0C; Tue, 17 Jan 2012 16:10:42 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 34C9E46B2C; Tue, 17 Jan 2012 11:10:42 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B4F3DB91C; Tue, 17 Jan 2012 11:10:41 -0500 (EST) From: John Baldwin To: Kevin Lo Date: Tue, 17 Jan 2012 11:05:22 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201161025.q0GAPNDq027693@svn.freebsd.org> <201201170950.15267.jhb@freebsd.org> In-Reply-To: <201201170950.15267.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201171105.23029.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Jan 2012 11:10:41 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230208 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 16:10:42 -0000 On Tuesday, January 17, 2012 9:50:15 am John Baldwin wrote: > On Monday, January 16, 2012 5:25:23 am Kevin Lo wrote: > > Author: kevlo > > Date: Mon Jan 16 10:25:22 2012 > > New Revision: 230208 > > URL: http://svn.freebsd.org/changeset/base/230208 > > > > Log: > > Add nfs export support to tmpfs(5) > > > > Reviewed by: kib > > > > Modified: > > head/sys/fs/tmpfs/tmpfs_vfsops.c > > > > Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c > > > ============================================================================== > > --- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jan 16 09:53:24 2012 (r230207) > > +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Jan 16 10:25:22 2012 (r230208) > > @@ -150,10 +150,8 @@ tmpfs_mount(struct mount *mp) > > return (EINVAL); > > > > if (mp->mnt_flag & MNT_UPDATE) { > > - /* XXX: There is no support yet to update file system > > - * settings. Should be added. */ > > - > > - return EOPNOTSUPP; > > + if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) > > + return (0); > > } > > Is it supposed to fall through if the 'export' option isn't in the list during > an update mount? Nevermind, was supposed to have deleted this from my pending send queue before it went out. This was fixed in a subsequent commit. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 16:20:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 464F31065677; Tue, 17 Jan 2012 16:20:51 +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 35D7A8FC15; Tue, 17 Jan 2012 16:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HGKpXj097742; Tue, 17 Jan 2012 16:20:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HGKpLx097740; Tue, 17 Jan 2012 16:20:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201171620.q0HGKpLx097740@svn.freebsd.org> From: Alan Cox Date: Tue, 17 Jan 2012 16:20: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: r230268 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 16:20:51 -0000 Author: alc Date: Tue Jan 17 16:20:50 2012 New Revision: 230268 URL: http://svn.freebsd.org/changeset/base/230268 Log: Explain why it is safe to unlock the vnode. Requested by: kib Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Jan 17 15:20:41 2012 (r230267) +++ head/sys/kern/imgact_elf.c Tue Jan 17 16:20:50 2012 (r230268) @@ -800,6 +800,9 @@ __CONCAT(exec_, __elfN(imgact))(struct i * than zero. Consequently, the vnode lock is not needed by vrele(). * However, in cases where the vnode lock is external, such as nullfs, * v_usecount may become zero. + * + * The VV_TEXT flag prevents modifications to the executable while + * the vnode is unlocked. */ VOP_UNLOCK(imgp->vp, 0); From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 16:48:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 881AA106566C; Tue, 17 Jan 2012 16:48:11 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 09D288FC17; Tue, 17 Jan 2012 16:48:10 +0000 (UTC) Received: by ghy10 with SMTP id 10so255332ghy.13 for ; Tue, 17 Jan 2012 08:48:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=zcBuYfYRcWwmK8wjYCSB4WGDFGUllEDOJQNeqMdfuwU=; b=QzsE6OXuWB+c2n6KTJyJt9ZsAG4XDkbKLG0sSp6Cgb0cSN3gz8v0QRhFLm5QL4XJr/ mGcFExGKOC5CuCbmcsenaCg4i98r3W1I6sBiPA9me36QfPcFytmaBShGKZwKYxmmStDF 09TeqXfsCOEDkrgQait6WyTL/4KrDQgh/JaQA= MIME-Version: 1.0 Received: by 10.50.207.72 with SMTP id lu8mr18290723igc.0.1326818890154; Tue, 17 Jan 2012 08:48:10 -0800 (PST) Sender: ermal.luci@gmail.com Received: by 10.231.134.198 with HTTP; Tue, 17 Jan 2012 08:48:10 -0800 (PST) In-Reply-To: <201201171214.q0HCEQm8089958@svn.freebsd.org> References: <201201171214.q0HCEQm8089958@svn.freebsd.org> Date: Tue, 17 Jan 2012 17:48:10 +0100 X-Google-Sender-Auth: Fn3XyeDI1_vhA9bClVKg7BKvbTM Message-ID: From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230265 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 16:48:11 -0000 Maybe it does not hurt in general to keep the V_ Some work was done to add it, no?! On Tue, Jan 17, 2012 at 1:14 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Jan 17 12:14:26 2012 > New Revision: 230265 > URL: http://svn.freebsd.org/changeset/base/230265 > > Log: > Allocate our mbuf with m_get2(). > > Modified: > head/sys/contrib/pf/net/if_pfsync.c > > Modified: head/sys/contrib/pf/net/if_pfsync.c > > ============================================================================== > --- head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:13:36 2012 > (r230264) > +++ head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:14:26 2012 > (r230265) > @@ -2121,9 +2121,6 @@ pfsync_sendout(void) > #ifdef notyet > struct tdb *t; > #endif > -#ifdef __FreeBSD__ > - size_t pktlen; > -#endif > int offset; > int q, count = 0; > > @@ -2145,44 +2142,33 @@ pfsync_sendout(void) > return; > } > > - MGETHDR(m, M_DONTWAIT, MT_DATA); > - if (m == NULL) { > #ifdef __FreeBSD__ > + m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + sc->sc_len); > + if (m == NULL) { > sc->sc_ifp->if_oerrors++; > + V_pfsyncstats.pfsyncs_onomem++; > + return; > + } > #else > + MGETHDR(m, M_DONTWAIT, MT_DATA); > + if (m == NULL) { > sc->sc_if.if_oerrors++; > -#endif > - V_pfsyncstats.pfsyncs_onomem++; > + pfsyncstats.pfsyncs_onomem++; > pfsync_drop(sc); > return; > } > > -#ifdef __FreeBSD__ > - pktlen = max_linkhdr + sc->sc_len; > - if (pktlen > MHLEN) { > - /* Find the right pool to allocate from. */ > - /* XXX: This is ugly. */ > - m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES : > -#if MJUMPAGESIZE != MCLBYTES > - pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE : > -#endif > - pktlen <= MJUM9BYTES ? MJUM9BYTES : MJUM16BYTES); > -#else > if (max_linkhdr + sc->sc_len > MHLEN) { > MCLGETI(m, M_DONTWAIT, NULL, max_linkhdr + sc->sc_len); > -#endif > if (!ISSET(m->m_flags, M_EXT)) { > m_free(m); > -#ifdef __FreeBSD__ > - sc->sc_ifp->if_oerrors++; > -#else > sc->sc_if.if_oerrors++; > -#endif > - V_pfsyncstats.pfsyncs_onomem++; > + pfsyncstats.pfsyncs_onomem++; > pfsync_drop(sc); > return; > } > } > +#endif > m->m_data += max_linkhdr; > m->m_len = m->m_pkthdr.len = sc->sc_len; > > -- Ermal From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 16:53:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2BC106566B; Tue, 17 Jan 2012 16:53:41 +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 612DF8FC0C; Tue, 17 Jan 2012 16:53:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HGrfS7098757; Tue, 17 Jan 2012 16:53:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HGrfYs098755; Tue, 17 Jan 2012 16:53:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201171653.q0HGrfYs098755@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Jan 2012 16:53:41 +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: r230269 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 16:53:41 -0000 Author: kib Date: Tue Jan 17 16:53:41 2012 New Revision: 230269 URL: http://svn.freebsd.org/changeset/base/230269 Log: Modernize the fpusave structures definitions by using uint*_t types. MFC after: 1 week Modified: head/sys/amd64/include/fpu.h Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Tue Jan 17 16:20:50 2012 (r230268) +++ head/sys/amd64/include/fpu.h Tue Jan 17 16:53:41 2012 (r230269) @@ -43,34 +43,39 @@ /* Contents of each x87 floating point accumulator */ struct fpacc87 { - u_char fp_bytes[10]; + uint8_t fp_bytes[10]; }; /* Contents of each SSE extended accumulator */ struct xmmacc { - u_char xmm_bytes[16]; + uint8_t xmm_bytes[16]; +}; + +/* Contents of the upper 16 bytes of each AVX extended accumulator */ +struct ymmacc { + uint8_t ymm_bytes[16]; }; struct envxmm { - u_int16_t en_cw; /* control word (16bits) */ - u_int16_t en_sw; /* status word (16bits) */ - u_int8_t en_tw; /* tag word (8bits) */ - u_int8_t en_zero; - u_int16_t en_opcode; /* opcode last executed (11 bits ) */ - u_int64_t en_rip; /* floating point instruction pointer */ - u_int64_t en_rdp; /* floating operand pointer */ - u_int32_t en_mxcsr; /* SSE sontorol/status register */ - u_int32_t en_mxcsr_mask; /* valid bits in mxcsr */ + uint16_t en_cw; /* control word (16bits) */ + uint16_t en_sw; /* status word (16bits) */ + uint8_t en_tw; /* tag word (8bits) */ + uint8_t en_zero; + uint16_t en_opcode; /* opcode last executed (11 bits ) */ + uint64_t en_rip; /* floating point instruction pointer */ + uint64_t en_rdp; /* floating operand pointer */ + uint32_t en_mxcsr; /* SSE sontorol/status register */ + uint32_t en_mxcsr_mask; /* valid bits in mxcsr */ }; struct savefpu { struct envxmm sv_env; struct { struct fpacc87 fp_acc; - u_char fp_pad[6]; /* padding */ + uint8_t fp_pad[6]; /* padding */ } sv_fp[8]; struct xmmacc sv_xmm[16]; - u_char sv_pad[96]; + uint8_t sv_pad[96]; } __aligned(16); #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 17:07:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 584B21065670; Tue, 17 Jan 2012 17:07: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 2CA9B8FC14; Tue, 17 Jan 2012 17:07:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HH7EON099244; Tue, 17 Jan 2012 17:07:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HH7EgG099241; Tue, 17 Jan 2012 17:07:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201171707.q0HH7EgG099241@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Jan 2012 17:07: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: r230270 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 17:07:14 -0000 Author: kib Date: Tue Jan 17 17:07:13 2012 New Revision: 230270 URL: http://svn.freebsd.org/changeset/base/230270 Log: Add definitions for the FPU extended state header, legacy extended state and AVX state. MFC after: 1 week Modified: head/sys/amd64/include/fpu.h head/sys/i386/include/npx.h Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Tue Jan 17 16:53:41 2012 (r230269) +++ head/sys/amd64/include/fpu.h Tue Jan 17 17:07:13 2012 (r230270) @@ -78,6 +78,28 @@ struct savefpu { uint8_t sv_pad[96]; } __aligned(16); +struct xstate_hdr { + uint64_t xstate_bv; + uint8_t xstate_rsrv0[16]; + uint8_t xstate_rsrv[40]; +}; + +struct savefpu_xstate { + struct xstate_hdr sx_hd; + struct ymmacc sx_ymm[16]; +}; + +struct savefpu_ymm { + struct envxmm sv_env; + struct { + struct fpacc87 fp_acc; + int8_t fp_pad[6]; /* padding */ + } sv_fp[8]; + struct xmmacc sv_xmm[16]; + uint8_t sv_pad[96]; + struct savefpu_xstate sv_xstate; +} __aligned(64); + #ifdef _KERNEL struct fpu_kern_ctx { struct savefpu hwstate; Modified: head/sys/i386/include/npx.h ============================================================================== --- head/sys/i386/include/npx.h Tue Jan 17 16:53:41 2012 (r230269) +++ head/sys/i386/include/npx.h Tue Jan 17 17:07:13 2012 (r230270) @@ -101,6 +101,11 @@ struct xmmacc { u_char xmm_bytes[16]; }; +/* Contents of the upper 16 bytes of each AVX extended accumulator */ +struct ymmacc { + uint8_t ymm_bytes[16]; +}; + struct savexmm { struct envxmm sv_env; struct { @@ -116,6 +121,28 @@ union savefpu { struct savexmm sv_xmm; }; +struct xstate_hdr { + uint64_t xstate_bv; + uint8_t xstate_rsrv0[16]; + uint8_t xstate_rsrv[40]; +}; + +struct savexmm_xstate { + struct xstate_hdr sx_hd; + struct ymmacc sx_ymm[16]; +}; + +struct savexmm_ymm { + struct envxmm sv_env; + struct { + struct fpacc87 fp_acc; + int8_t fp_pad[6]; /* padding */ + } sv_fp[8]; + struct xmmacc sv_xmm[16]; + uint8_t sv_pad[96]; + struct savexmm_xstate sv_xstate; +} __aligned(64); + /* * The hardware default control word for i387's and later coprocessors is * 0x37F, giving: From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 17:13:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ED551065670; Tue, 17 Jan 2012 17:13:07 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2B43C8FC0C; Tue, 17 Jan 2012 17:13:05 +0000 (UTC) Received: by lahe6 with SMTP id e6so452185lah.13 for ; Tue, 17 Jan 2012 09:13:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=o1PAITWtmJnqcJmjQD/j4+jc7rm6oir8IxbLXu1ED3M=; b=qvuStx+uB6yohu2px+5jPXGsrMYC4izlnZH2o7ecNqovBxzdOrkzRtqHn499pLzXXX 57vcR5VbV/sx2ubjj5Rb6V6GeQxSRVAVdCIbpm8xxU09cLnfXN4R1gjMc93kvtmA6wAj 1BGDK9LxICKRja8gzVhh39DeGL8ejy4V20Jro= Received: by 10.112.39.138 with SMTP id p10mr4333290lbk.98.1326820385093; Tue, 17 Jan 2012 09:13:05 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.21.168 with HTTP; Tue, 17 Jan 2012 09:12:34 -0800 (PST) In-Reply-To: <201201171008.28752.jhb@freebsd.org> References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F136109.9050004@FreeBSD.org> <4F13621B.1060203@freebsd.org> <201201171008.28752.jhb@freebsd.org> From: Eitan Adler Date: Tue, 17 Jan 2012 12:12:34 -0500 X-Google-Sender-Auth: UGXj5adH7ia9xOY27kAfd-_-bhw Message-ID: To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 17:13:07 -0000 On Tue, Jan 17, 2012 at 10:08 AM, John Baldwin wrote: > On Sunday, January 15, 2012 6:32:43 pm Colin Percival wrote: >> On 01/15/12 15:28, John Baldwin wrote: >> > On 1/15/12 2:09 AM, Eitan Adler wrote: >> >> Log: >> >> =C2=A0 =C2=A0- Fix undefined behavior when device_get_name is null >> >> =C2=A0 =C2=A0- Make error message more informative >> > >> > The in-kernel printf(9) always prints "(null)" for %s when the pointer= is NULL, >> > so that wasn't undefined behavior. =C2=A0Printing out the driver name = is a useful >> > change, but the "(unknown)" bits are just noise as it isn't clear that >> > "(unknown)" is substantially better than "(null)". >> >> I think the change from "(null)" to "(unknown)" is useful, since when I = see >> "(null)" printed my immediate thought is "looks like there's a bug I nee= d to >> track down here". > > The entire printf is "there's a bug I need to track down here". =C2=A0(nu= ll) > explicitly tells me that device_get_name() is NULL when looking at the pr= intf > to see what it means. =C2=A0Having it be (unknown) tells me the same exac= t thing, > but only after I've parsed an extra 2-3 lines of code to figure out what > (unknown) stands for. To me seeing "(null)" from the output of printf indicates "There is a bug here, printf should never be given a NULL argument.". However, given that it isn't undefined here, and the objections I've received I will revert this part of the change when I get home. --=20 Eitan Adler Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 17:22:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75C18106566C; Tue, 17 Jan 2012 17:22:20 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 20D2B8FC08; Tue, 17 Jan 2012 17:22:19 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q0HHMIJT039900; Tue, 17 Jan 2012 18:22:18 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q0HHMIt3039899; Tue, 17 Jan 2012 18:22:18 +0100 (CET) (envelope-from marius) Date: Tue, 17 Jan 2012 18:22:18 +0100 From: Marius Strobl To: Ed Schouten Message-ID: <20120117172218.GZ44286@alchemy.franken.de> References: <201201121755.q0CHtMA2020344@svn.freebsd.org> <20120113000057.GA23960@alchemy.franken.de> <20120117145505.GG95413@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5/uDoXvLw7AC5HRs" Content-Disposition: inline In-Reply-To: <20120117145505.GG95413@hoeg.nl> 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: r230025 - head/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 17:22:20 -0000 --5/uDoXvLw7AC5HRs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 17, 2012 at 03:55:05PM +0100, Ed Schouten wrote: > Hi Marius, > > * Marius Strobl , 20120113 01:00: > > Uhm, these are V8-specific, for V9 the C compiler frame size should > > be 192 instead of 64 and the function alignment should be 32 instead > > of 4 bytes (at least with GCC and US1-optimizations enabled as we > > default to on sparc64), see . However, given that > > these functions only seem to obtain new register window for > > debugging purposes you probably alternatively could just remove > > the saves and the corresponding restores completely. > > Any comments on the attached patch? > Index: divmod.m4 =================================================================== --- divmod.m4 (revision 230265) +++ divmod.m4 (working copy) @@ -235,7 +236,6 @@ got_result: tst SIGN bge 1f - restore ! answer < 0 retl ! leaf-routine return ifelse( ANSWER, `quotient', Sorry, on closer inspection you cannot just litteraly remove the restore in this case. The problem is that both bge and retl are delayed control-transfer instructions and the restore is done in the delay slot of the bge, which means it's actually execetuted before the branch (in FreeBSD source we usually mark this via an additional space character before the instruction in a delay slot so it's easier to spot). If you just remove the restore retl is now in the delay slot of bge, which gives wrong behavior. You therefore either need to replace it with a nop or you can actually take advantage of the delay slots like done in the attached patch (untested). Marius --5/uDoXvLw7AC5HRs Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sparc.diff" Index: divmod.m4 =================================================================== --- divmod.m4 (revision 230267) +++ divmod.m4 (working copy) @@ -59,9 +59,6 @@ define(SC,`%g2') #include "../assembly.h" -.text - .align 4 - define(DEVELOP_QUOTIENT_BITS, ` !depth $1, accumulated bits $2 bl L.$1.eval(TWOSUPN+$2) @@ -84,12 +81,14 @@ L.$1.eval(TWOSUPN+$2): ifelse( $1, 1, `9:') ') ifelse( ANSWER, `quotient', ` +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__udivsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,SIGN ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__divsi3) - save %sp,-64,%sp ! do this for debugging orcc divisor,dividend,%g0 ! are either dividend or divisor negative bge divide ! if not, skip this junk xor divisor,dividend,SIGN ! record sign of result in sign of SIGN @@ -104,12 +103,14 @@ DEFINE_COMPILERRT_FUNCTION(__divsi3) neg dividend ! FALL THROUGH ',` +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__umodsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,SIGN ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__modsi3) - save %sp,-64,%sp ! do this for debugging orcc divisor,dividend,%g0 ! are either dividend or divisor negative bge divide ! if not, skip this junk mov dividend,SIGN ! record sign of result in sign of SIGN @@ -184,8 +185,8 @@ do_single_div: nop sub R,V,R mov 1,Q - b end_single_divloop - nop + b,a end_single_divloop + ! EMPTY single_divloop: sll Q,1,Q bl 1f @@ -202,8 +203,8 @@ single_divloop: deccc SC bge single_divloop tst R - b end_regular_divide - nop + b,a end_regular_divide + ! EMPTY not_really_big: 1: @@ -224,9 +225,8 @@ end_regular_divide: deccc ITER bge divloop tst R - bge got_result - nop - ! non-restoring fixup here + bl,a got_result + ! non-restoring fixup if remainder < 0, otherwise annulled ifelse( ANSWER, `quotient', ` dec Q ',` add R,divisor,R @@ -234,13 +234,11 @@ ifelse( ANSWER, `quotient', got_result: tst SIGN - bge 1f - restore - ! answer < 0 - retl ! leaf-routine return + bl,a 1f + ! negate for answer < 0, otherwise annulled ifelse( ANSWER, `quotient', -` neg %o2,%o0 ! quotient <- -Q -',` neg %o3,%o0 ! remainder <- -R +` neg %o2,%o2 ! Q <- -Q +',` neg %o3,%o3 ! R <- -R ') 1: retl ! leaf-routine return --5/uDoXvLw7AC5HRs-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 17:29:11 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D85106564A; Tue, 17 Jan 2012 17:29:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E39538FC2C; Tue, 17 Jan 2012 17:29:09 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA12101; Tue, 17 Jan 2012 19:29:07 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <4F15AFE2.8000600@FreeBSD.org> Date: Tue, 17 Jan 2012 19:29:06 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120111 Thunderbird/9.0 MIME-Version: 1.0 To: Eitan Adler References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F136109.9050004@FreeBSD.org> <4F13621B.1060203@freebsd.org> <201201171008.28752.jhb@freebsd.org> In-Reply-To: X-Enigmail-Version: undefined 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, Colin Percival , John Baldwin Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 17:29:11 -0000 on 17/01/2012 19:12 Eitan Adler said the following: > To me seeing "(null)" from the output of printf indicates "There is a > bug here, printf should never be given a NULL argument.". > However, given that it isn't undefined here, and the objections I've > received I will revert this part of the change when I get home. Would this be worth the hassle now that the change is already committed? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 17:30:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 607F3106564A; Tue, 17 Jan 2012 17:30:03 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3FB8FC18; Tue, 17 Jan 2012 17:30:02 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id BEE411398B6; Tue, 17 Jan 2012 19:10:33 +0200 (EET) Date: Tue, 17 Jan 2012 19:10:31 +0200 From: Jaakko Heinonen To: Kevin Lo Message-ID: <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201170125.q0H1PrlJ061058@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 17:30:03 -0000 On 2012-01-17, Kevin Lo wrote: > Return EOPNOTSUPP since we only support update mounts for NFS export. > > @@ -150,8 +150,12 @@ tmpfs_mount(struct mount *mp) > return (EINVAL); > > if (mp->mnt_flag & MNT_UPDATE) { > + /* > + * Only support update mounts for NFS export. > + */ > if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) > return (0); > + return (EOPNOTSUPP); > } This doesn't look correct. As long as the option list includes the "export" option, all options are accepted. An example: # mount -u -o ro /mnt mount: tmpfs : Operation not supported # mount -u -o ro,export /mnt # -- Jaakko From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 17:53:25 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5932A106566C; Tue, 17 Jan 2012 17:53:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id E28F08FC20; Tue, 17 Jan 2012 17:53:24 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0HHrN6J023255; Tue, 17 Jan 2012 21:53:23 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0HHrNdC023254; Tue, 17 Jan 2012 21:53:23 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Jan 2012 21:53:23 +0400 From: Gleb Smirnoff To: Ermal Lu?i Message-ID: <20120117175323.GH12760@FreeBSD.org> References: <201201171214.q0HCEQm8089958@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230265 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 17:53:25 -0000 On Tue, Jan 17, 2012 at 05:48:10PM +0100, Ermal Lu?i wrote: E> Maybe it does not hurt in general to keep the V_ E> Some work was done to add it, no?! The V_ has been left under __FreeBSD__. E> On Tue, Jan 17, 2012 at 1:14 PM, Gleb Smirnoff wrote: E> E> > Author: glebius E> > Date: Tue Jan 17 12:14:26 2012 E> > New Revision: 230265 E> > URL: http://svn.freebsd.org/changeset/base/230265 E> > E> > Log: E> > Allocate our mbuf with m_get2(). E> > E> > Modified: E> > head/sys/contrib/pf/net/if_pfsync.c E> > E> > Modified: head/sys/contrib/pf/net/if_pfsync.c E> > E> > ============================================================================== E> > --- head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:13:36 2012 E> > (r230264) E> > +++ head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:14:26 2012 E> > (r230265) E> > @@ -2121,9 +2121,6 @@ pfsync_sendout(void) E> > #ifdef notyet E> > struct tdb *t; E> > #endif E> > -#ifdef __FreeBSD__ E> > - size_t pktlen; E> > -#endif E> > int offset; E> > int q, count = 0; E> > E> > @@ -2145,44 +2142,33 @@ pfsync_sendout(void) E> > return; E> > } E> > E> > - MGETHDR(m, M_DONTWAIT, MT_DATA); E> > - if (m == NULL) { E> > #ifdef __FreeBSD__ E> > + m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + sc->sc_len); E> > + if (m == NULL) { E> > sc->sc_ifp->if_oerrors++; E> > + V_pfsyncstats.pfsyncs_onomem++; E> > + return; E> > + } E> > #else E> > + MGETHDR(m, M_DONTWAIT, MT_DATA); E> > + if (m == NULL) { E> > sc->sc_if.if_oerrors++; E> > -#endif E> > - V_pfsyncstats.pfsyncs_onomem++; E> > + pfsyncstats.pfsyncs_onomem++; E> > pfsync_drop(sc); E> > return; E> > } E> > E> > -#ifdef __FreeBSD__ E> > - pktlen = max_linkhdr + sc->sc_len; E> > - if (pktlen > MHLEN) { E> > - /* Find the right pool to allocate from. */ E> > - /* XXX: This is ugly. */ E> > - m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES : E> > -#if MJUMPAGESIZE != MCLBYTES E> > - pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE : E> > -#endif E> > - pktlen <= MJUM9BYTES ? MJUM9BYTES : MJUM16BYTES); E> > -#else E> > if (max_linkhdr + sc->sc_len > MHLEN) { E> > MCLGETI(m, M_DONTWAIT, NULL, max_linkhdr + sc->sc_len); E> > -#endif E> > if (!ISSET(m->m_flags, M_EXT)) { E> > m_free(m); E> > -#ifdef __FreeBSD__ E> > - sc->sc_ifp->if_oerrors++; E> > -#else E> > sc->sc_if.if_oerrors++; E> > -#endif E> > - V_pfsyncstats.pfsyncs_onomem++; E> > + pfsyncstats.pfsyncs_onomem++; E> > pfsync_drop(sc); E> > return; E> > } E> > } E> > +#endif E> > m->m_data += max_linkhdr; E> > m->m_len = m->m_pkthdr.len = sc->sc_len; E> > E> > E> E> E> -- E> Ermal -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 18:10:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBF81065675; Tue, 17 Jan 2012 18:10:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA188FC1A; Tue, 17 Jan 2012 18:10:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HIAPTS001716; Tue, 17 Jan 2012 18:10:25 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HIAPCs001714; Tue, 17 Jan 2012 18:10:25 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201171810.q0HIAPCs001714@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 17 Jan 2012 18: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: r230272 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 18:10:25 -0000 Author: glebius Date: Tue Jan 17 18:10:25 2012 New Revision: 230272 URL: http://svn.freebsd.org/changeset/base/230272 Log: The newhook method can be called in ISR context at certain circumstances, so better use M_NOWAIT in it. Modified: head/sys/netgraph/ng_tag.c Modified: head/sys/netgraph/ng_tag.c ============================================================================== --- head/sys/netgraph/ng_tag.c Tue Jan 17 18:05:13 2012 (r230271) +++ head/sys/netgraph/ng_tag.c Tue Jan 17 18:10:25 2012 (r230272) @@ -303,8 +303,9 @@ ng_tag_newhook(node_p node, hook_p hook, int error; /* Create hook private structure. */ - hip = malloc(sizeof(*hip), M_NETGRAPH_TAG, M_WAITOK | M_ZERO); - /* M_WAITOK can't return NULL. */ + hip = malloc(sizeof(*hip), M_NETGRAPH_TAG, M_NOWAIT | M_ZERO); + if (hip == NULL) + return (ENOMEM); NG_HOOK_SET_PRIVATE(hook, hip); /* From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 18:20:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47B3A106564A; Tue, 17 Jan 2012 18:20:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 369218FC1A; Tue, 17 Jan 2012 18:20:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HIKZaU002077; Tue, 17 Jan 2012 18:20:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HIKZX8002075; Tue, 17 Jan 2012 18:20:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201171820.q0HIKZX8002075@svn.freebsd.org> From: Adrian Chadd Date: Tue, 17 Jan 2012 18:20: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: r230273 - head/sys/modules/wtap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 18:20:35 -0000 Author: adrian Date: Tue Jan 17 18:20:34 2012 New Revision: 230273 URL: http://svn.freebsd.org/changeset/base/230273 Log: Tidy-up. Modified: head/sys/modules/wtap/Makefile Modified: head/sys/modules/wtap/Makefile ============================================================================== --- head/sys/modules/wtap/Makefile Tue Jan 17 18:10:25 2012 (r230272) +++ head/sys/modules/wtap/Makefile Tue Jan 17 18:20:34 2012 (r230273) @@ -1,11 +1,11 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../dev/wtap # Declare Name of kernel module KMOD = wtap # Enumerate Source files for kernel module +.PATH: ${.CURDIR}/../../dev/wtap SRCS = if_wtap_module.c if_wtap.c if_medium.c .PATH: ${.CURDIR}/../../dev/wtap/wtap_hal From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 18:48:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C88A1065674; Tue, 17 Jan 2012 18:48:11 +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 710AB8FC0A; Tue, 17 Jan 2012 18:48:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 27C5A46B2E; Tue, 17 Jan 2012 13:48:11 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A8E24B95C; Tue, 17 Jan 2012 13:48:10 -0500 (EST) From: John Baldwin To: Andriy Gapon Date: Tue, 17 Jan 2012 13:48:10 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F15AFE2.8000600@FreeBSD.org> In-Reply-To: <4F15AFE2.8000600@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201171348.10192.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Jan 2012 13:48:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler , Colin Percival Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 18:48:11 -0000 On Tuesday, January 17, 2012 12:29:06 pm Andriy Gapon wrote: > on 17/01/2012 19:12 Eitan Adler said the following: > > To me seeing "(null)" from the output of printf indicates "There is a > > bug here, printf should never be given a NULL argument.". > > However, given that it isn't undefined here, and the objections I've > > received I will revert this part of the change when I get home. > > Would this be worth the hassle now that the change is already committed? Probably not, though at some point if the printf is reworked for some other reason it could be removed then. I don't think we need to add more special case handling for NULL string pointers passed to kernel printf in the future, however. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 19:07:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 3041F1065675; Tue, 17 Jan 2012 19:07:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 5DFB914D9B9; Tue, 17 Jan 2012 19:07:34 +0000 (UTC) Message-ID: <4F15C6F5.6000809@FreeBSD.org> Date: Tue, 17 Jan 2012 11:07:33 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: John Baldwin References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F15AFE2.8000600@FreeBSD.org> <201201171348.10192.jhb@freebsd.org> In-Reply-To: <201201171348.10192.jhb@freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, Andriy Gapon , Colin Percival , svn-src-head@freebsd.org Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 19:07:39 -0000 On 01/17/2012 10:48, John Baldwin wrote: > On Tuesday, January 17, 2012 12:29:06 pm Andriy Gapon wrote: >> on 17/01/2012 19:12 Eitan Adler said the following: >>> To me seeing "(null)" from the output of printf indicates "There is a >>> bug here, printf should never be given a NULL argument.". >>> However, given that it isn't undefined here, and the objections I've >>> received I will revert this part of the change when I get home. >> >> Would this be worth the hassle now that the change is already committed? > > Probably not, though at some point if the printf is reworked for some other > reason it could be removed then. I don't think we need to add more special > case handling for NULL string pointers passed to kernel printf in the future, > however. If it needs to be changed, it should be done sooner than later. It's not as if we're carving the bits out of stone after all. :) -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 19:31:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 141A4106566C; Tue, 17 Jan 2012 19:31: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 031578FC12; Tue, 17 Jan 2012 19:31:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HJV3sO004442; Tue, 17 Jan 2012 19:31:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HJV3F1004440; Tue, 17 Jan 2012 19:31:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201171931.q0HJV3F1004440@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 17 Jan 2012 19:31: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: r230275 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 19:31:04 -0000 Author: yongari Date: Tue Jan 17 19:31:03 2012 New Revision: 230275 URL: http://svn.freebsd.org/changeset/base/230275 Log: Use a RX DMA tag to free loaded RX DMA maps. Previously it used a TX DMA tag. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Jan 17 18:54:50 2012 (r230274) +++ head/sys/dev/re/if_re.c Tue Jan 17 19:31:03 2012 (r230275) @@ -3576,7 +3576,7 @@ re_stop(struct rl_softc *sc) for (i = 0; i < sc->rl_ldata.rl_rx_desc_cnt; i++) { rxd = &sc->rl_ldata.rl_rx_desc[i]; if (rxd->rx_m != NULL) { - bus_dmamap_sync(sc->rl_ldata.rl_tx_mtag, + bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag, rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->rl_ldata.rl_rx_mtag, rxd->rx_dmamap); From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 19:36:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7FB21065673; Tue, 17 Jan 2012 19:36:53 +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 D6EA38FC08; Tue, 17 Jan 2012 19:36:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HJarq0004649; Tue, 17 Jan 2012 19:36:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HJarSH004647; Tue, 17 Jan 2012 19:36:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201171936.q0HJarSH004647@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 17 Jan 2012 19:36: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: r230276 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 19:36:54 -0000 Author: yongari Date: Tue Jan 17 19:36:53 2012 New Revision: 230276 URL: http://svn.freebsd.org/changeset/base/230276 Log: Free allocated jumbo buffers when controller is stopped. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Jan 17 19:31:03 2012 (r230275) +++ head/sys/dev/re/if_re.c Tue Jan 17 19:36:53 2012 (r230276) @@ -3558,7 +3558,6 @@ re_stop(struct rl_softc *sc) } /* Free the TX list buffers. */ - for (i = 0; i < sc->rl_ldata.rl_tx_desc_cnt; i++) { txd = &sc->rl_ldata.rl_tx_desc[i]; if (txd->tx_m != NULL) { @@ -3572,7 +3571,6 @@ re_stop(struct rl_softc *sc) } /* Free the RX list buffers. */ - for (i = 0; i < sc->rl_ldata.rl_rx_desc_cnt; i++) { rxd = &sc->rl_ldata.rl_rx_desc[i]; if (rxd->rx_m != NULL) { @@ -3584,6 +3582,20 @@ re_stop(struct rl_softc *sc) rxd->rx_m = NULL; } } + + if ((sc->rl_flags & RL_FLAG_JUMBOV2) != 0) { + for (i = 0; i < sc->rl_ldata.rl_rx_desc_cnt; i++) { + rxd = &sc->rl_ldata.rl_jrx_desc[i]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->rl_ldata.rl_jrx_mtag, + rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rl_ldata.rl_jrx_mtag, + rxd->rx_dmamap); + m_freem(rxd->rx_m); + rxd->rx_m = NULL; + } + } + } } /* From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 19:44:31 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D99A6106564A; Tue, 17 Jan 2012 19:44:31 +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 A4D5B8FC15; Tue, 17 Jan 2012 19:44:31 +0000 (UTC) Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.5/8.14.5) with ESMTP id q0HJMR1g084867; Tue, 17 Jan 2012 12:22:27 -0700 (MST) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <201201171008.28752.jhb@freebsd.org> Date: Tue, 17 Jan 2012 12:22:26 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201150709.q0F79Iif067938@svn.freebsd.org> <4F136109.9050004@FreeBSD.org> <4F13621B.1060203@freebsd.org> <201201171008.28752.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1251.1) 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, Eitan Adler , Colin Percival Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 19:44:31 -0000 On Jan 17, 2012, at 8:08 AM, John Baldwin wrote: > On Sunday, January 15, 2012 6:32:43 pm Colin Percival wrote: >> On 01/15/12 15:28, John Baldwin wrote: >>> On 1/15/12 2:09 AM, Eitan Adler wrote: >>>> Log: >>>> - Fix undefined behavior when device_get_name is null >>>> - Make error message more informative >>>=20 >>> The in-kernel printf(9) always prints "(null)" for %s when the = pointer is NULL, >>> so that wasn't undefined behavior. Printing out the driver name is = a useful >>> change, but the "(unknown)" bits are just noise as it isn't clear = that >>> "(unknown)" is substantially better than "(null)". >>=20 >> I think the change from "(null)" to "(unknown)" is useful, since when = I see >> "(null)" printed my immediate thought is "looks like there's a bug I = need to >> track down here". >=20 > The entire printf is "there's a bug I need to track down here". = (null) > explicitly tells me that device_get_name() is NULL when looking at the = printf > to see what it means. Having it be (unknown) tells me the same exact = thing, > but only after I've parsed an extra 2-3 lines of code to figure out = what > (unknown) stands for. >=20 I like that change. "null" is ambiguous for those who aren't intimately = familiar with the bus code. Scott From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 20:21:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 412A2106564A; Tue, 17 Jan 2012 20:21:32 +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 EA53A8FC0C; Tue, 17 Jan 2012 20:21:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HKLVdi006010; Tue, 17 Jan 2012 20:21:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HKLVQW006008; Tue, 17 Jan 2012 20:21:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201172021.q0HKLVQW006008@svn.freebsd.org> From: Ed Schouten Date: Tue, 17 Jan 2012 20:21: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: r230277 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 20:21:32 -0000 Author: ed Date: Tue Jan 17 20:21:31 2012 New Revision: 230277 URL: http://svn.freebsd.org/changeset/base/230277 Log: Don't expose __generic() when not using C++. According to the GCC documentation, the constructs used to implement are only available in C mode. They only cause breakage when used used with g++. Reported by: tijl Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Jan 17 19:36:53 2012 (r230276) +++ head/sys/sys/cdefs.h Tue Jan 17 20:21:31 2012 (r230277) @@ -260,7 +260,7 @@ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #define __generic(expr, t, yes, no) \ _Generic(expr, t: yes, default: no) -#elif __GNUC_PREREQ__(3, 1) +#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __generic(expr, t, yes, no) \ __builtin_choose_expr( \ __builtin_types_compatible_p(__typeof(expr), t), yes, no) From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 20:22:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B08B51065670; Tue, 17 Jan 2012 20:22:10 +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 A00788FC1D; Tue, 17 Jan 2012 20:22:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HKMABK006085; Tue, 17 Jan 2012 20:22:10 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HKMAsP006083; Tue, 17 Jan 2012 20:22:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201172022.q0HKMAsP006083@svn.freebsd.org> From: Ed Schouten Date: Tue, 17 Jan 2012 20:22: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: r230278 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 20:22:10 -0000 Author: ed Date: Tue Jan 17 20:22:10 2012 New Revision: 230278 URL: http://svn.freebsd.org/changeset/base/230278 Log: Only use the static assertion when __generic is available. Reported by: tijl Modified: head/include/complex.h Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Tue Jan 17 20:21:31 2012 (r230277) +++ head/include/complex.h Tue Jan 17 20:22:10 2012 (r230278) @@ -36,6 +36,9 @@ #define _Complex __complex__ #endif #define _Complex_I ((float _Complex)1.0i) +#endif + +#ifdef __generic _Static_assert(__generic(_Complex_I, float _Complex, 1, 0), "_Complex_I must be of type float _Complex"); #endif From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 20:34:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B0641065675; Tue, 17 Jan 2012 20:34:09 +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 6FA7E8FC24; Tue, 17 Jan 2012 20:34:09 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 8968446B09; Tue, 17 Jan 2012 15:34:08 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 17756B91C; Tue, 17 Jan 2012 15:34:08 -0500 (EST) From: John Baldwin To: Scott Long Date: Tue, 17 Jan 2012 14:34:03 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201150709.q0F79Iif067938@svn.freebsd.org> <201201171008.28752.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201171434.03633.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 17 Jan 2012 15:34:08 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler , Colin Percival Subject: Re: svn commit: r230125 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 20:34:09 -0000 On Tuesday, January 17, 2012 2:22:26 pm Scott Long wrote: > On Jan 17, 2012, at 8:08 AM, John Baldwin wrote: > > On Sunday, January 15, 2012 6:32:43 pm Colin Percival wrote: > >> On 01/15/12 15:28, John Baldwin wrote: > >>> On 1/15/12 2:09 AM, Eitan Adler wrote: > >>>> Log: > >>>> - Fix undefined behavior when device_get_name is null > >>>> - Make error message more informative > >>> > >>> The in-kernel printf(9) always prints "(null)" for %s when the pointer is NULL, > >>> so that wasn't undefined behavior. Printing out the driver name is a useful > >>> change, but the "(unknown)" bits are just noise as it isn't clear that > >>> "(unknown)" is substantially better than "(null)". > >> > >> I think the change from "(null)" to "(unknown)" is useful, since when I see > >> "(null)" printed my immediate thought is "looks like there's a bug I need to > >> track down here". > > > > The entire printf is "there's a bug I need to track down here". (null) > > explicitly tells me that device_get_name() is NULL when looking at the printf > > to see what it means. Having it be (unknown) tells me the same exact thing, > > but only after I've parsed an extra 2-3 lines of code to figure out what > > (unknown) stands for. > > > > I like that change. "null" is ambiguous for those who aren't intimately familiar with the bus code. Bruce suggested in another e-mail that the entire printf should be using device_printf() instead which would also use 'unknown', but spelled slightly differently (and consistent with other device messages). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 20:37:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F6101065676; Tue, 17 Jan 2012 20:37:16 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 0547C8FC1C; Tue, 17 Jan 2012 20:37:15 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 210262A28CC3; Tue, 17 Jan 2012 21:37:15 +0100 (CET) Date: Tue, 17 Jan 2012 21:37:15 +0100 From: Ed Schouten To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120117203715.GL95413@hoeg.nl> References: <201201172021.q0HKLVQW006008@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dzI2QqkSBOAresgT" Content-Disposition: inline In-Reply-To: <201201172021.q0HKLVQW006008@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230277 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 20:37:16 -0000 --dzI2QqkSBOAresgT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten , 20120117 21:21: > Don't expose __generic() when not using C++. d'oh! I mean the opposite. Don't expose __generic() when using C++. --=20 Ed Schouten WWW: http://80386.nl/ --dzI2QqkSBOAresgT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPFdv6AAoJEG5e2P40kaK70DcQAJabTqq2zT3q4sSdF0VtMAyg ICJgOTxluV9nQMB2JUMMdI7Fs6AXpVl8pUDgL7vco5ps6t+70V9KYPo9OziFCicx Y4HxFE8AvEpL9RvAY93Ngr7QxRgBxKBTTwnN4rr9/emAqra68SIb2HL2jvXSHdst vD37PNXq3jBXz/f0ApF41q6sg6wk09H7q4q3EuRITHwqswyQRnmRLF+/JS14GzKn 82HD66x7MdZiw4q5CXcgV8XEaVz8cLr8tNFY286Xfih0pln+H7Elf1890PbTeq1H xt+Paxy0bzliq3er/KvGoHIo+qBP5iKXsp0oi2SaeCxEe+DIWnVxL7Iib2grF4LX pMzAr1G8RbPY2fzOZydSlNjQwgAGJKjFN9MSMtkC7Mv7Gk5RkGuq1A1iOyvh2F5k OV/7kjdIswbV14VVKaaaitRceEwu6KSCmtmCrJl9HMhwiYMhcbYsC3JEfxZe9XA6 ZlI6bmZucipsesOzIrSFsL0OlNAACL8JNvb2Dt/ftEzpwJFTLizCx7WT6ylB5EOl Bra8or5scTZ/wg+bP43qyMYRdVFHjMGx9Kjjm1+mdFMYKD3JCQBzDxaCD8trO7G7 /9q5mpJICotudErAjo2byK4Zdg51lOe7Ak6JsynWEjTGd+6w43tNNt+5wdMku9zd 9tipfs6LEkk0TEXbYx5v =Wu09 -----END PGP SIGNATURE----- --dzI2QqkSBOAresgT-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 20:39:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97338106564A; Tue, 17 Jan 2012 20:39:34 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 862108FC1B; Tue, 17 Jan 2012 20:39:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HKdYFr006689; Tue, 17 Jan 2012 20:39:34 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HKdYPB006687; Tue, 17 Jan 2012 20:39:34 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201172039.q0HKdYPB006687@svn.freebsd.org> From: Hiroki Sato Date: Tue, 17 Jan 2012 20:39: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: r230279 - head/usr.sbin/ypserv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 20:39:34 -0000 Author: hrs Date: Tue Jan 17 20:39:33 2012 New Revision: 230279 URL: http://svn.freebsd.org/changeset/base/230279 Log: Revert changes in r228790. It prevented the ypserv daemon from working with with multiple socktypes. Modified: head/usr.sbin/ypserv/yp_main.c Modified: head/usr.sbin/ypserv/yp_main.c ============================================================================== --- head/usr.sbin/ypserv/yp_main.c Tue Jan 17 20:22:10 2012 (r230278) +++ head/usr.sbin/ypserv/yp_main.c Tue Jan 17 20:39:33 2012 (r230279) @@ -256,7 +256,6 @@ create_service(const int sock, const str const struct __rpc_sockinfo *si) { int error; - char *sname; SVCXPRT *transp; struct addrinfo hints, *res, *res0; @@ -264,7 +263,6 @@ create_service(const int sock, const str struct bindaddrlistent *blep; struct netbuf svcaddr; - sname = NULL; SLIST_INIT(&sle_head); memset(&hints, 0, sizeof(hints)); memset(&svcaddr, 0, sizeof(svcaddr)); @@ -344,6 +342,7 @@ create_service(const int sock, const str if (strncmp("0", servname, 1) == 0) { struct sockaddr *sap; socklen_t slen; + char *sname; sname = malloc(NI_MAXSERV); if (sname == NULL) { @@ -444,7 +443,6 @@ create_service(const int sock, const str } /* XXX: ignore error intentionally */ rpcb_set(YPPROG, YPVERS, nconf, &svcaddr); - free(sname); freeaddrinfo(res0); return 0; } From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 21:00:00 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 299E3106564A; Tue, 17 Jan 2012 21:00:00 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7C6128FC0C; Tue, 17 Jan 2012 20:59:59 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0HKxksI051446; Wed, 18 Jan 2012 05:59:56 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0HKxiwf099011; Wed, 18 Jan 2012 05:59:46 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 18 Jan 2012 05:57:16 +0900 (JST) Message-Id: <20120118.055716.647522865702856321.hrs@allbsd.org> To: eadler@FreeBSD.org From: Hiroki Sato In-Reply-To: <201112212027.pBLKRfPK084637@svn.freebsd.org> References: <201112212027.pBLKRfPK084637@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3.51 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jan_18_05_57_16_2012_764)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Wed, 18 Jan 2012 05:59:57 +0900 (JST) X-Spam-Status: No, score=-102.4 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, FSL_RU_URL, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r228790 - in head/usr.sbin: fwcontrol newsyslog ypserv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 21:00:00 -0000 ----Security_Multipart(Wed_Jan_18_05_57_16_2012_764)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eitan Adler wrote in <201112212027.pBLKRfPK084637@svn.freebsd.org>: ea> Author: eadler (ports committer) ea> Date: Wed Dec 21 20:27:41 2011 ea> New Revision: 228790 ea> URL: http://svn.freebsd.org/changeset/base/228790 ea> ea> Log: ea> - Remove extraneous null ptr deref checks ea> - Fix memory leak ea> ea> Submitted by: Slono Slono ea> Approved by: jhb ea> MFC after: 1 week ea> ea> Modified: ea> head/usr.sbin/fwcontrol/fwcontrol.c ea> head/usr.sbin/newsyslog/newsyslog.c ea> head/usr.sbin/ypserv/yp_main.c I suspects you did not test ypserv after this change. Freeing the pointer sname at the end of create_service() is completely wrong and probably people get the following error message when invoking ypserv: getaddrinfo(): servname not supported for ai_socktype -- Hiroki ----Security_Multipart(Wed_Jan_18_05_57_16_2012_764)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8V4KwACgkQTyzT2CeTzy1vzgCfWz67OCry7fRH5m9rJzqAXcog Q18AnRy17FU/oYpEtgjcSW4M8281e81i =cFSe -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jan_18_05_57_16_2012_764)---- From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 21:16:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B817106566C; Tue, 17 Jan 2012 21:16:47 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0818FC1A; Tue, 17 Jan 2012 21:16:45 +0000 (UTC) Received: by wibhq12 with SMTP id hq12so2819486wib.13 for ; Tue, 17 Jan 2012 13:16:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Ek9f9LTl1Pjr8h6NO/eL5ky0khsoYrKKhVovqzuZNO0=; b=ZOFMhtEKlTAlOjwx6B6JuifTMZHdmq1J1eK1bbq3fTs+K8aHFGZNhVL09GWnlz8Eaj hYOIBtgirRbz2MzZWPraESVkiV990rp8AOkadUQVqZ885SewfzNuesxeGfVO724PrjwG MLWmN8Yjv0IMMqaqleW1WFg6QVwvIGcbAp0Nw= Received: by 10.180.106.202 with SMTP id gw10mr32647201wib.3.1326835005263; Tue, 17 Jan 2012 13:16:45 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.112.68 with HTTP; Tue, 17 Jan 2012 13:16:14 -0800 (PST) In-Reply-To: <20120118.055716.647522865702856321.hrs@allbsd.org> References: <201112212027.pBLKRfPK084637@svn.freebsd.org> <20120118.055716.647522865702856321.hrs@allbsd.org> From: Eitan Adler Date: Tue, 17 Jan 2012 16:16:14 -0500 X-Google-Sender-Auth: GoYnVMy5t7QxSKGkjnncMYK84Ro Message-ID: To: Hiroki Sato Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228790 - in head/usr.sbin: fwcontrol newsyslog ypserv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 21:16:47 -0000 On Tue, Jan 17, 2012 at 3:57 PM, Hiroki Sato wrote: > =C2=A0I suspects you did not test ypserv after this change. =C2=A0Freeing= the > =C2=A0pointer sname at the end of create_service() is completely wrong an= d > =C2=A0probably people get the following error message when invoking ypser= v: > > =C2=A0getaddrinfo(): servname not supported for ai_socktype Already on my list of things to fix - thanks for the report! --=20 Eitan Adler Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 21:55:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C113B1065672; Tue, 17 Jan 2012 21:55:20 +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 AFAB38FC14; Tue, 17 Jan 2012 21:55:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HLtKk1009047; Tue, 17 Jan 2012 21:55:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HLtKsV009043; Tue, 17 Jan 2012 21:55:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201172155.q0HLtKsV009043@svn.freebsd.org> From: Ed Schouten Date: Tue, 17 Jan 2012 21:55: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: r230281 - in head/libexec/rtld-elf: amd64 i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 21:55:20 -0000 Author: ed Date: Tue Jan 17 21:55:20 2012 New Revision: 230281 URL: http://svn.freebsd.org/changeset/base/230281 Log: Remove unneeded dtv variable. It is only assigned and not used at all. The object files stay identical when the variables are removed. Approved by: kib Modified: head/libexec/rtld-elf/amd64/reloc.c head/libexec/rtld-elf/i386/reloc.c Modified: head/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- head/libexec/rtld-elf/amd64/reloc.c Tue Jan 17 20:56:12 2012 (r230280) +++ head/libexec/rtld-elf/amd64/reloc.c Tue Jan 17 21:55:20 2012 (r230281) @@ -487,10 +487,8 @@ allocate_initial_tls(Obj_Entry *objs) void *__tls_get_addr(tls_index *ti) { Elf_Addr** segbase; - Elf_Addr* dtv; __asm __volatile("movq %%fs:0, %0" : "=r" (segbase)); - dtv = segbase[1]; return tls_get_addr_common(&segbase[1], ti->ti_module, ti->ti_offset); } Modified: head/libexec/rtld-elf/i386/reloc.c ============================================================================== --- head/libexec/rtld-elf/i386/reloc.c Tue Jan 17 20:56:12 2012 (r230280) +++ head/libexec/rtld-elf/i386/reloc.c Tue Jan 17 21:55:20 2012 (r230281) @@ -444,10 +444,8 @@ __attribute__((__regparm__(1))) void *___tls_get_addr(tls_index *ti) { Elf_Addr** segbase; - Elf_Addr* dtv; __asm __volatile("movl %%gs:0, %0" : "=r" (segbase)); - dtv = segbase[1]; return tls_get_addr_common(&segbase[1], ti->ti_module, ti->ti_offset); } @@ -456,10 +454,8 @@ void *___tls_get_addr(tls_index *ti) void *__tls_get_addr(tls_index *ti) { Elf_Addr** segbase; - Elf_Addr* dtv; __asm __volatile("movl %%gs:0, %0" : "=r" (segbase)); - dtv = segbase[1]; return tls_get_addr_common(&segbase[1], ti->ti_module, ti->ti_offset); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 22:15:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1AD0106564A; Tue, 17 Jan 2012 22:15:33 +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 E04C98FC1C; Tue, 17 Jan 2012 22:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HMFXdO009894; Tue, 17 Jan 2012 22:15:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HMFXgI009891; Tue, 17 Jan 2012 22:15:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201172215.q0HMFXgI009891@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 17 Jan 2012 22:15: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: r230286 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 22:15:34 -0000 Author: yongari Date: Tue Jan 17 22:15:33 2012 New Revision: 230286 URL: http://svn.freebsd.org/changeset/base/230286 Log: Introduce a tunable that disables use of MSI. Non-zero value will use INTx. 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 Tue Jan 17 22:09:33 2012 (r230285) +++ head/sys/dev/bge/if_bge.c Tue Jan 17 22:15:33 2012 (r230286) @@ -2745,6 +2745,9 @@ bge_can_use_msi(struct bge_softc *sc) { int can_use_msi = 0; + if (sc->bge_msi_disable != 0) + return (0); + /* Disable MSI for polling(4). */ #ifdef DEVICE_POLLING return (0); @@ -5627,6 +5630,12 @@ bge_add_sysctls(struct bge_softc *sc) "Number of fragmented TX buffers of a frame allowed before " "forced collapsing"); + sc->bge_msi_disable = 0; + snprintf(tn, sizeof(tn), "dev.bge.%d.msi_disable", unit); + TUNABLE_INT_FETCH(tn, &sc->bge_msi_disable); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "msi_disable", + CTLFLAG_RD, &sc->bge_msi_disable, 0, "Disable MSI"); + /* * It seems all Broadcom controllers have a bug that can generate UDP * datagrams with checksum value 0 when TX UDP checksum offloading is Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Tue Jan 17 22:09:33 2012 (r230285) +++ head/sys/dev/bge/if_bgereg.h Tue Jan 17 22:15:33 2012 (r230286) @@ -2864,6 +2864,7 @@ struct bge_softc { int bge_timer; int bge_forced_collapse; int bge_forced_udpcsum; + int bge_msi_disable; int bge_csum_features; struct callout bge_stat_ch; uint32_t bge_rx_discards; From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 22:17:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D39771065672; Tue, 17 Jan 2012 22:17:10 +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 C15538FC15; Tue, 17 Jan 2012 22:17:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HMHAWJ009987; Tue, 17 Jan 2012 22:17:10 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HMHAZJ009984; Tue, 17 Jan 2012 22:17:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201172217.q0HMHAZJ009984@svn.freebsd.org> From: Ed Schouten Date: Tue, 17 Jan 2012 22:17: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: r230287 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 22:17:10 -0000 Author: ed Date: Tue Jan 17 22:17:10 2012 New Revision: 230287 URL: http://svn.freebsd.org/changeset/base/230287 Log: Remove unused variables. Simply annotate the function parameters with __unused, instead of adding the ve-variables. This makes the code build with GCC 4.7 and -Werror. Modified: head/bin/ps/print.c Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Tue Jan 17 22:15:33 2012 (r230286) +++ head/bin/ps/print.c Tue Jan 17 22:17:10 2012 (r230287) @@ -99,10 +99,8 @@ printheader(void) char * arguments(KINFO *k, VARENT *ve) { - VAR *v; char *vis_args; - v = ve->var; if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL) errx(1, "malloc failed"); strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH); @@ -116,10 +114,8 @@ arguments(KINFO *k, VARENT *ve) char * command(KINFO *k, VARENT *ve) { - VAR *v; char *vis_args, *vis_env, *str; - v = ve->var; if (cflag) { /* If it is the last field, then don't pad */ if (STAILQ_NEXT(ve, next_ve) == NULL) { @@ -172,10 +168,8 @@ command(KINFO *k, VARENT *ve) char * ucomm(KINFO *k, VARENT *ve) { - VAR *v; char *str; - v = ve->var; if (STAILQ_NEXT(ve, next_ve) == NULL) { /* last field, don't pad */ asprintf(&str, "%s%s%s%s", k->ki_d.prefix ? k->ki_d.prefix : "", @@ -192,12 +186,10 @@ ucomm(KINFO *k, VARENT *ve) } char * -tdnam(KINFO *k, VARENT *ve) +tdnam(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; if (showthreads && k->ki_p->ki_numthreads > 1) str = strdup(k->ki_p->ki_tdname); else @@ -207,28 +199,24 @@ tdnam(KINFO *k, VARENT *ve) } char * -logname(KINFO *k, VARENT *ve) +logname(KINFO *k, VARENT *ve __unused) { - VAR *v; - v = ve->var; if (*k->ki_p->ki_login == '\0') return (NULL); return (strdup(k->ki_p->ki_login)); } char * -state(KINFO *k, VARENT *ve) +state(KINFO *k, VARENT *ve __unused) { int flag, tdflags; char *cp, *buf; - VAR *v; buf = malloc(16); if (buf == NULL) errx(1, "malloc failed"); - v = ve->var; flag = k->ki_p->ki_flag; tdflags = k->ki_p->ki_tdflags; /* XXXKSE */ cp = buf; @@ -294,72 +282,58 @@ state(KINFO *k, VARENT *ve) #define scalepri(x) ((x) - PZERO) char * -pri(KINFO *k, VARENT *ve) +pri(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; asprintf(&str, "%d", scalepri(k->ki_p->ki_pri.pri_level)); return (str); } char * -upr(KINFO *k, VARENT *ve) +upr(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; asprintf(&str, "%d", scalepri(k->ki_p->ki_pri.pri_user)); return (str); } #undef scalepri char * -uname(KINFO *k, VARENT *ve) +uname(KINFO *k, VARENT *ve __unused) { - VAR *v; - v = ve->var; return (strdup(user_from_uid(k->ki_p->ki_uid, 0))); } char * -egroupname(KINFO *k, VARENT *ve) +egroupname(KINFO *k, VARENT *ve __unused) { - VAR *v; - v = ve->var; return (strdup(group_from_gid(k->ki_p->ki_groups[0], 0))); } char * -rgroupname(KINFO *k, VARENT *ve) +rgroupname(KINFO *k, VARENT *ve __unused) { - VAR *v; - v = ve->var; return (strdup(group_from_gid(k->ki_p->ki_rgid, 0))); } char * -runame(KINFO *k, VARENT *ve) +runame(KINFO *k, VARENT *ve __unused) { - VAR *v; - v = ve->var; return (strdup(user_from_uid(k->ki_p->ki_ruid, 0))); } char * -tdev(KINFO *k, VARENT *ve) +tdev(KINFO *k, VARENT *ve __unused) { - VAR *v; dev_t dev; char *str; - v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV) str = strdup("-"); @@ -370,13 +344,11 @@ tdev(KINFO *k, VARENT *ve) } char * -tname(KINFO *k, VARENT *ve) +tname(KINFO *k, VARENT *ve __unused) { - VAR *v; dev_t dev; char *ttname, *str; - v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) str = strdup("- "); @@ -394,13 +366,11 @@ tname(KINFO *k, VARENT *ve) } char * -longtname(KINFO *k, VARENT *ve) +longtname(KINFO *k, VARENT *ve __unused) { - VAR *v; dev_t dev; const char *ttname; - v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) ttname = "-"; @@ -409,9 +379,8 @@ longtname(KINFO *k, VARENT *ve) } char * -started(KINFO *k, VARENT *ve) +started(KINFO *k, VARENT *ve __unused) { - VAR *v; time_t then; struct tm *tp; static int use_ampm = -1; @@ -422,7 +391,6 @@ started(KINFO *k, VARENT *ve) if (buf == NULL) errx(1, "malloc failed"); - v = ve->var; if (!k->ki_valid) return (NULL); if (use_ampm < 0) @@ -441,9 +409,8 @@ started(KINFO *k, VARENT *ve) } char * -lstarted(KINFO *k, VARENT *ve) +lstarted(KINFO *k, VARENT *ve __unused) { - VAR *v; time_t then; char *buf; size_t buflen = 100; @@ -452,7 +419,6 @@ lstarted(KINFO *k, VARENT *ve) if (buf == NULL) errx(1, "malloc failed"); - v = ve->var; if (!k->ki_valid) return (NULL); then = k->ki_p->ki_start.tv_sec; @@ -461,12 +427,10 @@ lstarted(KINFO *k, VARENT *ve) } char * -lockname(KINFO *k, VARENT *ve) +lockname(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; if (k->ki_p->ki_kiflag & KI_LOCKBLOCK) { if (k->ki_p->ki_lockname[0] != 0) str = strdup(k->ki_p->ki_lockname); @@ -479,12 +443,10 @@ lockname(KINFO *k, VARENT *ve) } char * -wchan(KINFO *k, VARENT *ve) +wchan(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; if (k->ki_p->ki_wchan) { if (k->ki_p->ki_wmesg[0] != 0) str = strdup(k->ki_p->ki_wmesg); @@ -497,12 +459,10 @@ wchan(KINFO *k, VARENT *ve) } char * -nwchan(KINFO *k, VARENT *ve) +nwchan(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; if (k->ki_p->ki_wchan) asprintf(&str, "%0lx", (long)k->ki_p->ki_wchan); else @@ -512,12 +472,10 @@ nwchan(KINFO *k, VARENT *ve) } char * -mwchan(KINFO *k, VARENT *ve) +mwchan(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; if (k->ki_p->ki_wchan) { if (k->ki_p->ki_wmesg[0] != 0) str = strdup(k->ki_p->ki_wmesg); @@ -535,27 +493,23 @@ mwchan(KINFO *k, VARENT *ve) } char * -vsize(KINFO *k, VARENT *ve) +vsize(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; asprintf(&str, "%lu", (u_long)(k->ki_p->ki_size / 1024)); return (str); } static char * -printtime(KINFO *k, VARENT *ve, long secs, long psecs) +printtime(KINFO *k, VARENT *ve __unused, long secs, long psecs) /* psecs is "parts" of a second. first micro, then centi */ { - VAR *v; static char decimal_point; char *str; if (decimal_point == '\0') decimal_point = localeconv()->decimal_point[0]; - v = ve->var; if (!k->ki_valid) { secs = 0; psecs = 0; @@ -618,14 +572,12 @@ usertime(KINFO *k, VARENT *ve) } char * -elapsed(KINFO *k, VARENT *ve) +elapsed(KINFO *k, VARENT *ve __unused) { - VAR *v; time_t val; int days, hours, mins, secs; char *str; - v = ve->var; if (!k->ki_valid) return (NULL); val = now - k->ki_p->ki_start.tv_sec; @@ -646,13 +598,11 @@ elapsed(KINFO *k, VARENT *ve) } char * -elapseds(KINFO *k, VARENT *ve) +elapseds(KINFO *k, VARENT *ve __unused) { - VAR *v; time_t val; char *str; - v = ve->var; if (!k->ki_valid) return (NULL); val = now - k->ki_p->ki_start.tv_sec; @@ -682,12 +632,10 @@ getpcpu(const KINFO *k) } char * -pcpu(KINFO *k, VARENT *ve) +pcpu(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; asprintf(&str, "%.1f", getpcpu(k)); return (str); } @@ -712,47 +660,39 @@ getpmem(KINFO *k) } char * -pmem(KINFO *k, VARENT *ve) +pmem(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; asprintf(&str, "%.1f", getpmem(k)); return (str); } char * -pagein(KINFO *k, VARENT *ve) +pagein(KINFO *k, VARENT *ve __unused) { - VAR *v; char *str; - v = ve->var; asprintf(&str, "%ld", k->ki_valid ? k->ki_p->ki_rusage.ru_majflt : 0); return (str); } /* ARGSUSED */ char * -maxrss(KINFO *k __unused, VARENT *ve) +maxrss(KINFO *k __unused, VARENT *ve __unused) { - VAR *v; - v = ve->var; /* XXX not yet */ return (NULL); } char * -priorityr(KINFO *k, VARENT *ve) +priorityr(KINFO *k, VARENT *ve __unused) { - VAR *v; struct priority *lpri; char *str; unsigned class, level; - v = ve->var; lpri = &k->ki_p->ki_pri; class = lpri->pri_class; level = lpri->pri_level; @@ -852,25 +792,21 @@ rvar(KINFO *k, VARENT *ve) } char * -emulname(KINFO *k, VARENT *ve) +emulname(KINFO *k, VARENT *ve __unused) { - VAR *v; - v = ve->var; if (k->ki_p->ki_emul == NULL) return (NULL); return (strdup(k->ki_p->ki_emul)); } char * -label(KINFO *k, VARENT *ve) +label(KINFO *k, VARENT *ve __unused) { char *string; - VAR *v; mac_t proclabel; int error; - v = ve->var; string = NULL; if (mac_prepare_process_label(&proclabel) == -1) { warn("mac_prepare_process_label"); @@ -887,12 +823,10 @@ out: } char * -loginclass(KINFO *k, VARENT *ve) +loginclass(KINFO *k, VARENT *ve __unused) { - VAR *v; char *s; - v = ve->var; /* * Don't display login class for system processes; * login classes are used for resource limits, From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 22:17:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19414106566C; Tue, 17 Jan 2012 22:17: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 07DA98FC16; Tue, 17 Jan 2012 22:17:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HMHBWL010021; Tue, 17 Jan 2012 22:17:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HMHBID010019; Tue, 17 Jan 2012 22:17:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201172217.q0HMHBID010019@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 17 Jan 2012 22:17: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: r230288 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 22:17:12 -0000 Author: yongari Date: Tue Jan 17 22:17:11 2012 New Revision: 230288 URL: http://svn.freebsd.org/changeset/base/230288 Log: Document dev.bge.%d.msi_disable tunable. Modified: head/share/man/man4/bge.4 Modified: head/share/man/man4/bge.4 ============================================================================== --- head/share/man/man4/bge.4 Tue Jan 17 22:17:10 2012 (r230287) +++ head/share/man/man4/bge.4 Tue Jan 17 22:17:11 2012 (r230288) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2011 +.Dd January 17, 2012 .Dt BGE 4 .Os .Sh NAME @@ -188,7 +188,7 @@ SysKonnect SK-9D21 (10/100/1000baseTX) SysKonnect SK-9D41 (1000baseSX) .El .Sh LOADER TUNABLES -The following tunable can be set at the +The following tunables can be set at the .Xr loader 8 prompt before booting the kernel, or stored in .Xr loader.conf 5 . @@ -197,6 +197,9 @@ prompt before booting the kernel, or sto Allow the ASF feature for cooperating with IPMI. Can cause system lockup problems on a small number of systems. Enabled by default. +.It Va dev.bge.%d.msi_disable +Non-zero value disables MSI support on the Ethernet hardware. +The default value is 0. .El .Sh SYSCTL VARIABLES The following variables are available as both From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 22:19:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A816106567F; Tue, 17 Jan 2012 22:19:36 +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 ED9F58FC1C; Tue, 17 Jan 2012 22:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HMJZAM010136; Tue, 17 Jan 2012 22:19:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HMJZ0I010134; Tue, 17 Jan 2012 22:19:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201172219.q0HMJZ0I010134@svn.freebsd.org> From: Ed Schouten Date: Tue, 17 Jan 2012 22:19: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: r230289 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 22:19:36 -0000 Author: ed Date: Tue Jan 17 22:19:35 2012 New Revision: 230289 URL: http://svn.freebsd.org/changeset/base/230289 Log: Allow growfs to be built with GCC 4.7 and -Werror. The dp1 variable is only used when FSIRAND is defined. Just place the variable behind #ifdefs entirely. Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Tue Jan 17 22:17:11 2012 (r230288) +++ head/sbin/growfs/growfs.c Tue Jan 17 22:19:35 2012 (r230289) @@ -374,7 +374,9 @@ initcg(int cylno, time_t modtime, int fs static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; +#ifdef FSIRAND struct ufs1_dinode *dp1; +#endif struct csum *cs; uint d, dupper, dlower; @@ -452,8 +454,8 @@ initcg(int cylno, time_t modtime, int fs bzero(iobuf, sblock.fs_bsize); for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { - dp1 = (struct ufs1_dinode *)(void *)iobuf; #ifdef FSIRAND + dp1 = (struct ufs1_dinode *)(void *)iobuf; for (j = 0; j < INOPB(&sblock); j++) { dp1->di_gen = random(); dp1++; From owner-svn-src-head@FreeBSD.ORG Tue Jan 17 22:38:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCA701065670; Tue, 17 Jan 2012 22:38:13 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4AE108FC15; Tue, 17 Jan 2012 22:38:13 +0000 (UTC) Received: by ggki1 with SMTP id i1so4476586ggk.13 for ; Tue, 17 Jan 2012 14:38:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZYchtQIOOoPx3H/VWxpZU+6YZRlcYxMMzcBoLxCAt4g=; b=wdDVX/myaukhXmWeW9KW9QaFxwt62NBDmIydK6WBeLWiEc1T333JWehP5AAvqss0M1 V4Bo1WonFIRpRnE29nly2SuMURSINmjM+q/hsJp7GugQ24Dp+C0JbRHwA/RKk3DLxCep sdiwnwniYfXDxp7h2PPjFSbHVe8xB8DWgdbPk= MIME-Version: 1.0 Received: by 10.50.207.72 with SMTP id lu8mr19697092igc.0.1326839892107; Tue, 17 Jan 2012 14:38:12 -0800 (PST) Sender: ermal.luci@gmail.com Received: by 10.231.134.198 with HTTP; Tue, 17 Jan 2012 14:38:12 -0800 (PST) In-Reply-To: <20120117175323.GH12760@FreeBSD.org> References: <201201171214.q0HCEQm8089958@svn.freebsd.org> <20120117175323.GH12760@FreeBSD.org> Date: Tue, 17 Jan 2012 23:38:12 +0100 X-Google-Sender-Auth: dEVCqjmQ0GzjfONCYCNd5E5ZoXM Message-ID: From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230265 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 22:38:14 -0000 2012/1/17 Gleb Smirnoff > On Tue, Jan 17, 2012 at 05:48:10PM +0100, Ermal Lu?i wrote: > E> Maybe it does not hurt in general to keep the V_ > E> Some work was done to add it, no?! > > The V_ has been left under __FreeBSD__. > > E> On Tue, Jan 17, 2012 at 1:14 PM, Gleb Smirnoff > wrote: > E> > E> > Author: glebius > E> > Date: Tue Jan 17 12:14:26 2012 > E> > New Revision: 230265 > E> > URL: http://svn.freebsd.org/changeset/base/230265 > E> > > E> > Log: > E> > Allocate our mbuf with m_get2(). > E> > > E> > Modified: > E> > head/sys/contrib/pf/net/if_pfsync.c > E> > > E> > Modified: head/sys/contrib/pf/net/if_pfsync.c > E> > > E> > > ============================================================================== > E> > --- head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:13:36 2012 > E> > (r230264) > E> > +++ head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:14:26 2012 > E> > (r230265) > E> > @@ -2121,9 +2121,6 @@ pfsync_sendout(void) > E> > #ifdef notyet > E> > struct tdb *t; > E> > #endif > E> > -#ifdef __FreeBSD__ > E> > - size_t pktlen; > E> > -#endif > E> > int offset; > E> > int q, count = 0; > E> > > E> > @@ -2145,44 +2142,33 @@ pfsync_sendout(void) > E> > return; > E> > } > E> > > E> > - MGETHDR(m, M_DONTWAIT, MT_DATA); > E> > - if (m == NULL) { > E> > #ifdef __FreeBSD__ > E> > + m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + > sc->sc_len); > E> > + if (m == NULL) { > E> > sc->sc_ifp->if_oerrors++; > E> > + V_pfsyncstats.pfsyncs_onomem++; > E> > + return; > E> > + } > E> > #else > E> > + MGETHDR(m, M_DONTWAIT, MT_DATA); > E> > + if (m == NULL) { > E> > sc->sc_if.if_oerrors++; > E> > -#endif > E> > - V_pfsyncstats.pfsyncs_onomem++; > E> > + pfsyncstats.pfsyncs_onomem++; > ^^^^^^^^^^^^^^^^^^ What about this? > E> > pfsync_drop(sc); > E> > return; > E> > } > E> > > E> > -#ifdef __FreeBSD__ > E> > - pktlen = max_linkhdr + sc->sc_len; > E> > - if (pktlen > MHLEN) { > E> > - /* Find the right pool to allocate from. */ > E> > - /* XXX: This is ugly. */ > E> > - m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES > : > E> > -#if MJUMPAGESIZE != MCLBYTES > E> > - pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE : > E> > -#endif > E> > - pktlen <= MJUM9BYTES ? MJUM9BYTES : > MJUM16BYTES); > E> > -#else > E> > if (max_linkhdr + sc->sc_len > MHLEN) { > E> > MCLGETI(m, M_DONTWAIT, NULL, max_linkhdr + sc->sc_len); > E> > -#endif > E> > if (!ISSET(m->m_flags, M_EXT)) { > E> > m_free(m); > E> > -#ifdef __FreeBSD__ > E> > - sc->sc_ifp->if_oerrors++; > E> > -#else > E> > sc->sc_if.if_oerrors++; > E> > -#endif > E> > - V_pfsyncstats.pfsyncs_onomem++; > E> > + pfsyncstats.pfsyncs_onomem++; > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ What about this? > E> > pfsync_drop(sc); > E> > return; > E> > } > E> > } > E> > +#endif > E> > m->m_data += max_linkhdr; > E> > m->m_len = m->m_pkthdr.len = sc->sc_len; > E> > > E> > > E> > E> > E> -- > E> Ermal > > -- > Totus tuus, Glebius. > -- Ermal From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 00:44:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7167B106566C; Wed, 18 Jan 2012 00:44:58 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3818FC0C; Wed, 18 Jan 2012 00:44:56 +0000 (UTC) Received: by lahe6 with SMTP id e6so744452lah.13 for ; Tue, 17 Jan 2012 16:44:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=ijZsX241FDdwUHYC1DM8be5q3/azhuZxHmZG7EKOig4=; b=m0UeSe7MGENS20fr53/pJeet0wEHJtE16TcBWDDF2+ZC1Iehyzsu2q8OIpscEFkokc EAoDAKV11++N3bbdWdcjxyR5FNHFiEZJMNfv0QnG46UAzfbsiD6KF5te6HlREvovXTXk 3AksNE6pqMzUJLgKBOo8DYupq5c4e5X1X1OYU= Received: by 10.112.39.138 with SMTP id p10mr4731341lbk.98.1326847496114; Tue, 17 Jan 2012 16:44:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.21.168 with HTTP; Tue, 17 Jan 2012 16:44:25 -0800 (PST) In-Reply-To: <201201172039.q0HKdYPB006687@svn.freebsd.org> References: <201201172039.q0HKdYPB006687@svn.freebsd.org> From: Eitan Adler Date: Tue, 17 Jan 2012 19:44:25 -0500 Message-ID: To: Hiroki Sato Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230279 - head/usr.sbin/ypserv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 00:44:58 -0000 On Tue, Jan 17, 2012 at 3:39 PM, Hiroki Sato wrote: > Author: hrs > Date: Tue Jan 17 20:39:33 2012 > New Revision: 230279 > URL: http://svn.freebsd.org/changeset/base/230279 > > Log: > =C2=A0Revert changes in r228790. =C2=A0It prevented the ypserv daemon fro= m working with > =C2=A0with multiple socktypes. I was at work and unable to do this earlier which is I was so brief before. I will be be certain to test better next time. Thanks for handling it! --=20 Eitan Adler From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 02:09:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2615106566B; Wed, 18 Jan 2012 02:09:29 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE008FC08; Wed, 18 Jan 2012 02:09:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0I29QoK065426; Wed, 18 Jan 2012 02:09:26 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F1629D5.4020605@gmail.com> Date: Wed, 18 Jan 2012 10:09:25 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: John Baldwin References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <201201170957.47718.jhb@freebsd.org> In-Reply-To: <201201170957.47718.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 02:09:29 -0000 On 2012/1/17 22:57, John Baldwin wrote: > On Monday, January 16, 2012 1:15:14 am David Xu wrote: >> Author: davidxu >> Date: Mon Jan 16 06:15:14 2012 >> New Revision: 230201 >> URL: http://svn.freebsd.org/changeset/base/230201 >> >> Log: >> Insert read memory barriers. > I think using atomic_load_acq() on sem->nwaiters would be clearer as it would > indicate which variable you need to ensure is read after other operations. In > general I think raw rmb/wmb usage should be avoided when possible as it is > does not describe the programmer's intent as well. > Yes, I had considered that I may use atomic_load_acq(), but at that time, I thought it emits a bus locking, right ? so I just picked up rmb() which only affects current cpu. maybe atomic_load_acq() does same thing with rmb() ? it is still unclear to me. Regards, David Xu From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 02:27:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D22106566B; Wed, 18 Jan 2012 02:27:10 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 613E58FC08; Wed, 18 Jan 2012 02:27:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0I2RAKm017950; Wed, 18 Jan 2012 02:27:10 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I2RAVi017948; Wed, 18 Jan 2012 02:27:10 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201180227.q0I2RAVi017948@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Jan 2012 02:27: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: r230291 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 02:27:10 -0000 Author: kevlo Date: Wed Jan 18 02:27:09 2012 New Revision: 230291 URL: http://svn.freebsd.org/changeset/base/230291 Log: vfs_object_create() function is obsolete. Use vnode_create_vobject() to create the backing object. Reviewed by: kib Modified: head/share/man/man9/vnode.9 Modified: head/share/man/man9/vnode.9 ============================================================================== --- head/share/man/man9/vnode.9 Tue Jan 17 22:42:54 2012 (r230290) +++ head/share/man/man9/vnode.9 Wed Jan 18 02:27:09 2012 (r230291) @@ -119,13 +119,13 @@ No type. .It Dv VREG A regular file; may be with or without VM object backing. If you want to make sure this get a backing object, call -.Xr vfs_object_create 9 . +.Fn vnode_create_vobject . .It Dv VDIR A directory. .It Dv VBLK A block device; may be with or without VM object backing. If you want to make sure this get a backing object, call -.Xr vfs_object_create 9 . +.Fn vnode_create_vobject . .It Dv VCHR A character device. .It Dv VLNK From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 02:29:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BCCC106566B; Wed, 18 Jan 2012 02:29:12 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAB338FC23; Wed, 18 Jan 2012 02:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0I2TBp4018070; Wed, 18 Jan 2012 02:29:11 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I2TBOT018068; Wed, 18 Jan 2012 02:29:11 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201180229.q0I2TBOT018068@svn.freebsd.org> From: Kevin Lo Date: Wed, 18 Jan 2012 02:29: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: r230292 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 02:29:12 -0000 Author: kevlo Date: Wed Jan 18 02:29:11 2012 New Revision: 230292 URL: http://svn.freebsd.org/changeset/base/230292 Log: NOOBJ is long time dead Reviewed by: kib Modified: head/share/man/man9/namei.9 Modified: head/share/man/man9/namei.9 ============================================================================== --- head/share/man/man9/namei.9 Wed Jan 18 02:27:09 2012 (r230291) +++ head/share/man/man9/namei.9 Wed Jan 18 02:29:11 2012 (r230292) @@ -196,10 +196,6 @@ With this flag, will follow the symbolic link if the last part of the path supplied is a symbolic link (i.e., it will return a vnode for whatever the link points at, instead for the link itself). -.It Dv NOOBJ -Do not call -.Fn vfs_object_create -for the returned vnode, even though it meets required criteria for VM support. .It Dv NOFOLLOW Do not follow symbolic links (pseudo). This flag is not looked for by the actual code, which looks for From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 02:44:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8661B106564A; Wed, 18 Jan 2012 02:44:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 718C68FC0A; Wed, 18 Jan 2012 02:44:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0I2iN2s018594; Wed, 18 Jan 2012 02:44:23 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I2iNlp018592; Wed, 18 Jan 2012 02:44:23 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201201180244.q0I2iNlp018592@svn.freebsd.org> From: Ed Maste Date: Wed, 18 Jan 2012 02:44: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: r230293 - head/usr.sbin/wpa/wpa_supplicant X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 02:44:23 -0000 Author: emaste Date: Wed Jan 18 02:44:22 2012 New Revision: 230293 URL: http://svn.freebsd.org/changeset/base/230293 Log: Add missing line continuation \. It did not cause any issue because the same path is already being included in ../Makefile.inc. PR: 164192 Submitted by: Devin Teske MFC after: 2 weeks Modified: head/usr.sbin/wpa/wpa_supplicant/Makefile Modified: head/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- head/usr.sbin/wpa/wpa_supplicant/Makefile Wed Jan 18 02:29:11 2012 (r230292) +++ head/usr.sbin/wpa/wpa_supplicant/Makefile Wed Jan 18 02:44:22 2012 (r230293) @@ -5,7 +5,7 @@ .PATH.c:${WPA_SUPPLICANT_DISTDIR} \ ${WPA_DISTDIR}/src/drivers \ ${WPA_DISTDIR}/src/eap_peer \ - ${WPA_DISTDIR}/src/rsn_supp + ${WPA_DISTDIR}/src/rsn_supp \ ${WPA_DISTDIR}/src/crypto PROG= wpa_supplicant From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 03:03:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 087EE106566B; Wed, 18 Jan 2012 03:03:22 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E72E48FC08; Wed, 18 Jan 2012 03:03:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0I33LXn019389; Wed, 18 Jan 2012 03:03:21 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I33Lp4019387; Wed, 18 Jan 2012 03:03:21 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201201180303.q0I33Lp4019387@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 18 Jan 2012 03:03: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: r230294 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 03:03:22 -0000 Author: lstewart Date: Wed Jan 18 03:03:21 2012 New Revision: 230294 URL: http://svn.freebsd.org/changeset/base/230294 Log: Specify the correct section (4 instead of 9) in the h_ertt man page's title and bump the document date. MFC after: 3 days Modified: head/share/man/man4/h_ertt.4 Modified: head/share/man/man4/h_ertt.4 ============================================================================== --- head/share/man/man4/h_ertt.4 Wed Jan 18 02:44:22 2012 (r230293) +++ head/share/man/man4/h_ertt.4 Wed Jan 18 03:03:21 2012 (r230294) @@ -29,8 +29,8 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 -.Dt H_ERTT 9 +.Dd January 18, 2012 +.Dt H_ERTT 4 .Os .Sh NAME .Nm h_ertt From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 04:12:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0368F106564A; Wed, 18 Jan 2012 04:12:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E31978FC0A; Wed, 18 Jan 2012 04:12:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0I4CW2w021733; Wed, 18 Jan 2012 04:12:32 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I4CWV4021731; Wed, 18 Jan 2012 04:12:32 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201201180412.q0I4CWV4021731@svn.freebsd.org> From: Ed Maste Date: Wed, 18 Jan 2012 04:12: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: r230296 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 04:12:33 -0000 Author: emaste Date: Wed Jan 18 04:12:32 2012 New Revision: 230296 URL: http://svn.freebsd.org/changeset/base/230296 Log: Don't write /var/db/zoneinfo when zone is not actually changed. If the specified zone file does not exist or the -n flag is specified, do not update /var/db/zoneinfo. PR: bin/164039 Submitted by: Devin Teske MFC after: 1 week Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Jan 18 03:07:34 2012 (r230295) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Jan 18 04:12:32 2012 (r230296) @@ -829,9 +829,11 @@ install_zoneinfo(const char *zoneinfo) rv = install_zoneinfo_file(path_zoneinfo_file); /* Save knowledge for later */ - if ((f = fopen(path_db, "w")) != NULL) { - fprintf(f, "%s\n", zoneinfo); - fclose(f); + if (reallydoit && (rv & DITEM_FAILURE) == 0) { + if ((f = fopen(path_db, "w")) != NULL) { + fprintf(f, "%s\n", zoneinfo); + fclose(f); + } } return (rv); From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 04:33:36 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6D1C106564A; Wed, 18 Jan 2012 04:33:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 7833B8FC12; Wed, 18 Jan 2012 04:33:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0I4XYHx027448; Wed, 18 Jan 2012 08:33:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0I4XYjJ027447; Wed, 18 Jan 2012 08:33:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 18 Jan 2012 08:33:33 +0400 From: Gleb Smirnoff To: Ermal Lu?i Message-ID: <20120118043333.GL12760@FreeBSD.org> References: <201201171214.q0HCEQm8089958@svn.freebsd.org> <20120117175323.GH12760@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230265 - head/sys/contrib/pf/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 04:33:36 -0000 On Tue, Jan 17, 2012 at 11:38:12PM +0100, Ermal Lu?i wrote: E> > On Tue, Jan 17, 2012 at 05:48:10PM +0100, Ermal Lu?i wrote: E> > E> Maybe it does not hurt in general to keep the V_ E> > E> Some work was done to add it, no?! E> > E> > The V_ has been left under __FreeBSD__. E> > E> > E> On Tue, Jan 17, 2012 at 1:14 PM, Gleb Smirnoff E> > wrote: E> > E> E> > E> > Author: glebius E> > E> > Date: Tue Jan 17 12:14:26 2012 E> > E> > New Revision: 230265 E> > E> > URL: http://svn.freebsd.org/changeset/base/230265 E> > E> > E> > E> > Log: E> > E> > Allocate our mbuf with m_get2(). E> > E> > E> > E> > Modified: E> > E> > head/sys/contrib/pf/net/if_pfsync.c E> > E> > E> > E> > Modified: head/sys/contrib/pf/net/if_pfsync.c E> > E> > E> > E> > E> > ============================================================================== E> > E> > --- head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:13:36 2012 E> > E> > (r230264) E> > E> > +++ head/sys/contrib/pf/net/if_pfsync.c Tue Jan 17 12:14:26 2012 E> > E> > (r230265) E> > E> > @@ -2121,9 +2121,6 @@ pfsync_sendout(void) E> > E> > #ifdef notyet E> > E> > struct tdb *t; E> > E> > #endif E> > E> > -#ifdef __FreeBSD__ E> > E> > - size_t pktlen; E> > E> > -#endif E> > E> > int offset; E> > E> > int q, count = 0; E> > E> > E> > E> > @@ -2145,44 +2142,33 @@ pfsync_sendout(void) E> > E> > return; E> > E> > } E> > E> > E> > E> > - MGETHDR(m, M_DONTWAIT, MT_DATA); E> > E> > - if (m == NULL) { E> > E> > #ifdef __FreeBSD__ E> > E> > + m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + E> > sc->sc_len); E> > E> > + if (m == NULL) { E> > E> > sc->sc_ifp->if_oerrors++; E> > E> > + V_pfsyncstats.pfsyncs_onomem++; E> > E> > + return; E> > E> > + } E> > E> > #else E> > E> > + MGETHDR(m, M_DONTWAIT, MT_DATA); E> > E> > + if (m == NULL) { E> > E> > sc->sc_if.if_oerrors++; E> > E> > -#endif E> > E> > - V_pfsyncstats.pfsyncs_onomem++; E> > E> > + pfsyncstats.pfsyncs_onomem++; E> > E> ^^^^^^^^^^^^^^^^^^ E> What about this? E> E> E> > E> > pfsync_drop(sc); E> > E> > return; E> > E> > } E> > E> > E> > E> > -#ifdef __FreeBSD__ E> > E> > - pktlen = max_linkhdr + sc->sc_len; E> > E> > - if (pktlen > MHLEN) { E> > E> > - /* Find the right pool to allocate from. */ E> > E> > - /* XXX: This is ugly. */ E> > E> > - m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES E> > : E> > E> > -#if MJUMPAGESIZE != MCLBYTES E> > E> > - pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE : E> > E> > -#endif E> > E> > - pktlen <= MJUM9BYTES ? MJUM9BYTES : E> > MJUM16BYTES); E> > E> > -#else E> > E> > if (max_linkhdr + sc->sc_len > MHLEN) { E> > E> > MCLGETI(m, M_DONTWAIT, NULL, max_linkhdr + sc->sc_len); E> > E> > -#endif E> > E> > if (!ISSET(m->m_flags, M_EXT)) { E> > E> > m_free(m); E> > E> > -#ifdef __FreeBSD__ E> > E> > - sc->sc_ifp->if_oerrors++; E> > E> > -#else E> > E> > sc->sc_if.if_oerrors++; E> > E> > -#endif E> > E> > - V_pfsyncstats.pfsyncs_onomem++; E> > E> > + pfsyncstats.pfsyncs_onomem++; E> > E> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ E> What about this? E> E> E> > E> > pfsync_drop(sc); E> > E> > return; E> > E> > } E> > E> > } E> > E> > +#endif E> > E> > m->m_data += max_linkhdr; E> > E> > m->m_len = m->m_pkthdr.len = sc->sc_len; E> > E> > E> > E> > These are not under __FreeBSD__. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 04:37:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEC47106566B; Wed, 18 Jan 2012 04:37:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5EE8FC12; Wed, 18 Jan 2012 04:37:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0I4baRL022631; Wed, 18 Jan 2012 04:37:36 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I4ba4w022629; Wed, 18 Jan 2012 04:37:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201201180437.q0I4ba4w022629@svn.freebsd.org> From: Ed Maste Date: Wed, 18 Jan 2012 04:37: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: r230299 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 04:37:36 -0000 Author: emaste Date: Wed Jan 18 04:37:35 2012 New Revision: 230299 URL: http://svn.freebsd.org/changeset/base/230299 Log: Fix #ifdef VERBOSE for UTC case Update verbose output to match what actually happens when selecting the UTC option, and when the -n option is used. Patch updated slightly for new libdialog. PR: bin/164042 Submitted by: Devin Teske MFC after: 2 weeks Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Jan 18 04:37:17 2012 (r230298) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Jan 18 04:37:35 2012 (r230299) @@ -659,16 +659,19 @@ install_zoneinfo_file(const char *zonein copymode = 1; #ifdef VERBOSE - if (copymode) + snprintf(title, sizeof(title), "Info"); + if (zoneinfo_file == NULL) + snprintf(prompt, sizeof(prompt), + "Removing %s", path_localtime); + else if (copymode) snprintf(prompt, sizeof(prompt), "Copying %s to %s", zoneinfo_file, path_localtime); else snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", - path_localtime, - zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file); + path_localtime, zoneinfo_file); if (usedialog) - dialog_notify(prompt); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); #endif @@ -699,6 +702,10 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } +#ifdef VERBOSE + snprintf(prompt, sizeof(prompt), + "Removed %s", path_localtime); +#endif return (DITEM_LEAVE_MENU); } @@ -797,23 +804,23 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } } - } #ifdef VERBOSE - snprintf(title, sizeof(title), "Done"); - if (copymode) - snprintf(prompt, sizeof(prompt), - "Copied timezone file from %s to %s", zoneinfo_file, - path_localtime); - else - snprintf(prompt, sizeof(prompt), - "Created symbolic link from %s to %s", zoneinfo_file, - path_localtime); - if (usedialog) - dialog_msgbox(title, prompt, 8, 72, 1); - else - fprintf(stderr, "%s\n", prompt); + snprintf(title, sizeof(title), "Done"); + if (copymode) + snprintf(prompt, sizeof(prompt), + "Copied timezone file from %s to %s", + zoneinfo_file, path_localtime); + else + snprintf(prompt, sizeof(prompt), + "Created symbolic link from %s to %s", + zoneinfo_file, path_localtime); + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else + fprintf(stderr, "%s\n", prompt); #endif + } /* reallydoit */ return (DITEM_LEAVE_MENU); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 06:19:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4442B1065678; Wed, 18 Jan 2012 06:19:49 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id AD4388FC12; Wed, 18 Jan 2012 06:19:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0I6JkKV081183; Wed, 18 Jan 2012 10:19:47 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0I6JkRI081182; Wed, 18 Jan 2012 10:19:46 +0400 (MSK) (envelope-from ache) Date: Wed, 18 Jan 2012 10:19:45 +0400 From: Andrey Chernov To: David Schultz Message-ID: <20120118061943.GA80874@vniz.net> Mail-Followup-To: Andrey Chernov , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201201162018.q0GKIADK050161@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201162018.q0GKIADK050161@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 06:19:49 -0000 On Mon, Jan 16, 2012 at 08:18:10PM +0000, David Schultz wrote: > Author: das > Date: Mon Jan 16 20:18:10 2012 > New Revision: 230230 > URL: http://svn.freebsd.org/changeset/base/230230 > > Log: > Generate a warning if the kernel's arc4random() is seeded with bogus entropy. While you are here, could you review/commit my patch to fix bad 31bit arc4rand() seeding, please? --- yarrow.c.bak 2011-09-26 07:35:48.000000000 +0400 +++ yarrow.c 2012-01-18 10:13:47.000000000 +0400 @@ -59,6 +59,8 @@ static void reseed(u_int); /* The reseed thread mutex */ struct mtx random_reseed_mtx; +static arc4rand_seeded = 0; + /* Process a single stochastic event off the harvest queue */ void random_process_event(struct harvest *event) @@ -261,6 +263,11 @@ reseed(u_int fastslow) /* Release the reseed mutex */ mtx_unlock(&random_reseed_mtx); + + if (!arc4rand_seeded) { + arc4rand_seeded = 1; + arc4rand(NULL, 0, 1); + } } /* Internal function to return processed entropy from the PRNG */ -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 08:56:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F5E106566C; Wed, 18 Jan 2012 08:56:26 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D06358FC18; Wed, 18 Jan 2012 08:56:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0I8uQCG031136; Wed, 18 Jan 2012 08:56:26 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I8uQIL031134; Wed, 18 Jan 2012 08:56:26 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201201180856.q0I8uQIL031134@svn.freebsd.org> From: Jens Schweikhardt Date: Wed, 18 Jan 2012 08:56: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: r230303 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 08:56:27 -0000 Author: schweikh Date: Wed Jan 18 08:56:26 2012 New Revision: 230303 URL: http://svn.freebsd.org/changeset/base/230303 Log: Connect the bktr module(s) to the amd64 build. MFC after: 7 days Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Jan 18 07:57:17 2012 (r230302) +++ head/sys/modules/Makefile Wed Jan 18 08:56:26 2012 (r230303) @@ -564,6 +564,7 @@ _amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc +_bktr= bktr _bxe= bxe _cardbus= cardbus _cbb= cbb From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 11:23:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2813E106564A; Wed, 18 Jan 2012 11:23:47 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 128428FC14; Wed, 18 Jan 2012 11:23:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IBNkRa038063; Wed, 18 Jan 2012 11:23:46 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IBNk19038061; Wed, 18 Jan 2012 11:23:46 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201201181123.q0IBNk19038061@svn.freebsd.org> From: Eygene Ryabinkin Date: Wed, 18 Jan 2012 11:23: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: r230304 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 11:23:47 -0000 Author: rea (ports committer) Date: Wed Jan 18 11:23:46 2012 New Revision: 230304 URL: http://svn.freebsd.org/changeset/base/230304 Log: Subject: NULLFS: properly destroy node hash Use hashdestroy() instead of naive free(). Approved by: kib MFC after: 2 weeks Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Wed Jan 18 08:56:26 2012 (r230303) +++ head/sys/fs/nullfs/null_subr.c Wed Jan 18 11:23:46 2012 (r230304) @@ -90,7 +90,7 @@ nullfs_uninit(vfsp) { mtx_destroy(&null_hashmtx); - free(null_node_hashtbl, M_NULLFSHASH); + hashdestroy(null_node_hashtbl, M_NULLFSHASH, null_node_hash); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 11:29:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 002261065673; Wed, 18 Jan 2012 11:29:14 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 73FF68FC16; Wed, 18 Jan 2012 11:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=TH5g7ZicF8/tnlQ8Mu0kVt+IEtKDafvlYtFHJni+KE8=; b=qdxfEyRQJC/XGIs2obf9d/cqDb2FCuO7s8rWdKlrYq3BgcBRmZWQ31E8P7wKFOH42Qx4m1FjJUA3wZFHiC31LGSsogszmsXD2VWathe8RxNbUM3nKODoGgwzFEdH8iTeo4Ij4sMu5VOdb3roQ5FhlLOMKXUhH1Yivh/9LfNxjY0e5zF2nXghUzGlrXQGGK+R9DZ6/RghJNhtKvDzLe7F/lvIbEOO64N2G/fce+4/QxsX7GnbszUbsWSk+97sqj2TZJJyyu+KcQefPRBA3OQDlaDtKP2aP+kl+0v8X9nJ1iWHF52Ui28rFFf03tFLVvP4AsU0og6Vbyn5UsAWvLwlIQ==; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1RnThZ-000Kgm-7r; Wed, 18 Jan 2012 14:29:13 +0300 Date: Wed, 18 Jan 2012 15:29:10 +0400 From: Eygene Ryabinkin To: John Baldwin Message-ID: <76N5o2cbOG1xa+/PCENoyerLpsM@HbohoBmewgxm0atwUoKO7zhAAgw> References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201120748.28564.jhb@freebsd.org> <201201121438.16674.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="llIrKcgUOe3dCx0c" Content-Disposition: inline In-Reply-To: Sender: rea@codelabs.ru Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 11:29:15 -0000 --llIrKcgUOe3dCx0c Content-Type: multipart/mixed; boundary="Fig2xvG2VGoz8o/s" Content-Disposition: inline --Fig2xvG2VGoz8o/s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fri, Jan 13, 2012 at 11:21:48AM +0400, Eygene Ryabinkin wrote: > But seems like the whole problem is that I used the err() function > instead of doing 'echo $errmsg; exit 1'. Such code shouldn't be > conditionalized for the devd, since it is only syslog message that > worried people; devd doesn't care what is written to the standard > output or the standard error by the scripts it invokes once it become > the daemon, since everything goes to /dev/null after calling > daemon(3). >=20 > So, seems like that the following dhclient_pre_check() will make > everyone happy: > {{{ > dhclient_pre_check() > { > if [ -z "${rc_force}" ] && ! dhcpif $ifn; then > echo "'$ifn' is not a DHCP-enabled interface" > exit 1 > fi > } > }}} > Hadn't tested it yet, but will do it today. The attached patch that just changes 'err' to 'echo ...; exit 1' works fine for me. Any views on it? > The related topic: in the process of grepping for dhclient within > /etc, I had found that /etc/netstart still wants to invoke it. But it > will do a lone '/etc/rc.d/dhclient quietstart' and this will never > be useful in the current state of dhclient: it will refuse to process > any commands without the interface being specified. And since we > have the invocation of /etc/rc.d/netif just two lines above, I think > that it will be good to remove call to dhclient from /etc/netstart. >=20 > At the time of the original addition of call to dhclient to /etc/netstart > (r114213), dhclient script had another form, > http://svnweb.freebsd.org/base/head/etc/rc.d/dhclient?revision=3D113759= &view=3Dmarkup&pathrev=3D114213 > and it was really a normal rc.d script that requires only one argument. > Now it is more of a helper-type script. > . > Am I missing something important here or the removal can really be > done? Anyone can say anything about /etc/netstart issue? Thanks. --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --Fig2xvG2VGoz8o/s Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="dhclient-use-echo.diff" Content-Transfer-Encoding: quoted-printable --- /usr/src/etc/rc.d/dhclient 2012-01-12 15:16:05.000000000 +0400 +++ /etc/rc.d/dhclient 2012-01-18 15:25:30.000000000 +0400 @@ -25,11 +25,11 @@ local msg msg=3D"'$ifn' is not a DHCP-enabled interface" if [ -z "${rc_quiet}" ]; then - err 1 "$msg" + echo "$msg" else debug "$msg" - exit 1 fi + exit 1 fi } =20 --Fig2xvG2VGoz8o/s-- --llIrKcgUOe3dCx0c Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk8WrQYACgkQFq+eroFS7PvxuwD/YGUQjA6HF3Ov3Kzin/UR6a3H 6wULeRjH37QaAJeObv8A/iQRZF/9yZghQwqfU1vxcHGL/1e3FKTMEYy7cYMdFtGn =Kf5v -----END PGP SIGNATURE----- --llIrKcgUOe3dCx0c-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 14:41:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 614151065673; Wed, 18 Jan 2012 14:41:27 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FE798FC16; Wed, 18 Jan 2012 14:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IEfRUg044402; Wed, 18 Jan 2012 14:41:27 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IEfRsQ044400; Wed, 18 Jan 2012 14:41:27 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201201181441.q0IEfRsQ044400@svn.freebsd.org> From: Jens Schweikhardt Date: Wed, 18 Jan 2012 14:41: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: r230306 - head/share/examples/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 14:41:27 -0000 Author: schweikh Date: Wed Jan 18 14:41:26 2012 New Revision: 230306 URL: http://svn.freebsd.org/changeset/base/230306 Log: Comment cosmetics: end more sentences with full stops. Modified: head/share/examples/etc/make.conf Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Wed Jan 18 11:48:07 2012 (r230305) +++ head/share/examples/etc/make.conf Wed Jan 18 14:41:26 2012 (r230306) @@ -91,13 +91,13 @@ # #COPTFLAGS= -O -pipe # -# Compare before install +# Compare before install. #INSTALL=install -C # -# Mtree will follow symlinks +# Mtree will follow symlinks. #MTREE_FOLLOWS_SYMLINKS= -L # -# To enable installing ssh(1) with the setuid bit turned on +# To enable installing ssh(1) with the setuid bit turned on. #ENABLE_SUID_SSH= # # To enable installing newgrp(1) with the setuid bit turned on. @@ -117,7 +117,7 @@ # #TRACEROUTE_NO_IPSEC= # do not build traceroute(8) with IPSEC support # -# To build sys/modules when building the world (our old way of doing things) +# To build sys/modules when building the world (our old way of doing things). #MODULES_WITH_WORLD= # do not build modules when building kernel # # The list of modules to build instead of all of them. @@ -133,7 +133,7 @@ # # # Default format for system documentation, depends on your printer. -# Set this to "ascii" for simple printers or screen +# Set this to "ascii" for simple printers or screen. # #PRINTERDEVICE= ps # @@ -199,7 +199,7 @@ # # Documentation # -# The list of languages and encodings to build and install +# The list of languages and encodings to build and install. # #DOC_LANG= en_US.ISO8859-1 ru_RU.KOI8-R # From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 15:13:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5115B1065670; Wed, 18 Jan 2012 15:13:22 +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 3F0538FC0C; Wed, 18 Jan 2012 15:13:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IFDMTL045397; Wed, 18 Jan 2012 15:13:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IFDMb1045392; Wed, 18 Jan 2012 15:13:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201201181513.q0IFDMb1045392@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 18 Jan 2012 15:13: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: r230307 - in head: lib/libfetch usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 15:13:22 -0000 Author: des Date: Wed Jan 18 15:13:21 2012 New Revision: 230307 URL: http://svn.freebsd.org/changeset/base/230307 Log: Fix two issues related to the use of SIGINFO in fetch(1) to display progress information. The first is that fetch_read() (used in the HTTP code but not the FTP code) can enter an infinite loop if it has previously been interrupted by a signal. The second is that when it is interrupted, fetch_read() will discard any data it may have read up to that point. Luckily, both bugs are extremely timing-sensitive and therefore difficult to trigger. PR: bin/153240 Submitted by: Mark MFC after: 3 weeks Modified: head/lib/libfetch/common.c head/lib/libfetch/common.h head/lib/libfetch/http.c head/usr.bin/fetch/fetch.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Wed Jan 18 14:41:26 2012 (r230306) +++ head/lib/libfetch/common.c Wed Jan 18 15:13:21 2012 (r230307) @@ -404,6 +404,34 @@ fetch_ssl_read(SSL *ssl, char *buf, size } #endif +/* + * Cache some data that was read from a socket but cannot be immediately + * returned because of an interrupted system call. + */ +static int +fetch_cache_data(conn_t *conn, char *src, size_t nbytes) +{ + char *tmp; + + if (conn->cache.size < nbytes) { + tmp = realloc(conn->cache.buf, nbytes); + if (tmp == NULL) { + errno = ENOMEM; + fetch_syserr(); + return (-1); + } + conn->cache.buf = tmp; + conn->cache.size = nbytes; + } + + memcpy(conn->cache.buf, src, nbytes); + conn->cache.len = nbytes; + conn->cache.pos = 0; + + return (0); +} + + static ssize_t fetch_socket_read(int sd, char *buf, size_t len) { @@ -429,6 +457,7 @@ fetch_read(conn_t *conn, char *buf, size fd_set readfds; ssize_t rlen, total; int r; + char *start; if (fetchTimeout) { FD_ZERO(&readfds); @@ -437,6 +466,24 @@ fetch_read(conn_t *conn, char *buf, size } total = 0; + start = buf; + + if (conn->cache.len > 0) { + /* + * The last invocation of fetch_read was interrupted by a + * signal after some data had been read from the socket. Copy + * the cached data into the supplied buffer before trying to + * read from the socket again. + */ + total = (conn->cache.len < len) ? conn->cache.len : len; + memcpy(buf, conn->cache.buf, total); + + conn->cache.len -= total; + conn->cache.pos += total; + len -= total; + buf+= total; + } + while (len > 0) { /* * The socket is non-blocking. Instead of the canonical @@ -472,6 +519,8 @@ fetch_read(conn_t *conn, char *buf, size total += rlen; continue; } else if (rlen == FETCH_READ_ERROR) { + if (errno == EINTR) + fetch_cache_data(conn, start, total); return (-1); } // assert(rlen == FETCH_READ_WAIT); @@ -492,8 +541,12 @@ fetch_read(conn_t *conn, char *buf, size errno = 0; r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); if (r == -1) { - if (errno == EINTR && fetchRestartCalls) - continue; + if (errno == EINTR) { + if (fetchRestartCalls) + continue; + /* Save anything that was read. */ + fetch_cache_data(conn, start, total); + } fetch_syserr(); return (-1); } @@ -677,6 +730,7 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); ret = close(conn->sd); + free(conn->cache.buf); free(conn->buf); free(conn); return (ret); Modified: head/lib/libfetch/common.h ============================================================================== --- head/lib/libfetch/common.h Wed Jan 18 14:41:26 2012 (r230306) +++ head/lib/libfetch/common.h Wed Jan 18 15:13:21 2012 (r230307) @@ -52,6 +52,13 @@ struct fetchconn { size_t bufsize; /* buffer size */ size_t buflen; /* length of buffer contents */ int err; /* last protocol reply code */ + struct { /* data cached after an interrupted + read */ + char *buf; + size_t size; + size_t pos; + size_t len; + } cache; #ifdef WITH_SSL SSL *ssl; /* SSL handle */ SSL_CTX *ssl_ctx; /* SSL context */ Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Wed Jan 18 14:41:26 2012 (r230306) +++ head/lib/libfetch/http.c Wed Jan 18 15:13:21 2012 (r230307) @@ -196,6 +196,8 @@ http_growbuf(struct httpio *io, size_t l static int http_fillbuf(struct httpio *io, size_t len) { + ssize_t nbytes; + if (io->error) return (-1); if (io->eof) @@ -204,10 +206,11 @@ http_fillbuf(struct httpio *io, size_t l if (io->chunked == 0) { if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->bufpos = 0; return (io->buflen); } @@ -227,10 +230,11 @@ http_fillbuf(struct httpio *io, size_t l len = io->chunksize; if (http_growbuf(io, len) == -1) return (-1); - if ((io->buflen = fetch_read(io->conn, io->buf, len)) == -1) { - io->error = 1; + if ((nbytes = fetch_read(io->conn, io->buf, len)) == -1) { + io->error = errno; return (-1); } + io->buflen = nbytes; io->chunksize -= io->buflen; if (io->chunksize == 0) { @@ -272,8 +276,11 @@ http_readfn(void *v, char *buf, int len) io->bufpos += l; } - if (!pos && io->error) + if (!pos && io->error) { + if (io->error == EINTR) + io->error = 0; return (-1); + } return (pos); } Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Wed Jan 18 14:41:26 2012 (r230306) +++ head/usr.bin/fetch/fetch.c Wed Jan 18 15:13:21 2012 (r230307) @@ -317,7 +317,7 @@ fetch(char *URL, const char *path) struct stat sb, nsb; struct xferstat xs; FILE *f, *of; - size_t size, wr; + size_t size, readcnt, wr; off_t count; char flags[8]; const char *slash; @@ -636,21 +636,26 @@ fetch(char *URL, const char *path) stat_end(&xs); siginfo = 0; } - if ((size = fread(buf, 1, size, f)) == 0) { + + if (size == 0) + break; + + if ((readcnt = fread(buf, 1, size, f)) < size) { if (ferror(f) && errno == EINTR && !sigint) clearerr(f); - else + else if (readcnt == 0) break; } - stat_update(&xs, count += size); - for (ptr = buf; size > 0; ptr += wr, size -= wr) - if ((wr = fwrite(ptr, 1, size, of)) < size) { + + stat_update(&xs, count += readcnt); + for (ptr = buf; readcnt > 0; ptr += wr, readcnt -= wr) + if ((wr = fwrite(ptr, 1, readcnt, of)) < readcnt) { if (ferror(of) && errno == EINTR && !sigint) clearerr(of); else break; } - if (size != 0) + if (readcnt != 0) break; } if (!sigalrm) From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 15:25:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B3C106564A; Wed, 18 Jan 2012 15:25:35 +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 2402D8FC1A; Wed, 18 Jan 2012 15:25:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IFPZdN045844; Wed, 18 Jan 2012 15:25:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IFPZEk045842; Wed, 18 Jan 2012 15:25:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201181525.q0IFPZEk045842@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 18 Jan 2012 15:25: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: r230308 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 15:25:35 -0000 Author: bz Date: Wed Jan 18 15:25:34 2012 New Revision: 230308 URL: http://svn.freebsd.org/changeset/base/230308 Log: Unbreak several mips kernel configs after r230150 and r230152 to make a universe complete successfully again. Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Jan 18 15:13:21 2012 (r230307) +++ head/sys/conf/kmod.mk Wed Jan 18 15:25:34 2012 (r230308) @@ -340,6 +340,7 @@ CFLAGS+= ${CONF_CFLAGS} MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \ dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \ + dev/gpio/gpio_if.m dev/gpio/gpiobus_if.m \ dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \ dev/mmc/mmcbr_if.m dev/mmc/mmcbus_if.m \ dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \ From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 15:26:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 668191065674; Wed, 18 Jan 2012 15:26:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 141638FC1F; Wed, 18 Jan 2012 15:26:03 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 2F59925D38FF; Wed, 18 Jan 2012 15:26:02 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 59D74BD9723; Wed, 18 Jan 2012 15:26:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id ysh7qBvEbKgO; Wed, 18 Jan 2012 15:26:00 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0EB12BD9722; Wed, 18 Jan 2012 15:26:00 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: Date: Wed, 18 Jan 2012 15:25:59 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <5FFDDCB8-46C6-4107-AD8D-F79B0E9708ED@FreeBSD.org> References: <201201151943.q0FJhvFH097175@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230152 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 15:26:03 -0000 On 16. Jan 2012, at 12:12 , Bjoern A. Zeeb wrote: >=20 > On 15. Jan 2012, at 19:43 , Adrian Chadd wrote: >=20 >> Author: adrian >> Date: Sun Jan 15 19:43:56 2012 >> New Revision: 230152 >> URL: http://svn.freebsd.org/changeset/base/230152 >>=20 >> Log: >> Build some more things (random, bridge/gif/gre, gpio, USB) as modules = as well >> so some embedded platform builds can use these instead of a fully = monolithic >> kernel. >=20 > I would assume that it's this one together with r230150 that broke the = following kernel configs: >=20 > AR71XX_BASE > PB47 > ROUTERSTATION > ROUTERSTATION_MFS > RSPRO > RSPRO_MFS > RSPRO_STANDALONE >=20 > with: >=20 > make: don't know how to make gpio_if.h. Stop >=20 > Please fix. Never mind. I did in r230308. >=20 >>=20 >> Modified: >> head/sys/mips/conf/AR71XX_BASE >>=20 >> Modified: head/sys/mips/conf/AR71XX_BASE >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/mips/conf/AR71XX_BASE Sun Jan 15 19:42:55 2012 = (r230151) >> +++ head/sys/mips/conf/AR71XX_BASE Sun Jan 15 19:43:56 2012 = (r230152) >> @@ -24,8 +24,9 @@ hints "AR71XX_BASE.hints" >>=20 >> makeoptions DEBUG=3D-g #Build kernel with gdb(1) debug = symbols >>=20 >> -# Also build these as modules, just to ensure the build gets tested. >> -makeoptions MODULES_OVERRIDE=3D"wlan wlan_xauth wlan_acl wlan_wep = wlan_tkip wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" >> +# Build these as modules so small platform builds will have the >> +# modules already built. >> +makeoptions MODULES_OVERRIDE=3D"random gpio ar71xx if_gif if_gre = if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip = wlan_ccmp wlan_rssadapt wlan_amrr ath ath_pci" >>=20 >> options DDB >> options KDB >=20 > --=20 > Bjoern A. Zeeb You have to have = visions! > It does not matter how good you are. It matters what good you do! >=20 --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 15:59:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95580106566B; Wed, 18 Jan 2012 15:59:23 +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 83C328FC17; Wed, 18 Jan 2012 15:59:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IFxNGi046856; Wed, 18 Jan 2012 15:59:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IFxNVa046854; Wed, 18 Jan 2012 15:59:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201181559.q0IFxNVa046854@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 18 Jan 2012 15:59: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: r230309 - head/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 15:59:23 -0000 Author: nwhitehorn Date: Wed Jan 18 15:59:23 2012 New Revision: 230309 URL: http://svn.freebsd.org/changeset/base/230309 Log: Warn if trying to install over an existing partition, which usually fails anyway due to libarchive not being able to overwrite schg flags. PR: bin/164278 MFC after: 4 days Modified: head/usr.sbin/bsdinstall/partedit/partedit.c Modified: head/usr.sbin/bsdinstall/partedit/partedit.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit.c Wed Jan 18 15:25:34 2012 (r230308) +++ head/usr.sbin/bsdinstall/partedit/partedit.c Wed Jan 18 15:59:23 2012 (r230309) @@ -240,23 +240,41 @@ delete_part_metadata(const char *name) static int validate_setup(void) { - struct partition_metadata *md; - int root_found = FALSE; + struct partition_metadata *md, *root = NULL; + int cancel; TAILQ_FOREACH(md, &part_metadata, metadata) { if (md->fstab != NULL && strcmp(md->fstab->fs_file, "/") == 0) - root_found = TRUE; + root = md; /* XXX: Check for duplicate mountpoints */ } - if (!root_found) { + if (root == NULL) { dialog_msgbox("Error", "No root partition was found. " "The root FreeBSD partition must have a mountpoint of '/'.", 0, 0, TRUE); return (FALSE); } + /* + * Check for root partitions that we aren't formatting, which is + * usually a mistake + */ + if (root->newfs == NULL) { + dialog_vars.defaultno = TRUE; + cancel = dialog_yesno("Warning", "The chosen root partition " + "has a preexisting filesystem. If it contains an existing " + "FreeBSD system, please update it with freebsd-update " + "instead of installing a new system on it. The partition " + "can also be erased by pressing \"No\" and then deleting " + "and recreating it. Are you sure you want to proceed?", + 0, 0); + dialog_vars.defaultno = FALSE; + if (cancel) + return (FALSE); + } + return (TRUE); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 17:54:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AAF91065672; Wed, 18 Jan 2012 17:54:41 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC1B8FC1B; Wed, 18 Jan 2012 17:54:40 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0IHsei3000426; Wed, 18 Jan 2012 12:54:40 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0IHseaT000425; Wed, 18 Jan 2012 12:54:40 -0500 (EST) (envelope-from das@freebsd.org) Date: Wed, 18 Jan 2012 12:54:40 -0500 From: David Schultz To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120118175440.GA365@zim.MIT.EDU> Mail-Followup-To: Andrey Chernov , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120118061943.GA80874@vniz.net> Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 17:54:41 -0000 On Wed, Jan 18, 2012, Andrey Chernov wrote: > On Mon, Jan 16, 2012 at 08:18:10PM +0000, David Schultz wrote: > > Author: das > > Date: Mon Jan 16 20:18:10 2012 > > New Revision: 230230 > > URL: http://svn.freebsd.org/changeset/base/230230 > > > > Log: > > Generate a warning if the kernel's arc4random() is seeded with bogus entropy. > > While you are here, could you review/commit my patch to fix bad 31bit > arc4rand() seeding, please? > > --- yarrow.c.bak 2011-09-26 07:35:48.000000000 +0400 > +++ yarrow.c 2012-01-18 10:13:47.000000000 +0400 > @@ -59,6 +59,8 @@ static void reseed(u_int); > /* The reseed thread mutex */ > struct mtx random_reseed_mtx; > > +static arc4rand_seeded = 0; > + > /* Process a single stochastic event off the harvest queue */ > void > random_process_event(struct harvest *event) > @@ -261,6 +263,11 @@ reseed(u_int fastslow) > > /* Release the reseed mutex */ > mtx_unlock(&random_reseed_mtx); > + > + if (!arc4rand_seeded) { > + arc4rand_seeded = 1; > + arc4rand(NULL, 0, 1); > + } > } > > /* Internal function to return processed entropy from the PRNG */ It appears to reseed arc4random's state exactly once, at whatever unpredictable time devrandom decides to reseed itself. Are you trying to fix the problems that arise if random.ko is loaded too late in the boot process? From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 18:26:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B31041065676; Wed, 18 Jan 2012 18:26:56 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1D0D8FC17; Wed, 18 Jan 2012 18:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IIQuZb051826; Wed, 18 Jan 2012 18:26:56 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IIQuLX051824; Wed, 18 Jan 2012 18:26:56 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201201181826.q0IIQuLX051824@svn.freebsd.org> From: Peter Wemm Date: Wed, 18 Jan 2012 18:26:56 +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: r230311 - head/lib/libpam/modules/pam_unix X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 18:26:56 -0000 Author: peter Date: Wed Jan 18 18:26:56 2012 New Revision: 230311 URL: http://svn.freebsd.org/changeset/base/230311 Log: Rev 228065 (change bsd.own.mk -> bsd.init.mk) broke pam_unix.so by causing the LDADD/DPADD to lose the -lpam, and causing openpam_dynamic() to fail due to "openpam_get_options" being undefined. This would cause obscure console log messages like: openpam_dynamic(): No error: 0 openpam_load_module(): no pam_unix.so found and other helpful messages which are no help in diagnosing the problem. Fortunately this change was not mfc'ed to 9.x, it isn't broken there. Modified: head/lib/libpam/modules/pam_unix/Makefile Modified: head/lib/libpam/modules/pam_unix/Makefile ============================================================================== --- head/lib/libpam/modules/pam_unix/Makefile Wed Jan 18 18:22:25 2012 (r230310) +++ head/lib/libpam/modules/pam_unix/Makefile Wed Jan 18 18:26:56 2012 (r230311) @@ -40,8 +40,8 @@ LIB= pam_unix SRCS= pam_unix.c MAN= pam_unix.8 -DPADD= ${LIBUTIL} ${LIBCRYPT} -LDADD= -lutil -lcrypt +DPADD+= ${LIBUTIL} ${LIBCRYPT} +LDADD+= -lutil -lcrypt .if ${MK_NIS} != "no" CFLAGS+= -DYP From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 18:49:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1F2E106566B; Wed, 18 Jan 2012 18:49:07 +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 890FF8FC08; Wed, 18 Jan 2012 18:49:07 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 2295046B06; Wed, 18 Jan 2012 13:49:07 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A53F2B968; Wed, 18 Jan 2012 13:49:06 -0500 (EST) From: John Baldwin To: Pyun YongHyeon Date: Wed, 18 Jan 2012 09:53:51 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201172215.q0HMFXgI009891@svn.freebsd.org> In-Reply-To: <201201172215.q0HMFXgI009891@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201180953.51362.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 18 Jan 2012 13:49:06 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230286 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 18:49:07 -0000 On Tuesday, January 17, 2012 5:15:33 pm Pyun YongHyeon wrote: > Author: yongari > Date: Tue Jan 17 22:15:33 2012 > New Revision: 230286 > URL: http://svn.freebsd.org/changeset/base/230286 > > Log: > Introduce a tunable that disables use of MSI. > Non-zero value will use INTx. Hmm, do you think it is best to do this on a per-device level vs a per-driver level (e.g. a 'hw..msi' tunable ala mfi(4))? Also, I think it is better to have a flag whose value more closely matches enable/disable (so 1 for enable, etc.) and default it to on, than to have a 'disable' tunable. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 18:49:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE78C1065670; Wed, 18 Jan 2012 18:49:09 +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 A4C568FC18; Wed, 18 Jan 2012 18:49:09 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 5A46A46B09; Wed, 18 Jan 2012 13:49:09 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9B127B96B; Wed, 18 Jan 2012 13:49:08 -0500 (EST) From: John Baldwin To: davidxu@freebsd.org Date: Wed, 18 Jan 2012 10:09:23 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <201201170957.47718.jhb@freebsd.org> <4F1629D5.4020605@gmail.com> In-Reply-To: <4F1629D5.4020605@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201181009.23221.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 18 Jan 2012 13:49:08 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 18:49:09 -0000 On Tuesday, January 17, 2012 9:09:25 pm David Xu wrote: > On 2012/1/17 22:57, John Baldwin wrote: > > On Monday, January 16, 2012 1:15:14 am David Xu wrote: > >> Author: davidxu > >> Date: Mon Jan 16 06:15:14 2012 > >> New Revision: 230201 > >> URL: http://svn.freebsd.org/changeset/base/230201 > >> > >> Log: > >> Insert read memory barriers. > > I think using atomic_load_acq() on sem->nwaiters would be clearer as it would > > indicate which variable you need to ensure is read after other operations. In > > general I think raw rmb/wmb usage should be avoided when possible as it is > > does not describe the programmer's intent as well. > > > Yes, I had considered that I may use atomic_load_acq(), but at that time, > I thought it emits a bus locking, right ? so I just picked up rmb() which > only affects current cpu. maybe atomic_load_acq() does same thing with > rmb() ? > it is still unclear to me. atomic_load_acq() is the same as rmb(). Right now it uses a locked instruction on amd64, but it could easily switch to lfence/sfence instead. I had patches to do that but I think bde@ had done some benchmarks that showed that change made no difference. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 18:49:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 779521065672; Wed, 18 Jan 2012 18:49:10 +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 4C48C8FC19; Wed, 18 Jan 2012 18:49:10 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 02F2F46B06; Wed, 18 Jan 2012 13:49:10 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 52C5FB968; Wed, 18 Jan 2012 13:49:09 -0500 (EST) From: John Baldwin To: Eygene Ryabinkin Date: Wed, 18 Jan 2012 10:11:04 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201120648.q0C6mBio096662@svn.freebsd.org> <76N5o2cbOG1xa+/PCENoyerLpsM@HbohoBmewgxm0atwUoKO7zhAAgw> In-Reply-To: <76N5o2cbOG1xa+/PCENoyerLpsM@HbohoBmewgxm0atwUoKO7zhAAgw> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201201181011.04397.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 18 Jan 2012 13:49:09 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 18:49:10 -0000 On Wednesday, January 18, 2012 6:29:10 am Eygene Ryabinkin wrote: > Fri, Jan 13, 2012 at 11:21:48AM +0400, Eygene Ryabinkin wrote: > > But seems like the whole problem is that I used the err() function > > instead of doing 'echo $errmsg; exit 1'. Such code shouldn't be > > conditionalized for the devd, since it is only syslog message that > > worried people; devd doesn't care what is written to the standard > > output or the standard error by the scripts it invokes once it become > > the daemon, since everything goes to /dev/null after calling > > daemon(3). > > > > So, seems like that the following dhclient_pre_check() will make > > everyone happy: > > {{{ > > dhclient_pre_check() > > { > > if [ -z "${rc_force}" ] && ! dhcpif $ifn; then > > echo "'$ifn' is not a DHCP-enabled interface" > > exit 1 > > fi > > } > > }}} > > Hadn't tested it yet, but will do it today. > > The attached patch that just changes 'err' to 'echo ...; exit 1' > works fine for me. > > Any views on it? Seems ok to me. > > The related topic: in the process of grepping for dhclient within > > /etc, I had found that /etc/netstart still wants to invoke it. But it > > will do a lone '/etc/rc.d/dhclient quietstart' and this will never > > be useful in the current state of dhclient: it will refuse to process > > any commands without the interface being specified. And since we > > have the invocation of /etc/rc.d/netif just two lines above, I think > > that it will be good to remove call to dhclient from /etc/netstart. > > > > At the time of the original addition of call to dhclient to /etc/netstart > > (r114213), dhclient script had another form, > > http://svnweb.freebsd.org/base/head/etc/rc.d/dhclient?revision=113759&view=markup&pathrev=114213 > > and it was really a normal rc.d script that requires only one argument. > > Now it is more of a helper-type script. > > . > > Am I missing something important here or the removal can really be > > done? > > Anyone can say anything about /etc/netstart issue? My guess is that it is ok to remove it from netstart. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 19:05:28 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45EDF1065674; Wed, 18 Jan 2012 19:05:28 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id B007B8FC20; Wed, 18 Jan 2012 19:05:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0IJ5PEK010000; Wed, 18 Jan 2012 23:05:25 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0IJ5PqU009999; Wed, 18 Jan 2012 23:05:25 +0400 (MSK) (envelope-from ache) Date: Wed, 18 Jan 2012 23:05:24 +0400 From: Andrey Chernov To: src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120118190524.GA9847@vniz.net> Mail-Followup-To: Andrey Chernov , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> <20120118175440.GA365@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120118175440.GA365@zim.MIT.EDU> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 19:05:28 -0000 On Wed, Jan 18, 2012 at 12:54:40PM -0500, David Schultz wrote: > It appears to reseed arc4random's state exactly once, at whatever > unpredictable time devrandom decides to reseed itself. Are you As fast as possible, immediatelly when we have enough good entropy. > trying to fix the problems that arise if random.ko is loaded too > late in the boot process? There is only _initial_ seeding security problem with arc4rand() and not only when random.ko is not loaded, but when it is loaded too and don't harvest enough entropy yet. All late stages don't have security problem because arc4rand() periodically reseeds itself from yarrow when ARC4_RESEED_SECONDS is expired. About random.ko loading itself, this is separate question and I already express opinion to make random.ko not optional but required kernel module. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 19:07:15 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ED3A1065670; Wed, 18 Jan 2012 19:07:15 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 15E8D8FC22; Wed, 18 Jan 2012 19:07:14 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0IJ7Eb1025180; Wed, 18 Jan 2012 14:07:14 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0IJ7E7u025179; Wed, 18 Jan 2012 14:07:14 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Wed, 18 Jan 2012 14:07:14 -0500 From: David Schultz To: David Chisnall Message-ID: <20120118190714.GA13375@zim.MIT.EDU> Mail-Followup-To: David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111201445.pAKEjgNR096676@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111201445.pAKEjgNR096676@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r227753 - in head: contrib/gdtoa include lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 19:07:15 -0000 On Sun, Nov 20, 2011, David Chisnall wrote: > Author: theraven > Date: Sun Nov 20 14:45:42 2011 > New Revision: 227753 > URL: http://svn.freebsd.org/changeset/base/227753 > > Log: > Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a > load of _l suffixed versions of various standard library functions that use > the global locale, making them take an explicit locale parameter. Also > adds support for per-thread locales. This work was funded by the FreeBSD > Foundation. > > Please test any code you have that uses the C standard locale functions! > > Reviewed by: das (gdtoa changes) > Approved by: dim (mentor) This patch appears to cause a large performance regression. For example, I measured a 78% slowdown for strtol(" 42", ...). Furthermore, the resulting static binary for a trivial program goes from 7k to 303k, due to pulling in malloc, stdio, and all the pthread stubs. Presumably the capabilities of the non-xlocale entry points aren't appreciably changed, so there ought to be a way to avoid the overhead for them. Do you have any thoughts on this? Some more minor issues... It's also customary to document public APIs so that, for instance, `man printf_l' pulls up a page with the prototype, required #includes, and behavior. Aliasing manpages with MLINKS as appropriate is fine; for instance, Darwin's manpages on these functions look like a good example to follow. Finally, I'm not usually one to be picky about style, but could you make a pass to clean things up a little bit to match the surrounding code, wrap multiline comments to 80 columns, etc? You've also added new copyright notices for one-line changes (e.g., stdio/vdprintf.c, gdtoa/machdep_ldis?.c) and multiple copyright notices in the same file (locale/collate.c), which could be cleaned up concurrently. From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 19:12:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F8911065673; Wed, 18 Jan 2012 19:12:33 +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 5CEF68FC13; Wed, 18 Jan 2012 19:12:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IJCXsI053312; Wed, 18 Jan 2012 19:12:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IJCXk4053306; Wed, 18 Jan 2012 19:12:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201181912.q0IJCXk4053306@svn.freebsd.org> From: Alexander Motin Date: Wed, 18 Jan 2012 19:12: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: r230312 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 19:12:33 -0000 Author: mav Date: Wed Jan 18 19:12:33 2012 New Revision: 230312 URL: http://svn.freebsd.org/changeset/base/230312 Log: Improve HDMI/DisplayPort audio support in snd_hda(4): - Enable and handle unsolicited responses from digital display pins, reporting connection and EDID-Like Data (ELD) validity status changes. - Fetch ELD data, describing connected digital display device audio capabilities. These data not really used at the moment (user is not denied to use audio formats not supported by the device), only printed to verbose logs. But they are useful for debugging. The fact that ELD was received tells that HDMI link was established and video driver enabled HDMI audio passthrough. Some old chips may not return ELD, so lack of it is not necessary a problem. - Add some more points to CODEC configuration sequence: - For converter widgets, supporting more then two channels (HDMI/DP converter widgets support 8), set number of channels to handle. - For digital display pins (HDMI/DP) fill audio infoframe, reporting connected device about number of channels and speakers allocation. - For digital display pins (HDMI/DP) set mapping between channels seen by software and channels transferred via HDMI/DisplayPort. - Allow more audio formats, not used for analog connections because of stereo pairs orientation, but easily applicable to HDMI/DisplayPort: 2.1, 3.0, 3.1, 4.1, 5.0, 6.0, 6.1, 7.0. That list may be filtered later using info from ELD. - Disable MSI interrupts for NVIDIA HDA controllers before GT520. At this point I can successfully play audio over HDMI from NVIDIA GT210 and GT520 cards with nvidia-driver-290.10 driver to Marantz SR4001 receiver in 2.0, 2.1, 3.0, 4.0, 4.1, 5.0 and 5.1 PCM formats at 44, 48, 88 and 96KHz at 16 and 24 bits, same as do AC3/DTS passthrough. 6.0, 6.1, 7.0 and 7.1 PCM formats are not working for me, but I think it is because of receiver age. MFC after: 2 months Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hda_reg.h head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdaa.h head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hda_reg.h ============================================================================== --- head/sys/dev/sound/pci/hda/hda_reg.h Wed Jan 18 18:26:56 2012 (r230311) +++ head/sys/dev/sound/pci/hda/hda_reg.h Wed Jan 18 19:12:33 2012 (r230312) @@ -419,6 +419,7 @@ HDA_CMD_VERB_SET_PIN_SENSE, (payload))) #define HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT 0x80000000 +#define HDA_CMD_GET_PIN_SENSE_ELD_VALID 0x40000000 #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE_MASK 0x7fffffff #define HDA_CMD_GET_PIN_SENSE_IMP_SENSE_SHIFT 0 @@ -675,17 +676,47 @@ HDA_CMD_VERB_SET_CONV_CHAN_COUNT, (payload))) #define HDA_CMD_VERB_GET_HDMI_DIP_SIZE 0xf2e + +#define HDA_CMD_GET_HDMI_DIP_SIZE(cad, nid, arg) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_DIP_SIZE, (arg))) + #define HDA_CMD_VERB_GET_HDMI_ELDD 0xf2f +#define HDA_CMD_GET_HDMI_ELDD(cad, nid, off) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_ELDD, (off))) + #define HDA_CMD_VERB_GET_HDMI_DIP_INDEX 0xf30 #define HDA_CMD_VERB_SET_HDMI_DIP_INDEX 0x730 +#define HDA_CMD_GET_HDMI_DIP_INDEX(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_DIP_INDEX, 0x0)) +#define HDA_CMD_SET_HDMI_DIP_INDEX(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_HDMI_DIP_INDEX, (payload))) + #define HDA_CMD_VERB_GET_HDMI_DIP_DATA 0xf31 #define HDA_CMD_VERB_SET_HDMI_DIP_DATA 0x731 +#define HDA_CMD_GET_HDMI_DIP_DATA(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_DIP_DATA, 0x0)) +#define HDA_CMD_SET_HDMI_DIP_DATA(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_HDMI_DIP_DATA, (payload))) + #define HDA_CMD_VERB_GET_HDMI_DIP_XMIT 0xf32 #define HDA_CMD_VERB_SET_HDMI_DIP_XMIT 0x732 +#define HDA_CMD_GET_HDMI_DIP_XMIT(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_DIP_XMIT, 0x0)) +#define HDA_CMD_SET_HDMI_DIP_XMIT(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_HDMI_DIP_XMIT, (payload))) + #define HDA_CMD_VERB_GET_HDMI_CP_CTRL 0xf33 #define HDA_CMD_VERB_SET_HDMI_CP_CTRL 0x733 @@ -699,6 +730,23 @@ (HDA_CMD_12BIT((cad), (nid), \ HDA_CMD_VERB_SET_HDMI_CHAN_SLOT, (payload))) +#define HDA_HDMI_CODING_TYPE_REF_STREAM_HEADER 0 +#define HDA_HDMI_CODING_TYPE_LPCM 1 +#define HDA_HDMI_CODING_TYPE_AC3 2 +#define HDA_HDMI_CODING_TYPE_MPEG1 3 +#define HDA_HDMI_CODING_TYPE_MP3 4 +#define HDA_HDMI_CODING_TYPE_MPEG2 5 +#define HDA_HDMI_CODING_TYPE_AACLC 6 +#define HDA_HDMI_CODING_TYPE_DTS 7 +#define HDA_HDMI_CODING_TYPE_ATRAC 8 +#define HDA_HDMI_CODING_TYPE_SACD 9 +#define HDA_HDMI_CODING_TYPE_EAC3 10 +#define HDA_HDMI_CODING_TYPE_DTS_HD 11 +#define HDA_HDMI_CODING_TYPE_MLP 12 +#define HDA_HDMI_CODING_TYPE_DST 13 +#define HDA_HDMI_CODING_TYPE_WMAPRO 14 +#define HDA_HDMI_CODING_TYPE_REF_CTX 15 + /* Function Reset */ #define HDA_CMD_VERB_FUNCTION_RESET 0x7ff Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Wed Jan 18 18:26:56 2012 (r230311) +++ head/sys/dev/sound/pci/hda/hdaa.c Wed Jan 18 19:12:33 2012 (r230312) @@ -116,6 +116,12 @@ const char *HDA_LOCS[64] = { const char *HDA_GPIO_ACTIONS[8] = { "keep", "set", "clear", "disable", "input", "0x05", "0x06", "0x07"}; +const char *HDA_HDMI_CODING_TYPES[18] = { + "undefined", "LPCM", "AC-3", "MPEG1", "MP3", "MPEG2", "AAC-LC", "DTS", + "ATRAC", "DSD", "E-AC-3", "DTS-HD", "MLP", "DST", "WMAPro", "HE-AAC", + "HE-AACv2", "MPEG-Surround" +}; + /* Default */ static uint32_t hdaa_fmt[] = { SND_FORMAT(AFMT_S16_LE, 2, 0), @@ -246,43 +252,38 @@ hdaa_audio_ctl_amp_get(struct hdaa_devin * Jack detection (Speaker/HP redirection) event handler. */ static void -hdaa_hp_switch_handler(struct hdaa_devinfo *devinfo, int asid) +hdaa_hp_switch_handler(struct hdaa_widget *w) { + struct hdaa_devinfo *devinfo = w->devinfo; struct hdaa_audio_as *as; - struct hdaa_widget *w; + struct hdaa_widget *w1; struct hdaa_audio_ctl *ctl; uint32_t val, res; int j; - as = &devinfo->as[asid]; - if (as->hpredir < 0) - return; - - w = hdaa_widget_get(devinfo, as->pins[15]); - if (w == NULL || w->enable == 0 || w->type != + if (w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) return; - res = hda_command(devinfo->dev, - HDA_CMD_GET_PIN_SENSE(0, as->pins[15])); - + res = hda_command(devinfo->dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); HDA_BOOTVERBOSE( device_printf(devinfo->dev, - "Pin sense: nid=%d sence=0x%08x", - as->pins[15], res); + "Pin sense: nid=%d sence=0x%08x", w->nid, res); ); - res = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; if (devinfo->quirks & HDAA_QUIRK_SENSEINV) res ^= 1; - HDA_BOOTVERBOSE( - printf(" %sconnected\n", res == 0 ? "dis" : ""); + printf(" (%sconnected)\n", res == 0 ? "dis" : ""); ); + as = &devinfo->as[w->bindas]; + if (as->hpredir < 0 || as->pins[15] != w->nid) + return; + /* (Un)Mute headphone pin. */ ctl = hdaa_audio_ctl_amp_get(devinfo, - as->pins[15], HDAA_CTL_IN, -1, 1); + w->nid, HDAA_CTL_IN, -1, 1); if (ctl != NULL && ctl->mute) { /* If pin has muter - use it. */ val = (res != 0) ? 0 : 1; @@ -294,21 +295,17 @@ hdaa_hp_switch_handler(struct hdaa_devin } } else { /* If there is no muter - disable pin output. */ - w = hdaa_widget_get(devinfo, as->pins[15]); - if (w != NULL && w->type == - HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - if (res != 0) - val = w->wclass.pin.ctrl | - HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; - else - val = w->wclass.pin.ctrl & - ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; - if (val != w->wclass.pin.ctrl) { - w->wclass.pin.ctrl = val; - hda_command(devinfo->dev, - HDA_CMD_SET_PIN_WIDGET_CTRL(0, - w->nid, w->wclass.pin.ctrl)); - } + if (res != 0) + val = w->wclass.pin.ctrl | + HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + else + val = w->wclass.pin.ctrl & + ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; + if (val != w->wclass.pin.ctrl) { + w->wclass.pin.ctrl = val; + hda_command(devinfo->dev, + HDA_CMD_SET_PIN_WIDGET_CTRL(0, + w->nid, w->wclass.pin.ctrl)); } } /* (Un)Mute other pins. */ @@ -329,20 +326,20 @@ hdaa_hp_switch_handler(struct hdaa_devin continue; } /* If there is no muter - disable pin output. */ - w = hdaa_widget_get(devinfo, as->pins[j]); - if (w != NULL && w->type == + w1 = hdaa_widget_get(devinfo, as->pins[j]); + if (w1 != NULL && w1->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { if (res != 0) - val = w->wclass.pin.ctrl & + val = w1->wclass.pin.ctrl & ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; else - val = w->wclass.pin.ctrl | + val = w1->wclass.pin.ctrl | HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; - if (val != w->wclass.pin.ctrl) { - w->wclass.pin.ctrl = val; + if (val != w1->wclass.pin.ctrl) { + w1->wclass.pin.ctrl = val; hda_command(devinfo->dev, HDA_CMD_SET_PIN_WIDGET_CTRL(0, - w->nid, w->wclass.pin.ctrl)); + w1->nid, w1->wclass.pin.ctrl)); } } } @@ -355,6 +352,7 @@ static void hdaa_jack_poll_callback(void *arg) { struct hdaa_devinfo *devinfo = arg; + struct hdaa_widget *w; int i; hdaa_lock(devinfo); @@ -365,7 +363,11 @@ hdaa_jack_poll_callback(void *arg) for (i = 0; i < devinfo->ascnt; i++) { if (devinfo->as[i].hpredir < 0) continue; - hdaa_hp_switch_handler(devinfo, i); + w = hdaa_widget_get(devinfo, devinfo->as[i].pins[15]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + hdaa_hp_switch_handler(w); } callout_reset(&devinfo->poll_jack, devinfo->poll_ival, hdaa_jack_poll_callback, devinfo); @@ -397,15 +399,17 @@ hdaa_hp_switch_init(struct hdaa_devinfo as[i].pins[15]); continue; } - if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) { - as[i].unsol = HDAC_UNSOL_ALLOC( + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) && + w->unsol < 0) { + w->unsol = HDAC_UNSOL_ALLOC( device_get_parent(devinfo->dev), devinfo->dev, w->nid); hda_command(devinfo->dev, HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | - as[i].unsol)); - } else + w->unsol)); + } + if (w->unsol < 0) poll = 1; HDA_BOOTVERBOSE( device_printf(devinfo->dev, @@ -414,7 +418,7 @@ hdaa_hp_switch_init(struct hdaa_devinfo i, w->nid, (poll != 0) ? "polling" : "unsolicited responses"); ); - hdaa_hp_switch_handler(devinfo, i); + hdaa_hp_switch_handler(w); } if (poll) { callout_reset(&devinfo->poll_jack, 1, @@ -430,18 +434,208 @@ hdaa_hp_switch_deinit(struct hdaa_devinf int i; for (i = 0; i < devinfo->ascnt; i++) { - if (as[i].unsol < 0) - continue; w = hdaa_widget_get(devinfo, as[i].pins[15]); if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; + if (HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) || + HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + continue; + if (w->unsol < 0) + continue; hda_command(devinfo->dev, HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, 0)); HDAC_UNSOL_FREE( device_get_parent(devinfo->dev), devinfo->dev, - as[i].unsol); - as[i].unsol = -1; + w->unsol); + w->unsol = -1; + } +} + +static void +hdaa_eld_dump(struct hdaa_widget *w) +{ + struct hdaa_devinfo *devinfo = w->devinfo; + device_t dev = devinfo->dev; + uint8_t *sad; + int len, mnl, i, sadc, fmt; + + if (w->eld == NULL || w->eld_len < 4) + return; + device_printf(dev, + "ELD nid=%d: ELD_Ver=%u Baseline_ELD_Len=%u\n", + w->nid, w->eld[0] >> 3, w->eld[2]); + if ((w->eld[0] >> 3) != 0x02) + return; + len = min(w->eld_len, (u_int)w->eld[2] * 4); + mnl = w->eld[4] & 0x1f; + device_printf(dev, + "ELD nid=%d: CEA_EDID_Ver=%u MNL=%u\n", + w->nid, w->eld[4] >> 5, mnl); + sadc = w->eld[5] >> 4; + device_printf(dev, + "ELD nid=%d: SAD_Count=%u Conn_Type=%u S_AI=%u HDCP=%u\n", + w->nid, sadc, (w->eld[5] >> 2) & 0x3, + (w->eld[5] >> 1) & 0x1, w->eld[5] & 0x1); + device_printf(dev, + "ELD nid=%d: Aud_Synch_Delay=%ums\n", + w->nid, w->eld[6] * 2); + device_printf(dev, + "ELD nid=%d: Channels=0x%b\n", + w->nid, w->eld[7], + "\020\07RLRC\06FLRC\05RC\04RLR\03FC\02LFE\01FLR"); + device_printf(dev, + "ELD nid=%d: Port_ID=0x%02x%02x%02x%02x%02x%02x%02x%02x\n", + w->nid, w->eld[8], w->eld[9], w->eld[10], w->eld[11], + w->eld[12], w->eld[13], w->eld[14], w->eld[15]); + device_printf(dev, + "ELD nid=%d: Manufacturer_Name=0x%02x%02x\n", + w->nid, w->eld[16], w->eld[17]); + device_printf(dev, + "ELD nid=%d: Product_Code=0x%02x%02x\n", + w->nid, w->eld[18], w->eld[19]); + device_printf(dev, + "ELD nid=%d: Monitor_Name_String='%.*s'\n", + w->nid, mnl, &w->eld[20]); + for (i = 0; i < sadc; i++) { + sad = &w->eld[20 + mnl + i * 3]; + fmt = (sad[0] >> 3) & 0x0f; + if (fmt == HDA_HDMI_CODING_TYPE_REF_CTX) { + fmt = (sad[2] >> 3) & 0x1f; + if (fmt < 1 || fmt > 3) + fmt = 0; + else + fmt += 14; + } + device_printf(dev, + "ELD nid=%d: %s %dch freqs=0x%b", + w->nid, HDA_HDMI_CODING_TYPES[fmt], (sad[0] & 0x07) + 1, + sad[1], "\020\007192\006176\00596\00488\00348\00244\00132"); + switch (fmt) { + case HDA_HDMI_CODING_TYPE_LPCM: + printf(" sizes=0x%b", + sad[2] & 0x07, "\020\00324\00220\00116"); + break; + case HDA_HDMI_CODING_TYPE_AC3: + case HDA_HDMI_CODING_TYPE_MPEG1: + case HDA_HDMI_CODING_TYPE_MP3: + case HDA_HDMI_CODING_TYPE_MPEG2: + case HDA_HDMI_CODING_TYPE_AACLC: + case HDA_HDMI_CODING_TYPE_DTS: + case HDA_HDMI_CODING_TYPE_ATRAC: + printf(" max_bitrate=%d", sad[2] * 8000); + break; + case HDA_HDMI_CODING_TYPE_WMAPRO: + printf(" profile=%d", sad[2] & 0x07); + break; + } + printf("\n"); + } +} + +static void +hdaa_eld_handler(struct hdaa_widget *w) +{ + struct hdaa_devinfo *devinfo = w->devinfo; + uint32_t res; + int i; + + if (w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + return; + + if (w->eld != NULL) { + w->eld_len = 0; + free(w->eld, M_HDAA); + w->eld = NULL; + } + + res = hda_command(devinfo->dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x " + "(%sconnected, ELD %svalid)\n", + w->nid, res, + (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) ? "" : "dis", + (res & HDA_CMD_GET_PIN_SENSE_ELD_VALID) ? "" : "in"); + ); + if ((res & HDA_CMD_GET_PIN_SENSE_ELD_VALID) == 0) + return; + + res = hda_command(devinfo->dev, + HDA_CMD_GET_HDMI_DIP_SIZE(0, w->nid, 0x08)); + if (res == HDA_INVALID) + return; + w->eld_len = res & 0xff; + if (w->eld_len != 0) + w->eld = malloc(w->eld_len, M_HDAA, M_ZERO | M_NOWAIT); + if (w->eld == NULL) { + w->eld_len = 0; + return; + } + + for (i = 0; i < w->eld_len; i++) { + res = hda_command(devinfo->dev, + HDA_CMD_GET_HDMI_ELDD(0, w->nid, i)); + if (res & 0x80000000) + w->eld[i] = res & 0xff; + } + HDA_BOOTVERBOSE( + hdaa_eld_dump(w); + ); +} + + +static void +hdaa_eld_init(struct hdaa_devinfo *devinfo) +{ + struct hdaa_widget *w; + int i; + + for (i = devinfo->startnode; i < devinfo->endnode; i++) { + w = hdaa_widget_get(devinfo, i); + if (w == NULL || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + if (!HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) && + !HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + continue; + if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) && + w->unsol < 0) { + w->unsol = HDAC_UNSOL_ALLOC( + device_get_parent(devinfo->dev), devinfo->dev, + w->nid); + hda_command(devinfo->dev, + HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, + HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | + w->unsol)); + } + hdaa_eld_handler(w); + } +} + +static void +hdaa_eld_deinit(struct hdaa_devinfo *devinfo) +{ + struct hdaa_widget *w; + int i; + + for (i = devinfo->startnode; i < devinfo->endnode; i++) { + w = hdaa_widget_get(devinfo, i); + if (w == NULL || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + if (!HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) && + !HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + continue; + if (w->unsol < 0) + continue; + hda_command(devinfo->dev, + HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, 0)); + HDAC_UNSOL_FREE( + device_get_parent(devinfo->dev), devinfo->dev, + w->unsol); + w->unsol = -1; } } @@ -938,6 +1132,7 @@ hdaa_widget_parse(struct hdaa_widget *w) hdaa_sysctl_config, "A", "Original pin configuration"); hdaa_lock(w->devinfo); } + w->unsol = -1; } static void @@ -1197,27 +1392,42 @@ static void hdaa_audio_setup(struct hdaa_chan *ch) { struct hdaa_audio_as *as = &ch->devinfo->as[ch->as]; - struct hdaa_widget *w; - int i, chn, totalchn, c; + struct hdaa_widget *w, *wp; + int i, j, k, chn, cchn, totalchn, totalextchn, c; uint16_t fmt, dfmt; - uint16_t chmap[2][5] = {{ 0x0010, 0x0001, 0x0201, 0x0231, 0x0231 }, /* 5.1 */ - { 0x0010, 0x0001, 0x2001, 0x2031, 0x2431 }};/* 7.1 */ - int map = -1; + /* Mapping channel pairs to codec pins/converters. */ + const static uint16_t convmap[2][5] = + {{ 0x0010, 0x0001, 0x0201, 0x0231, 0x0231 }, /* 5.1 */ + { 0x0010, 0x0001, 0x2001, 0x2031, 0x2431 }};/* 7.1 */ + /* Mapping formats to HDMI channel allocations. */ + const static uint8_t hdmica[2][8] = + {{ 0x02, 0x00, 0x04, 0x08, 0x0a, 0x0e, 0x12, 0x12 }, /* x.0 */ + { 0x01, 0x03, 0x01, 0x03, 0x09, 0x0b, 0x0f, 0x13 }}; /* x.1 */ + /* Mapping formats to HDMI channels order. */ + const static uint32_t hdmich[2][8] = + {{ 0xFFFF0F00, 0xFFFFFF10, 0xFFF2FF10, 0xFF32FF10, + 0xFF324F10, 0xF5324F10, 0x54326F10, 0x54326F10 }, /* x.0 */ + { 0xFFFFF000, 0xFFFF0100, 0xFFFFF210, 0xFFFF2310, + 0xFF32F410, 0xFF324510, 0xF6324510, 0x76325410 }}; /* x.1 */ + int convmapid = -1; + nid_t nid; + uint8_t csum; totalchn = AFMT_CHANNEL(ch->fmt); + totalextchn = AFMT_EXTCHANNEL(ch->fmt); HDA_BOOTHVERBOSE( device_printf(ch->pdevinfo->dev, - "PCMDIR_%s: Stream setup fmt=%08x speed=%d\n", + "PCMDIR_%s: Stream setup fmt=%08x (%d.%d) speed=%d\n", (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", - ch->fmt, ch->spd); + ch->fmt, totalchn - totalextchn, totalextchn, ch->spd); ); fmt = hdaa_stream_format(ch); - /* Set channel mapping for known speaker setups. */ + /* Set channels to I/O converters mapping for known speaker setups. */ if ((as->pinset == 0x0007 || as->pinset == 0x0013)) /* Standard 5.1 */ - map = 0; + convmapid = 0; else if (as->pinset == 0x0017) /* Standard 7.1 */ - map = 1; + convmapid = 1; dfmt = HDA_CMD_SET_DIGITAL_CONV_FMT1_DIGEN; if (ch->fmt & AFMT_AC3) @@ -1234,22 +1444,16 @@ hdaa_audio_setup(struct hdaa_chan *ch) if (as->fakeredir && i == (as->pincnt - 1)) { c = (ch->sid << 4); } else { - if (map >= 0) /* Map known speaker setups. */ - chn = (((chmap[map][totalchn / 2] >> i * 4) & - 0xf) - 1) * 2; + /* Map channels to I/O converters, if set. */ + if (convmapid >= 0) + chn = (((convmap[convmapid][totalchn / 2] + >> i * 4) & 0xf) - 1) * 2; if (chn < 0 || chn >= totalchn) { c = 0; } else { c = (ch->sid << 4) | chn; } } - HDA_BOOTHVERBOSE( - device_printf(ch->pdevinfo->dev, - "PCMDIR_%s: Stream setup nid=%d: " - "fmt=0x%04x, dfmt=0x%04x, chan=0x%04x\n", - (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", - ch->io[i], fmt, dfmt, c); - ); hda_command(ch->devinfo->dev, HDA_CMD_SET_CONV_FMT(0, ch->io[i], fmt)); if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) { @@ -1258,15 +1462,93 @@ hdaa_audio_setup(struct hdaa_chan *ch) } hda_command(ch->devinfo->dev, HDA_CMD_SET_CONV_STREAM_CHAN(0, ch->io[i], c)); -#if 0 - hda_command(ch->devinfo->dev, - HDA_CMD_SET_CONV_CHAN_COUNT(0, ch->io[i], 1)); - hda_command(ch->devinfo->dev, - HDA_CMD_SET_HDMI_CHAN_SLOT(0, ch->io[i], 0x00)); - hda_command(ch->devinfo->dev, - HDA_CMD_SET_HDMI_CHAN_SLOT(0, ch->io[i], 0x11)); -#endif - chn += HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) + 1; + cchn = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap); + if (cchn > 1 && chn < totalchn) { + cchn = min(cchn, totalchn - chn - 1); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_CONV_CHAN_COUNT(0, ch->io[i], cchn)); + } + HDA_BOOTHVERBOSE( + device_printf(ch->pdevinfo->dev, + "PCMDIR_%s: Stream setup nid=%d: " + "fmt=0x%04x, dfmt=0x%04x, chan=0x%04x, " + "chan_count=0x%02x\n", + (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", + ch->io[i], fmt, dfmt, c, cchn); + ); + for (j = 0; j < 16; j++) { + if (as->dacs[ch->asindex][j] != ch->io[i]) + continue; + nid = as->pins[j]; + wp = hdaa_widget_get(ch->devinfo, nid); + if (wp == NULL) + continue; + if (!HDA_PARAM_PIN_CAP_DP(wp->wclass.pin.cap) && + !HDA_PARAM_PIN_CAP_HDMI(wp->wclass.pin.cap)) + continue; + + /* Set channel mapping. */ + for (k = 0; k < 8; k++) { + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_CHAN_SLOT(0, nid, + (((hdmich[totalextchn == 0 ? 0 : 1][totalchn - 1] + >> (k * 4)) & 0xf) << 4) | k)); + } + + /* Stop audio infoframe transmission. */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_XMIT(0, nid, 0x00)); + + /* Clear audio infoframe buffer. */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); + for (k = 0; k < 32; k++) + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x00)); + + /* Write HDMI/DisplayPort audio infoframe. */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); + if (w->eld != NULL && w->eld_len >= 6 && + ((w->eld[5] >> 2) & 0x3) == 1) { /* DisplayPort */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x84)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x1b)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x44)); + } else { /* HDMI */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x84)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x01)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x0a)); + csum = 0; + csum -= 0x84 + 0x01 + 0x0a + (totalchn - 1) + + hdmica[totalextchn == 0 ? 0 : 1][totalchn - 1]; + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, csum)); + } + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, totalchn - 1)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x00)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, 0x00)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_DATA(0, nid, + hdmica[totalextchn == 0 ? 0 : 1][totalchn - 1])); + + /* Start audio infoframe transmission. */ + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); + hda_command(ch->devinfo->dev, + HDA_CMD_SET_HDMI_DIP_XMIT(0, nid, 0xc0)); + } + chn += cchn + 1; } } @@ -2169,7 +2451,6 @@ hdaa_audio_as_parse(struct hdaa_devinfo as[i].hpredir = -1; as[i].digital = 0; as[i].num_chans = 1; - as[i].unsol = -1; as[i].location = -1; } @@ -4277,21 +4558,51 @@ hdaa_pcmchannel_setup(struct hdaa_chan * if (ch->bit32) ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 2, 0); } - if (channels == 4 || /* Any 4-channel */ - pinset == 0x0007 || /* 5.1 */ - pinset == 0x0013 || /* 5.1 */ - pinset == 0x0017) { /* 7.1 */ + if (channels >= 3 && !onlystereo) { + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 3, 0); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 3, 0); + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 3, 1); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 3, 1); + } + if (channels >= 4) { ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 4, 0); if (ch->bit32) ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 4, 0); + if (!onlystereo) { + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 4, 1); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 4, 1); + } } - if (channels == 6 || /* Any 6-channel */ - pinset == 0x0017) { /* 7.1 */ + if (channels >= 5 && !onlystereo) { + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 5, 0); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 5, 0); + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 5, 1); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 5, 1); + } + if (channels >= 6) { ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 6, 1); if (ch->bit32) ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 6, 1); + if (!onlystereo) { + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 6, 0); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 6, 0); + } + } + if (channels >= 7 && !onlystereo) { + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 7, 0); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 7, 0); + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 7, 1); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 7, 1); } - if (channels == 8) { /* Any 8-channel */ + if (channels >= 8) { ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 8, 1); if (ch->bit32) ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 8, 1); @@ -4584,8 +4895,18 @@ hdaa_dump_pin(struct hdaa_widget *w) printf(" IN"); if (w->wclass.pin.ctrl & HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE) printf(" OUT"); - if (w->wclass.pin.ctrl & HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK) - printf(" VREFs"); + if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) { + if ((w->wclass.pin.ctrl & + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK) == 0x03) + printf(" HBR"); + else if ((w->wclass.pin.ctrl & + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK) != 0) + printf(" EPTs"); + } else { + if ((w->wclass.pin.ctrl & + HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK) != 0) + printf(" VREFs"); + } printf("\n"); } @@ -4956,9 +5277,12 @@ hdaa_pindump(device_t dev) res = hda_command(dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); } - printf(" Sense: 0x%08x (%sconnected)", res, + printf(" Sense: 0x%08x (%sconnected%s)", res, (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) ? - "" : "dis"); + "" : "dis", + (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap) && + (res & HDA_CMD_GET_PIN_SENSE_ELD_VALID)) ? + ", ELD valid" : ""); if (delay > 0) printf(" delay %dus", delay * 10); } @@ -5064,6 +5388,10 @@ hdaa_configure(device_t dev) ); hdaa_patch_direct(devinfo); HDA_BOOTHVERBOSE( + device_printf(dev, "ELD init...\n"); + ); + hdaa_eld_init(devinfo); + HDA_BOOTHVERBOSE( device_printf(dev, "HP switch init...\n"); ); hdaa_hp_switch_init(devinfo); @@ -5134,6 +5462,10 @@ hdaa_unconfigure(device_t dev) device_printf(dev, "HP switch deinit...\n"); ); hdaa_hp_switch_deinit(devinfo); + HDA_BOOTHVERBOSE( + device_printf(dev, "ELD deinit...\n"); + ); + hdaa_eld_deinit(devinfo); free(devinfo->ctl, M_HDAA); devinfo->ctl = NULL; devinfo->ctlcnt = 0; @@ -5160,6 +5492,11 @@ hdaa_unconfigure(device_t dev) for (j = 0; j < w->nconns; j++) w->connsenable[j] = 1; w->wclass.pin.config = w->wclass.pin.newconf; + if (w->eld != NULL) { + w->eld_len = 0; + free(w->eld, M_HDAA); + w->eld = NULL; + } } } @@ -5656,12 +5993,29 @@ static void hdaa_unsol_intr(device_t dev, uint32_t resp) { struct hdaa_devinfo *devinfo = device_get_softc(dev); - int i, tag; + struct hdaa_widget *w; + int i, tag, flags; + HDA_BOOTHVERBOSE( + device_printf(dev, "Unsolicited response %08x\n", resp); + ); tag = resp >> 26; - for (i = 0; i < devinfo->ascnt; i++) { - if (devinfo->as[i].unsol == tag) - hdaa_hp_switch_handler(devinfo, i); + for (i = devinfo->startnode; i < devinfo->endnode; i++) { + w = hdaa_widget_get(devinfo, i); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + if (w->unsol != tag) + continue; + if (HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) || + HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + flags = resp & 0x03; + else + flags = 0x01; + if (flags & 0x01) + hdaa_hp_switch_handler(w); + if (flags & 0x02) + hdaa_eld_handler(w); } } Modified: head/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.h Wed Jan 18 18:26:56 2012 (r230311) +++ head/sys/dev/sound/pci/hda/hdaa.h Wed Jan 18 19:12:33 2012 (r230312) @@ -93,9 +93,12 @@ struct hdaa_widget { int bindseqmask; int ossdev; uint32_t ossmask; + int unsol; nid_t conns[HDA_MAX_CONNS]; u_char connsenable[HDA_MAX_CONNS]; char name[HDA_MAX_NAMELEN]; + uint8_t *eld; + int eld_len; struct hdaa_devinfo *devinfo; struct { uint32_t widget_cap; @@ -140,7 +143,6 @@ struct hdaa_audio_as { nid_t dacs[2][16]; int num_chans; int chans[2]; - int unsol; int location; /* Pins location, if all have the same */ int mixed; /* Mixed/multiplexed recording, not multichannel. */ }; @@ -197,7 +199,7 @@ struct hdaa_chan { struct pcmchan_caps caps; struct hdaa_devinfo *devinfo; struct hdaa_pcm_devinfo *pdevinfo; - uint32_t spd, fmt, fmtlist[16], pcmrates[16]; + uint32_t spd, fmt, fmtlist[32], pcmrates[16]; uint32_t supp_stream_formats, supp_pcm_size_rate; uint32_t ptr, prevptr, blkcnt, blksz; uint32_t *dmapos; Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Jan 18 18:26:56 2012 (r230311) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Jan 18 19:12:33 2012 (r230312) @@ -124,6 +124,17 @@ static const struct { { HDA_NVIDIA_MCP89_2, "NVIDIA MCP89", 0, 0 }, { HDA_NVIDIA_MCP89_3, "NVIDIA MCP89", 0, 0 }, { HDA_NVIDIA_MCP89_4, "NVIDIA MCP89", 0, 0 }, + { HDA_NVIDIA_0BE2, "NVIDIA 0x0be2", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_0BE3, "NVIDIA 0x0be3", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_0BE4, "NVIDIA 0x0be4", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_GT100, "NVIDIA GT100", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_GT104, "NVIDIA GT104", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_GT106, "NVIDIA GT106", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_GT108, "NVIDIA GT108", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_GT116, "NVIDIA GT116", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_GF119, "NVIDIA GF119", 0, 0 }, + { HDA_NVIDIA_GF110_1, "NVIDIA GF110", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_GF110_2, "NVIDIA GF110", 0, HDAC_QUIRK_MSI }, { HDA_ATI_SB450, "ATI SB450", 0, 0 }, { HDA_ATI_SB600, "ATI SB600", 0, 0 }, { HDA_ATI_RS600, "ATI RS600", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Jan 18 18:26:56 2012 (r230311) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Jan 18 19:12:33 2012 (r230312) @@ -76,10 +76,21 @@ #define HDA_NVIDIA_MCP79_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac1) #define HDA_NVIDIA_MCP79_3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac2) #define HDA_NVIDIA_MCP79_4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac3) +#define HDA_NVIDIA_0BE2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0be2) +#define HDA_NVIDIA_0BE3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0be3) +#define HDA_NVIDIA_0BE4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0be4) +#define HDA_NVIDIA_GT100 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0be5) +#define HDA_NVIDIA_GT106 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0be9) +#define HDA_NVIDIA_GT108 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0bea) +#define HDA_NVIDIA_GT104 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0beb) +#define HDA_NVIDIA_GT116 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0bee) #define HDA_NVIDIA_MCP89_1 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d94) #define HDA_NVIDIA_MCP89_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d95) #define HDA_NVIDIA_MCP89_3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d96) #define HDA_NVIDIA_MCP89_4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d97) +#define HDA_NVIDIA_GF119 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0e08) +#define HDA_NVIDIA_GF110_1 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0e09) +#define HDA_NVIDIA_GF110_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0e0c) #define HDA_NVIDIA_ALL HDA_MODEL_CONSTRUCT(NVIDIA, 0xffff) /* ATI */ From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 19:35:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3830106564A; Wed, 18 Jan 2012 19:35:16 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D243E8FC0A; Wed, 18 Jan 2012 19:35:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IJZGXx054024; Wed, 18 Jan 2012 19:35:16 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IJZGKY054022; Wed, 18 Jan 2012 19:35:16 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201201181935.q0IJZGKY054022@svn.freebsd.org> From: Sean Bruno Date: Wed, 18 Jan 2012 19:35: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: r230313 - head/sys/dev/ciss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 19:35:17 -0000 Author: sbruno Date: Wed Jan 18 19:35:16 2012 New Revision: 230313 URL: http://svn.freebsd.org/changeset/base/230313 Log: Add support for HP P420 to ciss(4) Tested on upcoming Gen 8 releases of hardware from HP. MFC to all supported releases. Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Wed Jan 18 19:12:33 2012 (r230312) +++ head/sys/dev/ciss/ciss.c Wed Jan 18 19:35:16 2012 (r230313) @@ -329,6 +329,7 @@ static struct { 0x103C, 0x3249, CISS_BOARD_SA5, "HP Smart Array P812" }, { 0x103C, 0x324A, CISS_BOARD_SA5, "HP Smart Array P712m" }, { 0x103C, 0x324B, CISS_BOARD_SA5, "HP Smart Array" }, + { 0x103C, 0x3351, CISS_BOARD_SA5, "HP Smart Array P420" }, { 0, 0, 0, NULL } }; From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 21:27:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4569106564A; Wed, 18 Jan 2012 21:27:49 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B33828FC08; Wed, 18 Jan 2012 21:27:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ILRnqC057663; Wed, 18 Jan 2012 21:27:49 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ILRnSl057661; Wed, 18 Jan 2012 21:27:49 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201201182127.q0ILRnSl057661@svn.freebsd.org> From: Sean Bruno Date: Wed, 18 Jan 2012 21:27: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: r230316 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 21:27:49 -0000 Author: sbruno Date: Wed Jan 18 21:27:49 2012 New Revision: 230316 URL: http://svn.freebsd.org/changeset/base/230316 Log: Update man page to show that ciss(4) now support the P420 MFC with r230313 Caught by: brueffer Obtained from: Yahoo! Inc MFC after: 2 weeks Modified: head/share/man/man4/ciss.4 Modified: head/share/man/man4/ciss.4 ============================================================================== --- head/share/man/man4/ciss.4 Wed Jan 18 19:55:51 2012 (r230315) +++ head/share/man/man4/ciss.4 Wed Jan 18 21:27:49 2012 (r230316) @@ -131,6 +131,8 @@ HP Smart Array P410i .It HP Smart Array P411 .It +HP Smart Array P420 +.It HP Smart Array P600 .It HP Smart Array P800 From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 22:43:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61FA106566C for ; Wed, 18 Jan 2012 22:43:59 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB618FC16 for ; Wed, 18 Jan 2012 22:43:59 +0000 (UTC) Received: by iagz16 with SMTP id z16so11472675iag.13 for ; Wed, 18 Jan 2012 14:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=+jNX1usHcDMhKIlXjvZf5OzwT8cqxQrM/KQbQhLFRHk=; b=DjbA3sIrylJ7NSIC3b1O/2DCf2xXqXP17L7npsjseDoWu7Mm9v29rxNmZecZhHlQJE neRlFAsxLxxaWUx7mwpJ/k2d2AlHsq3NZerjKo0hjBbPnaJRy7hRuRP+bkzO3bimT+nC nshT/06SXpjuIEYqhbc2Wh6MBPfYglydJj9Sk= Received: by 10.42.168.202 with SMTP id x10mr19708340icy.4.1326924857715; Wed, 18 Jan 2012 14:14:17 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id r5sm46721946igl.3.2012.01.18.14.14.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jan 2012 14:14:16 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 18 Jan 2012 14:14:15 -0800 From: YongHyeon PYUN Date: Wed, 18 Jan 2012 14:14:15 -0800 To: John Baldwin Message-ID: <20120118221415.GD7469@michelle.cdnetworks.com> References: <201201172215.q0HMFXgI009891@svn.freebsd.org> <201201180953.51362.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201180953.51362.jhb@freebsd.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: r230286 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 22:43:59 -0000 On Wed, Jan 18, 2012 at 09:53:51AM -0500, John Baldwin wrote: > On Tuesday, January 17, 2012 5:15:33 pm Pyun YongHyeon wrote: > > Author: yongari > > Date: Tue Jan 17 22:15:33 2012 > > New Revision: 230286 > > URL: http://svn.freebsd.org/changeset/base/230286 > > > > Log: > > Introduce a tunable that disables use of MSI. > > Non-zero value will use INTx. > > Hmm, do you think it is best to do this on a per-device level vs a per-driver > level (e.g. a 'hw..msi' tunable ala mfi(4))? Also, I think it is I thought that too. But what if other bge(4) controller on the box works with MSI? I admit it would be rare case but making it per-device-level wouldn't hurt. > better to have a flag whose value more closely matches enable/disable (so 1 > for enable, etc.) and default it to on, than to have a 'disable' tunable. > The decision was made to make it easy to support MSIX in future. If controller supports both MSIX and MSI, the suggested scheme may confuse users but I don't have strong opinion on that so will follow your suggestion. Thank you. From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 22:52:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DD5D1065673; Wed, 18 Jan 2012 22:52:03 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0E558FC13; Wed, 18 Jan 2012 22:52:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0IMq2U9060605; Wed, 18 Jan 2012 22:52:02 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IMq25J060603; Wed, 18 Jan 2012 22:52:02 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201201182252.q0IMq25J060603@svn.freebsd.org> From: Sean Bruno Date: Wed, 18 Jan 2012 22:52: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: r230323 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 22:52:03 -0000 Author: sbruno Date: Wed Jan 18 22:52:02 2012 New Revision: 230323 URL: http://svn.freebsd.org/changeset/base/230323 Log: Update .Dd date on this man page. MFC with r230313 and r230316 Caught by: bz Obtained from: Yahoo! Inc. Modified: head/share/man/man4/ciss.4 Modified: head/share/man/man4/ciss.4 ============================================================================== --- head/share/man/man4/ciss.4 Wed Jan 18 22:08:26 2012 (r230322) +++ head/share/man/man4/ciss.4 Wed Jan 18 22:52:02 2012 (r230323) @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is in the public domain. .\" -.Dd November 3, 2005 +.Dd January 18, 2012 .Dt CISS 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Jan 18 23:10:26 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6642C106566B; Wed, 18 Jan 2012 23:10:26 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id C484D8FC13; Wed, 18 Jan 2012 23:10:25 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0INA79M012064; Wed, 18 Jan 2012 17:10:07 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from [192.168.221.36] ([192.168.221.36]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0INA1u6024846 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 18 Jan 2012 17:10:03 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0INA1u6024846 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1326928204; bh=Vt7BMzfL1XtSpHJJldRFKr9m1ZRRcru6XQCAv13BBak=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=RE69+86CdD1PiuJp8Guqa3pL0X3YBId/m3EmaLbPVrZCX6hAKs8JGJ1eTf5KKyOCv wqYOZN1Q4cmW4ZEdjcT5KBrd/WmItPsNtcvL1oEKA5aotWUlKRxZ0AgFvbiG08LITo GhS00LKMD1WBAyBSUnVSIwy/d8uD/Ku2FUfNSE4w= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120117201411.B1819@besplex.bde.org> Date: Wed, 18 Jan 2012 17:10:04 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <8DD4D210-28DA-453F-86D0-6FC4FB84AC04@palisadesystems.com> References: <201201122249.q0CMnaZe030200@svn.freebsd.org> <20120114204720.Q1458@besplex.bde.org> <20120114182758.GJ1694@garage.freebsd.pl> <20120115073823.O843@besplex.bde.org> <52A73054-9960-403B-B2FE-857C8801D129@palisadesystems.com> <20120116175627.GA1674@garage.freebsd.pl> <20120117201411.B1819@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Wed, 18 Jan 2012 17:10:04 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0INA1u6024846 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.628, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r230037 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 23:10:26 -0000 On Jan 17, 2012, at 3:58 AM, Bruce Evans wrote: > On Mon, 16 Jan 2012, Pawel Jakub Dawidek wrote: >=20 >> On Mon, Jan 16, 2012 at 11:14:32AM -0600, Guy Helmer wrote: >>> I've pasted the diff below that I think captures the majority of the = issues you have brought up. I have not attempted to tackle the = property.3/properties.3 issues, nor the objections to the prefixes that = I think would take considerably more effort to resolve -- I wanted to = concentrate on the issues that can be isolated to libutil. I hope the = diff was pasted OK, especially WRT characters. >>=20 >> The patch looks mostly good, one nit mentioned below and also one >> question for Bruce. >>=20 >>> +/* Flags for hexdump(3) */ >>> +/* Flags for humanize_number(3) flags */ >>> +/* Flags for humanize_number(3) scale */ >>> +/* return values from realhostname() */ >>> +/* Flags for pw_scan() */ >>> +/* Return values from uu_lock() */ >>=20 >> All those sentences are missing period and one doesn't start with >> capital letter. >=20 > I decided not to worry about the termination since it was fairly = consistent > in the file. The most recent commit fixed these, but made all the = others > inconsistent: >=20 > % /* for properties.c */ > % /* Avoid pulling in all the include files for no need */ > % #ifdef _STDIO_H_ /* avoid adding new includes */ >=20 > This is now the only comment to the right of code. Comments to the > right of ifdefs are especially hard format nicely > (the normal comment indentation to 32 or 40 columns doesn't work > well; I normally use a single space; the above indents to 24 = columns), > so the should be avoided. The same treatment is used for 3 other = includes, > but there is no comment for the others. The simplest fix is to remove > this comment. Otherwise, put a meta-comment about them all somewhere. > It's hard to place this so that it clearly covers them all, but = anywhere > is better than to the right of 1 of their ifdefs. >=20 > % /* fparseln(3) */ >=20 > This is also missing the new, otherwise (too) uniform wording > "Flags for..." >=20 >> I noticed also one more inconsistency: >>=20 >> struct kinfo_file * >> kinfo_getfile(pid_t _pid, int *_cntp); >> struct passwd >> *pw_dup(const struct passwd *_pw); >>=20 >> Sometimes * is on the same line as function type and sometimes it is = in >> the line below. Former is definiately better. >=20 > Indded. >=20 OK, one more round of proposed changes: Index: lib/libutil/libutil.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 --- lib/libutil/libutil.h (revision 230318) +++ lib/libutil/libutil.h (working copy) @@ -71,14 +71,14 @@ #define PROPERTY_MAX_NAME 64 #define PROPERTY_MAX_VALUE 512 =20 -/* for properties.c */ +/* For properties.c. */ typedef struct _property { struct _property *next; char *name; char *value; } *properties; =20 -/* Avoid pulling in all the include files for no need */ +/* Avoid pulling in all the include files for no need. */ struct in_addr; struct pidfh; struct sockaddr; @@ -132,7 +132,11 @@ int uu_unlock(const char *_ttyname); int uu_lock_txfr(const char *_ttyname, pid_t _pid); =20 -#ifdef _STDIO_H_ /* avoid adding new includes */ +/* + * Conditionally prototype the following functions if the include + * files upon which they depend have been included. + */ +#ifdef _STDIO_H_ char *fparseln(FILE *_fp, size_t *_len, size_t *_lineno, const char _delim[3], int _flags); #endif @@ -150,26 +154,26 @@ char *pw_make_v7(const struct passwd *_pw); int pw_mkdb(const char *_user); int pw_lock(void); -struct passwd - *pw_scan(const char *_line, int _flags); -const char - *pw_tempname(void); +struct passwd * + pw_scan(const char *_line, int _flags); +const char * + pw_tempname(void); int pw_tmp(int _mfd); #endif =20 #ifdef _GRP_H_ int gr_copy(int __ffd, int _tfd, const struct group *_gr, struct group *_old_gr); -struct group - *gr_dup(const struct group *_gr); +struct group * + gr_dup(const struct group *_gr); int gr_equal(const struct group *_gr1, const struct group *_gr2); void gr_fini(void); int gr_init(const char *_dir, const char *_master); int gr_lock(void); char *gr_make(const struct group *_gr); int gr_mkdb(void); -struct group - *gr_scan(const char *_line); +struct group * + gr_scan(const char *_line); int gr_tmp(int _mdf); #endif =20 @@ -209,18 +213,18 @@ #define HD_OMIT_HEX (1 << 17) #define HD_OMIT_CHARS (1 << 18) =20 -/* Flags for humanize_number(3) flags. */ +/* Values for humanize_number(3)'s flags parameter. */ #define HN_DECIMAL 0x01 #define HN_NOSPACE 0x02 #define HN_B 0x04 #define HN_DIVISOR_1000 0x08 #define HN_IEC_PREFIXES 0x10 =20 -/* Flags for humanize_number(3) scale. */ +/* Values for humanize_number(3)'s scale parameter. */ #define HN_GETSCALE 0x10 #define HN_AUTOSCALE 0x20 =20 -/* return values from realhostname(). */ +/* Return values from realhostname(). */ #define HOSTNAME_FOUND 0 #define HOSTNAME_INCORRECTNAME 1 #define HOSTNAME_INVALIDADDR 2 @@ -233,12 +237,12 @@ /* Return values from uu_lock(). */ #define UU_LOCK_INUSE 1 #define UU_LOCK_OK 0 -#define UU_LOCK_OPEN_ERR -1 -#define UU_LOCK_READ_ERR -2 -#define UU_LOCK_CREAT_ERR -3 -#define UU_LOCK_WRITE_ERR -4 -#define UU_LOCK_LINK_ERR -5 -#define UU_LOCK_TRY_ERR -6 -#define UU_LOCK_OWNER_ERR -7 +#define UU_LOCK_OPEN_ERR (-1) +#define UU_LOCK_READ_ERR (-2) +#define UU_LOCK_CREAT_ERR (-3) +#define UU_LOCK_WRITE_ERR (-4) +#define UU_LOCK_LINK_ERR (-5) +#define UU_LOCK_TRY_ERR (-6) +#define UU_LOCK_OWNER_ERR (-7) =20 #endif /* !_LIBUTIL_H_ */ -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 01:25:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F570106567B; Thu, 19 Jan 2012 01:25:51 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E8698FC1A; Thu, 19 Jan 2012 01:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0J1PpSK065449; Thu, 19 Jan 2012 01:25:51 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0J1Poox065447; Thu, 19 Jan 2012 01:25:50 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201201190125.q0J1Poox065447@svn.freebsd.org> From: Sean Bruno Date: Thu, 19 Jan 2012 01:25: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: r230325 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 01:25:51 -0000 Author: sbruno Date: Thu Jan 19 01:25:50 2012 New Revision: 230325 URL: http://svn.freebsd.org/changeset/base/230325 Log: Wrap changes from svn r212126 inside LOADER_NFS_SUPPORT such that using LOADER_TFTP_SUPPORT excludes this code. Fixes compilation of pxeldr with -DLOADER_TFTP_SUPPORT Applicable to stable/9 and stable/8 now. This appears to not be needed on stable/7 as r212126 has not been MFC'd. Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/boot/i386/libi386/pxe.c Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Thu Jan 19 00:11:39 2012 (r230324) +++ head/sys/boot/i386/libi386/pxe.c Thu Jan 19 01:25:50 2012 (r230325) @@ -405,6 +405,7 @@ pxe_perror(int err) return; } +#ifdef LOADER_NFS_SUPPORT /* * Reach inside the libstand NFS code and dig out an NFS handle * for the root filesystem. @@ -515,6 +516,7 @@ pxe_setnfshandle(char *rootpath) setenv("boot.nfsroot.nfshandlelen", buf, 1); } #endif /* OLD_NFSV2 */ +#endif /* LOADER_NFS_SUPPORT */ void pxenv_call(int func) From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 01:54:58 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1ED6106566B; Thu, 19 Jan 2012 01:54:58 +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 7D3FD8FC1E; Thu, 19 Jan 2012 01:54:58 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0J1ssdf028834 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Jan 2012 12:54:56 +1100 Date: Thu, 19 Jan 2012 12:54:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Peter Wemm In-Reply-To: <201201181826.q0IIQuLX051824@svn.freebsd.org> Message-ID: <20120119110628.F1702@besplex.bde.org> References: <201201181826.q0IIQuLX051824@svn.freebsd.org> 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 Subject: Re: svn commit: r230311 - head/lib/libpam/modules/pam_unix X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 01:54:59 -0000 On Wed, 18 Jan 2012, Peter Wemm wrote: > Log: > Rev 228065 (change bsd.own.mk -> bsd.init.mk) broke pam_unix.so by causing > the LDADD/DPADD to lose the -lpam, and causing openpam_dynamic() to fail > due to "openpam_get_options" being undefined. bsd.init.mk (actually this abuse of it -- see below) is horribily broken. It includes ../Makefile.inc, so anything that includes it early tends to get ../Makefile.inc in a wrong order. The normal order is to include bsd.prog.mk late, and get ../Makefile.inc late from there. Any early include of a bsd.*.mk file is dangerous because it is not the normal order. Unfortunately, a few Makefiles need to include bsd.own.mk early. bsd.init.mk includes bsd.own.mk, so these Makefiles can now (actually for a long time) include bsd.init.mk instead. I think bsd.init.mk is an implementation detail and including it directly is just bug. Its documentation still agrees with this interpretatation: - the comment at the start of it only says that it is used at the top of all files. - the automatic include of ../Makefile.inc is only documented (in bsd.README) for , and . BTW, why the bracket quoting for these? - bsd.README documents bsd.init.mk as being for the make include files. In /usr/src on Nov 13 2011, the only Makefile[.inc] files with this bug are: gnu/usr.bin/cc/include/Makefile lib/clang/include/Makefile sys/boot/toomany/Makefile (this matches the general low quality of boot Makefiles) The bug in libpam was too new to show up here. > > This would cause obscure console log messages like: > openpam_dynamic(): No error: 0 > openpam_load_module(): no pam_unix.so found > and other helpful messages which are no help in diagnosing the problem. > > Fortunately this change was not mfc'ed to 9.x, it isn't broken there. > > Modified: > head/lib/libpam/modules/pam_unix/Makefile > > Modified: head/lib/libpam/modules/pam_unix/Makefile > ============================================================================== > --- head/lib/libpam/modules/pam_unix/Makefile Wed Jan 18 18:22:25 2012 (r230310) > +++ head/lib/libpam/modules/pam_unix/Makefile Wed Jan 18 18:26:56 2012 (r230311) > @@ -40,8 +40,8 @@ LIB= pam_unix > SRCS= pam_unix.c > MAN= pam_unix.8 > > -DPADD= ${LIBUTIL} ${LIBCRYPT} > -LDADD= -lutil -lcrypt > +DPADD+= ${LIBUTIL} ${LIBCRYPT} > +LDADD+= -lutil -lcrypt Bitrot near here started in 2004 when the tabs were lost. > > .if ${MK_NIS} != "no" Including bsd.own.mk is unfortunately necessary for getting MK_NIS defined (bsd.own.mk is abused to define MK_* and compatibility cruft that are both completely unrelated to ownership). That is enough for the "few" Makefiles that test MK_*. (More than 200 Makefiles include bsd.own.mk explicitly, presumably only (early) for testimg MK_* :-(.) According to the log message for the commit that broke this, bsd.init.mk is used (early) instead of bsd.own.mk (early) to allow use of settings from ../Makefile.inc. This seems to be actually to use settings in the user's make.conf or environment or defaults to kill CTF in an old implementation of killing CTF. Now, bsd.own.mk is abused further to kill CTF, and I can't see why it doesn't do this when only it is included early. > CFLAGS+= -DYP > I don't like the structure of this file or tree at all. The library order is important for static linkage, so the implementation detail that bsd.init.mk includes ../Makefile.inc is important (it only does this for the benefit of bsd.prog.mk etc. which are documented to do it. According to a strict reading of the documentation, only bsd.prog.mk does it, so the order is wrong here). Actually, ../Makefile.inc has always added -lpam, but before this included bsd.init.mk, its order was precisely the opposite of what it is now -- it was last instead of first. It's not clear how either order can work. -lpam first seems right (in case this library refers to symbols in the others), but the old order seemed to work. I checked all the other includes of bsd.init.mk. All except the boot Makefiles use it correctly (near the end, for the technical reason that they include something like bsd.obj.mk and not bsd.prog.mk, so they don't include it in the normal way via bsd.prog.mk). The boot makefiles document that they are using it to get ../Makefile.inc. They should just include ../Makefile.inc for that. They need it mainly to get the BTX* symbols defined. Related bugs: - sys.mk was polluted in 2004 with an unconditional include of bsd.compat.mk, just after the place where previous FreeBSD-build- specific includes are ifdefed to reduce such pollution. - the include of bsd.compat.mk in bsd.init.mk has no effect, since sys.mk has already done it unconditionally. - MK_CTF is still used unitialized kern.post.mk and kern.pre.mk. It is uninitialized when the kernel source tree is current and the host mk non-kernel files more than a couple of months old. The corresponding bug in kmod.mk was only there for a few days. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 01:55:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E113106566C; Thu, 19 Jan 2012 01:55:49 +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 E5B318FC14; Thu, 19 Jan 2012 01:55:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0J1tmJ0066351; Thu, 19 Jan 2012 01:55:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0J1tmNQ066343; Thu, 19 Jan 2012 01:55:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201190155.q0J1tmNQ066343@svn.freebsd.org> From: Alexander Motin Date: Thu, 19 Jan 2012 01:55: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: r230326 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 01:55:49 -0000 Author: mav Date: Thu Jan 19 01:55:48 2012 New Revision: 230326 URL: http://svn.freebsd.org/changeset/base/230326 Log: Two 192/24/8 playback streams overflow single mandatory output line (SDO) of HDA bus. Handle that from two directions: - Add support for "striping" (using several SDO lines), if supported. - Account HDA bus utilization and return error on new stream allocation attempt if remaining bandwidth is unsifficient. Most of HDA controllers have one SDO line with 46Mbps output bandwidth. NVIDIA GF210 has 2 lines - 92Mbps. NVIDIA GF520 has 4 lines - 184Mbps! MFC after: 2 months Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdaa.h head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac_if.m head/sys/dev/sound/pci/hda/hdac_private.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Thu Jan 19 01:25:50 2012 (r230325) +++ head/sys/dev/sound/pci/hda/hdaa.c Thu Jan 19 01:55:48 2012 (r230326) @@ -1096,6 +1096,11 @@ hdaa_widget_parse(struct hdaa_widget *w) w->param.supp_pcm_size_rate = w->devinfo->supp_pcm_size_rate; } + if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) { + w->wclass.conv.stripecap = hda_command(dev, + HDA_CMD_GET_STRIPE_CONTROL(0, w->nid)) >> 20; + } else + w->wclass.conv.stripecap = 1; } else { w->param.supp_stream_formats = 0; w->param.supp_pcm_size_rate = 0; @@ -1388,6 +1393,18 @@ hdaa_stream_format(struct hdaa_chan *ch) return (fmt); } +static int +hdaa_allowed_stripes(uint16_t fmt) +{ + static const int bits[8] = { 8, 16, 20, 24, 32, 32, 32, 32 }; + int size; + + size = bits[(fmt >> 4) & 0x03]; + size *= (fmt & 0x0f) + 1; + size *= ((fmt >> 11) & 0x07) + 1; + return (0xffffffffU >> (32 - fls(size / 8))); +} + static void hdaa_audio_setup(struct hdaa_chan *ch) { @@ -1462,6 +1479,10 @@ hdaa_audio_setup(struct hdaa_chan *ch) } hda_command(ch->devinfo->dev, HDA_CMD_SET_CONV_STREAM_CHAN(0, ch->io[i], c)); + if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) { + hda_command(ch->devinfo->dev, + HDA_CMD_SET_STRIPE_CONTROL(0, w->nid, ch->stripectl)); + } cchn = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap); if (cchn > 1 && chn < totalchn) { cchn = min(cchn, totalchn - chn - 1); @@ -1472,9 +1493,9 @@ hdaa_audio_setup(struct hdaa_chan *ch) device_printf(ch->pdevinfo->dev, "PCMDIR_%s: Stream setup nid=%d: " "fmt=0x%04x, dfmt=0x%04x, chan=0x%04x, " - "chan_count=0x%02x\n", + "chan_count=0x%02x, stripe=%d\n", (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", - ch->io[i], fmt, dfmt, c, cchn); + ch->io[i], fmt, dfmt, c, cchn, ch->stripectl); ); for (j = 0; j < 16; j++) { if (as->dacs[ch->asindex][j] != ch->io[i]) @@ -1658,11 +1679,12 @@ static int hdaa_channel_start(struct hdaa_chan *ch) { struct hdaa_devinfo *devinfo = ch->devinfo; + uint32_t fmt; - ch->ptr = 0; - ch->prevptr = 0; + fmt = hdaa_stream_format(ch); + ch->stripectl = fls(ch->stripecap & hdaa_allowed_stripes(fmt)) - 1; ch->sid = HDAC_STREAM_ALLOC(device_get_parent(devinfo->dev), devinfo->dev, - ch->dir == PCMDIR_PLAY ? 1 : 0, hdaa_stream_format(ch), &ch->dmapos); + ch->dir == PCMDIR_PLAY ? 1 : 0, fmt, ch->stripectl, &ch->dmapos); if (ch->sid <= 0) return (EBUSY); hdaa_audio_setup(ch); @@ -4464,6 +4486,7 @@ hdaa_pcmchannel_setup(struct hdaa_chan * ch->bit32 = 0; ch->pcmrates[0] = 48000; ch->pcmrates[1] = 0; + ch->stripecap = 0xff; ret = 0; channels = 0; @@ -4506,6 +4529,7 @@ hdaa_pcmchannel_setup(struct hdaa_chan * pcmcap &= w->param.supp_pcm_size_rate; } ch->io[ret++] = as[ch->as].dacs[ch->asindex][i]; + ch->stripecap &= w->wclass.conv.stripecap; /* Do not count redirection pin/dac channels. */ if (i == 15 && as[ch->as].hpredir >= 0) continue; @@ -5001,7 +5025,8 @@ hdaa_dump_nodes(struct hdaa_devinfo *dev if (HDA_PARAM_AUDIO_WIDGET_CAP_PROC_WIDGET(w->param.widget_cap)) printf(" PROC"); if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) - printf(" STRIPE"); + printf(" STRIPE(x%d)", + 1 << (fls(w->wclass.conv.stripecap) - 1)); j = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap); if (j == 1) printf(" STEREO"); Modified: head/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.h Thu Jan 19 01:25:50 2012 (r230325) +++ head/sys/dev/sound/pci/hda/hdaa.h Thu Jan 19 01:55:48 2012 (r230326) @@ -116,6 +116,9 @@ struct hdaa_widget { uint32_t cap; uint32_t ctrl; } pin; + struct { + uint8_t stripecap; + } conv; } wclass; }; @@ -201,7 +204,7 @@ struct hdaa_chan { struct hdaa_pcm_devinfo *pdevinfo; uint32_t spd, fmt, fmtlist[32], pcmrates[16]; uint32_t supp_stream_formats, supp_pcm_size_rate; - uint32_t ptr, prevptr, blkcnt, blksz; + uint32_t blkcnt, blksz; uint32_t *dmapos; uint32_t flags; int dir; @@ -212,6 +215,8 @@ struct hdaa_chan { int as; /* Number of association. */ int asindex; /* Index within association. */ nid_t io[16]; + uint8_t stripecap; /* AND of stripecap of all ios. */ + uint8_t stripectl; /* stripe to use to all ios. */ }; #define hdaa_codec_id(devinfo) \ Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Jan 19 01:25:50 2012 (r230325) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Jan 19 01:55:48 2012 (r230326) @@ -1339,10 +1339,10 @@ sysctl_hdac_pindump(SYSCTL_HANDLER_ARGS) } static int -hdac_data_rate(uint16_t fmt) +hdac_mdata_rate(uint16_t fmt) { - static const int bits[8] = { 8, 16, 20, 24, 32, 32, 32, 32 }; - int rate; + static const int mbits[8] = { 8, 16, 32, 32, 32, 32, 32, 32 }; + int rate, bits; if (fmt & (1 << 14)) rate = 44100; @@ -1350,8 +1350,24 @@ hdac_data_rate(uint16_t fmt) rate = 48000; rate *= ((fmt >> 11) & 0x07) + 1; rate /= ((fmt >> 8) & 0x07) + 1; - rate *= ((bits[(fmt >> 4) & 0x03]) * ((fmt & 0x0f) + 1) + 7) / 8; - return (rate); + bits = mbits[(fmt >> 4) & 0x03]; + bits *= (fmt & 0x0f) + 1; + return (rate * bits); +} + +static int +hdac_bdata_rate(uint16_t fmt, int output) +{ + static const int bbits[8] = { 8, 16, 20, 24, 32, 32, 32, 32 }; + int rate, bits; + + rate = 48000; + rate *= ((fmt >> 11) & 0x07) + 1; + bits = bbits[(fmt >> 4) & 0x03]; + bits *= (fmt & 0x0f) + 1; + if (!output) + bits = ((bits + 7) & ~0x07) + 10; + return (rate * bits); } static void @@ -1369,7 +1385,7 @@ hdac_poll_reinit(struct hdac_softc *sc) if (s->running == 0) continue; pollticks = ((uint64_t)hz * s->blksz) / - hdac_data_rate(s->format); + (hdac_mdata_rate(s->format) / 8); pollticks >>= 1; if (pollticks > hz) pollticks = hz; @@ -1790,11 +1806,12 @@ hdac_find_stream(struct hdac_softc *sc, } static int -hdac_stream_alloc(device_t dev, device_t child, int dir, int format, +hdac_stream_alloc(device_t dev, device_t child, int dir, int format, int stripe, uint32_t **dmapos) { struct hdac_softc *sc = device_get_softc(dev); - int stream, ss; + nid_t cad = (uintptr_t)device_get_ivars(child); + int stream, ss, bw, maxbw, prevbw; /* Look for empty stream. */ ss = hdac_find_stream(sc, dir, 0); @@ -1803,6 +1820,28 @@ hdac_stream_alloc(device_t dev, device_t if (ss < 0) return (0); + /* Check bus bandwidth. */ + bw = hdac_bdata_rate(format, dir); + if (dir == 1) { + bw *= 1 << (sc->num_sdo - stripe); + prevbw = sc->sdo_bw_used; + maxbw = 48000 * 960 * (1 << sc->num_sdo); + } else { + prevbw = sc->codecs[cad].sdi_bw_used; + maxbw = 48000 * 464; + } + HDA_BOOTHVERBOSE( + device_printf(dev, "%dKbps of %dKbps bandwidth used%s\n", + (bw + prevbw) / 1000, maxbw / 1000, + bw + prevbw > maxbw ? " -- OVERFLOW!" : ""); + ); + if (bw + prevbw > maxbw) + return (0); + if (dir == 1) + sc->sdo_bw_used += bw; + else + sc->codecs[cad].sdi_bw_used += bw; + /* Allocate stream number */ if (ss >= sc->num_iss + sc->num_oss) stream = 15 - (ss - sc->num_iss + sc->num_oss); @@ -1814,7 +1853,9 @@ hdac_stream_alloc(device_t dev, device_t sc->streams[ss].dev = child; sc->streams[ss].dir = dir; sc->streams[ss].stream = stream; + sc->streams[ss].bw = bw; sc->streams[ss].format = format; + sc->streams[ss].stripe = stripe; if (dmapos != NULL) { if (sc->pos_dma.dma_vaddr != NULL) *dmapos = (uint32_t *)(sc->pos_dma.dma_vaddr + ss * 8); @@ -1828,11 +1869,16 @@ static void hdac_stream_free(device_t dev, device_t child, int dir, int stream) { struct hdac_softc *sc = device_get_softc(dev); + nid_t cad = (uintptr_t)device_get_ivars(child); int ss; ss = hdac_find_stream(sc, dir, stream); KASSERT(ss >= 0, ("Free for not allocated stream (%d/%d)\n", dir, stream)); + if (dir == 1) + sc->sdo_bw_used -= sc->streams[ss].bw; + else + sc->codecs[cad].sdi_bw_used -= sc->streams[ss].bw; sc->streams[ss].stream = 0; sc->streams[ss].dev = NULL; } @@ -1875,6 +1921,8 @@ hdac_stream_start(device_t dev, device_t ctl &= ~HDAC_SDCTL2_DIR; ctl &= ~HDAC_SDCTL2_STRM_MASK; ctl |= stream << HDAC_SDCTL2_STRM_SHIFT; + ctl &= ~HDAC_SDCTL2_STRIPE_MASK; + ctl |= sc->streams[ss].stripe << HDAC_SDCTL2_STRIPE_SHIFT; HDAC_WRITE_1(&sc->mem, off + HDAC_SDCTL2, ctl); HDAC_WRITE_2(&sc->mem, off + HDAC_SDFMT, sc->streams[ss].format); Modified: head/sys/dev/sound/pci/hda/hdac_if.m ============================================================================== --- head/sys/dev/sound/pci/hda/hdac_if.m Thu Jan 19 01:25:50 2012 (r230325) +++ head/sys/dev/sound/pci/hda/hdac_if.m Thu Jan 19 01:55:48 2012 (r230326) @@ -44,6 +44,7 @@ METHOD int stream_alloc { device_t child; int dir; int format; + int stripe; uint32_t **dmapos; }; Modified: head/sys/dev/sound/pci/hda/hdac_private.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac_private.h Thu Jan 19 01:25:50 2012 (r230325) +++ head/sys/dev/sound/pci/hda/hdac_private.h Thu Jan 19 01:55:48 2012 (r230326) @@ -155,6 +155,8 @@ struct hdac_stream { int stream; int blksz; int running; + int bw; + int stripe; uint16_t format; }; @@ -206,6 +208,8 @@ struct hdac_softc { int unsolq_st; uint32_t unsolq[HDAC_UNSOLQ_MAX]; + int sdo_bw_used; + struct hdac_stream *streams; struct { @@ -216,6 +220,7 @@ struct hdac_softc { uint8_t stepping_id; int pending; uint32_t response; + int sdi_bw_used; } codecs[HDAC_CODEC_MAX]; }; Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 19 01:25:50 2012 (r230325) +++ head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 19 01:55:48 2012 (r230326) @@ -503,13 +503,13 @@ hdacc_codec_command(device_t dev, device static int hdacc_stream_alloc(device_t dev, device_t child, int dir, int format, - uint32_t **dmapos) + int stripe, uint32_t **dmapos) { struct hdacc_softc *codec = device_get_softc(dev); int stream; stream = HDAC_STREAM_ALLOC(device_get_parent(dev), dev, - dir, format, dmapos); + dir, format, stripe, dmapos); if (stream > 0) codec->streams[dir][stream] = child; return (stream); From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 02:47:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69BD6106566C; Thu, 19 Jan 2012 02:47:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592408FC18; Thu, 19 Jan 2012 02:47:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0J2lC6n068037; Thu, 19 Jan 2012 02:47:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0J2lCiE068035; Thu, 19 Jan 2012 02:47:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201190247.q0J2lCiE068035@svn.freebsd.org> From: Eitan Adler Date: Thu, 19 Jan 2012 02:47: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: r230327 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 02:47:12 -0000 Author: eadler Date: Thu Jan 19 02:47:11 2012 New Revision: 230327 URL: http://svn.freebsd.org/changeset/base/230327 Log: Add support for Sony Ericsson GC89 EDGE/Wirelles LAN PC Card PR: kern/131933 Submitted by: Alex Keda Approved by: jhb Approved by: cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 1 week Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Thu Jan 19 01:55:48 2012 (r230326) +++ head/sys/dev/uart/uart_bus_pci.c Thu Jan 19 02:47:11 2012 (r230327) @@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = 8 * DEFAULT_RCLK }, { 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART", 0x10, 16384000 }, +{ 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, { 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 02:49:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00C2A1065670; Thu, 19 Jan 2012 02:49:22 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E442C8FC19; Thu, 19 Jan 2012 02:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0J2nLbw068160; Thu, 19 Jan 2012 02:49:21 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0J2nL05068158; Thu, 19 Jan 2012 02:49:21 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201190249.q0J2nL05068158@svn.freebsd.org> From: Kevin Lo Date: Thu, 19 Jan 2012 02:49: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: r230328 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 02:49:22 -0000 Author: kevlo Date: Thu Jan 19 02:49:21 2012 New Revision: 230328 URL: http://svn.freebsd.org/changeset/base/230328 Log: Add missing MLINKS to INDEX.5 Modified: head/share/man/man5/Makefile Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Thu Jan 19 02:47:11 2012 (r230327) +++ head/share/man/man5/Makefile Thu Jan 19 02:49:21 2012 (r230328) @@ -76,6 +76,7 @@ MLINKS+=fs.5 inode.5 MLINKS+=hosts.equiv.5 rhosts.5 MLINKS+=msdosfs.5 msdos.5 MLINKS+=passwd.5 master.passwd.5 +MLINKS+=portindex.5 INDEX.5 MLINKS+=quota.user.5 quota.group.5 MLINKS+=rc.conf.5 rc.conf.local.5 MLINKS+=resolver.5 resolv.conf.5 From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 03:24:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBDD11065689; Thu, 19 Jan 2012 03:24:15 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BD2CB8FC18; Thu, 19 Jan 2012 03:24:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0J3OCpj020174; Thu, 19 Jan 2012 03:24:13 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F178CDC.3030807@gmail.com> Date: Thu, 19 Jan 2012 11:24:12 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: John Baldwin References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <201201170957.47718.jhb@freebsd.org> <4F1629D5.4020605@gmail.com> <201201181009.23221.jhb@freebsd.org> In-Reply-To: <201201181009.23221.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, davidxu@freebsd.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 03:24:16 -0000 On 2012/1/18 23:09, John Baldwin wrote: > On Tuesday, January 17, 2012 9:09:25 pm David Xu wrote: >> On 2012/1/17 22:57, John Baldwin wrote: >>> On Monday, January 16, 2012 1:15:14 am David Xu wrote: >>>> Author: davidxu >>>> Date: Mon Jan 16 06:15:14 2012 >>>> New Revision: 230201 >>>> URL: http://svn.freebsd.org/changeset/base/230201 >>>> >>>> Log: >>>> Insert read memory barriers. >>> I think using atomic_load_acq() on sem->nwaiters would be clearer as it would >>> indicate which variable you need to ensure is read after other operations. In >>> general I think raw rmb/wmb usage should be avoided when possible as it is >>> does not describe the programmer's intent as well. >>> >> Yes, I had considered that I may use atomic_load_acq(), but at that time, >> I thought it emits a bus locking, right ? so I just picked up rmb() which >> only affects current cpu. maybe atomic_load_acq() does same thing with >> rmb() ? >> it is still unclear to me. > atomic_load_acq() is the same as rmb(). Right now it uses a locked > instruction on amd64, but it could easily switch to lfence/sfence instead. I > had patches to do that but I think bde@ had done some benchmarks that showed > that change made no difference. > I wish there is a version uses lfence for atomic_load_acq(). I always think bus locking is expensive on a multiple-core machine. Here we work on large machine found that even current rwlock in libthr is not scale well if most threads are readers, we have to implement CSNZI-like rwlock to avoid CPU conflict. http://people.csail.mit.edu/mareko/spaa09-scalablerwlocks.pdf I have just done a benchmark on my notebook which is a 4 SMT sandy bridge CPU i3 2310m. http://people.freebsd.org/~davidxu/bench/semaphore/ The load_acq uses atomic locking is much slower than lfence: http://people.freebsd.org/~davidxu/bench/semaphore/ministat.txt benchmark program: http://people.freebsd.org/~davidxu/bench/semaphore/sem_test.c Regards, David Xu From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 04:19:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7D96106564A; Thu, 19 Jan 2012 04:19:57 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 901948FC12; Thu, 19 Jan 2012 04:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=CVEGTH0k/9JVnmkIWLayPLtat5USwYV9HD+dCiThJA0=; b=JQeuSoT2fQi07MooZGUULJ697/ohVt7EG3YH84GTw+NsDaJqZgkQf+N3zormYndX2okk9EnZECR8TmRs6tGgxi3F0TjPfhYVbA4UZyLucoRuX/Lj11ndm8gZ/xGrSe6HpVYiO2/DHo2bQA4uqCE/BCZroFgYXBScktAYHGK3+EkkYe1fzj5vrRoH72vgavg074cavA4y3CvciovtkJIciGLa+T9Xh0csrhmV74hbs8H9B71+BqZ+lUXjixo8uv7WkkDdUi0KFIswNOwp8aO+ypEq7shn3Y84cNDzrOXmLxBraLU6m2jhcRMjvedP3WLcHif7zXHoWVC+6UpTlaK1pQ==; Received: from shadow.codelabs.ru (ppp91-77-173-118.pppoe.mtu-net.ru [91.77.173.118]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1RnjTg-0009QB-AP; Thu, 19 Jan 2012 07:19:56 +0300 Date: Thu, 19 Jan 2012 08:19:53 +0400 From: Eygene Ryabinkin To: John Baldwin Message-ID: References: <201201120648.q0C6mBio096662@svn.freebsd.org> <76N5o2cbOG1xa+/PCENoyerLpsM@HbohoBmewgxm0atwUoKO7zhAAgw> <201201181011.04397.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <201201181011.04397.jhb@freebsd.org> Sender: rea@codelabs.ru Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 04:19:58 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Wed, Jan 18, 2012 at 10:11:04AM -0500, John Baldwin wrote: > On Wednesday, January 18, 2012 6:29:10 am Eygene Ryabinkin wrote: > > The attached patch that just changes 'err' to 'echo ...; exit 1' > > works fine for me. > >=20 > > Any views on it? >=20 > Seems ok to me. >=20 > > Anyone can say anything about /etc/netstart issue? >=20 > My guess is that it is ok to remove it from netstart. Then, can I have your 'Approved by' sticker for the commits? I am ports committer, so src commits require me to go through approval. Thanks. --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk8XmekACgkQFq+eroFS7PuhBwD/SwRwf4pXfxOy1cT/51JgWeVk 0HCbjMPqdgppOLMueUoA/2eD0UMWRryL6vdpSjT1ksl0oacs4wiu5ydsz2UGcq4u =idC6 -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 05:57:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23C1D106566B; Thu, 19 Jan 2012 05:57:56 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E86988FC15; Thu, 19 Jan 2012 05:57:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0J5vpra058026; Thu, 19 Jan 2012 05:57:52 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F17B0DE.3060008@gmail.com> Date: Thu, 19 Jan 2012 13:57:50 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: davidxu@freebsd.org References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <201201170957.47718.jhb@freebsd.org> <4F1629D5.4020605@gmail.com> <201201181009.23221.jhb@freebsd.org> <4F178CDC.3030807@gmail.com> In-Reply-To: <4F178CDC.3030807@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 05:57:56 -0000 On 2012/1/19 11:24, David Xu wrote: > On 2012/1/18 23:09, John Baldwin wrote: >> On Tuesday, January 17, 2012 9:09:25 pm David Xu wrote: >>> On 2012/1/17 22:57, John Baldwin wrote: >>>> On Monday, January 16, 2012 1:15:14 am David Xu wrote: >>>>> Author: davidxu >>>>> Date: Mon Jan 16 06:15:14 2012 >>>>> New Revision: 230201 >>>>> URL: http://svn.freebsd.org/changeset/base/230201 >>>>> >>>>> Log: >>>>> Insert read memory barriers. >>>> I think using atomic_load_acq() on sem->nwaiters would be clearer >>>> as it would >>>> indicate which variable you need to ensure is read after other >>>> operations. In >>>> general I think raw rmb/wmb usage should be avoided when possible >>>> as it is >>>> does not describe the programmer's intent as well. >>>> >>> Yes, I had considered that I may use atomic_load_acq(), but at that >>> time, >>> I thought it emits a bus locking, right ? so I just picked up rmb() >>> which >>> only affects current cpu. maybe atomic_load_acq() does same thing with >>> rmb() ? >>> it is still unclear to me. >> atomic_load_acq() is the same as rmb(). Right now it uses a locked >> instruction on amd64, but it could easily switch to lfence/sfence >> instead. I >> had patches to do that but I think bde@ had done some benchmarks that >> showed >> that change made no difference. >> > I wish there is a version uses lfence for atomic_load_acq(). I always > think > bus locking is expensive on a multiple-core machine. Here we work on > large > machine found that even current rwlock in libthr is not scale well if > most threads are readers, we have to implement CSNZI-like rwlock to avoid > CPU conflict. > http://people.csail.mit.edu/mareko/spaa09-scalablerwlocks.pdf > > I have just done a benchmark on my notebook which is a 4 SMT sandy bridge > CPU i3 2310m. > http://people.freebsd.org/~davidxu/bench/semaphore/ > > > The load_acq uses atomic locking is much slower than lfence: > http://people.freebsd.org/~davidxu/bench/semaphore/ministat.txt > > > benchmark program: > http://people.freebsd.org/~davidxu/bench/semaphore/sem_test.c > > rdtsc() may not work on SMP, so I have updated it to use clock_gettime to get total time. http://people.freebsd.org/~davidxu/bench/semaphore2/ Still, lfence is a lot faster than atomic lock. From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 09:36:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0753106564A; Thu, 19 Jan 2012 09:36:19 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAFEC8FC08; Thu, 19 Jan 2012 09:36:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0J9aJH4080857; Thu, 19 Jan 2012 09:36:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0J9aJX8080855; Thu, 19 Jan 2012 09:36:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201190936.q0J9aJX8080855@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 19 Jan 2012 09:36: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: r230329 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 09:36:20 -0000 Author: luigi Date: Thu Jan 19 09:36:19 2012 New Revision: 230329 URL: http://svn.freebsd.org/changeset/base/230329 Log: netmap-related changes: 1. correct the initialization of RDT when there is an ixgbe_init() while a netmap client is active. This code was previously in ixgbe_initialize_receive_units() but RDT is overwritten shortly afterwards in ixgbe_init_locked() 2. add code (not active yet) to disable CRCSTRIP while in netmap mode. From all evidence i could gather, it seems that when the 82599 has to write a data block that is not a full cache line, it first reads the line (64 bytes) and then writes back the updated version. This hurts reception of min-sized frames, which are only 60 bytes if the CRC is stripped: i could never get above 11Mpps (received from one queue) with CRCSTRIP enabled, whyle 64+4-byte packets reach 14.2 Mpps (the theoretical maximum). Leaving the CRC in gets us 14.88Mpps for 60+4 byte frames, (and penalizes 64+4). The min-size case is important not just because it looks good in benchmarks, but also because this is the size of pure acks. Note we cannot leave CRCSTRIP on by default because it is incompatible with some other features (LRO etc.) Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Jan 19 02:49:21 2012 (r230328) +++ head/sys/dev/ixgbe/ixgbe.c Thu Jan 19 09:36:19 2012 (r230329) @@ -1138,6 +1138,31 @@ ixgbe_init_locked(struct adapter *adapte msec_delay(1); } wmb(); +#ifdef DEV_NETMAP + /* + * In netmap mode, we must preserve the buffers made + * available to userspace before the if_init() + * (this is true by default on the TX side, because + * init makes all buffers available to userspace). + * + * netmap_reset() and the device specific routines + * (e.g. ixgbe_setup_receive_rings()) map these + * buffers at the end of the NIC ring, so here we + * must set the RDT (tail) register to make sure + * they are not overwritten. + * + * In this driver the NIC ring starts at RDH = 0, + * RDT points to the last slot available for reception (?), + * so RDT = num_rx_desc - 1 means the whole ring is available. + */ + if (ifp->if_capenable & IFCAP_NETMAP) { + struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_kring *kring = &na->rx_rings[i]; + int t = na->num_rx_desc - 1 - kring->nr_hwavail; + + IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t); + } else +#endif /* DEV_NETMAP */ IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1); } @@ -3903,6 +3928,21 @@ skip_head: lro->ifp = adapter->ifp; } +#ifdef DEV_NETMAP1 /* XXX experimental CRC strip */ + { + struct ixgbe_hw *hw = &adapter->hw; + u32 rdrxctl; + + rdrxctl = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); + rdrxctl &= ~IXGBE_RDRXCTL_RSCFRSTSIZE; + if (slot) + rdrxctl &= ~IXGBE_RDRXCTL_CRCSTRIP; + else + rdrxctl |= IXGBE_RDRXCTL_CRCSTRIP; + rdrxctl |= IXGBE_RDRXCTL_RSCACKC; + IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); + } +#endif /* DEV_NETMAP1 */ IXGBE_RX_UNLOCK(rxr); return (0); @@ -3982,6 +4022,12 @@ ixgbe_initialize_receive_units(struct ad hlreg |= IXGBE_HLREG0_JUMBOEN; else hlreg &= ~IXGBE_HLREG0_JUMBOEN; +#ifdef DEV_NETMAP1 /* XXX experimental CRCSTRIP */ + if (ifp->if_capenable & IFCAP_NETMAP) + hlreg &= ~IXGBE_HLREG0_RXCRCSTRP; + else + hlreg |= IXGBE_HLREG0_RXCRCSTRP; +#endif /* DEV_NETMAP1 */ IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); bufsz = (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; @@ -4013,35 +4059,6 @@ ixgbe_initialize_receive_units(struct ad /* Setup the HW Rx Head and Tail Descriptor Pointers */ IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0); -#ifdef DEV_NETMAP - /* - * In netmap mode, we must preserve the buffers made - * available to userspace before the if_init() - * (this is true by default on the TX side, because - * init makes all buffers available to userspace). - * - * netmap_reset() and the device specific routines - * (e.g. ixgbe_setup_receive_rings()) map these - * buffers at the end of the NIC ring, so here we - * must set the RDT (tail) register to make sure - * they are not overwritten. - * - * In this driver the NIC ring starts at RDH = 0, - * RDT points to the first 'busy' slot, so RDT = 0 - * means the whole ring is available, and - * RDT = (num_rx_desc - X) means X slots are available. - * Computations are done modulo the ring size. - */ - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(adapter->ifp); - struct netmap_kring *kring = &na->rx_rings[i]; - int t = na->num_rx_desc - kring->nr_hwavail; - - if (t >= na->num_rx_desc) - t -= adapter->num_rx_desc; - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t); - } else -#endif /* DEV_NETMAP */ IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 09:51:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26FE9106566C; Thu, 19 Jan 2012 09:51:08 +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 05B848FC1F; Thu, 19 Jan 2012 09:51:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0J9p7Lv081320; Thu, 19 Jan 2012 09:51:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0J9p7Uj081314; Thu, 19 Jan 2012 09:51:07 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201190951.q0J9p7Uj081314@svn.freebsd.org> From: Ed Schouten Date: Thu, 19 Jan 2012 09:51: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: r230330 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 09:51:08 -0000 Author: ed Date: Thu Jan 19 09:51:07 2012 New Revision: 230330 URL: http://svn.freebsd.org/changeset/base/230330 Log: Remove remnants of dev_t. These functions take a `struct cdev *' -- not a dev_t. Inside the kernel, dev_t has the same use as in userspace, namely to store a device identifier. MFC after: 2 weeks Modified: head/share/man/man9/DEV_MODULE.9 head/share/man/man9/devtoname.9 head/share/man/man9/physio.9 head/share/man/man9/uio.9 head/share/man/man9/vcount.9 Modified: head/share/man/man9/DEV_MODULE.9 ============================================================================== --- head/share/man/man9/DEV_MODULE.9 Thu Jan 19 09:36:19 2012 (r230329) +++ head/share/man/man9/DEV_MODULE.9 Thu Jan 19 09:51:07 2012 (r230330) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2001 +.Dd January 19, 2012 .Dt DEV_MODULE 9 .Os .Sh NAME @@ -68,7 +68,7 @@ on load and to destroy it when it is unl static struct cdevsw foo_devsw = { ... }; -static dev_t sdev; +static struct cdev *sdev; static int foo_load(module_t mod, int cmd, void *arg) Modified: head/share/man/man9/devtoname.9 ============================================================================== --- head/share/man/man9/devtoname.9 Thu Jan 19 09:36:19 2012 (r230329) +++ head/share/man/man9/devtoname.9 Thu Jan 19 09:51:07 2012 (r230330) @@ -24,17 +24,17 @@ .\" .\" $FreeBSD$ .\" -.Dd September 25, 1999 +.Dd January 19, 2012 .Dt DEVTONAME 9 .Os .Sh NAME .Nm devtoname -.Nd "converts dev_t data into a string indicating the device name" +.Nd "converts character device into a string indicating the device name" .Sh SYNOPSIS .In sys/param.h .In sys/conf.h .Ft const char * -.Fn devtoname "dev_t dev" +.Fn devtoname "struct cdev *dev" .Sh DESCRIPTION The .Fn devtoname Modified: head/share/man/man9/physio.9 ============================================================================== --- head/share/man/man9/physio.9 Thu Jan 19 09:36:19 2012 (r230329) +++ head/share/man/man9/physio.9 Thu Jan 19 09:51:07 2012 (r230330) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2004 +.Dd January 19, 2012 .Dt PHYSIO 9 .Os .Sh NAME @@ -41,7 +41,7 @@ .In sys/bio.h .In sys/buf.h .Ft int -.Fn physio "dev_t dev" "struct uio *uio" "int ioflag" +.Fn physio "struct cdev *dev" "struct uio *uio" "int ioflag" .Sh DESCRIPTION The .Fn physio Modified: head/share/man/man9/uio.9 ============================================================================== --- head/share/man/man9/uio.9 Thu Jan 19 09:36:19 2012 (r230329) +++ head/share/man/man9/uio.9 Thu Jan 19 09:51:07 2012 (r230330) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2011 +.Dd January 19, 2012 .Dt UIO 9 .Os .Sh NAME @@ -154,7 +154,7 @@ static char buffer[BUFSIZE]; static int data_available; /* amount of data that can be read */ static int -fooread(dev_t dev, struct uio *uio, int flag) +fooread(struct cdev *dev, struct uio *uio, int flag) { int rv, amnt; Modified: head/share/man/man9/vcount.9 ============================================================================== --- head/share/man/man9/vcount.9 Thu Jan 19 09:36:19 2012 (r230329) +++ head/share/man/man9/vcount.9 Thu Jan 19 09:51:07 2012 (r230330) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2001 +.Dd January 19, 2012 .Dt VCOUNT 9 .Os .Sh NAME @@ -47,7 +47,7 @@ .Ft int .Fn vcount "struct vnode *vp" .Ft int -.Fn count_dev "dev_t dev" +.Fn count_dev "struct cdev *dev" .Sh DESCRIPTION .Fn vcount is used to get the number of references to a particular device. @@ -56,7 +56,7 @@ It allows for the fact that multiple vno does the same thing as .Fn vcount , but takes a -.Vt dev_t +.Vt "struct cdev" rather than a .Vt "struct vnode" pointer as an argument. From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 11:18:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 118E7106566C; Thu, 19 Jan 2012 11:18:22 +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 EF0A98FC1A; Thu, 19 Jan 2012 11:18:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JBILoY088278; Thu, 19 Jan 2012 11:18:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JBILYA088275; Thu, 19 Jan 2012 11:18:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201191118.q0JBILYA088275@svn.freebsd.org> From: Alexander Motin Date: Thu, 19 Jan 2012 11: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: r230331 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 11:18:22 -0000 Author: mav Date: Thu Jan 19 11:18:21 2012 New Revision: 230331 URL: http://svn.freebsd.org/changeset/base/230331 Log: Print controller/codec IDs for unknown chips instead of useless and frightening "unknown" word. In most cases we don't need to know chips to properly handle them, but having IDs in logs may simplify debugging. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Jan 19 09:51:07 2012 (r230330) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Jan 19 11:18:21 2012 (r230331) @@ -124,9 +124,9 @@ static const struct { { HDA_NVIDIA_MCP89_2, "NVIDIA MCP89", 0, 0 }, { HDA_NVIDIA_MCP89_3, "NVIDIA MCP89", 0, 0 }, { HDA_NVIDIA_MCP89_4, "NVIDIA MCP89", 0, 0 }, - { HDA_NVIDIA_0BE2, "NVIDIA 0x0be2", 0, HDAC_QUIRK_MSI }, - { HDA_NVIDIA_0BE3, "NVIDIA 0x0be3", 0, HDAC_QUIRK_MSI }, - { HDA_NVIDIA_0BE4, "NVIDIA 0x0be4", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_0BE2, "NVIDIA (0x0be2)", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_0BE3, "NVIDIA (0x0be3)", 0, HDAC_QUIRK_MSI }, + { HDA_NVIDIA_0BE4, "NVIDIA (0x0be4)", 0, HDAC_QUIRK_MSI }, { HDA_NVIDIA_GT100, "NVIDIA GT100", 0, HDAC_QUIRK_MSI }, { HDA_NVIDIA_GT104, "NVIDIA GT104", 0, HDAC_QUIRK_MSI }, { HDA_NVIDIA_GT106, "NVIDIA GT106", 0, HDAC_QUIRK_MSI }, @@ -154,12 +154,12 @@ static const struct { { HDA_SIS_966, "SiS 966", 0, 0 }, { HDA_ULI_M5461, "ULI M5461", 0, 0 }, /* Unknown */ - { HDA_INTEL_ALL, "Intel (Unknown)", 0, 0 }, - { HDA_NVIDIA_ALL, "NVIDIA (Unknown)", 0, 0 }, - { HDA_ATI_ALL, "ATI (Unknown)", 0, 0 }, - { HDA_VIA_ALL, "VIA (Unknown)", 0, 0 }, - { HDA_SIS_ALL, "SiS (Unknown)", 0, 0 }, - { HDA_ULI_ALL, "ULI (Unknown)", 0, 0 }, + { HDA_INTEL_ALL, "Intel", 0, 0 }, + { HDA_NVIDIA_ALL, "NVIDIA", 0, 0 }, + { HDA_ATI_ALL, "ATI", 0, 0 }, + { HDA_VIA_ALL, "VIA", 0, 0 }, + { HDA_SIS_ALL, "SiS", 0, 0 }, + { HDA_ULI_ALL, "ULI", 0, 0 }, }; #define HDAC_DEVICES_LEN (sizeof(hdac_devices) / sizeof(hdac_devices[0])) @@ -1017,26 +1017,27 @@ hdac_probe(device_t dev) result = ENXIO; for (i = 0; i < HDAC_DEVICES_LEN; i++) { if (hdac_devices[i].model == model) { - strlcpy(desc, hdac_devices[i].desc, sizeof(desc)); - result = BUS_PROBE_DEFAULT; + strlcpy(desc, hdac_devices[i].desc, sizeof(desc)); + result = BUS_PROBE_DEFAULT; break; } if (HDA_DEV_MATCH(hdac_devices[i].model, model) && class == PCIC_MULTIMEDIA && subclass == PCIS_MULTIMEDIA_HDA) { - strlcpy(desc, hdac_devices[i].desc, sizeof(desc)); - result = BUS_PROBE_GENERIC; + snprintf(desc, sizeof(desc), + "%s (0x%04x)", + hdac_devices[i].desc, pci_get_device(dev)); + result = BUS_PROBE_GENERIC; break; } } if (result == ENXIO && class == PCIC_MULTIMEDIA && subclass == PCIS_MULTIMEDIA_HDA) { - strlcpy(desc, "Generic", sizeof(desc)); - result = BUS_PROBE_GENERIC; + snprintf(desc, sizeof(desc), "Generic (0x%08x)", model); + result = BUS_PROBE_GENERIC; } if (result != ENXIO) { - strlcat(desc, " HDA Controller", - sizeof(desc)); + strlcat(desc, " HDA Controller", sizeof(desc)); device_set_desc_copy(dev, desc); } Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 19 09:51:07 2012 (r230330) +++ head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 19 11:18:21 2012 (r230331) @@ -266,44 +266,22 @@ static const struct { { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, /* Unknown CODECs */ - { HDA_CODEC_ALCXXXX, 0, "Realtek (Unknown)" }, - { HDA_CODEC_ADXXXX, 0, "Analog Devices (Unknown)" }, - { HDA_CODEC_CSXXXX, 0, "Cirrus Logic (Unknown)" }, - { HDA_CODEC_CMIXXXX, 0, "CMedia (Unknown)" }, - { HDA_CODEC_STACXXXX, 0, "Sigmatel (Unknown)" }, - { HDA_CODEC_SIIXXXX, 0, "Silicon Image (Unknown)" }, - { HDA_CODEC_AGEREXXXX, 0, "Lucent/Agere Systems (Unknown)" }, - { HDA_CODEC_CXXXXX, 0, "Conexant (Unknown)" }, - { HDA_CODEC_VTXXXX, 0, "VIA (Unknown)" }, - { HDA_CODEC_ATIXXXX, 0, "ATI (Unknown)" }, - { HDA_CODEC_NVIDIAXXXX, 0, "NVIDIA (Unknown)" }, - { HDA_CODEC_INTELXXXX, 0, "Intel (Unknown)" }, - { HDA_CODEC_IDTXXXX, 0, "IDT (Unknown)" }, + { HDA_CODEC_ALCXXXX, 0, "Realtek" }, + { HDA_CODEC_ADXXXX, 0, "Analog Devices" }, + { HDA_CODEC_CSXXXX, 0, "Cirrus Logic" }, + { HDA_CODEC_CMIXXXX, 0, "CMedia" }, + { HDA_CODEC_STACXXXX, 0, "Sigmatel" }, + { HDA_CODEC_SIIXXXX, 0, "Silicon Image" }, + { HDA_CODEC_AGEREXXXX, 0, "Lucent/Agere Systems" }, + { HDA_CODEC_CXXXXX, 0, "Conexant" }, + { HDA_CODEC_VTXXXX, 0, "VIA" }, + { HDA_CODEC_ATIXXXX, 0, "ATI" }, + { HDA_CODEC_NVIDIAXXXX, 0, "NVIDIA" }, + { HDA_CODEC_INTELXXXX, 0, "Intel" }, + { HDA_CODEC_IDTXXXX, 0, "IDT" }, }; #define HDACC_CODECS_LEN (sizeof(hdacc_codecs) / sizeof(hdacc_codecs[0])) - -/**************************************************************************** - * Function prototypes - ****************************************************************************/ - -static char * -hdacc_codec_name(uint32_t id, uint16_t revid) -{ - int i; - - for (i = 0; i < HDACC_CODECS_LEN; i++) { - if (!HDA_DEV_MATCH(hdacc_codecs[i].id, id)) - continue; - if (hdacc_codecs[i].revid != 0 && - hdacc_codecs[i].revid != revid) - continue; - return (hdacc_codecs[i].name); - } - - return ((id == 0x00000000) ? "NULL CODEC" : "Unknown CODEC"); -} - static int hdacc_suspend(device_t dev) { @@ -337,10 +315,28 @@ hdacc_probe(device_t dev) { uint32_t id, revid; char buf[128]; + int i; id = ((uint32_t)hda_get_vendor_id(dev) << 16) + hda_get_device_id(dev); revid = ((uint32_t)hda_get_revision_id(dev) << 8) + hda_get_stepping_id(dev); - snprintf(buf, sizeof(buf), "%s HDA CODEC", hdacc_codec_name(id, revid)); + + for (i = 0; i < HDACC_CODECS_LEN; i++) { + if (!HDA_DEV_MATCH(hdacc_codecs[i].id, id)) + continue; + if (hdacc_codecs[i].revid != 0 && + hdacc_codecs[i].revid != revid) + continue; + break; + } + if (i < HDACC_CODECS_LEN) { + if ((hdacc_codecs[i].id & 0xffff) != 0xffff) + strlcpy(buf, hdacc_codecs[i].name, sizeof(buf)); + else + snprintf(buf, sizeof(buf), "%s (0x%04x)", + hdacc_codecs[i].name, hda_get_device_id(dev)); + } else + snprintf(buf, sizeof(buf), "Generic (0x%04x)", id); + strlcat(buf, " HDA CODEC", sizeof(buf)); device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 14:51:34 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18827106566B; Thu, 19 Jan 2012 14:51:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 871E68FC19; Thu, 19 Jan 2012 14:51:33 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0JEpW01042832; Thu, 19 Jan 2012 18:51:32 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0JEpWxA042831; Thu, 19 Jan 2012 18:51:32 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Jan 2012 18:51:32 +0400 From: Gleb Smirnoff To: Gleb Kurtsou Message-ID: <20120119145132.GZ12760@FreeBSD.org> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> <20120119143837.GA28308@reks> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120119143837.GA28308@reks> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 14:51:34 -0000 On Thu, Jan 19, 2012 at 04:38:38PM +0200, Gleb Kurtsou wrote: G> On (16/01/2012 09:53), Gleb Smirnoff wrote: G> > Author: glebius G> > Date: Mon Jan 16 09:53:24 2012 G> > New Revision: 230207 G> > URL: http://svn.freebsd.org/changeset/base/230207 G> > G> > Log: G> > Drop support for SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFDSTADDR G> > ioctl commands. G> G> What was the reason for dropping them? "80-ish ioctl" doesn't justify G> reducing compatibility with other unix-like OS'es (namely linux). The reason is to get code more readable and thus maintainable. You can compare in_control() + in_addprefix() in the stable/9 with what we have in head now. Which one would you prefer to hack on? I wouldn't claim compatibility for the commands that didn't work very well. I won't also name Linux, since these commands predate the Linux itself. Do you use them? Or do you know software that use them? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 15:04:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0D86106566C; Thu, 19 Jan 2012 15:04:36 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 22D568FC13; Thu, 19 Jan 2012 15:04:35 +0000 (UTC) Received: by lahe6 with SMTP id e6so9182lah.13 for ; Thu, 19 Jan 2012 07:04:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=whvIpyEJc8jDVOseCGQOcGHueVpvM3CcJ2ixyZm+xac=; b=A8PPNiuwzmJ7ipS++pz5avjvkpL52H+up83kxd++jxjQ6JWd0mTfyyK4u7L9EXTzpl qDoAq5oV6Qopd8s5nRaer2CSGUANUdF6t3D/7F9lO4GznbSnk6hZmT1hqCo/vepv/UAx xIeo6/xiWzU4rKmBzeQh2KLtbxHHR1S5Owkl4= Received: by 10.152.131.41 with SMTP id oj9mr12859316lab.42.1326983916129; Thu, 19 Jan 2012 06:38:36 -0800 (PST) Received: from localhost ([78.157.92.5]) by mx.google.com with ESMTPS id oi8sm21288504lab.6.2012.01.19.06.38.34 (version=SSLv3 cipher=OTHER); Thu, 19 Jan 2012 06:38:34 -0800 (PST) Date: Thu, 19 Jan 2012 16:38:38 +0200 From: Gleb Kurtsou To: Gleb Smirnoff Message-ID: <20120119143837.GA28308@reks> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201201160953.q0G9rPp8026625@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 15:04:36 -0000 On (16/01/2012 09:53), Gleb Smirnoff wrote: > Author: glebius > Date: Mon Jan 16 09:53:24 2012 > New Revision: 230207 > URL: http://svn.freebsd.org/changeset/base/230207 > > Log: > Drop support for SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFDSTADDR > ioctl commands. What was the reason for dropping them? "80-ish ioctl" doesn't justify reducing compatibility with other unix-like OS'es (namely linux). Thanks, Gleb. > > PR: 163524 > Reviewed by: net > > Modified: > head/sys/netinet/in.c > head/sys/sys/param.h > > Modified: head/sys/netinet/in.c > ============================================================================== > --- head/sys/netinet/in.c Mon Jan 16 08:31:32 2012 (r230206) > +++ head/sys/netinet/in.c Mon Jan 16 09:53:24 2012 (r230207) > @@ -73,7 +73,7 @@ static int in_lifaddr_ioctl(struct socke > > static void in_socktrim(struct sockaddr_in *); > static int in_ifinit(struct ifnet *, struct in_ifaddr *, > - struct sockaddr_in *, int, int, int); > + struct sockaddr_in *, int, int); > static void in_purgemaddrs(struct ifnet *); > > static VNET_DEFINE(int, nosameprefix); > @@ -220,7 +220,6 @@ in_control(struct socket *so, u_long cmd > struct in_addr dst; > struct in_ifinfo *ii; > struct in_aliasreq *ifra = (struct in_aliasreq *)data; > - struct sockaddr_in oldaddr; > int error, hostIsNew, iaIsNew, maskIsNew; > int iaIsFirst; > u_long ocmd = cmd; > @@ -278,10 +277,8 @@ in_control(struct socket *so, u_long cmd > case SIOCSIFBRDADDR: > case SIOCSIFDSTADDR: > case SIOCSIFNETMASK: > - if (ifr->ifr_addr.sa_family != AF_INET || > - ifr->ifr_addr.sa_len != sizeof(struct sockaddr_in)) > - return (EINVAL); > - break; > + /* We no longer support that old commands. */ > + return (EINVAL); > > case SIOCALIFADDR: > if (td != NULL) { > @@ -322,10 +319,6 @@ in_control(struct socket *so, u_long cmd > */ > switch (cmd) { > case SIOCAIFADDR: > - case SIOCSIFADDR: > - case SIOCSIFBRDADDR: > - case SIOCSIFNETMASK: > - case SIOCSIFDSTADDR: > if (td != NULL) { > error = priv_check(td, PRIV_NET_ADDIFADDR); > if (error) > @@ -413,10 +406,6 @@ in_control(struct socket *so, u_long cmd > error = EADDRNOTAVAIL; > goto out; > } > - /* FALLTHROUGH */ > - case SIOCSIFADDR: > - case SIOCSIFNETMASK: > - case SIOCSIFDSTADDR: > if (ia == NULL) { > ia = (struct in_ifaddr *) > malloc(sizeof *ia, M_IFADDR, M_NOWAIT | > @@ -452,7 +441,6 @@ in_control(struct socket *so, u_long cmd > } > break; > > - case SIOCSIFBRDADDR: > case SIOCGIFADDR: > case SIOCGIFNETMASK: > case SIOCGIFDSTADDR: > @@ -493,61 +481,6 @@ in_control(struct socket *so, u_long cmd > *((struct sockaddr_in *)&ifr->ifr_addr) = ia->ia_sockmask; > goto out; > > - case SIOCSIFDSTADDR: > - if ((ifp->if_flags & IFF_POINTOPOINT) == 0) { > - error = EINVAL; > - goto out; > - } > - oldaddr = ia->ia_dstaddr; > - ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr; > - if (ifp->if_ioctl != NULL) { > - error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, > - (caddr_t)ia); > - if (error) { > - ia->ia_dstaddr = oldaddr; > - goto out; > - } > - } > - if (ia->ia_flags & IFA_ROUTE) { > - ia->ia_ifa.ifa_dstaddr = (struct sockaddr *)&oldaddr; > - rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST); > - ia->ia_ifa.ifa_dstaddr = > - (struct sockaddr *)&ia->ia_dstaddr; > - rtinit(&(ia->ia_ifa), (int)RTM_ADD, RTF_HOST|RTF_UP); > - } > - goto out; > - > - case SIOCSIFBRDADDR: > - if ((ifp->if_flags & IFF_BROADCAST) == 0) { > - error = EINVAL; > - goto out; > - } > - ia->ia_broadaddr = *(struct sockaddr_in *)&ifr->ifr_broadaddr; > - goto out; > - > - case SIOCSIFADDR: > - error = in_ifinit(ifp, ia, > - (struct sockaddr_in *) &ifr->ifr_addr, 1, 0, 0); > - if (error != 0 && iaIsNew) > - break; > - if (error == 0) { > - ii = ((struct in_ifinfo *)ifp->if_afdata[AF_INET]); > - if (iaIsFirst && > - (ifp->if_flags & IFF_MULTICAST) != 0) { > - error = in_joingroup(ifp, &allhosts_addr, > - NULL, &ii->ii_allhosts); > - } > - EVENTHANDLER_INVOKE(ifaddr_event, ifp); > - } > - error = 0; > - goto out; > - > - case SIOCSIFNETMASK: > - ia->ia_sockmask.sin_addr = ((struct sockaddr_in *) > - &ifr->ifr_addr)->sin_addr; > - ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr); > - goto out; > - > case SIOCAIFADDR: > maskIsNew = 0; > hostIsNew = 1; > @@ -579,8 +512,8 @@ in_control(struct socket *so, u_long cmd > maskIsNew = 1; /* We lie; but the effect's the same */ > } > if (hostIsNew || maskIsNew) > - error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0, > - maskIsNew, (ocmd == cmd ? ifra->ifra_vhid : 0)); > + error = in_ifinit(ifp, ia, &ifra->ifra_addr, maskIsNew, > + (ocmd == cmd ? ifra->ifra_vhid : 0)); > if (error != 0 && iaIsNew) > break; > > @@ -863,14 +796,11 @@ in_ifscrub(struct ifnet *ifp, struct in_ > */ > static int > in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, > - int scrub, int masksupplied, int vhid) > + int masksupplied, int vhid) > { > register u_long i = ntohl(sin->sin_addr.s_addr); > int flags = RTF_UP, error = 0; > > - if (scrub) > - in_scrubprefix(ia, LLE_STATIC); > - > IN_IFADDR_WLOCK(); > if (ia->ia_addr.sin_family == AF_INET) > LIST_REMOVE(ia, ia_hash); > > Modified: head/sys/sys/param.h > ============================================================================== > --- head/sys/sys/param.h Mon Jan 16 08:31:32 2012 (r230206) > +++ head/sys/sys/param.h Mon Jan 16 09:53:24 2012 (r230207) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1000004 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1000005 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 15:50:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 285261065677; Thu, 19 Jan 2012 15:50:47 +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 B28DF8FC12; Thu, 19 Jan 2012 15:50:46 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6B0E246B09; Thu, 19 Jan 2012 10:50:46 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ED330B946; Thu, 19 Jan 2012 10:50:45 -0500 (EST) From: John Baldwin To: Eygene Ryabinkin Date: Thu, 19 Jan 2012 10:19:50 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201181011.04397.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201201191019.50042.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 19 Jan 2012 10:50:46 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 15:50:47 -0000 On Wednesday, January 18, 2012 11:19:53 pm Eygene Ryabinkin wrote: > Wed, Jan 18, 2012 at 10:11:04AM -0500, John Baldwin wrote: > > On Wednesday, January 18, 2012 6:29:10 am Eygene Ryabinkin wrote: > > > The attached patch that just changes 'err' to 'echo ...; exit 1' > > > works fine for me. > > > > > > Any views on it? > > > > Seems ok to me. > > > > > Anyone can say anything about /etc/netstart issue? > > > > My guess is that it is ok to remove it from netstart. > > Then, can I have your 'Approved by' sticker for the commits? > I am ports committer, so src commits require me to go through > approval. Go ahead. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 15:50:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2E23106564A; Thu, 19 Jan 2012 15:50:47 +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 768C88FC13; Thu, 19 Jan 2012 15:50:47 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 2F08F46B0C; Thu, 19 Jan 2012 10:50:47 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 97814B999; Thu, 19 Jan 2012 10:50:46 -0500 (EST) From: John Baldwin To: davidxu@freebsd.org Date: Thu, 19 Jan 2012 10:23:28 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F178CDC.3030807@gmail.com> <4F17B0DE.3060008@gmail.com> In-Reply-To: <4F17B0DE.3060008@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201191023.28426.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 19 Jan 2012 10:50:46 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 15:50:47 -0000 On Thursday, January 19, 2012 12:57:50 am David Xu wrote: > rdtsc() may not work on SMP, so I have updated it to use clock_gettime > to get total time. > http://people.freebsd.org/~davidxu/bench/semaphore2/ > > > Still, lfence is a lot faster than atomic lock. http://www.freebsd.org/~jhb/patches/amd64_fence.patch This the patch I've had for quite a while. Can you retest with this? You'll probably have to install the updated header in /usr/include as well. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 16:09:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E355106566C; Thu, 19 Jan 2012 16:09:01 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id B21618FC21; Thu, 19 Jan 2012 16:09:00 +0000 (UTC) Received: by yhfs35 with SMTP id s35so59953yhf.13 for ; Thu, 19 Jan 2012 08:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=8dEyEU4DlPDYJp4YC4E4EJ59ufZ4wKxLzw53tKN+avk=; b=q5ApBjqq8qrppoEiuMx6AMm5SV1QCC3Nnv/3xOAMEcb0lCLl+eSRWegtpmj68qyAFo luH6KWlOgmbPJ9mnB0MKf3a9FjhUXSZdP6qygP6gz6KqWJfefxfM/hDl+MfoJANxP+Kl YdamL1HmOQdyoPtfFODlZqFItSUY45ygOzbGk= Received: by 10.236.177.74 with SMTP id c50mr6670986yhm.130.1326987603220; Thu, 19 Jan 2012 07:40:03 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.100.250.7 with HTTP; Thu, 19 Jan 2012 07:39:22 -0800 (PST) In-Reply-To: <20120119145132.GZ12760@FreeBSD.org> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> <20120119143837.GA28308@reks> <20120119145132.GZ12760@FreeBSD.org> From: Ivan Voras Date: Thu, 19 Jan 2012 16:39:22 +0100 X-Google-Sender-Auth: L8xvJ--dCXMrQLjLj6kgmKhSPHg Message-ID: To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 16:09:01 -0000 2012/1/19 Gleb Smirnoff : > Do you use them? Or do you know software that use them? That's easy: Google: SIOCSIFADDR "About 55,400 results" A different question is if any *important* software uses it... From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 16:46:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 595AC106566C; Thu, 19 Jan 2012 16:46:27 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9068FC1C; Thu, 19 Jan 2012 16:46:25 +0000 (UTC) Received: by lahe6 with SMTP id e6so105661lah.13 for ; Thu, 19 Jan 2012 08:46:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=5ZwNEFupwgpLYPPMp4F3cfoue8+a0wcdRuq/APYHSmk=; b=CHHxlAQWNzNgOzMzEQPMHMsX8tmPgJMaJNQqqplzoPJQsXBuJex65x7ncy9YEWaedB eCpQzOJ2gRkXU4eLb58sHMshFQWzz1b64xZnrN+dKl3Ank3V2uCggEtSrBrdZg4B6XCL +kka0IYG7zK7Wy4orwPAZ8QddnNkbSb/tZJkI= Received: by 10.152.147.1 with SMTP id tg1mr10906lab.22.1326991584953; Thu, 19 Jan 2012 08:46:24 -0800 (PST) Received: from localhost ([78.157.92.5]) by mx.google.com with ESMTPS id lz18sm16036773lab.17.2012.01.19.08.46.23 (version=SSLv3 cipher=OTHER); Thu, 19 Jan 2012 08:46:24 -0800 (PST) Date: Thu, 19 Jan 2012 18:46:27 +0200 From: Gleb Kurtsou To: Gleb Smirnoff Message-ID: <20120119164627.GA42205@reks> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> <20120119143837.GA28308@reks> <20120119145132.GZ12760@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20120119145132.GZ12760@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 16:46:27 -0000 On (19/01/2012 18:51), Gleb Smirnoff wrote: > On Thu, Jan 19, 2012 at 04:38:38PM +0200, Gleb Kurtsou wrote: > G> On (16/01/2012 09:53), Gleb Smirnoff wrote: > G> > Author: glebius > G> > Date: Mon Jan 16 09:53:24 2012 > G> > New Revision: 230207 > G> > URL: http://svn.freebsd.org/changeset/base/230207 > G> > > G> > Log: > G> > Drop support for SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFDSTADDR > G> > ioctl commands. > G> > G> What was the reason for dropping them? "80-ish ioctl" doesn't justify > G> reducing compatibility with other unix-like OS'es (namely linux). > > The reason is to get code more readable and thus maintainable. You can compare > in_control() + in_addprefix() in the stable/9 with what we have in head now. > Which one would you prefer to hack on? Your point is valid and I'm all for it. > I wouldn't claim compatibility for the commands that didn't work very well. > I won't also name Linux, since these commands predate the Linux itself. I meant that SIOCSIFADDR is default (if not the only) way to set interface address on linux. > Do you use them? Or do you know software that use them? I do and I've seen other examples of using SIOCSIF*ADDR with BSD specific tweaks. Although I must admit that nowadays the most common way of configuring interface is to call /sbin/ifconfig. It's not a big deal for me, I have no problem with replacing them on FreeBSD. FreeBSD is not even officially supported platform for the product and I build/test on FreeBSD solely for the purpose of avoiding linuxisms and platform specific behaviour. Let's hope it won't break for somebody else :) Thanks, Gleb. > > -- > Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 16:55:48 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5F7D106566C; Thu, 19 Jan 2012 16:55:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 3AF758FC16; Thu, 19 Jan 2012 16:55:47 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0JGthr7006251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Jan 2012 03:55:46 +1100 Date: Fri, 20 Jan 2012 03:55:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201201191023.28426.jhb@freebsd.org> Message-ID: <20120120030456.O1411@besplex.bde.org> References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F178CDC.3030807@gmail.com> <4F17B0DE.3060008@gmail.com> <201201191023.28426.jhb@freebsd.org> 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, davidxu@FreeBSD.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 16:55:48 -0000 On Thu, 19 Jan 2012, John Baldwin wrote: > On Thursday, January 19, 2012 12:57:50 am David Xu wrote: >> rdtsc() may not work on SMP, so I have updated it to use clock_gettime >> to get total time. >> http://people.freebsd.org/~davidxu/bench/semaphore2/ >> >> >> Still, lfence is a lot faster than atomic lock. I hope it does non-microbenchmarks. IIRC, jhb found that it was actually slower in some cases. I only did micro-benchmarks on Athlon64. > http://www.freebsd.org/~jhb/patches/amd64_fence.patch > > This the patch I've had for quite a while. Can you retest with this? You'll > probably have to install the updated header in /usr/include as well. % --- //depot/projects/smpng/sys/amd64/include/atomic.h 2011-01-05 17:06:25.000000000 0000 % +++ //depot/user/jhb/ktrace/amd64/include/atomic.h 2011-01-05 22:08:56.000000000 0000 % ... % @@ -213,13 +213,12 @@ % #if defined(_KERNEL) && !defined(SMP) % % /* % - * We assume that a = b will do atomic loads and stores. However, on a % - * PentiumPro or higher, reads may pass writes, so for that case we have % - * to use a serializing instruction (i.e. with LOCK) to do the load in % - * SMP kernels. For UP kernels, however, the cache of the single processor % + * We assume that a = b will do atomic loads and stores. However, reads % + * may pass writes, so we have to use fences in SMP kernels to preserve % + * ordering. For UP kernels, however, the cache of the single processor % * is always consistent, so we only need to take care of compiler. % */ % -#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ % +#define ATOMIC_STORE_LOAD(TYPE) \ % static __inline u_##TYPE \ % atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ % { \ It also has some simplifications from removing the use of different operators for load and store. These simplifications seem to be not quite generic, since "lock; cmpxchg*" seems to be 2 cycles faster than "xchg*" in Athlon64. The ATOMIC_STORE_LOAD() macro is obfuscatory. Better to have separate macros for load/store, like we do for set/clear/add/subtract. (The latter can be obfuscated even better using 4 parameters for the ops. Then better yet by making the type a parameter.) % @@ -240,32 +239,22 @@ % % #else /* !(_KERNEL && !SMP) */ % % -#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ % +#define ATOMIC_STORE_LOAD(TYPE) \ % static __inline u_##TYPE \ % atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ % { \ % - u_##TYPE res; \ % + u_##TYPE v; \ % \ % - __asm __volatile(MPLOCKED LOP \ % - : "=a" (res), /* 0 */ \ % - "=m" (*p) /* 1 */ \ % - : "m" (*p) /* 2 */ \ % - : "memory", "cc"); \ % - \ % - return (res); \ % + v = *p; \ % + __asm __volatile("lfence" ::: "memory"); \ Style bug (missing spaces around binary operator `:') which becomes a syntax error for C++. Other places in this file use ` : : : '. lfence() should be in cpufunc.h if it can be done separately like this. However, I think it can't be done separately -- it needs to be done in the same asm as the load/store, since separate C statements may be reordered. This is the same problem that forces us to write __asm volatile("sti; hlt"); instead of sti(); hlt(); in too many places for idling in machdep.c. BTW, sti() and hlt() are bogusly not in cpufunc.h either: - I misnamed sti() as disable_intr() since disable_intr() was supposed to be MI and I didn't understand that any MI interface should not be direct in cpufunc.h. - someone misnamed hlt() as halt(). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 17:07:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C67A81065674; Thu, 19 Jan 2012 17:07:58 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id A1A2C8FC26; Thu, 19 Jan 2012 17:07:56 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id B181D56205; Thu, 19 Jan 2012 11:07:55 -0600 (CST) Date: Thu, 19 Jan 2012 11:07:55 -0600 From: Mark Linimon To: Gleb Smirnoff Message-ID: <20120119170755.GE23733@lonesome.com> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201160953.q0G9rPp8026625@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: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 17:07:58 -0000 I had kind of hoped that before support was dropped, we had generated a strategy for dealing with the port breakages that my -exp run detected. This is disappointing. mcl From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 17:29:03 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B67DC106566C; Thu, 19 Jan 2012 17:29:03 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 00E5D8FC12; Thu, 19 Jan 2012 17:29:01 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id q0JHRxlj073987; Thu, 19 Jan 2012 11:27:59 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id q0JHRxrP073986; Thu, 19 Jan 2012 11:27:59 -0600 (CST) (envelope-from brooks) Date: Thu, 19 Jan 2012 11:27:59 -0600 From: Brooks Davis To: Eygene Ryabinkin Message-ID: <20120119172759.GC60214@lor.one-eyed-alien.net> References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201120748.28564.jhb@freebsd.org> <201201121438.16674.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="96YOpH+ONegL0A3E" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 17:29:03 -0000 --96YOpH+ONegL0A3E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 13, 2012 at 11:21:48AM +0400, Eygene Ryabinkin wrote: > The related topic: in the process of grepping for dhclient within > /etc, I had found that /etc/netstart still wants to invoke it. But it > will do a lone '/etc/rc.d/dhclient quietstart' and this will never > be useful in the current state of dhclient: it will refuse to process > any commands without the interface being specified. And since we > have the invocation of /etc/rc.d/netif just two lines above, I think > that it will be good to remove call to dhclient from /etc/netstart. >=20 > At the time of the original addition of call to dhclient to /etc/netstart > (r114213), dhclient script had another form, > http://svnweb.freebsd.org/base/head/etc/rc.d/dhclient?revision=3D113759= &view=3Dmarkup&pathrev=3D114213 > and it was really a normal rc.d script that requires only one argument. > Now it is more of a helper-type script. > . > Am I missing something important here or the removal can really be > done? Removing it from /etc/netstart is the right thing to do. Arguably it should be moved to /libexec since it's not an rc.d script and simply uses the framework because it had similar needs -- Brooks --96YOpH+ONegL0A3E Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFPGFKeXY6L6fI4GtQRAug7AKCvtvN1ow4QqhhpZqPdSS26N3X4lQCfYsem whKgoWhygM3wZtbnv65l6yA= =vEbH -----END PGP SIGNATURE----- --96YOpH+ONegL0A3E-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 17:29:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B3BB1065674; Thu, 19 Jan 2012 17:29:55 +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 25C308FC17; Thu, 19 Jan 2012 17:29:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JHTtnX099900; Thu, 19 Jan 2012 17:29:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JHTtVj099898; Thu, 19 Jan 2012 17:29:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201191729.q0JHTtVj099898@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Jan 2012 17: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: r230332 - head/release/doc/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 17:29:55 -0000 Author: jhb Date: Thu Jan 19 17:29:54 2012 New Revision: 230332 URL: http://svn.freebsd.org/changeset/base/230332 Log: Add support for the Em command. This restores a missing 'not' in the description of snd_emu10kx(4). Reviewed by: simon MFC after: 1 week Modified: head/release/doc/share/misc/man2hwnotes.pl Modified: head/release/doc/share/misc/man2hwnotes.pl ============================================================================== --- head/release/doc/share/misc/man2hwnotes.pl Thu Jan 19 11:18:21 2012 (r230331) +++ head/release/doc/share/misc/man2hwnotes.pl Thu Jan 19 17:29:54 2012 (r230332) @@ -324,6 +324,11 @@ sub parse { } elsif (/^Fx/) { dlog(3, "Got Fx command"); parabuf_addline(\%mdocvars, "FreeBSD"); + } elsif (/^Em (.+)$/) { + my ($txt, $punct_str) = split_punct_chars($1); + + parabuf_addline(\%mdocvars, + normalize("$txt$punct_str")); } else { # Ignore all other commands. dlog(3, "Ignoring unknown command $cmd"); From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 17:53:34 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3F8D106564A; Thu, 19 Jan 2012 17:53:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 3C66B8FC15; Thu, 19 Jan 2012 17:53:33 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0JHrU3S018951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Jan 2012 04:53:31 +1100 Date: Fri, 20 Jan 2012 04:53:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20120120030456.O1411@besplex.bde.org> Message-ID: <20120120041332.V1706@besplex.bde.org> References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F178CDC.3030807@gmail.com> <4F17B0DE.3060008@gmail.com> <201201191023.28426.jhb@freebsd.org> <20120120030456.O1411@besplex.bde.org> 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, davidxu@FreeBSD.org, John Baldwin Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 17:53:34 -0000 On Fri, 20 Jan 2012, Bruce Evans wrote: > ... > % + v = *p; \ > % + __asm __volatile("lfence" ::: "memory"); \ > > Style bug (missing spaces around binary operator `:') which becomes > a syntax error for C++. Other places in this file use ` : : : '. > > lfence() should be in cpufunc.h if it can be done separately > like this. However, I think it can't be done separately -- > it needs to be done in the same asm as the load/store, since > separate C statements may be reordered. This is the same > problem that forces us to write __asm volatile("sti; hlt"); > instead of sti(); hlt(); in too many places for idling in > machdep.c. BTW, sti() and hlt() are bogusly not in cpufunc.h > either: > - I misnamed sti() as disable_intr() since disable_intr() was > supposed to be MI and I didn't understand that any MI > interface should not be direct in cpufunc.h. > - someone misnamed hlt() as halt(). BTW2, there are 1 or 2 direct uses of halt() per arch, and all seem to be wrong: - cpu_halt() uses halt() for amd64, i386 and pc98. It neither enables or disables interrupts. When it is called from ddb, enabling interrupts would be a bug. Otherwise, it might want to ensure that interrupts are enabled (to allow i/o to complete), but it is safer to ensure that they is disabled (the caller, which is normally shutdown_halt(), should have waited). - on arches that support apm (i386 and maybe pc98), apm_cpu_idle() uses halt(). It neither disables nor enables interrupts. Apparently they are always enabled already. But that seems to give races. But this seems to have no effect, since apm_cpu_idle() seems to be never used. It seems to have been last used in FreeBSD-2, where it is called from swtch.s. All references to apm were removed from swtch.s in 1997. The call was replaced by a call through the function pointer _hlt_vector (aout spelling). This always called a default which just executed the hlt instruction. _hlt_vector was not connected to apm. This later turned into cpu_idle() and the function pointer cpu_idle_hook that we have today. The hook was apparently never connected to apm. It is even misdescribed in its comment as being the ACPI idle hook. Perhaps ACPI is the only thing that uses it, but its declaration shouldn't say that. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 18:03:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16854106572E; Thu, 19 Jan 2012 18:03:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04D248FC0C; Thu, 19 Jan 2012 18:03:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JI3q7B001063; Thu, 19 Jan 2012 18:03:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JI3q2F001059; Thu, 19 Jan 2012 18:03:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201191803.q0JI3q2F001059@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 19 Jan 2012 18:03: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: r230333 - in head/sys/dev/usb: . wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 18:03:53 -0000 Author: hselasky Date: Thu Jan 19 18:03:52 2012 New Revision: 230333 URL: http://svn.freebsd.org/changeset/base/230333 Log: Add support for new USB device. PR: usb/164275 MFC after: 3 days Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Jan 19 17:29:54 2012 (r230332) +++ head/sys/dev/usb/usbdevs Thu Jan 19 18:03:52 2012 (r230333) @@ -2091,7 +2091,6 @@ product LINKSYS4 RT3070 0x0078 RT3070 product LINKSYS4 WUSB600NV2 0x0079 WUSB600N v2 /* Logitech products */ -product LOGITECH LANW300NU2 0x0166 LAN-W300N/U2 product LOGITECH M2452 0x0203 M2452 keyboard product LOGITECH M4848 0x0301 M4848 mouse product LOGITECH PAGESCAN 0x040f PageScan @@ -2124,6 +2123,7 @@ product LOGITEC LAN_GTJU2A 0x0160 LAN-GT product LOGITEC RT2870_1 0x0162 RT2870 product LOGITEC RT2870_2 0x0163 RT2870 product LOGITEC RT2870_3 0x0164 RT2870 +product LOGITEC LANW300NU2 0x0166 LAN-W300N/U2 /* Longcheer Holdings, Ltd. products */ product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Jan 19 17:29:54 2012 (r230332) +++ head/sys/dev/usb/wlan/if_run.c Thu Jan 19 18:03:52 2012 (r230333) @@ -208,7 +208,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(LOGITEC, RT2870_1), RUN_DEV(LOGITEC, RT2870_2), RUN_DEV(LOGITEC, RT2870_3), - RUN_DEV(LOGITECH, LANW300NU2), + RUN_DEV(LOGITEC, LANW300NU2), RUN_DEV(MELCO, RT2870_1), RUN_DEV(MELCO, RT2870_2), RUN_DEV(MELCO, WLIUCAG300N), From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 18:09:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CB7D1065676; Thu, 19 Jan 2012 18:09:51 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 083D08FC15; Thu, 19 Jan 2012 18:09:51 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 3ADBB2A28CC6; Thu, 19 Jan 2012 19:09:50 +0100 (CET) Date: Thu, 19 Jan 2012 19:09:50 +0100 From: Ed Schouten To: davidxu@freebsd.org Message-ID: <20120119180949.GU95413@hoeg.nl> References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F13D43C.2060207@freebsd.org> <4F13D768.10307@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CpBQqYjq/d0HQTAP" Content-Disposition: inline In-Reply-To: <4F13D768.10307@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Lawrence Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 18:09:51 -0000 --CpBQqYjq/d0HQTAP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi David, * David Xu , 20120116 08:53: > but since atomic.h does not have a full barrier atomic operation > interface, I intend to add a rmb() here. In the very nearby future (after I switch SPARC64 and MIPS to libcompiler_rt), it should be possible to safely use C11's on all supported architectures. The C11 interface allows any operation to be combined with any type of barrier. Maybe we should simply migrate this code to use then? Greetings, --=20 Ed Schouten WWW: http://80386.nl/ --CpBQqYjq/d0HQTAP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPGFxtAAoJEG5e2P40kaK72fsP/iemke6oOFlBGnm/VCQjZenS mxgJIRaqHjLHQ73aBn2mhn+aB8tpR72TXG2lUW8TYth9af2jewf1o2yeRCH2KBUC 6pwfRvlnD2zm+9U+M2HyfXVpZqjrvsipRzJYEzMqupv0US0LOp9QQqtS6yGLTC9N hvq7VdxBfbdW5M3fuew7mrccU8F0BVuGivK6AMQByBnC1ob5Ut9TtinZqLxVDmng VrEGp1jgSC69NAc7+1Kt18Ozp0a0CskPkjV2TGihwdbuLIfkc2LoEH/yI2F/GWjw EhrcYTvCxz/VU9O29RvX2wJjR5laXC/zk7xD3vjpc+dPbmw7E1xnXeixx6MUowBt YlFG/OrgE8yOqKFJu+LkdRIl1y0Lh/39kciZTeMS7WuQw/Clyv5eSUNeVoqbLXE8 Z9DTGiy7nj62j1DjOulGpigoKyHFavMyWuJxthraM+nWPiedfqWiMw3aHj1Ebs/Q VXy3wsAtGUbICB7wPyXCVY/nzktzP0Ols5raHESeQavzCl83BMPWym6TlNw66B4t uR+3sSqWCO3L/OULLCoGXuEY66GSzr28S8nXN6E6DIYsjtfB4DCh+n5Jemc9YD1P ylHOP2nNDJTaVX0JYkGpLs5Yfhd+x8ScZH5Q/dRC0VPpv+inNwc/oZ3lmVDh0AL9 N9aWEJ28JeZ4DJOa/6Me =CDHV -----END PGP SIGNATURE----- --CpBQqYjq/d0HQTAP-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 18:30:53 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B36A106564A; Thu, 19 Jan 2012 18:30:53 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id C59648FC12; Thu, 19 Jan 2012 18:30:52 +0000 (UTC) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com [82.20.153.2]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id q0JIUlZ7003392 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 19 Jan 2012 18:30:51 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20120119180949.GU95413@hoeg.nl> Date: Thu, 19 Jan 2012 18:30:40 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F13D43C.2060207@freebsd.org> <4F13D768.10307@gmail.com> <20120119180949.GU95413@hoeg.nl> To: Ed Schouten X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, Lawrence Stewart , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, davidxu@FreeBSD.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 18:30:53 -0000 On 19 Jan 2012, at 18:09, Ed Schouten wrote: > In the very nearby future (after I switch SPARC64 and MIPS to > libcompiler_rt), it should be possible to safely use C11's = > on all supported architectures. The C11 interface allows any operation > to be combined with any type of barrier. >=20 > Maybe we should simply migrate this code to use then? Currently, that will give worse code if we use gcc 4.2.1, but (I hope!) = better code if we use clang. With GCC, we are implementing = atomic_thread_fence() as __sync_synchronize(), which is a full barrier, = and ignoring its argument. It would probably be worth postponing any = such migration until: 1) Clang is the default compiler, and 2) The bugs in LLVM that cause the back end to fatal error on any = nontrivial code using atomics are fixed. David= From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 18:42:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BFCE106567D; Thu, 19 Jan 2012 18:42:03 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A4D88FC0C; Thu, 19 Jan 2012 18:42:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JIg3LG002335; Thu, 19 Jan 2012 18:42:03 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JIg3bq002329; Thu, 19 Jan 2012 18:42:03 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201191842.q0JIg3bq002329@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 19 Jan 2012 18:42: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: r230334 - head/sys/cam/ctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 18:42:03 -0000 Author: ken Date: Thu Jan 19 18:42:03 2012 New Revision: 230334 URL: http://svn.freebsd.org/changeset/base/230334 Log: Quiet some clang warnings when compiling CTL. ctl_error.c, ctl_error.h: Take out the ctl_sense_format enumeration, and use scsi_sense_data_type instead. Remove ctl_get_sense_format() and switch ctl_build_ua() over to using scsi_sense_data_type. ctl_backend_ramdisk.c, ctl_backend_block.c: Use C99 structure initializers instead of GNU initializers. ctl.c: Switch over to using the SCSI sense format enumeration instead of the CTL-specific enumeration. Submitted by: dim (partially) MFC after: 1 month Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_error.c head/sys/cam/ctl/ctl_error.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Jan 19 18:03:52 2012 (r230333) +++ head/sys/cam/ctl/ctl.c Thu Jan 19 18:42:03 2012 (r230334) @@ -8736,7 +8736,7 @@ ctl_request_sense(struct ctl_scsiio *cts struct ctl_lun *lun; uint32_t initidx; int have_error; - ctl_sense_format sense_format; + scsi_sense_data_type sense_format; cdb = (struct scsi_request_sense *)ctsio->cdb; @@ -8748,9 +8748,9 @@ ctl_request_sense(struct ctl_scsiio *cts * Determine which sense format the user wants. */ if (cdb->byte2 & SRS_DESC) - sense_format = CTL_SENSE_DESCRIPTOR; + sense_format = SSD_TYPE_DESC; else - sense_format = CTL_SENSE_FIXED; + sense_format = SSD_TYPE_FIXED; ctsio->kern_data_ptr = malloc(sizeof(*sense_ptr), M_CTL, M_WAITOK); if (ctsio->kern_data_ptr == NULL) { @@ -8789,13 +8789,13 @@ ctl_request_sense(struct ctl_scsiio *cts */ mtx_lock(&lun->ctl_softc->ctl_lock); if (ctl_is_set(lun->have_ca, initidx)) { - ctl_sense_format stored_format; + scsi_sense_data_type stored_format; /* * Check to see which sense format was used for the stored * sense data. */ - stored_format = ctl_get_sense_format( + stored_format = scsi_sense_type( &lun->pending_sense[initidx].sense); /* @@ -8804,14 +8804,17 @@ ctl_request_sense(struct ctl_scsiio *cts * format. If we're going from descriptor to fixed format * sense data, we may lose things in translation, depending * on what options were used. + * + * If the stored format is SSD_TYPE_NONE (i.e. invalid), + * for some reason we'll just copy it out as-is. */ - if ((stored_format == CTL_SENSE_FIXED) - && (sense_format == CTL_SENSE_DESCRIPTOR)) + if ((stored_format == SSD_TYPE_FIXED) + && (sense_format == SSD_TYPE_DESC)) ctl_sense_to_desc((struct scsi_sense_data_fixed *) &lun->pending_sense[initidx].sense, (struct scsi_sense_data_desc *)sense_ptr); - else if ((stored_format == CTL_SENSE_DESCRIPTOR) - && (sense_format == CTL_SENSE_FIXED)) + else if ((stored_format == SSD_TYPE_DESC) + && (sense_format == SSD_TYPE_FIXED)) ctl_sense_to_fixed((struct scsi_sense_data_desc *) &lun->pending_sense[initidx].sense, (struct scsi_sense_data_fixed *)sense_ptr); @@ -10459,14 +10462,14 @@ ctl_scsiio_precheck(struct ctl_softc *ct ua_type = lun->pending_sense[initidx].ua_pending; if (ua_type != CTL_UA_NONE) { - ctl_sense_format sense_format; + scsi_sense_data_type sense_format; if (lun != NULL) sense_format = (lun->flags & - CTL_LUN_SENSE_DESC) ? CTL_SENSE_DESCRIPTOR : - CTL_SENSE_FIXED; + CTL_LUN_SENSE_DESC) ? SSD_TYPE_DESC : + SSD_TYPE_FIXED; else - sense_format = CTL_SENSE_FIXED; + sense_format = SSD_TYPE_FIXED; ua_type = ctl_build_ua(ua_type, &ctsio->sense_data, sense_format); Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Jan 19 18:03:52 2012 (r230333) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Jan 19 18:42:03 2012 (r230334) @@ -260,15 +260,15 @@ int ctl_be_block_init(void); static struct ctl_backend_driver ctl_be_block_driver = { - name: "block", - flags: CTL_BE_FLAG_HAS_CONFIG, - init: ctl_be_block_init, - data_submit: ctl_be_block_submit, - data_move_done: ctl_be_block_move_done, - config_read: ctl_be_block_config_read, - config_write: ctl_be_block_config_write, - ioctl: ctl_be_block_ioctl, - lun_info: ctl_be_block_lun_info + .name = "block", + .flags = CTL_BE_FLAG_HAS_CONFIG, + .init = ctl_be_block_init, + .data_submit = ctl_be_block_submit, + .data_move_done = ctl_be_block_move_done, + .config_read = ctl_be_block_config_read, + .config_write = ctl_be_block_config_write, + .ioctl = ctl_be_block_ioctl, + .lun_info = ctl_be_block_lun_info }; MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend"); Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Jan 19 18:03:52 2012 (r230333) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Jan 19 18:42:03 2012 (r230334) @@ -110,14 +110,14 @@ static int ctl_backend_ramdisk_config_re static struct ctl_backend_driver ctl_be_ramdisk_driver = { - name: "ramdisk", - flags: CTL_BE_FLAG_HAS_CONFIG, - init: ctl_backend_ramdisk_init, - data_submit: ctl_backend_ramdisk_submit, - data_move_done: ctl_backend_ramdisk_move_done, - config_read: ctl_backend_ramdisk_config_read, - config_write: ctl_backend_ramdisk_config_write, - ioctl: ctl_backend_ramdisk_ioctl + .name = "ramdisk", + .flags = CTL_BE_FLAG_HAS_CONFIG, + .init = ctl_backend_ramdisk_init, + .data_submit = ctl_backend_ramdisk_submit, + .data_move_done = ctl_backend_ramdisk_move_done, + .config_read = ctl_backend_ramdisk_config_read, + .config_write = ctl_backend_ramdisk_config_write, + .ioctl = ctl_backend_ramdisk_ioctl }; MALLOC_DEFINE(M_RAMDISK, "ramdisk", "Memory used for CTL RAMdisk"); Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Thu Jan 19 18:03:52 2012 (r230333) +++ head/sys/cam/ctl/ctl_error.c Thu Jan 19 18:42:03 2012 (r230334) @@ -354,21 +354,6 @@ ctl_sense_to_fixed(struct scsi_sense_dat SSD_ELEM_NONE); } -ctl_sense_format -ctl_get_sense_format(struct scsi_sense_data *sense_data) -{ - switch (sense_data->error_code & SSD_ERRCODE) { - case SSD_DESC_CURRENT_ERROR: - case SSD_DESC_DEFERRED_ERROR: - return (SSD_TYPE_DESC); - case SSD_CURRENT_ERROR: - case SSD_DEFERRED_ERROR: - default: - return (SSD_TYPE_FIXED); - break; - } -} - void ctl_set_ua(struct ctl_scsiio *ctsio, int asc, int ascq) { @@ -382,7 +367,7 @@ ctl_set_ua(struct ctl_scsiio *ctsio, int ctl_ua_type ctl_build_ua(ctl_ua_type ua_type, struct scsi_sense_data *sense, - ctl_sense_format sense_format) + scsi_sense_data_type sense_format) { ctl_ua_type ua_to_build; int i, asc, ascq; Modified: head/sys/cam/ctl/ctl_error.h ============================================================================== --- head/sys/cam/ctl/ctl_error.h Thu Jan 19 18:03:52 2012 (r230333) +++ head/sys/cam/ctl/ctl_error.h Thu Jan 19 18:42:03 2012 (r230334) @@ -42,12 +42,6 @@ #ifndef _CTL_ERROR_H_ #define _CTL_ERROR_H_ -typedef enum { - CTL_SENSE_NOT_SPECIFIED, - CTL_SENSE_FIXED, - CTL_SENSE_DESCRIPTOR -} ctl_sense_format; - void ctl_set_sense_data_va(struct scsi_sense_data *sense_data, void *lun, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq, va_list ap); @@ -60,10 +54,9 @@ void ctl_sense_to_desc(struct scsi_sense struct scsi_sense_data_desc *sense_dest); void ctl_sense_to_fixed(struct scsi_sense_data_desc *sense_src, struct scsi_sense_data_fixed *sense_dest); -ctl_sense_format ctl_get_sense_format(struct scsi_sense_data *sense_data); void ctl_set_ua(struct ctl_scsiio *ctsio, int asc, int ascq); ctl_ua_type ctl_build_ua(ctl_ua_type ua_type, struct scsi_sense_data *sense, - ctl_sense_format sense_format); + scsi_sense_data_type sense_format); void ctl_set_overlapped_cmd(struct ctl_scsiio *ctsio); void ctl_set_overlapped_tag(struct ctl_scsiio *ctsio, uint8_t tag); void ctl_set_invalid_field(struct ctl_scsiio *ctsio, int sks_valid, int command, From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 19:18:47 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3419106564A; Thu, 19 Jan 2012 19:18:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 395948FC0A; Thu, 19 Jan 2012 19:18:46 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0JJIjWE044426; Thu, 19 Jan 2012 23:18:45 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0JJIjIO044425; Thu, 19 Jan 2012 23:18:45 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Jan 2012 23:18:44 +0400 From: Gleb Smirnoff To: Gleb Kurtsou Message-ID: <20120119191844.GA12760@FreeBSD.org> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> <20120119143837.GA28308@reks> <20120119145132.GZ12760@FreeBSD.org> <20120119164627.GA42205@reks> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120119164627.GA42205@reks> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 19:18:47 -0000 On Thu, Jan 19, 2012 at 06:46:27PM +0200, Gleb Kurtsou wrote: G> > I wouldn't claim compatibility for the commands that didn't work very well. G> > I won't also name Linux, since these commands predate the Linux itself. G> G> I meant that SIOCSIFADDR is default (if not the only) way to set G> interface address on linux. If this is true, then I am almost sure that their SIOCSIFADDR is not the command I have removed, but something similar to our SIOCAIFADDR. Our SIOCSIFADDR added a classful prefix on the interface. G> > Do you use them? Or do you know software that use them? G> G> I do and I've seen other examples of using SIOCSIF*ADDR with BSD G> specific tweaks. Although I must admit that nowadays the most common way G> of configuring interface is to call /sbin/ifconfig. Where did you see that examples? In the "TCP/IP Illustrated"? G> It's not a big deal for me, I have no problem with replacing them on G> FreeBSD. FreeBSD is not even officially supported platform for the G> product and I build/test on FreeBSD solely for the purpose of avoiding G> linuxisms and platform specific behaviour. Let's hope it won't break for G> somebody else :) I'm pretty sure it will not break anyone, except for people still living in Internet with classdful addressing. Do you know any? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 19:19:35 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 758F91065673; Thu, 19 Jan 2012 19:19:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id E44448FC0C; Thu, 19 Jan 2012 19:19:34 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0JJJX7B044444; Thu, 19 Jan 2012 23:19:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0JJJXIS044443; Thu, 19 Jan 2012 23:19:33 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Jan 2012 23:19:33 +0400 From: Gleb Smirnoff To: Mark Linimon Message-ID: <20120119191932.GB12760@FreeBSD.org> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> <20120119170755.GE23733@lonesome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120119170755.GE23733@lonesome.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 19:19:35 -0000 On Thu, Jan 19, 2012 at 11:07:55AM -0600, Mark Linimon wrote: M> I had kind of hoped that before support was dropped, we had generated M> a strategy for dealing with the port breakages that my -exp run detected. M> This is disappointing. These three ports were false positives. They do not utilize SIOCSIFADDR as ioctl() argument. They are not broken by the r230207. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 20:12:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55F51106564A; Thu, 19 Jan 2012 20:12:28 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id D15328FC13; Thu, 19 Jan 2012 20:12:27 +0000 (UTC) Received: by yhfs35 with SMTP id s35so246243yhf.13 for ; Thu, 19 Jan 2012 12:12:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LKBTk17FXUlZKXl9JdCDznOqh+u6zIXsdLOvH/KYbfM=; b=BXGMzHMM6+4UPjuj3ZPQT3cOWoV0SfWstmEEwJuL73w80Th3xUaPIev5KOSKxDZK3/ eENCHl3chQeY9lBsj+ForShkc+39i+1B1zMM8VfX1MKeRQxQ3D9JJkLlo1moJ+KFVeIs KcF1jGqchQkVia/Cc+gycs6E6m6Nb4NzyEF0c= MIME-Version: 1.0 Received: by 10.236.153.42 with SMTP id e30mr42196275yhk.10.1327003947199; Thu, 19 Jan 2012 12:12:27 -0800 (PST) Received: by 10.236.105.210 with HTTP; Thu, 19 Jan 2012 12:12:27 -0800 (PST) In-Reply-To: <20120119191844.GA12760@FreeBSD.org> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> <20120119143837.GA28308@reks> <20120119145132.GZ12760@FreeBSD.org> <20120119164627.GA42205@reks> <20120119191844.GA12760@FreeBSD.org> Date: Thu, 19 Jan 2012 15:12:27 -0500 Message-ID: From: Ben Kaduk To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Gleb Kurtsou , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 20:12:28 -0000 On 1/19/12, Gleb Smirnoff wrote: > On Thu, Jan 19, 2012 at 06:46:27PM +0200, Gleb Kurtsou wrote: > > G> It's not a big deal for me, I have no problem with replacing them on > G> FreeBSD. FreeBSD is not even officially supported platform for the > G> product and I build/test on FreeBSD solely for the purpose of avoiding > G> linuxisms and platform specific behaviour. Let's hope it won't break for > G> somebody else :) > > I'm pretty sure it will not break anyone, except for people still living > in Internet with classdful addressing. Do you know any? Not directly as classful addressing per se, but the interpretation of an address as possibly-classful is encoded in the voting algorithm for the ubik server elections that make our AFS distributed filesystem work. We support having ubik servers on quite a few different OSes, and we can only change the voting algorithm with an OpenAFS major version number bump because of our interoperability guarantees. I'm not willing to claim that removing classfull addressing will preserve the voting algorithm without an in-depth review that I don't have time to undertake. When you removed ia_net{,mask} from struct in_ifaddr (with no __FreeBSD_version bump! And then merged it to 9.0 during the RC stage!), I had to scramble to keep net/openafs compiling and with the same functionality. It turns out that there is another code path in OpenAFS (used by e.g. Darwin) that instead uses the IN_CLASSA() family of macros, so I could preserve compatibility. But if you go and remove those too, I am screwed. Please don't just assume that no one is using classful addressing and remove things ahead of a reasonable deprecation schedule. -Ben Kaduk From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 20:13:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82715106564A; Thu, 19 Jan 2012 20:13: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 6A5748FC0C; Thu, 19 Jan 2012 20:13:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JKDGkY005362; Thu, 19 Jan 2012 20:13:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JKDGYe005360; Thu, 19 Jan 2012 20:13:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201192013.q0JKDGYe005360@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 Jan 2012 20:13: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: r230336 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 20:13:16 -0000 Author: yongari Date: Thu Jan 19 20:13:16 2012 New Revision: 230336 URL: http://svn.freebsd.org/changeset/base/230336 Log: Fix a logic error which resulted in putting PHY into sleep when WOL is active. If WOL is active driver should not put PHY into sleep. This change makes WOL work on RTL8168E. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Thu Jan 19 19:39:41 2012 (r230335) +++ head/sys/dev/re/if_re.c Thu Jan 19 20:13:16 2012 (r230336) @@ -3808,7 +3808,7 @@ re_setwol(struct rl_softc *sc) /* Config register write done. */ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); - if ((ifp->if_capenable & IFCAP_WOL) != 0 && + if ((ifp->if_capenable & IFCAP_WOL) == 0 && (sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) & ~0x80); /* From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 20:21:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B3C2106564A; Thu, 19 Jan 2012 20:21:59 +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 8A2078FC18; Thu, 19 Jan 2012 20:21:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JKLxNq005785; Thu, 19 Jan 2012 20:21:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JKLxGO005782; Thu, 19 Jan 2012 20:21:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201192021.q0JKLxGO005782@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 Jan 2012 20:21: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: r230337 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 20:21:59 -0000 Author: yongari Date: Thu Jan 19 20:21:59 2012 New Revision: 230337 URL: http://svn.freebsd.org/changeset/base/230337 Log: Rename dev.bge.%d.msi_disable to dev.bge.%d.msi which matches enable/disable and default it to on. Suggested by: jhb 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 Thu Jan 19 20:13:16 2012 (r230336) +++ head/sys/dev/bge/if_bge.c Thu Jan 19 20:21:59 2012 (r230337) @@ -2745,7 +2745,7 @@ bge_can_use_msi(struct bge_softc *sc) { int can_use_msi = 0; - if (sc->bge_msi_disable != 0) + if (sc->bge_msi != 0) return (0); /* Disable MSI for polling(4). */ @@ -5630,11 +5630,11 @@ bge_add_sysctls(struct bge_softc *sc) "Number of fragmented TX buffers of a frame allowed before " "forced collapsing"); - sc->bge_msi_disable = 0; - snprintf(tn, sizeof(tn), "dev.bge.%d.msi_disable", unit); - TUNABLE_INT_FETCH(tn, &sc->bge_msi_disable); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "msi_disable", - CTLFLAG_RD, &sc->bge_msi_disable, 0, "Disable MSI"); + sc->bge_msi = 1; + snprintf(tn, sizeof(tn), "dev.bge.%d.msi", unit); + TUNABLE_INT_FETCH(tn, &sc->bge_msi); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "msi", + CTLFLAG_RD, &sc->bge_msi, 0, "Enable MSI"); /* * It seems all Broadcom controllers have a bug that can generate UDP Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Thu Jan 19 20:13:16 2012 (r230336) +++ head/sys/dev/bge/if_bgereg.h Thu Jan 19 20:21:59 2012 (r230337) @@ -2864,7 +2864,7 @@ struct bge_softc { int bge_timer; int bge_forced_collapse; int bge_forced_udpcsum; - int bge_msi_disable; + int bge_msi; int bge_csum_features; struct callout bge_stat_ch; uint32_t bge_rx_discards; From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 20:22:13 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D28F1065789; Thu, 19 Jan 2012 20:22:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8078FC14; Thu, 19 Jan 2012 20:22:08 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0JKM7YZ044861; Fri, 20 Jan 2012 00:22:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0JKM7KS044860; Fri, 20 Jan 2012 00:22:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 20 Jan 2012 00:22:07 +0400 From: Gleb Smirnoff To: Ben Kaduk Message-ID: <20120119202207.GC12760@FreeBSD.org> References: <201201160953.q0G9rPp8026625@svn.freebsd.org> <20120119143837.GA28308@reks> <20120119145132.GZ12760@FreeBSD.org> <20120119164627.GA42205@reks> <20120119191844.GA12760@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Gleb Kurtsou , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r230207 - in head/sys: netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 20:22:13 -0000 Ben, On Thu, Jan 19, 2012 at 03:12:27PM -0500, Ben Kaduk wrote: B> > G> It's not a big deal for me, I have no problem with replacing them on B> > G> FreeBSD. FreeBSD is not even officially supported platform for the B> > G> product and I build/test on FreeBSD solely for the purpose of avoiding B> > G> linuxisms and platform specific behaviour. Let's hope it won't break for B> > G> somebody else :) B> > B> > I'm pretty sure it will not break anyone, except for people still living B> > in Internet with classdful addressing. Do you know any? B> B> Not directly as classful addressing per se, but the interpretation of B> an address as possibly-classful is encoded in the voting algorithm for B> the ubik server elections that make our AFS distributed filesystem B> work. We support having ubik servers on quite a few different OSes, B> and we can only change the voting algorithm with an OpenAFS major B> version number bump because of our interoperability guarantees. B> I'm not willing to claim that removing classfull addressing will B> preserve the voting algorithm without an in-depth review that I don't B> have time to undertake. B> B> When you removed ia_net{,mask} from struct in_ifaddr (with no B> __FreeBSD_version bump! And then merged it to 9.0 during the RC B> stage!), I had to scramble to keep net/openafs compiling and with the B> same functionality. It turns out that there is another code path in B> OpenAFS (used by e.g. Darwin) that instead uses the IN_CLASSA() family B> of macros, so I could preserve compatibility. But if you go and B> remove those too, I am screwed. B> B> Please don't just assume that no one is using classful addressing and B> remove things ahead of a reasonable deprecation schedule. I'm sorry for that :( I should have bumped __FreeBSD_version. I don't plan to remove what currently left from classes: the macros, and the autoguessing in the case if mask isn't supplied. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 20:28:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0720106564A; Thu, 19 Jan 2012 20:28:58 +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 8F7938FC0A; Thu, 19 Jan 2012 20:28:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JKSwNL006267; Thu, 19 Jan 2012 20:28:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JKSwpr006265; Thu, 19 Jan 2012 20:28:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201192028.q0JKSwpr006265@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 Jan 2012 20:28: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: r230338 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 20:28:58 -0000 Author: yongari Date: Thu Jan 19 20:28:58 2012 New Revision: 230338 URL: http://svn.freebsd.org/changeset/base/230338 Log: Oops, fix logic error introduced in r230337. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Jan 19 20:21:59 2012 (r230337) +++ head/sys/dev/bge/if_bge.c Thu Jan 19 20:28:58 2012 (r230338) @@ -2745,7 +2745,7 @@ bge_can_use_msi(struct bge_softc *sc) { int can_use_msi = 0; - if (sc->bge_msi != 0) + if (sc->bge_msi == 0) return (0); /* Disable MSI for polling(4). */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 20:30:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACF36106566B for ; Thu, 19 Jan 2012 20:30:03 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) by mx1.freebsd.org (Postfix) with ESMTP id 669328FC0C for ; Thu, 19 Jan 2012 20:30:03 +0000 (UTC) Received: from uucp by gromit.grondar.org with local-rmail (Exim 4.76 (FreeBSD)) (envelope-from ) id 1Rny4h-000CXn-8p for svn-src-head@freebsd.org; Thu, 19 Jan 2012 19:55:07 +0000 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Rny2A-000C3x-O6; Thu, 19 Jan 2012 19:52:30 +0000 To: Andrey Chernov In-reply-to: <20120118061943.GA80874@vniz.net> References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> From: Mark Murray Date: Thu, 19 Jan 2012 19:52:30 +0000 Message-Id: Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 20:30:03 -0000 Andrey Chernov writes: > On Mon, Jan 16, 2012 at 08:18:10PM +0000, David Schultz wrote: > > Author: das > > Date: Mon Jan 16 20:18:10 2012 > > New Revision: 230230 > > URL: http://svn.freebsd.org/changeset/base/230230 > > > > Log: > > Generate a warning if the kernel's arc4random() is seeded with bogus entropy. > > While you are here, could you review/commit my patch to fix bad 31bit > arc4rand() seeding, please? > > --- yarrow.c.bak 2011-09-26 07:35:48.000000000 +0400 > +++ yarrow.c 2012-01-18 10:13:47.000000000 +0400 This is the wrong place for this; it may achieve the desired result, but the file is where the Yarrow algorithm is implepeneted; ARC4 reseeds are not a part of that, which makes this proposal a layering violation at best, and an unwarranted dependancy at worst. Look at the function random_yarrow_unblock(). Thats where yopu want to be doing this. This function is where the random device is unblocked once safely seeded. M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 20:31:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92647106566C; Thu, 19 Jan 2012 20:31:29 +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 815DE8FC08; Thu, 19 Jan 2012 20:31:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JKVT83006465; Thu, 19 Jan 2012 20:31:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JKVTCr006463; Thu, 19 Jan 2012 20:31:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201192031.q0JKVTCr006463@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 19 Jan 2012 20:31: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: r230339 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 20:31:29 -0000 Author: yongari Date: Thu Jan 19 20:31:29 2012 New Revision: 230339 URL: http://svn.freebsd.org/changeset/base/230339 Log: Reflect tunable name change made in r230337. Modified: head/share/man/man4/bge.4 Modified: head/share/man/man4/bge.4 ============================================================================== --- head/share/man/man4/bge.4 Thu Jan 19 20:28:58 2012 (r230338) +++ head/share/man/man4/bge.4 Thu Jan 19 20:31:29 2012 (r230339) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2012 +.Dd January 19, 2012 .Dt BGE 4 .Os .Sh NAME @@ -197,9 +197,9 @@ prompt before booting the kernel, or sto Allow the ASF feature for cooperating with IPMI. Can cause system lockup problems on a small number of systems. Enabled by default. -.It Va dev.bge.%d.msi_disable -Non-zero value disables MSI support on the Ethernet hardware. -The default value is 0. +.It Va dev.bge.%d.msi +Non-zero value enables MSI support on the Ethernet hardware. +The default value is 1. .El .Sh SYSCTL VARIABLES The following variables are available as both From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 21:38:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B0141065670; Thu, 19 Jan 2012 21:38:19 +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 7A1468FC18; Thu, 19 Jan 2012 21:38:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JLcJIA008878; Thu, 19 Jan 2012 21:38:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JLcJru008876; Thu, 19 Jan 2012 21:38:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201192138.q0JLcJru008876@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Jan 2012 21:38: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: r230340 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 21:38:19 -0000 Author: jhb Date: Thu Jan 19 21:38:19 2012 New Revision: 230340 URL: http://svn.freebsd.org/changeset/base/230340 Log: Properly return success once a matching VPD entry is found in pci_get_vpd_readonly_method(). Previously the loop was always running to completion and falling through to failing with ENXIO. PR: kern/164313 Submitted by: Chuck Tuffli chuck tuffli net MFC after: 1 week Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Jan 19 20:31:29 2012 (r230339) +++ head/sys/dev/pci/pci.c Thu Jan 19 21:38:19 2012 (r230340) @@ -1136,11 +1136,9 @@ pci_get_vpd_readonly_method(device_t dev if (memcmp(kw, cfg->vpd.vpd_ros[i].keyword, sizeof(cfg->vpd.vpd_ros[i].keyword)) == 0) { *vptr = cfg->vpd.vpd_ros[i].value; + return (0); } - if (i != cfg->vpd.vpd_rocnt) - return (0); - *vptr = NULL; return (ENXIO); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 19 23:03:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F38106564A; Thu, 19 Jan 2012 23:03:32 +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 57C358FC08; Thu, 19 Jan 2012 23:03:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JN3WhC011527; Thu, 19 Jan 2012 23:03:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JN3W7o011525; Thu, 19 Jan 2012 23:03:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201192303.q0JN3W7o011525@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Jan 2012 23:03: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: r230341 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 23:03:32 -0000 Author: kib Date: Thu Jan 19 23:03:31 2012 New Revision: 230341 URL: http://svn.freebsd.org/changeset/base/230341 Log: Use shared lock for the executable vnode in the exec path after the VV_TEXT changes are handled. Assert that vnode is exclusively locked at the places that modify VV_TEXT. Discussed with: alc MFC after: 3 weeks Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Jan 19 21:38:19 2012 (r230340) +++ head/sys/kern/kern_exec.c Thu Jan 19 23:03:31 2012 (r230341) @@ -471,6 +471,7 @@ interpret: * actually an executable image. */ textset = imgp->vp->v_vflag & VV_TEXT; + ASSERT_VOP_ELOCKED(imgp->vp, "vv_text"); imgp->vp->v_vflag |= VV_TEXT; error = exec_map_first_page(imgp); @@ -502,8 +503,10 @@ interpret: if (error) { if (error == -1) { - if (textset == 0) + if (textset == 0) { + ASSERT_VOP_ELOCKED(imgp->vp, "vv_text"); imgp->vp->v_vflag &= ~VV_TEXT; + } error = ENOEXEC; } goto exec_fail_dealloc; @@ -596,7 +599,7 @@ interpret: /* close files on exec */ fdcloseexec(td); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); /* Get a reference to the vnode prior to locking the proc */ VREF(binvp); @@ -701,7 +704,7 @@ interpret: VOP_UNLOCK(imgp->vp, 0); setugidsafety(td); error = fdcheckstd(td); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); if (error != 0) goto done1; PROC_LOCK(p); @@ -805,7 +808,7 @@ interpret: pe.pm_entryaddr = imgp->entry_addr; PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC, (void *) &pe); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } else PROC_UNLOCK(p); #else /* !HWPMC_HOOKS */ @@ -857,7 +860,7 @@ done1: if (tracecred != NULL) crfree(tracecred); #endif - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); pargs_drop(oldargs); pargs_drop(newargs); if (oldsigacts != NULL) From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 00:36:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D2F8106564A; Fri, 20 Jan 2012 00:36:36 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id ECEF58FC1A; Fri, 20 Jan 2012 00:36:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0K0aXcr037274; Fri, 20 Jan 2012 00:36:34 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F18B711.9000406@gmail.com> Date: Fri, 20 Jan 2012 08:36:33 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: John Baldwin References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F178CDC.3030807@gmail.com> <4F17B0DE.3060008@gmail.com> <201201191023.28426.jhb@freebsd.org> In-Reply-To: <201201191023.28426.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, davidxu@freebsd.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 00:36:36 -0000 On 2012/1/19 23:23, John Baldwin wrote: > On Thursday, January 19, 2012 12:57:50 am David Xu wrote: >> rdtsc() may not work on SMP, so I have updated it to use clock_gettime >> to get total time. >> http://people.freebsd.org/~davidxu/bench/semaphore2/ >> >> >> Still, lfence is a lot faster than atomic lock. > http://www.freebsd.org/~jhb/patches/amd64_fence.patch > > This the patch I've had for quite a while. Can you retest with this? You'll > probably have to install the updated header in /usr/include as well. > The lines in atomic_load_acq() seem not what I want: + v = *p; \ + __asm __volatile("lfence" ::: "memory"); \ I think they should be swapped ? + __asm __volatile("lfence" ::: "memory"); \ + v = *p; \ What I need in the semaphore code is read can not pass write in such a special case. From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 00:46:12 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82B54106564A; Fri, 20 Jan 2012 00:46:12 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6C65B8FC08; Fri, 20 Jan 2012 00:46:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0K0k9J7045739; Fri, 20 Jan 2012 00:46:10 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F18B951.6080404@gmail.com> Date: Fri, 20 Jan 2012 08:46:09 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Bruce Evans References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F178CDC.3030807@gmail.com> <4F17B0DE.3060008@gmail.com> <201201191023.28426.jhb@freebsd.org> <20120120030456.O1411@besplex.bde.org> In-Reply-To: <20120120030456.O1411@besplex.bde.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, davidxu@FreeBSD.org, John Baldwin Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 00:46:12 -0000 On 2012/1/20 0:55, Bruce Evans wrote: > On Thu, 19 Jan 2012, John Baldwin wrote: > >> On Thursday, January 19, 2012 12:57:50 am David Xu wrote: >>> rdtsc() may not work on SMP, so I have updated it to use clock_gettime >>> to get total time. >>> http://people.freebsd.org/~davidxu/bench/semaphore2/ >>> >>> >>> Still, lfence is a lot faster than atomic lock. > > I hope it does non-microbenchmarks. IIRC, jhb found that it was > actually slower in some cases. I only did micro-benchmarks on Athlon64. It depends on hardware, if it is a large machine with lots of cpu, a small conflict on dual-core machine can become a large conflict on large machine because it is possible more cpus are now running same code which becomes a bottleneck. On a large machine which has 1024 cores, many code need to be redesigned. From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 00:58:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1D0C1065673; Fri, 20 Jan 2012 00:58:51 +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 9FF628FC08; Fri, 20 Jan 2012 00:58:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K0wp66015225; Fri, 20 Jan 2012 00:58:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K0wpPX015223; Fri, 20 Jan 2012 00:58:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201200058.q0K0wpPX015223@svn.freebsd.org> From: Rick Macklem Date: Fri, 20 Jan 2012 00:58: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: r230345 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 00:58:51 -0000 Author: rmacklem Date: Fri Jan 20 00:58:51 2012 New Revision: 230345 URL: http://svn.freebsd.org/changeset/base/230345 Log: Martin Cracauer reported a problem to freebsd-current@ under the subject "Data corruption over NFS in -current". During investigation of this, I came across an ugly bogusity in the new NFS client where it replaced the cr_uid with the one used for the mount. This was done so that "system operations" like the NFSv4 Renew would be performed as the user that did the mount. However, if any other thread shares the credential with the one doing this operation, it could do an RPC (or just about anything else) as the wrong cr_uid. This patch fixes the above, by using the mount credentials instead of the one provided as an argument for this case. It appears to have fixed Martin's problem. This patch is needed for NFSv4 mounts and NFSv3 mounts against some non-FreeBSD servers that do not put post operation attributes in the NFSv3 Statfs RPC reply. Tested by: Martin Cracauer (cracauer at cons.org) Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Fri Jan 20 00:34:02 2012 (r230344) +++ head/sys/fs/nfs/nfs_commonkrpc.c Fri Jan 20 00:58:51 2012 (r230345) @@ -472,7 +472,7 @@ newnfs_request(struct nfsrv_descript *nd { u_int32_t *tl; time_t waituntil; - int i, j, set_uid = 0, set_sigset = 0, timeo; + int i, j, set_sigset = 0, timeo; int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS; u_int16_t procnum; u_int trylater_delay = 1; @@ -483,8 +483,8 @@ newnfs_request(struct nfsrv_descript *nd enum clnt_stat stat; struct nfsreq *rep = NULL; char *srv_principal = NULL; - uid_t saved_uid = (uid_t)-1; sigset_t oldset; + struct ucred *authcred; if (xidp != NULL) *xidp = 0; @@ -494,6 +494,14 @@ newnfs_request(struct nfsrv_descript *nd return (ESTALE); } + /* + * Set authcred, which is used to acquire RPC credentials to + * the cred argument, by default. The crhold() should not be + * necessary, but will ensure that some future code change + * doesn't result in the credential being free'd prematurely. + */ + authcred = crhold(cred); + /* For client side interruptible mounts, mask off the signals. */ if (nmp != NULL && td != NULL && NFSHASINT(nmp)) { newnfs_set_sigmask(td, &oldset); @@ -532,13 +540,16 @@ newnfs_request(struct nfsrv_descript *nd /* * If there is a client side host based credential, * use that, otherwise use the system uid, if set. + * The system uid is in the nmp->nm_sockreq.nr_cred + * credentials. */ if (nmp->nm_krbnamelen > 0) { usegssname = 1; } else if (nmp->nm_uid != (uid_t)-1) { - saved_uid = cred->cr_uid; - cred->cr_uid = nmp->nm_uid; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } } else if (nmp->nm_krbnamelen == 0 && nmp->nm_uid != (uid_t)-1 && cred->cr_uid == (uid_t)0) { @@ -547,10 +558,13 @@ newnfs_request(struct nfsrv_descript *nd * the system uid is set and this is root, use the * system uid, since root won't have user * credentials in a credentials cache file. + * The system uid is in the nmp->nm_sockreq.nr_cred + * credentials. */ - saved_uid = cred->cr_uid; - cred->cr_uid = nmp->nm_uid; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } if (NFSHASINTEGRITY(nmp)) secflavour = RPCSEC_GSS_KRB5I; @@ -566,13 +580,13 @@ newnfs_request(struct nfsrv_descript *nd * Use the uid that did the mount when the RPC is doing * NFSv4 system operations, as indicated by the * ND_USEGSSNAME flag, for the AUTH_SYS case. + * The credentials in nm_sockreq.nr_cred were used for the + * mount. */ - saved_uid = cred->cr_uid; - if (nmp->nm_uid != (uid_t)-1) - cred->cr_uid = nmp->nm_uid; - else - cred->cr_uid = 0; - set_uid = 1; + KASSERT(nmp->nm_sockreq.nr_cred != NULL, + ("newnfs_request: NULL nr_cred")); + crfree(authcred); + authcred = crhold(nmp->nm_sockreq.nr_cred); } if (nmp != NULL) { @@ -588,12 +602,11 @@ newnfs_request(struct nfsrv_descript *nd auth = authnone_create(); else if (usegssname) auth = nfs_getauth(nrp, secflavour, nmp->nm_krbname, - srv_principal, NULL, cred); + srv_principal, NULL, authcred); else auth = nfs_getauth(nrp, secflavour, NULL, - srv_principal, NULL, cred); - if (set_uid) - cred->cr_uid = saved_uid; + srv_principal, NULL, authcred); + crfree(authcred); if (auth == NULL) { m_freem(nd->nd_mreq); if (set_sigset) From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:37:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E0D61065670; Fri, 20 Jan 2012 01:37:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CEBA8FC0A; Fri, 20 Jan 2012 01:37:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1bOac016394; Fri, 20 Jan 2012 01:37:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1bNNf016392; Fri, 20 Jan 2012 01:37:23 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200137.q0K1bNNf016392@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:37: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: r230346 - head/usr.sbin/rarpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:37:24 -0000 Author: eadler Date: Fri Jan 20 01:37:23 2012 New Revision: 230346 URL: http://svn.freebsd.org/changeset/base/230346 Log: Fix warning when compiling with gcc46: error: variable 'hostname' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/rarpd/rarpd.c Modified: head/usr.sbin/rarpd/rarpd.c ============================================================================== --- head/usr.sbin/rarpd/rarpd.c Fri Jan 20 00:58:51 2012 (r230345) +++ head/usr.sbin/rarpd/rarpd.c Fri Jan 20 01:37:23 2012 (r230346) @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) { int op; - char *ifname, *hostname, *name; + char *ifname, *name; int aflag = 0; /* listen on "all" interfaces */ int fflag = 0; /* don't fork */ @@ -174,7 +174,6 @@ main(int argc, char *argv[]) argv += optind; ifname = (aflag == 0) ? argv[0] : NULL; - hostname = ifname ? argv[1] : argv[0]; if ((aflag && ifname) || (!aflag && ifname == NULL)) usage(); From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:37:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F156106564A; Fri, 20 Jan 2012 01:37:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DF7A8FC14; Fri, 20 Jan 2012 01:37:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1bWYG016434; Fri, 20 Jan 2012 01:37:32 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1bWQF016432; Fri, 20 Jan 2012 01:37:32 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200137.q0K1bWQF016432@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:37: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: r230347 - head/usr.sbin/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:37:32 -0000 Author: eadler Date: Fri Jan 20 01:37:31 2012 New Revision: 230347 URL: http://svn.freebsd.org/changeset/base/230347 Log: Fix warning when compiling with gcc46: error: variable 'addrs' set but not used Approved by: dim Approved by: cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC After: 3 days Modified: head/usr.sbin/ppp/iface.c Modified: head/usr.sbin/ppp/iface.c ============================================================================== --- head/usr.sbin/ppp/iface.c Fri Jan 20 01:37:23 2012 (r230346) +++ head/usr.sbin/ppp/iface.c Fri Jan 20 01:37:31 2012 (r230347) @@ -471,12 +471,11 @@ iface_Descr(struct cmdargs const *arg) void iface_Clear(struct iface *iface, struct ncp *ncp, int family, int how) { - int addrs, af, inskip, in6skip, s4 = -1, s6 = -1, *s; + int af, inskip, in6skip, s4 = -1, s6 = -1, *s; unsigned n; if (iface->addrs) { inskip = in6skip = how == IFACE_CLEAR_ALL ? 0 : 1; - addrs = 0; for (n = 0; n < iface->addrs; n++) { af = ncprange_family(&iface->addr[n].ifa); From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:37:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B939C1065780; Fri, 20 Jan 2012 01:37:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A811E8FC0C; Fri, 20 Jan 2012 01:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1bdsI016475; Fri, 20 Jan 2012 01:37:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1bdSN016473; Fri, 20 Jan 2012 01:37:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200137.q0K1bdSN016473@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:37: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: r230348 - head/usr.sbin/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:37:39 -0000 Author: eadler Date: Fri Jan 20 01:37:39 2012 New Revision: 230348 URL: http://svn.freebsd.org/changeset/base/230348 Log: Fix warning when compiling with gcc46: error: variable 'extra_async_bytes' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC After: 3 days Modified: head/usr.sbin/ppp/lqr.c Modified: head/usr.sbin/ppp/lqr.c ============================================================================== --- head/usr.sbin/ppp/lqr.c Fri Jan 20 01:37:31 2012 (r230347) +++ head/usr.sbin/ppp/lqr.c Fri Jan 20 01:37:39 2012 (r230348) @@ -417,7 +417,7 @@ lqr_LayerPush(struct bundle *b __unused, int pri __unused, u_short *proto) { struct physical *p = link2physical(l); - int len, layer, extra_async_bytes; + int len, layer; if (!p) { /* Oops - can't happen :-] */ @@ -445,7 +445,6 @@ lqr_LayerPush(struct bundle *b __unused, * acf layers (to avoid alignment issues), so deal with this too. */ - extra_async_bytes = 0; p->hdlc.lqm.ifOutUniPackets++; p->hdlc.lqm.ifOutOctets += len + 1; /* plus 1 flag octet! */ for (layer = 0; layer < l->nlayers; layer++) From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:37:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 928A81065880; Fri, 20 Jan 2012 01:37:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 818F88FC14; Fri, 20 Jan 2012 01:37:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1bnVN016516; Fri, 20 Jan 2012 01:37:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1bn5p016514; Fri, 20 Jan 2012 01:37:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200137.q0K1bn5p016514@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:37: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: r230349 - head/usr.sbin/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:37:49 -0000 Author: eadler Date: Fri Jan 20 01:37:49 2012 New Revision: 230349 URL: http://svn.freebsd.org/changeset/base/230349 Log: Fix warning when compiling with gcc46: error: variable 'len' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/ppp/physical.c Modified: head/usr.sbin/ppp/physical.c ============================================================================== --- head/usr.sbin/ppp/physical.c Fri Jan 20 01:37:39 2012 (r230348) +++ head/usr.sbin/ppp/physical.c Fri Jan 20 01:37:49 2012 (r230349) @@ -585,7 +585,7 @@ iov2physical(struct datalink *dl, struct int fd, int *auxfd, int *nauxfd) { struct physical *p; - int len, type; + int type; unsigned h; p = (struct physical *)iov[(*niov)++].iov_base; @@ -598,7 +598,6 @@ iov2physical(struct datalink *dl, struct p->desc.Write = physical_DescriptorWrite; p->type = PHYS_DIRECT; p->dl = dl; - len = strlen(_PATH_DEV); p->out = NULL; p->connect_count = 1; From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:37:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A82BC1065686; Fri, 20 Jan 2012 01:37:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 970308FC16; Fri, 20 Jan 2012 01:37:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1buqn016557; Fri, 20 Jan 2012 01:37:56 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1buZt016555; Fri, 20 Jan 2012 01:37:56 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200137.q0K1buZt016555@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:37:56 +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: r230350 - head/usr.sbin/pmcstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:37:56 -0000 Author: eadler Date: Fri Jan 20 01:37:56 2012 New Revision: 230350 URL: http://svn.freebsd.org/changeset/base/230350 Log: Fix warning when compiling with gcc46: error: variable 'current_cpu' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Fri Jan 20 01:37:49 2012 (r230349) +++ head/usr.sbin/pmcstat/pmcstat.c Fri Jan 20 01:37:56 2012 (r230350) @@ -551,7 +551,7 @@ main(int argc, char **argv) cpuset_t cpumask; double interval; int hcpu, option, npmc, ncpu; - int c, check_driver_stats, current_cpu, current_sampling_count; + int c, check_driver_stats, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; int do_print, do_read; size_t dummy; @@ -571,7 +571,6 @@ main(int argc, char **argv) char buffer[PATH_MAX]; check_driver_stats = 0; - current_cpu = 0; current_sampling_count = DEFAULT_SAMPLE_COUNT; do_callchain = 1; do_descendants = 0; From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:38:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E4FF1065691; Fri, 20 Jan 2012 01:38:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D4128FC16; Fri, 20 Jan 2012 01:38:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1c5AK016602; Fri, 20 Jan 2012 01:38:05 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1c5IW016600; Fri, 20 Jan 2012 01:38:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200138.q0K1c5IW016600@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:38: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: r230351 - head/usr.sbin/moused X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:38:05 -0000 Author: eadler Date: Fri Jan 20 01:38:05 2012 New Revision: 230351 URL: http://svn.freebsd.org/changeset/base/230351 Log: Fix warning when compiling with gcc46: error: variable 'now' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/moused/moused.c Modified: head/usr.sbin/moused/moused.c ============================================================================== --- head/usr.sbin/moused/moused.c Fri Jan 20 01:37:56 2012 (r230350) +++ head/usr.sbin/moused/moused.c Fri Jan 20 01:38:05 2012 (r230351) @@ -3242,7 +3242,7 @@ kidspad(u_char rxc, mousestatus_t *act) static int buf[5]; static int buflen = 0, b_prev = 0 , x_prev = -1, y_prev = -1; static k_status status = S_IDLE; - static struct timespec old, now; + static struct timespec now; int x, y; @@ -3280,7 +3280,6 @@ kidspad(u_char rxc, mousestatus_t *act) x_prev = x; y_prev = y; } - old = now; act->dx = x - x_prev; act->dy = y - y_prev; if (act->dx || act->dy) From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:38:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1355D1065968; Fri, 20 Jan 2012 01:38:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 023EE8FC0A; Fri, 20 Jan 2012 01:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1cCFI016646; Fri, 20 Jan 2012 01:38:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1cCm7016644; Fri, 20 Jan 2012 01:38:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200138.q0K1cCm7016644@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:38: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: r230352 - head/usr.sbin/mountd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:38:13 -0000 Author: eadler Date: Fri Jan 20 01:38:12 2012 New Revision: 230352 URL: http://svn.freebsd.org/changeset/base/230352 Log: Fix warning when compiling with gcc46: error: variable 'dirp' set but not used error: variable 'dirplen' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Fri Jan 20 01:38:05 2012 (r230351) +++ head/usr.sbin/mountd/mountd.c Fri Jan 20 01:38:12 2012 (r230352) @@ -1642,9 +1642,8 @@ get_exportlist(void) struct iovec *iov; struct statfs *fsp, *mntbufp; struct xvfsconf vfc; - char *dirp; char errmsg[255]; - int dirplen, num, i; + int num, i; int iovlen; int done; struct nfsex_args eargs; @@ -1652,8 +1651,6 @@ get_exportlist(void) v4root_dirpath[0] = '\0'; bzero(&export, sizeof(export)); export.ex_flags = MNT_DELEXPORT; - dirp = NULL; - dirplen = 0; iov = NULL; iovlen = 0; bzero(errmsg, sizeof(errmsg)); From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:38:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D821065949; Fri, 20 Jan 2012 01:38:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91E1F8FC14; Fri, 20 Jan 2012 01:38:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1cLL9016697; Fri, 20 Jan 2012 01:38:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1cLZP016695; Fri, 20 Jan 2012 01:38:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200138.q0K1cLZP016695@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:38: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: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:38:21 -0000 Author: eadler Date: Fri Jan 20 01:38:21 2012 New Revision: 230353 URL: http://svn.freebsd.org/changeset/base/230353 Log: Fix warning when compiling with gcc46: error: variable 'temp' set but not used Approved by: dim Approved by: cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Fri Jan 20 01:38:12 2012 (r230352) +++ head/usr.sbin/makefs/cd9660.c Fri Jan 20 01:38:21 2012 (r230353) @@ -623,10 +623,6 @@ static void cd9660_finalize_PVD(void) { time_t tim; - unsigned char *temp; - - /* Copy the root directory record */ - temp = (unsigned char *) &diskStructure.primaryDescriptor; /* root should be a fixed size of 34 bytes since it has no name */ memcpy(diskStructure.primaryDescriptor.root_directory_record, From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:38:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0180310659E7; Fri, 20 Jan 2012 01:38:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4AF28FC1E; Fri, 20 Jan 2012 01:38:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1cSTK016741; Fri, 20 Jan 2012 01:38:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1cSou016739; Fri, 20 Jan 2012 01:38:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200138.q0K1cSou016739@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:38: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: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:38:29 -0000 Author: eadler Date: Fri Jan 20 01:38:28 2012 New Revision: 230354 URL: http://svn.freebsd.org/changeset/base/230354 Log: Fix a variety of warnings when compiling with gcc46 Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Fri Jan 20 01:38:21 2012 (r230353) +++ head/usr.sbin/makefs/cd9660.c Fri Jan 20 01:38:28 2012 (r230354) @@ -1049,7 +1049,7 @@ static cd9660node * cd9660_rename_filename(cd9660node *iter, int num, int delete_chars) { int i = 0; - int numbts, dot, semi, digit, digits, temp, powers, multiplier, count; + int numbts, digit, digits, temp, powers, count; char *naming; int maxlength; char *tmp; @@ -1071,7 +1071,6 @@ cd9660_rename_filename(cd9660node *iter, powers = 1; count = 0; digits = 1; - multiplier = 1; while (((int)(i / powers) ) >= 10) { digits++; powers = powers * 10; @@ -1086,15 +1085,7 @@ cd9660_rename_filename(cd9660node *iter, } */ - dot = -1; - semi = -1; while (count < maxlength) { - if (*naming == '.') - dot = count; - else if (*naming == ';') { - semi = count; - break; - } naming++; count++; } From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:38:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E3461065C4B; Fri, 20 Jan 2012 01:38:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D5188FC19; Fri, 20 Jan 2012 01:38:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1cZ7x016781; Fri, 20 Jan 2012 01:38:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1cZJ1016779; Fri, 20 Jan 2012 01:38:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200138.q0K1cZJ1016779@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:38: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: r230355 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:38:36 -0000 Author: eadler Date: Fri Jan 20 01:38:35 2012 New Revision: 230355 URL: http://svn.freebsd.org/changeset/base/230355 Log: Fix warning when compiling with gcc46: error: variable 'parentrecnum' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Fri Jan 20 01:38:28 2012 (r230354) +++ head/usr.sbin/makefs/cd9660.c Fri Jan 20 01:38:35 2012 (r230355) @@ -1516,7 +1516,6 @@ cd9660_generate_path_table(void) cd9660node *last = dirNode; int pathTableSize = 0; /* computed as we go */ int counter = 1; /* root gets a count of 0 */ - int parentRecNum = 0; /* root's parent is '0' */ TAILQ_HEAD(cd9660_pt_head, ptq_entry) pt_head; TAILQ_INIT(&pt_head); @@ -1546,10 +1545,6 @@ cd9660_generate_path_table(void) } last = dirNode; - parentRecNum = 1; - if (dirNode->parent != 0) - parentRecNum = dirNode->parent->ptnumber; - /* Push children onto queue */ TAILQ_FOREACH(cn, &dirNode->cn_children, cn_next_child) { /* From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:38:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F0701065C9E; Fri, 20 Jan 2012 01:38:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1078FC1A; Fri, 20 Jan 2012 01:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1cjix016823; Fri, 20 Jan 2012 01:38:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1cjUq016821; Fri, 20 Jan 2012 01:38:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200138.q0K1cjUq016821@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01: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: r230356 - head/usr.sbin/i2c X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:38:45 -0000 Author: eadler Date: Fri Jan 20 01:38:44 2012 New Revision: 230356 URL: http://svn.freebsd.org/changeset/base/230356 Log: Fix warning when compiling with gcc46: error: variable 'i2c' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Fri Jan 20 01:38:35 2012 (r230355) +++ head/usr.sbin/i2c/i2c.c Fri Jan 20 01:38:44 2012 (r230356) @@ -464,7 +464,7 @@ main(int argc, char** argv) { struct iiccmd cmd; struct options i2c_opt; - char *dev, *skip_addr, *err_msg, *i2c_buf; + char *dev, *skip_addr, *i2c_buf; int error, chunk_size, i, j, ch; errno = 0; @@ -474,7 +474,6 @@ main(int argc, char** argv) chunk_size = 16; dev = I2C_DEV; - err_msg = NULL; /* Default values */ i2c_opt.addr_set = 0; From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:38:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE1FF1065F06; Fri, 20 Jan 2012 01:38:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCBEC8FC08; Fri, 20 Jan 2012 01:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1cq1X016863; Fri, 20 Jan 2012 01:38:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1cqwO016861; Fri, 20 Jan 2012 01:38:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200138.q0K1cqwO016861@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:38: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: r230357 - head/usr.sbin/rtsold X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:38:53 -0000 Author: eadler Date: Fri Jan 20 01:38:52 2012 New Revision: 230357 URL: http://svn.freebsd.org/changeset/base/230357 Log: Fix warning when compiling with gcc46: error: variable 'target' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/rtsold/rtsold.c Modified: head/usr.sbin/rtsold/rtsold.c ============================================================================== --- head/usr.sbin/rtsold/rtsold.c Fri Jan 20 01:38:44 2012 (r230356) +++ head/usr.sbin/rtsold/rtsold.c Fri Jan 20 01:38:52 2012 (r230357) @@ -881,7 +881,7 @@ autoifprobe(void) static int n = 0; char **a; int s = 0, i, found; - struct ifaddrs *ifap, *ifa, *target; + struct ifaddrs *ifap, *ifa; struct in6_ndireq nd; /* initialize */ @@ -901,7 +901,6 @@ autoifprobe(void) exit(1); } - target = NULL; /* find an ethernet */ for (ifa = ifap; ifa; ifa = ifa->ifa_next) { if ((ifa->ifa_flags & IFF_UP) == 0) From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:39:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9038F106567E; Fri, 20 Jan 2012 01:39:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F45B8FC18; Fri, 20 Jan 2012 01:39:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1d1d9016905; Fri, 20 Jan 2012 01:39:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1d1La016903; Fri, 20 Jan 2012 01:39:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200139.q0K1d1La016903@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:39: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: r230358 - head/usr.sbin/sade X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:39:01 -0000 Author: eadler Date: Fri Jan 20 01:39:01 2012 New Revision: 230358 URL: http://svn.freebsd.org/changeset/base/230358 Log: Fix warning when compiling with gcc46: error: variable 'fd' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/sade/devices.c Modified: head/usr.sbin/sade/devices.c ============================================================================== --- head/usr.sbin/sade/devices.c Fri Jan 20 01:38:52 2012 (r230357) +++ head/usr.sbin/sade/devices.c Fri Jan 20 01:39:01 2012 (r230358) @@ -169,7 +169,7 @@ deviceReset(void) void deviceGetAll(void) { - int i, j, fd; + int i, j; char **names; msgNotify("Probing devices, please wait (this can take a while)..."); @@ -183,7 +183,7 @@ deviceGetAll(void) switch(device_names[i].type) { case DEVICE_TYPE_DISK: - fd = deviceTry(device_names[i], try, j); + deviceTry(device_names[i], try, j); break; default: From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:39:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 465171065AB3; Fri, 20 Jan 2012 01:39:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34FA48FC17; Fri, 20 Jan 2012 01:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1d923016948; Fri, 20 Jan 2012 01:39:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1d9Bg016946; Fri, 20 Jan 2012 01:39:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200139.q0K1d9Bg016946@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 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: r230359 - head/usr.sbin/faithd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:39:09 -0000 Author: eadler Date: Fri Jan 20 01:39:08 2012 New Revision: 230359 URL: http://svn.freebsd.org/changeset/base/230359 Log: Fix warning when compiling with gcc46: error: variable 'a' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/faithd/prefix.c Modified: head/usr.sbin/faithd/prefix.c ============================================================================== --- head/usr.sbin/faithd/prefix.c Fri Jan 20 01:39:01 2012 (r230358) +++ head/usr.sbin/faithd/prefix.c Fri Jan 20 01:39:08 2012 (r230359) @@ -63,7 +63,6 @@ prefix_set(const char *s, struct prefix char *p = NULL, *q, *r; struct addrinfo hints, *res = NULL; int max; - char *a; p = strdup(s); if (!p) @@ -88,14 +87,11 @@ prefix_set(const char *s, struct prefix switch (prefix->a.ss_family) { case AF_INET: max = 32; - a = (char *)&((struct sockaddr_in *)&prefix->a)->sin_addr; break; case AF_INET6: max = 128; - a = (char *)&((struct sockaddr_in6 *)&prefix->a)->sin6_addr; break; default: - a = NULL; max = -1; break; } From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:39:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 244B210656E3; Fri, 20 Jan 2012 01:39:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 134008FC1E; Fri, 20 Jan 2012 01:39:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1dGNU016990; Fri, 20 Jan 2012 01:39:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1dGUQ016988; Fri, 20 Jan 2012 01:39:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200139.q0K1dGUQ016988@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:39: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: r230360 - head/usr.sbin/cpucontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:39:17 -0000 Author: eadler Date: Fri Jan 20 01:39:16 2012 New Revision: 230360 URL: http://svn.freebsd.org/changeset/base/230360 Log: Fix warning when compiling with gcc46: error: variable 'flags' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/cpucontrol/via.c Modified: head/usr.sbin/cpucontrol/via.c ============================================================================== --- head/usr.sbin/cpucontrol/via.c Fri Jan 20 01:39:08 2012 (r230359) +++ head/usr.sbin/cpucontrol/via.c Fri Jan 20 01:39:16 2012 (r230360) @@ -82,7 +82,7 @@ via_update(const char *dev, const char * unsigned int i; size_t payload_size; via_fw_header_t *fw_header; - uint32_t signature, flags; + uint32_t signature; int32_t revision; void *fw_data; size_t data_size, total_size; @@ -121,7 +121,6 @@ via_update(const char *dev, const char * /* * MSR_IA32_PLATFORM_ID contains flag in BCD in bits 52-50. */ - flags = 1 << ((msrargs.data >> 50) & 7); msrargs.msr = MSR_BIOS_SIGN; error = ioctl(devfd, CPUCTL_RDMSR, &msrargs); if (error < 0) { From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 01:39:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD520106579B; Fri, 20 Jan 2012 01:39:26 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C0F48FC13; Fri, 20 Jan 2012 01:39:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K1dQsK017031; Fri, 20 Jan 2012 01:39:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K1dQeF017029; Fri, 20 Jan 2012 01:39:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201200139.q0K1dQeF017029@svn.freebsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 01:39: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: r230361 - head/usr.sbin/bootparamd/callbootd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 01:39:26 -0000 Author: eadler Date: Fri Jan 20 01:39:26 2012 New Revision: 230361 URL: http://svn.freebsd.org/changeset/base/230361 Log: Fix warning when compiling with gcc46: error: variable 'clnt_stat' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Modified: head/usr.sbin/bootparamd/callbootd/callbootd.c Modified: head/usr.sbin/bootparamd/callbootd/callbootd.c ============================================================================== --- head/usr.sbin/bootparamd/callbootd/callbootd.c Fri Jan 20 01:39:16 2012 (r230360) +++ head/usr.sbin/bootparamd/callbootd/callbootd.c Fri Jan 20 01:39:26 2012 (r230361) @@ -81,7 +81,6 @@ char **argv; long the_inet_addr; CLIENT *clnt; - enum clnt_stat clnt_stat; stat_whoami_res.client_name = cln; stat_whoami_res.domain_name = dmn; @@ -117,7 +116,7 @@ char **argv; } else exit(0); } else { - clnt_stat=clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS, + (void)clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS, BOOTPARAMPROC_WHOAMI, (xdrproc_t)xdr_bp_whoami_arg, (char *)&whoami_arg, @@ -140,7 +139,7 @@ char **argv; } else exit(0); } else { - clnt_stat=clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS, + (void)clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS, BOOTPARAMPROC_GETFILE, (xdrproc_t)xdr_bp_getfile_arg, (char *)&getfile_arg, From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 03:36:34 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74037106566C; Fri, 20 Jan 2012 03:36:34 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 160788FC13; Fri, 20 Jan 2012 03:36:32 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0K3aK4A045413; Fri, 20 Jan 2012 12:36:30 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0K3aI2H084998; Fri, 20 Jan 2012 12:36:20 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Fri, 20 Jan 2012 12:32:56 +0900 (JST) Message-Id: <20120120.123256.1432718473132856309.hrs@allbsd.org> To: eadler@FreeBSD.org From: Hiroki Sato In-Reply-To: <201201200138.q0K1cSou016739@svn.freebsd.org> References: <201201200138.q0K1cSou016739@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3.51 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Fri_Jan_20_12_32_56_2012_697)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Fri, 20 Jan 2012 12:36:30 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 03:36:34 -0000 ----Security_Multipart(Fri_Jan_20_12_32_56_2012_697)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eitan Adler wrote in <201201200138.q0K1cSou016739@svn.freebsd.org>: ea> Author: eadler ea> Date: Fri Jan 20 01:38:28 2012 ea> New Revision: 230354 ea> URL: http://svn.freebsd.org/changeset/base/230354 ea> ea> Log: ea> Fix a variety of warnings when compiling with gcc46 ea> ea> Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) ea> MFC after: 3 days ea> ea> Modified: ea> head/usr.sbin/makefs/cd9660.c Removing the dot handling part and leaving a comment in lines 1106-1117 make people confused. In addition to that, I personally don't think this should be removed because our cd9660.c is still based on NetBSD's one in any way---bugfixes on our side have been reported to the upstream and we will import useful changes from there if any. Although the current dot handling is useless, keeping the difference between the two small still has a meaning. -- Hiroki ----Security_Multipart(Fri_Jan_20_12_32_56_2012_697)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8Y4GgACgkQTyzT2CeTzy17TwCeNf8nCaYUTJ7ouN2v4wkXuJTb P88An3ZRYyFsDUmkRgNXUm74QwB7CN5i =D+Nd -----END PGP SIGNATURE----- ----Security_Multipart(Fri_Jan_20_12_32_56_2012_697)---- From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 05:58:27 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B3AE106564A; Fri, 20 Jan 2012 05:58:27 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id D32D78FC18; Fri, 20 Jan 2012 05:58:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0K5wOG5028229; Fri, 20 Jan 2012 09:58:24 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0K5wOph028228; Fri, 20 Jan 2012 09:58:24 +0400 (MSK) (envelope-from ache) Date: Fri, 20 Jan 2012 09:58:23 +0400 From: Andrey Chernov To: Mark Murray Message-ID: <20120120055823.GA28177@vniz.net> Mail-Followup-To: Andrey Chernov , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 05:58:27 -0000 On Thu, Jan 19, 2012 at 07:52:30PM +0000, Mark Murray wrote: > Andrey Chernov writes: > > On Mon, Jan 16, 2012 at 08:18:10PM +0000, David Schultz wrote: > > > Author: das > > > Date: Mon Jan 16 20:18:10 2012 > > > New Revision: 230230 > > > URL: http://svn.freebsd.org/changeset/base/230230 > > > > > > Log: > > > Generate a warning if the kernel's arc4random() is seeded with bogus entropy. > > > > While you are here, could you review/commit my patch to fix bad 31bit > > arc4rand() seeding, please? > > > > --- yarrow.c.bak 2011-09-26 07:35:48.000000000 +0400 > > +++ yarrow.c 2012-01-18 10:13:47.000000000 +0400 > > This is the wrong place for this; it may achieve the desired result, but > the file is where the Yarrow algorithm is implepeneted; ARC4 reseeds are > not a part of that, which makes this proposal a layering violation at > best, and an unwarranted dependancy at worst. > > Look at the function random_yarrow_unblock(). Thats where yopu want to > be doing this. This function is where the random device is unblocked > once safely seeded. Thanx for your hint, but I fear one moment using random_yarrow_unblock(). It is called under mtx_lock(&random_reseed_mtx) in reseed(). And when arc4rand() seeding is called, it uses read_random(), so I see possible deadlock can happens. In my version arc4rand() seeding happens only when this lock is released, so no blocking is possible. But perhaps I oversight something, correct me if I am wrong, please. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 06:16:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0F9D1065673; Fri, 20 Jan 2012 06:16:14 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEA038FC08; Fri, 20 Jan 2012 06:16:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K6GExk026872; Fri, 20 Jan 2012 06:16:14 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K6GEwT026852; Fri, 20 Jan 2012 06:16:14 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201200616.q0K6GEwT026852@svn.freebsd.org> From: David Schultz Date: Fri, 20 Jan 2012 06:16: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: r230363 - in head/lib/libc/softfloat: . bits32 bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 06:16:14 -0000 Author: das Date: Fri Jan 20 06:16:14 2012 New Revision: 230363 URL: http://svn.freebsd.org/changeset/base/230363 Log: Merge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the original vendor, but we're using their heavily modified version.) This brings in functions for long double emulation (both extended and quad formats), which may be useful for testing, and also for replacing libc/sparc64/fpu/. Added: head/lib/libc/softfloat/eqtf2.c (contents, props changed) head/lib/libc/softfloat/getf2.c (contents, props changed) head/lib/libc/softfloat/gexf2.c (contents, props changed) head/lib/libc/softfloat/gttf2.c (contents, props changed) head/lib/libc/softfloat/gtxf2.c (contents, props changed) head/lib/libc/softfloat/letf2.c (contents, props changed) head/lib/libc/softfloat/lttf2.c (contents, props changed) head/lib/libc/softfloat/negtf2.c (contents, props changed) head/lib/libc/softfloat/negxf2.c (contents, props changed) head/lib/libc/softfloat/netf2.c (contents, props changed) head/lib/libc/softfloat/nexf2.c (contents, props changed) Modified: head/lib/libc/softfloat/Makefile.inc head/lib/libc/softfloat/bits32/softfloat-macros head/lib/libc/softfloat/bits64/softfloat-macros head/lib/libc/softfloat/bits64/softfloat.c head/lib/libc/softfloat/softfloat-for-gcc.h head/lib/libc/softfloat/softfloat-source.txt head/lib/libc/softfloat/softfloat-specialize head/lib/libc/softfloat/softfloat.txt Modified: head/lib/libc/softfloat/Makefile.inc ============================================================================== --- head/lib/libc/softfloat/Makefile.inc Fri Jan 20 05:05:47 2012 (r230362) +++ head/lib/libc/softfloat/Makefile.inc Fri Jan 20 06:16:14 2012 (r230363) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.3 2003/05/06 08:58:20 rearnsha Exp $ +# $NetBSD: Makefile.inc,v 1.10 2011/07/04 02:53:15 mrg Exp $ # $FreeBSD$ SOFTFLOAT_BITS?=64 @@ -17,4 +17,14 @@ SRCS+= eqsf2.c nesf2.c gtsf2.c gesf2.c eqdf2.c nedf2.c gtdf2.c gedf2.c ltdf2.c ledf2.c negdf2.c \ unordsf2.c unorddf2.c +.if defined(SOFTFLOAT_128) +CFLAGS+= -DFLOAT128 +SRCS+= eqtf2.c netf2.c gttf2.c getf2.c lttf2.c letf2.c negtf2.c +.endif + +.if defined(SOFTFLOAT_X80) +CFLAGS+= -DFLOATX80 +SRCS+= nexf2.c gtxf2.c gexf2.c negxf2.c +.endif + SYM_MAPS+= ${.CURDIR}/softfloat/Symbol.map Modified: head/lib/libc/softfloat/bits32/softfloat-macros ============================================================================== --- head/lib/libc/softfloat/bits32/softfloat-macros Fri Jan 20 05:05:47 2012 (r230362) +++ head/lib/libc/softfloat/bits32/softfloat-macros Fri Jan 20 06:16:14 2012 (r230363) @@ -312,7 +312,7 @@ INLINE void carry0 = ( z1 < a1 ); z0 = a0 + b0; z1 += carry1; - z0 += ( z1 < carry1 ); + z0 += ( z1 < (bits32)carry1 ); z0 += carry0; *z2Ptr = z2; *z1Ptr = z1; @@ -369,7 +369,7 @@ INLINE void z1 = a1 - b1; borrow0 = ( a1 < b1 ); z0 = a0 - b0; - z0 -= ( z1 < borrow1 ); + z0 -= ( z1 < (bits32)borrow1 ); z1 -= borrow1; z0 -= borrow0; *z2Ptr = z2; Modified: head/lib/libc/softfloat/bits64/softfloat-macros ============================================================================== --- head/lib/libc/softfloat/bits64/softfloat-macros Fri Jan 20 05:05:47 2012 (r230362) +++ head/lib/libc/softfloat/bits64/softfloat-macros Fri Jan 20 06:16:14 2012 (r230363) @@ -1,4 +1,4 @@ -/* $NetBSD: softfloat-macros,v 1.1 2002/05/21 23:51:08 bjh21 Exp $ */ +/* $NetBSD: softfloat-macros,v 1.2 2009/02/16 10:23:35 tron Exp $ */ /* $FreeBSD$ */ /* @@ -387,7 +387,7 @@ INLINE void carry0 = ( z1 < a1 ); z0 = a0 + b0; z1 += carry1; - z0 += ( z1 < carry1 ); + z0 += ( z1 < (bits64)carry1 ); z0 += carry0; *z2Ptr = z2; *z1Ptr = z1; @@ -444,7 +444,7 @@ INLINE void z1 = a1 - b1; borrow0 = ( a1 < b1 ); z0 = a0 - b0; - z0 -= ( z1 < borrow1 ); + z0 -= ( z1 < (bits64)borrow1 ); z1 -= borrow1; z0 -= borrow0; *z2Ptr = z2; Modified: head/lib/libc/softfloat/bits64/softfloat.c ============================================================================== --- head/lib/libc/softfloat/bits64/softfloat.c Fri Jan 20 05:05:47 2012 (r230362) +++ head/lib/libc/softfloat/bits64/softfloat.c Fri Jan 20 06:16:14 2012 (r230363) @@ -1,4 +1,4 @@ -/* $NetBSD: softfloat.c,v 1.2 2003/07/26 19:24:52 salo Exp $ */ +/* $NetBSD: softfloat.c,v 1.8 2011/07/10 04:52:23 matt Exp $ */ /* * This version hacked for use with gcc -msoft-float by bjh21. @@ -1126,6 +1126,15 @@ float32 int32_to_float32( int32 a ) } +float32 uint32_to_float32( uint32 a ) +{ + if ( a == 0 ) return 0; + if ( a & (bits32) 0x80000000 ) + return normalizeRoundAndPackFloat32( 0, 0x9D, a >> 1 ); + return normalizeRoundAndPackFloat32( 0, 0x9C, a ); +} + + /* ------------------------------------------------------------------------------- Returns the result of converting the 32-bit two's complement integer `a' @@ -1149,6 +1158,17 @@ float64 int32_to_float64( int32 a ) } +float64 uint32_to_float64( uint32 a ) +{ + int8 shiftCount; + bits64 zSig = a; + + if ( a == 0 ) return 0; + shiftCount = countLeadingZeros32( a ) + 21; + return packFloat64( 0, 0x432 - shiftCount, zSig<>( ( - shiftCount ) & 63 ) ); + if ( (bits64) ( aSig1<>( - shiftCount ); + if (aSig1 || ( shiftCount && (bits64) ( aSig0<<( shiftCount & 63 ) ) ) ) { + float_exception_flags |= float_flag_inexact; + } + } + if ( aSign ) z = - z; + return z; + +} +#endif /* (SOFTFLOATSPARC64_FOR_GCC || SOFTFLOAT_FOR_GCC) && SOFTFLOAT_NEED_FIXUNS */ + /* ------------------------------------------------------------------------------- Returns the result of converting the quadruple-precision floating-point @@ -5110,7 +5205,7 @@ float128 float128_rem( float128 a, float sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 ); } while ( 0 <= (sbits64) aSig0 ); add128( - aSig0, aSig1, alternateASig0, alternateASig1, &sigMean0, &sigMean1 ); + aSig0, aSig1, alternateASig0, alternateASig1, (bits64 *)&sigMean0, &sigMean1 ); if ( ( sigMean0 < 0 ) || ( ( ( sigMean0 | sigMean1 ) == 0 ) && ( q & 1 ) ) ) { aSig0 = alternateASig0; Added: head/lib/libc/softfloat/eqtf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/eqtf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,24 @@ +/* $NetBSD: eqtf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */ + +/* + * Written by Matt Thomas, 2011. This file is in the Public Domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#ifdef FLOAT128 +flag __eqtf2(float128, float128); + +flag +__eqtf2(float128 a, float128 b) +{ + + /* libgcc1.c says !(a == b) */ + return !float128_eq(a, b); +} +#endif /* FLOAT128 */ Added: head/lib/libc/softfloat/getf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/getf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,26 @@ +/* $NetBSD: getf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */ + +/* + * Written by Matt Thomas, 2011. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOAT128 + +flag __getf2(float128, float128); + +flag +__getf2(float128 a, float128 b) +{ + + /* libgcc1.c says (a >= b) - 1 */ + return float128_le(b, a) - 1; +} + +#endif /* FLOAT128 */ Added: head/lib/libc/softfloat/gexf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/gexf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,25 @@ +/* $NetBSD: gexf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ + +/* + * Written by Ben Harris, 2000. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOATX80 + +flag __gexf2(floatx80, floatx80); + +flag +__gexf2(floatx80 a, floatx80 b) +{ + + /* libgcc1.c says (a >= b) - 1 */ + return floatx80_le(b, a) - 1; +} +#endif /* FLOATX80 */ Added: head/lib/libc/softfloat/gttf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/gttf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,26 @@ +/* $NetBSD: gttf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */ + +/* + * Written by Matt Thomas, 2011. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOAT128 + +flag __gttf2(float128, float128); + +flag +__gttf2(float128 a, float128 b) +{ + + /* libgcc1.c says a > b */ + return float128_lt(b, a); +} + +#endif /* FLOAT128 */ Added: head/lib/libc/softfloat/gtxf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/gtxf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,25 @@ +/* $NetBSD: gtxf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ + +/* + * Written by Ben Harris, 2000. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOATX80 + +flag __gtxf2(floatx80, floatx80); + +flag +__gtxf2(floatx80 a, floatx80 b) +{ + + /* libgcc1.c says a > b */ + return floatx80_lt(b, a); +} +#endif /* FLOATX80 */ Added: head/lib/libc/softfloat/letf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/letf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,26 @@ +/* $NetBSD: letf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */ + +/* + * Written by Matt Thomas, 2011. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOAT128 + +flag __letf2(float128, float128); + +flag +__letf2(float128 a, float128 b) +{ + + /* libgcc1.c says 1 - (a <= b) */ + return 1 - float128_le(a, b); +} + +#endif /* FLOAT128 */ Added: head/lib/libc/softfloat/lttf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/lttf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,26 @@ +/* $NetBSD: lttf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */ + +/* + * Written by Matt Thomas, 2011. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOAT128 + +flag __lttf2(float128, float128); + +flag +__lttf2(float128 a, float128 b) +{ + + /* libgcc1.c says -(a < b) */ + return -float128_lt(a, b); +} + +#endif /* FLOAT128 */ Added: head/lib/libc/softfloat/negtf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/negtf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,27 @@ +/* $NetBSD: negtf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */ + +/* + * Written by Matt Thomas, 2011. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOAT128 + +float128 __negtf2(float128); + +float128 +__negtf2(float128 a) +{ + + /* libgcc1.c says -a */ + a.high ^= FLOAT64_MANGLE(0x8000000000000000ULL); + return a; +} + +#endif /* FLOAT128 */ Added: head/lib/libc/softfloat/negxf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/negxf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,25 @@ +/* $NetBSD: negxf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ + +/* + * Written by Ben Harris, 2000. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOATX80 + +floatx80 __negxf2(floatx80); + +floatx80 +__negxf2(floatx80 a) +{ + + /* libgcc1.c says -a */ + return __mulxf3(a,__floatsixf(-1)); +} +#endif /* FLOATX80 */ Added: head/lib/libc/softfloat/netf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/netf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,26 @@ +/* $NetBSD: netf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */ + +/* + * Written by Matt Thomas, 2011. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOAT128 + +flag __netf2(float128, float128); + +flag +__netf2(float128 a, float128 b) +{ + + /* libgcc1.c says a != b */ + return !float128_eq(a, b); +} + +#endif /* FLOAT128 */ Added: head/lib/libc/softfloat/nexf2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/softfloat/nexf2.c Fri Jan 20 06:16:14 2012 (r230363) @@ -0,0 +1,25 @@ +/* $NetBSD: nexf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ + +/* + * Written by Ben Harris, 2000. This file is in the Public Domain. + */ + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +#include +__FBSDID("$FreeBSD$"); + +#ifdef FLOATX80 + +flag __nexf2(floatx80, floatx80); + +flag +__nexf2(floatx80 a, floatx80 b) +{ + + /* libgcc1.c says a != b */ + return !floatx80_eq(a, b); +} +#endif /* FLOATX80 */ Modified: head/lib/libc/softfloat/softfloat-for-gcc.h ============================================================================== --- head/lib/libc/softfloat/softfloat-for-gcc.h Fri Jan 20 05:05:47 2012 (r230362) +++ head/lib/libc/softfloat/softfloat-for-gcc.h Fri Jan 20 06:16:14 2012 (r230363) @@ -1,4 +1,4 @@ -/* $NetBSD: softfloat-for-gcc.h,v 1.6 2003/07/26 19:24:51 salo Exp $ */ +/* $NetBSD: softfloat-for-gcc.h,v 1.8 2009/12/14 01:07:42 matt Exp $ */ /* $FreeBSD$ */ /* @@ -16,6 +16,9 @@ #define float64_eq __softfloat_float64_eq #define float64_le __softfloat_float64_le #define float64_lt __softfloat_float64_lt +#define float128_eq __softfloat_float128_eq +#define float128_le __softfloat_float128_le +#define float128_lt __softfloat_float128_lt /* * Macros to define functions with the GCC expected names @@ -23,21 +26,144 @@ #define float32_add __addsf3 #define float64_add __adddf3 +#define floatx80_add __addxf3 +#define float128_add __addtf3 + #define float32_sub __subsf3 #define float64_sub __subdf3 +#define floatx80_sub __subxf3 +#define float128_sub __subtf3 + #define float32_mul __mulsf3 #define float64_mul __muldf3 +#define floatx80_mul __mulxf3 +#define float128_mul __multf3 + #define float32_div __divsf3 #define float64_div __divdf3 +#define floatx80_div __divxf3 +#define float128_div __divtf3 + +#if 0 +#define float32_neg __negsf2 +#define float64_neg __negdf2 +#define floatx80_neg __negxf2 +#define float128_neg __negtf2 +#endif + #define int32_to_float32 __floatsisf #define int32_to_float64 __floatsidf +#define int32_to_floatx80 __floatsixf +#define int32_to_float128 __floatsitf + #define int64_to_float32 __floatdisf #define int64_to_float64 __floatdidf +#define int64_to_floatx80 __floatdixf +#define int64_to_float128 __floatditf + +#define int128_to_float32 __floattisf +#define int128_to_float64 __floattidf +#define int128_to_floatx80 __floattixf +#define int128_to_float128 __floattitf + +#define uint32_to_float32 __floatunsisf +#define uint32_to_float64 __floatunsidf +#define uint32_to_floatx80 __floatunsixf +#define uint32_to_float128 __floatunsitf + +#define uint64_to_float32 __floatundisf +#define uint64_to_float64 __floatundidf +#define uint64_to_floatx80 __floatundixf +#define uint64_to_float128 __floatunditf + +#define uint128_to_float32 __floatuntisf +#define uint128_to_float64 __floatuntidf +#define uint128_to_floatx80 __floatuntixf +#define uint128_to_float128 __floatuntitf + #define float32_to_int32_round_to_zero __fixsfsi #define float64_to_int32_round_to_zero __fixdfsi +#define floatx80_to_int32_round_to_zero __fixxfsi +#define float128_to_int32_round_to_zero __fixtfsi + #define float32_to_int64_round_to_zero __fixsfdi #define float64_to_int64_round_to_zero __fixdfdi +#define floatx80_to_int64_round_to_zero __fixxfdi +#define float128_to_int64_round_to_zero __fixtfdi + +#define float32_to_int128_round_to_zero __fixsfti +#define float64_to_int128_round_to_zero __fixdfti +#define floatx80_to_int128_round_to_zero __fixxfti +#define float128_to_int128_round_to_zero __fixtfti + #define float32_to_uint32_round_to_zero __fixunssfsi #define float64_to_uint32_round_to_zero __fixunsdfsi +#define floatx80_to_uint32_round_to_zero __fixunsxfsi +#define float128_to_uint32_round_to_zero __fixunstfsi + +#define float32_to_uint64_round_to_zero __fixunssfdi +#define float64_to_uint64_round_to_zero __fixunsdfdi +#define floatx80_to_uint64_round_to_zero __fixunsxfdi +#define float128_to_uint64_round_to_zero __fixunstfdi + +#define float32_to_uint128_round_to_zero __fixunssfti +#define float64_to_uint128_round_to_zero __fixunsdfti +#define floatx80_to_uint128_round_to_zero __fixunsxfti +#define float128_to_uint128_round_to_zero __fixunstfti + #define float32_to_float64 __extendsfdf2 +#define float32_to_floatx80 __extendsfxf2 +#define float32_to_float128 __extendsftf2 +#define float64_to_floatx80 __extenddfxf2 +#define float64_to_float128 __extenddftf2 + +#define float128_to_float64 __trunctfdf2 +#define floatx80_to_float64 __truncxfdf2 +#define float128_to_float32 __trunctfsf2 +#define floatx80_to_float32 __truncxfsf2 #define float64_to_float32 __truncdfsf2 + +#if 0 +#define float32_cmp __cmpsf2 +#define float32_unord __unordsf2 +#define float32_eq __eqsf2 +#define float32_ne __nesf2 +#define float32_ge __gesf2 +#define float32_lt __ltsf2 +#define float32_le __lesf2 +#define float32_gt __gtsf2 +#endif + +#if 0 +#define float64_cmp __cmpdf2 +#define float64_unord __unorddf2 +#define float64_eq __eqdf2 +#define float64_ne __nedf2 +#define float64_ge __gedf2 +#define float64_lt __ltdf2 +#define float64_le __ledf2 +#define float64_gt __gtdf2 +#endif + +/* XXX not in libgcc */ +#if 1 +#define floatx80_cmp __cmpxf2 +#define floatx80_unord __unordxf2 +#define floatx80_eq __eqxf2 +#define floatx80_ne __nexf2 +#define floatx80_ge __gexf2 +#define floatx80_lt __ltxf2 +#define floatx80_le __lexf2 +#define floatx80_gt __gtxf2 +#endif + +#if 0 +#define float128_cmp __cmptf2 +#define float128_unord __unordtf2 +#define float128_eq __eqtf2 +#define float128_ne __netf2 +#define float128_ge __getf2 +#define float128_lt __lttf2 +#define float128_le __letf2 +#define float128_gt __gttf2 +#endif Modified: head/lib/libc/softfloat/softfloat-source.txt ============================================================================== --- head/lib/libc/softfloat/softfloat-source.txt Fri Jan 20 05:05:47 2012 (r230362) +++ head/lib/libc/softfloat/softfloat-source.txt Fri Jan 20 06:16:14 2012 (r230363) @@ -1,4 +1,4 @@ -$NetBSD: softfloat-source.txt,v 1.1 2000/06/06 08:15:10 bjh21 Exp $ +$NetBSD: softfloat-source.txt,v 1.2 2006/11/24 19:46:58 christos Exp $ $FreeBSD$ SoftFloat Release 2a Source Documentation @@ -33,7 +33,7 @@ C Compiler (`gcc') for several platforms Limitations SoftFloat as written requires an ISO/ANSI-style C compiler. No attempt has -been made to accomodate compilers that are not ISO-conformant. Older ``K&R- +been made to accommodate compilers that are not ISO-conformant. Older ``K&R- style'' compilers are not adequate for compiling SoftFloat. All testing I have done so far has been with the GNU C Compiler. Compilation with other compilers should be possible but has not been tested. Modified: head/lib/libc/softfloat/softfloat-specialize ============================================================================== --- head/lib/libc/softfloat/softfloat-specialize Fri Jan 20 05:05:47 2012 (r230362) +++ head/lib/libc/softfloat/softfloat-specialize Fri Jan 20 06:16:14 2012 (r230363) @@ -1,4 +1,4 @@ -/* $NetBSD: softfloat-specialize,v 1.3 2002/05/12 13:12:45 bjh21 Exp $ */ +/* $NetBSD: softfloat-specialize,v 1.6 2011/03/06 10:27:37 martin Exp $ */ /* $FreeBSD$ */ /* This is a derivative work. */ @@ -34,6 +34,8 @@ this code that are retained. */ #include +#include +#include /* ------------------------------------------------------------------------------- @@ -58,6 +60,9 @@ substitute a result value. If traps are should be simply `float_exception_flags |= flags;'. ------------------------------------------------------------------------------- */ +#ifdef SOFTFLOAT_FOR_GCC +#define float_exception_mask __softfloat_float_exception_mask +#endif int float_exception_mask = 0; void float_raise( int flags ) { @@ -65,9 +70,29 @@ void float_raise( int flags ) float_exception_flags |= flags; if ( flags & float_exception_mask ) { +#if 0 + siginfo_t info; + memset(&info, 0, sizeof info); + info.si_signo = SIGFPE; + info.si_pid = getpid(); + info.si_uid = geteuid(); + if (flags & float_flag_underflow) + info.si_code = FPE_FLTUND; + else if (flags & float_flag_overflow) + info.si_code = FPE_FLTOVF; + else if (flags & float_flag_divbyzero) + info.si_code = FPE_FLTDIV; + else if (flags & float_flag_invalid) + info.si_code = FPE_FLTINV; + else if (flags & float_flag_inexact) + info.si_code = FPE_FLTRES; + sigqueueinfo(getpid(), &info); +#else raise( SIGFPE ); +#endif } } +#undef float_exception_mask /* ------------------------------------------------------------------------------- @@ -108,7 +133,8 @@ Returns 1 if the single-precision floati NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ -#if defined(SOFTFLOAT_FOR_GCC) && !defined(SOFTFLOATSPARC64_FOR_GCC) +#if defined(SOFTFLOAT_FOR_GCC) && !defined(SOFTFLOATSPARC64_FOR_GCC) && \ + !defined(SOFTFLOAT_M68K_FOR_GCC) static #endif flag float32_is_signaling_nan( float32 a ) @@ -207,7 +233,8 @@ Returns 1 if the double-precision floati NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ -#if defined(SOFTFLOAT_FOR_GCC) && !defined(SOFTFLOATSPARC64_FOR_GCC) +#if defined(SOFTFLOAT_FOR_GCC) && !defined(SOFTFLOATSPARC64_FOR_GCC) && \ + !defined(SOFTFLOATM68K_FOR_GCC) static #endif flag float64_is_signaling_nan( float64 a ) Modified: head/lib/libc/softfloat/softfloat.txt ============================================================================== --- head/lib/libc/softfloat/softfloat.txt Fri Jan 20 05:05:47 2012 (r230362) +++ head/lib/libc/softfloat/softfloat.txt Fri Jan 20 06:16:14 2012 (r230363) @@ -1,4 +1,4 @@ -$NetBSD: softfloat.txt,v 1.1 2000/06/06 08:15:10 bjh21 Exp $ +$NetBSD: softfloat.txt,v 1.2 2006/11/24 19:46:58 christos Exp $ $FreeBSD$ SoftFloat Release 2a General Documentation @@ -27,7 +27,7 @@ Limitations SoftFloat is written in C and is designed to work with other C code. The SoftFloat header files assume an ISO/ANSI-style C compiler. No attempt -has been made to accomodate compilers that are not ISO-conformant. In +has been made to accommodate compilers that are not ISO-conformant. In particular, the distributed header files will not be acceptable to any compiler that does not recognize function prototypes. From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 06:50:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E60DD106568A; Fri, 20 Jan 2012 06:50:07 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 46A588FC0C; Fri, 20 Jan 2012 06:50:06 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0K6o6Sh080997; Fri, 20 Jan 2012 01:50:06 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0K6o6xO080996; Fri, 20 Jan 2012 01:50:06 -0500 (EST) (envelope-from das@freebsd.org) Date: Fri, 20 Jan 2012 01:50:06 -0500 From: David Schultz To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120120065006.GA80490@zim.MIT.EDU> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201200616.q0K6GEwT026852@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201200616.q0K6GEwT026852@svn.freebsd.org> Cc: Subject: Re: svn commit: r230363 - in head/lib/libc/softfloat: . bits32 bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 06:50:15 -0000 On Fri, Jan 20, 2012, David Schultz wrote: > Merge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the > original vendor, but we're using their heavily modified version.) > This brings in functions for long double emulation (both extended and > quad formats), which may be useful for testing, and also for replacing > libc/sparc64/fpu/. I'd appreciate it if an svn guru could let me know if anything needs to be done to record the fact that this is a merged copy of /vendor/NetBSD/softfloat/dist@230364. `svn merge --record-only $url' didn't do anything, I'm guessing because there's no history yet. The previous libc/softfloat sources were a mishmash, so I didn't try to recreate any merge history for those. From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 06:51:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2907D1065672; Fri, 20 Jan 2012 06:51:42 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D13B8FC1C; Fri, 20 Jan 2012 06:51:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K6pfNc028206; Fri, 20 Jan 2012 06:51:41 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K6pfOe028201; Fri, 20 Jan 2012 06:51:41 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201200651.q0K6pfOe028201@svn.freebsd.org> From: David Schultz Date: Fri, 20 Jan 2012 06:51:41 +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: r230366 - in head/sys: arm/include ia64/include mips/include powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 06:51:42 -0000 Author: das Date: Fri Jan 20 06:51:41 2012 New Revision: 230366 URL: http://svn.freebsd.org/changeset/base/230366 Log: Add parentheses where required. Without them, `sizeof LDBL_MAX' is a syntax error and shouldn't be, while `1 FLT_ROUNDS' isn't a syntax error and should be. Thanks to bde for the examples. Modified: head/sys/arm/include/float.h head/sys/ia64/include/float.h head/sys/mips/include/float.h head/sys/powerpc/include/float.h Modified: head/sys/arm/include/float.h ============================================================================== --- head/sys/arm/include/float.h Fri Jan 20 06:33:49 2012 (r230365) +++ head/sys/arm/include/float.h Fri Jan 20 06:51:41 2012 (r230366) @@ -75,12 +75,12 @@ __END_DECLS #define DBL_MAX_10_EXP 308 #define LDBL_MANT_DIG DBL_MANT_DIG -#define LDBL_EPSILON (long double)DBL_EPSILON +#define LDBL_EPSILON ((long double)DBL_EPSILON) #define LDBL_DIG DBL_DIG #define LDBL_MIN_EXP DBL_MIN_EXP -#define LDBL_MIN (long double)DBL_MIN +#define LDBL_MIN ((long double)DBL_MIN) #define LDBL_MIN_10_EXP DBL_MIN_10_EXP #define LDBL_MAX_EXP DBL_MAX_EXP -#define LDBL_MAX (long double)DBL_MAX +#define LDBL_MAX ((long double)DBL_MAX) #define LDBL_MAX_10_EXP DBL_MAX_10_EXP #endif /* _MACHINE_FLOAT_H_ */ Modified: head/sys/ia64/include/float.h ============================================================================== --- head/sys/ia64/include/float.h Fri Jan 20 06:33:49 2012 (r230365) +++ head/sys/ia64/include/float.h Fri Jan 20 06:51:41 2012 (r230366) @@ -49,9 +49,9 @@ __END_DECLS #define FLT_MANT_DIG 24 /* p */ #define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ #define FLT_DIG 6 /* floor((p-1)*log10(b))+(b == 10) */ -#define FLT_MIN_EXP -125 /* emin */ +#define FLT_MIN_EXP (-125) /* emin */ #define FLT_MIN 1.17549435E-38F /* b**(emin-1) */ -#define FLT_MIN_10_EXP -37 /* ceil(log10(b**(emin-1))) */ +#define FLT_MIN_10_EXP (-37) /* ceil(log10(b**(emin-1))) */ #define FLT_MAX_EXP 128 /* emax */ #define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ #define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ @@ -59,9 +59,9 @@ __END_DECLS #define DBL_MANT_DIG 53 #define DBL_EPSILON 2.2204460492503131E-16 #define DBL_DIG 15 -#define DBL_MIN_EXP -1021 +#define DBL_MIN_EXP (-1021) #define DBL_MIN 2.2250738585072014E-308 -#define DBL_MIN_10_EXP -307 +#define DBL_MIN_10_EXP (-307) #define DBL_MAX_EXP 1024 #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 Modified: head/sys/mips/include/float.h ============================================================================== --- head/sys/mips/include/float.h Fri Jan 20 06:33:49 2012 (r230365) +++ head/sys/mips/include/float.h Fri Jan 20 06:51:41 2012 (r230366) @@ -45,7 +45,7 @@ __END_DECLS #ifdef CPU_HAVEFPU #define FLT_ROUNDS __flt_rounds() /* FP addition rounds to nearest */ #else -#define FLT_ROUNDS -1 +#define FLT_ROUNDS (-1) #endif #if __ISO_C_VISIBLE >= 1999 @@ -74,13 +74,13 @@ __END_DECLS #define DBL_MAX_10_EXP 308 #define LDBL_MANT_DIG DBL_MANT_DIG -#define LDBL_EPSILON (long double)DBL_EPSILON +#define LDBL_EPSILON ((long double)DBL_EPSILON) #define LDBL_DIG DBL_DIG #define LDBL_MIN_EXP DBL_MIN_EXP -#define LDBL_MIN (long double)DBL_MIN +#define LDBL_MIN ((long double)DBL_MIN) #define LDBL_MIN_10_EXP DBL_MIN_10_EXP #define LDBL_MAX_EXP DBL_MAX_EXP -#define LDBL_MAX (long double)DBL_MAX +#define LDBL_MAX ((long double)DBL_MAX) #define LDBL_MAX_10_EXP DBL_MAX_10_EXP #endif /* _MACHINE_FLOAT_H_ */ Modified: head/sys/powerpc/include/float.h ============================================================================== --- head/sys/powerpc/include/float.h Fri Jan 20 06:33:49 2012 (r230365) +++ head/sys/powerpc/include/float.h Fri Jan 20 06:51:41 2012 (r230366) @@ -42,7 +42,7 @@ extern int __flt_rounds(void); __END_DECLS #define FLT_ROUNDS __flt_rounds() #else -#define FLT_ROUNDS -1 +#define FLT_ROUNDS (-1) #endif #define FLT_RADIX 2 /* b */ @@ -72,13 +72,13 @@ __END_DECLS #define DBL_MAX_10_EXP 308 #define LDBL_MANT_DIG DBL_MANT_DIG -#define LDBL_EPSILON (long double)DBL_EPSILON +#define LDBL_EPSILON ((long double)DBL_EPSILON) #define LDBL_DIG DBL_DIG #define LDBL_MIN_EXP DBL_MIN_EXP -#define LDBL_MIN (long double)DBL_MIN +#define LDBL_MIN ((long double)DBL_MIN) #define LDBL_MIN_10_EXP DBL_MIN_10_EXP #define LDBL_MAX_EXP DBL_MAX_EXP -#define LDBL_MAX (long double)DBL_MAX +#define LDBL_MAX ((long double)DBL_MAX) #define LDBL_MAX_10_EXP DBL_MAX_10_EXP #endif /* _MACHINE_FLOAT_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 06:54:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C10091065670; Fri, 20 Jan 2012 06:54:30 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF9998FC16; Fri, 20 Jan 2012 06:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K6sUfB028328; Fri, 20 Jan 2012 06:54:30 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K6sUHJ028323; Fri, 20 Jan 2012 06:54:30 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201200654.q0K6sUHJ028323@svn.freebsd.org> From: David Schultz Date: Fri, 20 Jan 2012 06:54: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: r230367 - in head/lib: libc/arm/gen msun/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 06:54:30 -0000 Author: das Date: Fri Jan 20 06:54:30 2012 New Revision: 230367 URL: http://svn.freebsd.org/changeset/base/230367 Log: Don't inline fenv.h functions on arm for now. Inlining makes sense: the function bodies require only 2 to 10 instructions. However, it leads to application binaries that refer to a private ABI, namely, the softfloat innards in libc. This could complicate future changes in the implementation of the floating-point emulation layer, so it seems best to have programs refer to the official fe* entry points in libm. Modified: head/lib/libc/arm/gen/flt_rounds.c head/lib/msun/arm/Symbol.map head/lib/msun/arm/fenv.c head/lib/msun/arm/fenv.h Modified: head/lib/libc/arm/gen/flt_rounds.c ============================================================================== --- head/lib/libc/arm/gen/flt_rounds.c Fri Jan 20 06:51:41 2012 (r230366) +++ head/lib/libc/arm/gen/flt_rounds.c Fri Jan 20 06:54:30 2012 (r230367) @@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "softfloat-for-gcc.h" +#include "milieu.h" #include "softfloat.h" int Modified: head/lib/msun/arm/Symbol.map ============================================================================== --- head/lib/msun/arm/Symbol.map Fri Jan 20 06:51:41 2012 (r230366) +++ head/lib/msun/arm/Symbol.map Fri Jan 20 06:54:30 2012 (r230367) @@ -5,8 +5,13 @@ FBSD_1.0 { }; FBSD_1.3 { + feclearexcept; + fegetexceptflag; fesetexceptflag; feraiseexcept; + fetestexcept; + fegetround; + fesetround; fegetenv; feholdexcept; feupdateenv; Modified: head/lib/msun/arm/fenv.c ============================================================================== --- head/lib/msun/arm/fenv.c Fri Jan 20 06:51:41 2012 (r230366) +++ head/lib/msun/arm/fenv.c Fri Jan 20 06:54:30 2012 (r230367) @@ -29,6 +29,20 @@ #define __fenv_static #include "fenv.h" +/* + * The following macros map between the softfloat emulator's flags and + * the hardware's FPSR. The hardware this file was written for doesn't + * have rounding control bits, so we stick those in the system ID byte. + */ +#define __set_env(env, flags, mask, rnd) env = ((flags) \ + | (mask)<<_FPUSW_SHIFT \ + | (rnd) << 24) +#define __env_flags(env) ((env) & FE_ALL_EXCEPT) +#define __env_mask(env) (((env) >> _FPUSW_SHIFT) \ + & FE_ALL_EXCEPT) +#define __env_round(env) (((env) >> 24) & _ROUND_MASK) +#include "fenv-softfloat.h" + #ifdef __GNUC_GNU_INLINE__ #error "This file must be compiled with C99 'inline' semantics" #endif Modified: head/lib/msun/arm/fenv.h ============================================================================== --- head/lib/msun/arm/fenv.h Fri Jan 20 06:51:41 2012 (r230366) +++ head/lib/msun/arm/fenv.h Fri Jan 20 06:54:30 2012 (r230367) @@ -65,19 +65,18 @@ extern const fenv_t __fe_dfl_env; #define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT) #ifndef ARM_HARD_FLOAT -/* - * The following macros map between the softfloat emulator's flags and - * the hardware's FPSR. The hardware this file was written for doesn't - * have rounding control bits, so we stick those in the system ID byte. - */ -#define __set_env(env, flags, mask, rnd) env = ((flags) \ - | (mask)<<_FPUSW_SHIFT \ - | (rnd) << 24) -#define __env_flags(env) ((env) & FE_ALL_EXCEPT) -#define __env_mask(env) (((env) >> _FPUSW_SHIFT) \ - & FE_ALL_EXCEPT) -#define __env_round(env) (((env) >> 24) & _ROUND_MASK) -#include + +int feclearexcept(int __excepts); +int fegetexceptflag(fexcept_t *__flagp, int __excepts); +int fesetexceptflag(const fexcept_t *__flagp, int __excepts); +int feraiseexcept(int __excepts); +int fetestexcept(int __excepts); +int fegetround(void); +int fesetround(int __round); +int fegetenv(fenv_t *__envp); +int feholdexcept(fenv_t *__envp); +int fesetenv(const fenv_t *__envp); +int feupdateenv(const fenv_t *__envp); #else /* ARM_HARD_FLOAT */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 06:57:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B49ED106564A; Fri, 20 Jan 2012 06:57:22 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 990A28FC08; Fri, 20 Jan 2012 06:57:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K6vMRq028466; Fri, 20 Jan 2012 06:57:22 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K6vMhf028463; Fri, 20 Jan 2012 06:57:22 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201200657.q0K6vMhf028463@svn.freebsd.org> From: David Schultz Date: Fri, 20 Jan 2012 06:57: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: r230368 - head/tools/regression/usr.bin/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 06:57:22 -0000 Author: das Date: Fri Jan 20 06:57:21 2012 New Revision: 230368 URL: http://svn.freebsd.org/changeset/base/230368 Log: These tests check whether the compiler evaluates floating-point expressions properly. Some of the tests depend on the compiler implementing C99's FENV_ACCESS pragma, and only commercial compilers do; those tests are currently skipped. If any of the enabled tests fail, then odds are the libm regression tests will fail also. This should make it easier to diagnose reported problems on platforms I don't have. Currently, gcc passes all the tests that don't depend on FENV_ACCESS on amd64 and sparc64. Clang fails a few on amd64 (see clang bug 11406). Both gcc and clang fare poorly on i386, which has well-known issues. Added: head/tools/regression/usr.bin/cc/ head/tools/regression/usr.bin/cc/Makefile (contents, props changed) head/tools/regression/usr.bin/cc/float.c (contents, props changed) head/tools/regression/usr.bin/cc/float.t (contents, props changed) Added: head/tools/regression/usr.bin/cc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/cc/Makefile Fri Jan 20 06:57:21 2012 (r230368) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTS= float +CFLAGS+=-lm + +.PHONY: tests +tests: ${TESTS} + for p in ${TESTS}; do ${.OBJDIR}/$$p; done + +.PHONY: clean +clean: + -rm -f ${TESTS} Added: head/tools/regression/usr.bin/cc/float.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/cc/float.c Fri Jan 20 06:57:21 2012 (r230368) @@ -0,0 +1,271 @@ +/*- + * Copyright (c) 2012 David Schultz + * 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. + */ + +/* + * Test that floating-point arithmetic works as specified by the C standard. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#ifdef __i386__ +#include +#endif + +#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ + FE_OVERFLOW | FE_UNDERFLOW) + +#define TWICE(x) ((x) + (x)) +#define test(desc, pass) test1((desc), (pass), 0) +#define skiptest(desc, pass) test1((desc), (pass), 1) + +#pragma STDC FENV_ACCESS ON + +static const float one_f = 1.0 + FLT_EPSILON / 2; +static const double one_d = 1.0 + DBL_EPSILON / 2; +static const long double one_ld = 1.0L + LDBL_EPSILON / 2; + +static int testnum, failures; + +static void +test1(const char *testdesc, int pass, int skip) +{ + + testnum++; + printf("%sok %d - %s%s\n", pass || skip ? "" : "not ", testnum, + skip ? "(SKIPPED) " : "", testdesc); + if (!pass && !skip) + failures++; +} + +/* + * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. + */ +static int +fpequal(long double d1, long double d2) +{ + + if (d1 != d2) + return (isnan(d1) && isnan(d2)); + return (copysignl(1.0, d1) == copysignl(1.0, d2)); +} + +void +run_zero_opt_test(double d1, double d2) +{ + + test("optimizations don't break the sign of 0", + fpequal(d1 - d2, 0.0) + && fpequal(-d1 + 0.0, 0.0) + && fpequal(-d1 - d2, -0.0) + && fpequal(-(d1 - d2), -0.0) + && fpequal(-d1 - (-d2), 0.0)); +} + +void +run_inf_opt_test(double d) +{ + + test("optimizations don't break infinities", + fpequal(d / d, NAN) && fpequal(0.0 * d, NAN)); +} + +static inline double +todouble(long double ld) +{ + + return (ld); +} + +static inline float +tofloat(double d) +{ + + return (d); +} + +void +run_tests(void) +{ + volatile long double vld; + long double ld; + volatile double vd; + double d; + volatile float vf; + float f; + int x; + + test("sign bits", fpequal(-0.0, -0.0) && !fpequal(0.0, -0.0)); + + vd = NAN; + test("NaN equality", fpequal(NAN, NAN) && NAN != NAN && vd != vd); + + feclearexcept(ALL_STD_EXCEPT); + test("NaN comparison returns false", !(vd <= vd)); + /* + * XXX disabled; gcc/amd64 botches this IEEE 754 requirement by + * emitting ucomisd instead of comisd. + */ + skiptest("FENV_ACCESS: NaN comparison raises invalid exception", + fetestexcept(ALL_STD_EXCEPT) == FE_INVALID); + + vd = 0.0; + run_zero_opt_test(vd, vd); + + vd = INFINITY; + run_inf_opt_test(vd); + + feclearexcept(ALL_STD_EXCEPT); + vd = INFINITY; + x = (int)vd; + /* XXX disabled (works with -O0); gcc doesn't support FENV_ACCESS */ + skiptest("FENV_ACCESS: Inf->int conversion raises invalid exception", + fetestexcept(ALL_STD_EXCEPT) == FE_INVALID); + + /* Raising an inexact exception here is an IEEE-854 requirement. */ + feclearexcept(ALL_STD_EXCEPT); + vd = 0.75; + x = (int)vd; + test("0.75->int conversion rounds toward 0, raises inexact exception", + x == 0 && fetestexcept(ALL_STD_EXCEPT) == FE_INEXACT); + + feclearexcept(ALL_STD_EXCEPT); + vd = -42.0; + x = (int)vd; + test("-42.0->int conversion is exact, raises no exception", + x == -42 && fetestexcept(ALL_STD_EXCEPT) == 0); + + feclearexcept(ALL_STD_EXCEPT); + x = (int)INFINITY; + /* XXX disabled; gcc doesn't support FENV_ACCESS */ + skiptest("FENV_ACCESS: const Inf->int conversion raises invalid", + fetestexcept(ALL_STD_EXCEPT) == FE_INVALID); + + feclearexcept(ALL_STD_EXCEPT); + x = (int)0.5; + /* XXX disabled; gcc doesn't support FENV_ACCESS */ + skiptest("FENV_ACCESS: const double->int conversion raises inexact", + x == 0 && fetestexcept(ALL_STD_EXCEPT) == FE_INEXACT); + + test("compile-time constants don't have too much precision", + one_f == 1.0L && one_d == 1.0L && one_ld == 1.0L); + + test("const minimum rounding precision", + 1.0F + FLT_EPSILON != 1.0F && + 1.0 + DBL_EPSILON != 1.0 && + 1.0L + LDBL_EPSILON != 1.0L); + + /* It isn't the compiler's fault if this fails on FreeBSD/i386. */ + vf = FLT_EPSILON; + vd = DBL_EPSILON; + vld = LDBL_EPSILON; + test("runtime minimum rounding precision", + 1.0F + vf != 1.0F && 1.0 + vd != 1.0 && 1.0L + vld != 1.0L); + + test("explicit float to float conversion discards extra precision", + (float)(1.0F + FLT_EPSILON * 0.5F) == 1.0F && + (float)(1.0F + vf * 0.5F) == 1.0F); + test("explicit double to float conversion discards extra precision", + (float)(1.0 + FLT_EPSILON * 0.5) == 1.0F && + (float)(1.0 + vf * 0.5) == 1.0F); + test("explicit ldouble to float conversion discards extra precision", + (float)(1.0L + FLT_EPSILON * 0.5L) == 1.0F && + (float)(1.0L + vf * 0.5L) == 1.0F); + + test("explicit double to double conversion discards extra precision", + (double)(1.0 + DBL_EPSILON * 0.5) == 1.0 && + (double)(1.0 + vd * 0.5) == 1.0); + test("explicit ldouble to double conversion discards extra precision", + (double)(1.0L + DBL_EPSILON * 0.5L) == 1.0 && + (double)(1.0L + vd * 0.5L) == 1.0); + + /* + * FLT_EVAL_METHOD > 1 implies that float expressions are always + * evaluated in double precision or higher, but some compilers get + * this wrong when registers spill to memory. The following expression + * forces a spill when there are at most 8 FP registers. + */ + test("implicit promption to double or higher precision is consistent", +#if FLT_EVAL_METHOD == 1 || FLT_EVAL_METHOD == 2 || defined(__i386__) + TWICE(TWICE(TWICE(TWICE(TWICE( + TWICE(TWICE(TWICE(TWICE(1.0F + vf * 0.5F))))))))) + == (1.0 + FLT_EPSILON * 0.5) * 512.0 +#else + 1 +#endif + ); + + f = 1.0 + FLT_EPSILON * 0.5; + d = 1.0L + DBL_EPSILON * 0.5L; + test("const assignment discards extra precision", f == 1.0F && d == 1.0); + + f = 1.0 + vf * 0.5; + d = 1.0L + vd * 0.5L; + test("variable assignment discards explicit extra precision", + f == 1.0F && d == 1.0); + f = 1.0F + vf * 0.5F; + d = 1.0 + vd * 0.5; + test("variable assignment discards implicit extra precision", + f == 1.0F && d == 1.0); + + test("return discards extra precision", + tofloat(1.0 + vf * 0.5) == 1.0F && + todouble(1.0L + vd * 0.5L) == 1.0); + + fesetround(FE_UPWARD); + /* XXX disabled (works with -frounding-math) */ + skiptest("FENV_ACCESS: constant arithmetic respects rounding mode", + 1.0F + FLT_MIN == 1.0F + FLT_EPSILON && + 1.0 + DBL_MIN == 1.0 + DBL_EPSILON && + 1.0L + LDBL_MIN == 1.0L + LDBL_EPSILON); + fesetround(FE_TONEAREST); + + ld = vld * 0.5; + test("associativity is respected", + 1.0L + ld + (LDBL_EPSILON * 0.5) == 1.0L && + 1.0L + (LDBL_EPSILON * 0.5) + ld == 1.0L && + ld + 1.0 + (LDBL_EPSILON * 0.5) == 1.0L && + ld + (LDBL_EPSILON * 0.5) + 1.0 == 1.0L + LDBL_EPSILON); +} + +int +main(int argc, char *argv[]) +{ + + printf("1..26\n"); + +#ifdef __i386__ + fpsetprec(FP_PE); +#endif + run_tests(); + + return (failures); +} Added: head/tools/regression/usr.bin/cc/float.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/cc/float.t Fri Jan 20 06:57:21 2012 (r230368) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 06:59:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74C06106564A; Fri, 20 Jan 2012 06:59:30 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6474A8FC08; Fri, 20 Jan 2012 06:59:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K6xURf028565; Fri, 20 Jan 2012 06:59:30 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K6xU7l028563; Fri, 20 Jan 2012 06:59:30 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201200659.q0K6xU7l028563@svn.freebsd.org> From: David Schultz Date: Fri, 20 Jan 2012 06:59: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: r230369 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 06:59:30 -0000 Author: das Date: Fri Jan 20 06:59:29 2012 New Revision: 230369 URL: http://svn.freebsd.org/changeset/base/230369 Log: Remove an errant `#define dprintf printf'. It seems to be leftover debugging code that nothing depends on. (I've had this in my tree for years without issue.) Modified: head/lib/libdisk/libdisk.h Modified: head/lib/libdisk/libdisk.h ============================================================================== --- head/lib/libdisk/libdisk.h Fri Jan 20 06:57:21 2012 (r230368) +++ head/lib/libdisk/libdisk.h Fri Jan 20 06:59:29 2012 (r230369) @@ -293,8 +293,6 @@ int Fixup_Names(struct disk *); int MakeDevChunk(const struct chunk *, const char *); __END_DECLS -#define dprintf printf - /* TODO * * Need an error string mechanism from the functions instead of warn() From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 07:01:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D791065674; Fri, 20 Jan 2012 07:01:59 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BFB78FC15; Fri, 20 Jan 2012 07:01:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K71wAF028692; Fri, 20 Jan 2012 07:01:58 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K71wNk028690; Fri, 20 Jan 2012 07:01:58 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201200701.q0K71wNk028690@svn.freebsd.org> From: David Schultz Date: Fri, 20 Jan 2012 07:01: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: r230370 - head/lib/msun/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 07:01:59 -0000 Author: das Date: Fri Jan 20 07:01:58 2012 New Revision: 230370 URL: http://svn.freebsd.org/changeset/base/230370 Log: Add a change I missed in r230367 (don't inline arm's fenv.h functions). Modified: head/lib/msun/arm/Makefile.inc Modified: head/lib/msun/arm/Makefile.inc ============================================================================== --- head/lib/msun/arm/Makefile.inc Fri Jan 20 06:59:29 2012 (r230369) +++ head/lib/msun/arm/Makefile.inc Fri Jan 20 07:01:58 2012 (r230370) @@ -1,5 +1,4 @@ # $FreeBSD$ -INCS += fenv-softfloat.h LDBL_PREC = 53 SYM_MAPS += ${.CURDIR}/arm/Symbol.map From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 07:02:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 431831065670; Fri, 20 Jan 2012 07:02:43 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 328778FC18; Fri, 20 Jan 2012 07:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K72hMg028750; Fri, 20 Jan 2012 07:02:43 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K72hLj028748; Fri, 20 Jan 2012 07:02:43 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201200702.q0K72hLj028748@svn.freebsd.org> From: David Schultz Date: Fri, 20 Jan 2012 07:02: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: r230371 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 07:02:43 -0000 Author: das Date: Fri Jan 20 07:02:42 2012 New Revision: 230371 URL: http://svn.freebsd.org/changeset/base/230371 Log: Fix a small nit noted by bde: exp_x should be of type float, not double. Modified: head/lib/msun/src/k_expf.c Modified: head/lib/msun/src/k_expf.c ============================================================================== --- head/lib/msun/src/k_expf.c Fri Jan 20 07:01:58 2012 (r230370) +++ head/lib/msun/src/k_expf.c Fri Jan 20 07:02:42 2012 (r230371) @@ -44,7 +44,7 @@ static const float kln2 = 162.88958740F static float __frexp_expf(float x, int *expt) { - double exp_x; + float exp_x; uint32_t hx; exp_x = expf(x - kln2); From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 07:29:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3E5B1065674; Fri, 20 Jan 2012 07:29:29 +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 932C38FC0C; Fri, 20 Jan 2012 07:29:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0K7TTiC029563; Fri, 20 Jan 2012 07:29:29 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K7TT6E029561; Fri, 20 Jan 2012 07:29:29 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201200729.q0K7TT6E029561@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 20 Jan 2012 07:29: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: r230372 - head/sbin/mount X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 07:29:29 -0000 Author: jh Date: Fri Jan 20 07:29:29 2012 New Revision: 230372 URL: http://svn.freebsd.org/changeset/base/230372 Log: - Clean up checkpath(). - Remove unneeded sysexits.h include. No functional change. Submitted by: bde Modified: head/sbin/mount/getmntopts.c Modified: head/sbin/mount/getmntopts.c ============================================================================== --- head/sbin/mount/getmntopts.c Fri Jan 20 07:02:42 2012 (r230371) +++ head/sbin/mount/getmntopts.c Fri Jan 20 07:29:29 2012 (r230372) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "mntopts.h" @@ -129,14 +128,12 @@ checkpath(const char *path, char *resolv { struct stat sb; - if (realpath(path, resolved) != NULL && stat(resolved, &sb) == 0) { - if (!S_ISDIR(sb.st_mode)) { - errno = ENOTDIR; - return (1); - } - } else + if (realpath(path, resolved) == NULL || stat(resolved, &sb) != 0) return (1); - + if (!S_ISDIR(sb.st_mode)) { + errno = ENOTDIR; + return (1); + } return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 08:04:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65630106566C; Fri, 20 Jan 2012 08:04:14 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id 917B68FC19; Fri, 20 Jan 2012 08:04:13 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id C74FA7F387D; Fri, 20 Jan 2012 08:55:51 +0100 (CET) Date: Fri, 20 Jan 2012 08:55:51 +0100 From: Roman Divacky To: David Schultz Message-ID: <20120120075551.GA28975@freebsd.org> References: <201201200657.q0K6vMhf028463@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201200657.q0K6vMhf028463@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: r230368 - head/tools/regression/usr.bin/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 08:04:14 -0000 http://llvm.org/bugs/show_bug.cgi?id=11406 says this has been fixed, is this just problem with us having older clang in base? On Fri, Jan 20, 2012 at 06:57:22AM +0000, David Schultz wrote: > Author: das > Date: Fri Jan 20 06:57:21 2012 > New Revision: 230368 > URL: http://svn.freebsd.org/changeset/base/230368 > > Log: > These tests check whether the compiler evaluates floating-point > expressions properly. Some of the tests depend on the compiler > implementing C99's FENV_ACCESS pragma, and only commercial compilers > do; those tests are currently skipped. If any of the enabled tests > fail, then odds are the libm regression tests will fail also. > This should make it easier to diagnose reported problems on platforms > I don't have. > > Currently, gcc passes all the tests that don't depend on FENV_ACCESS > on amd64 and sparc64. Clang fails a few on amd64 (see clang bug > 11406). Both gcc and clang fare poorly on i386, which has well-known > issues. > > Added: > head/tools/regression/usr.bin/cc/ > head/tools/regression/usr.bin/cc/Makefile (contents, props changed) > head/tools/regression/usr.bin/cc/float.c (contents, props changed) > head/tools/regression/usr.bin/cc/float.t (contents, props changed) > > Added: head/tools/regression/usr.bin/cc/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/regression/usr.bin/cc/Makefile Fri Jan 20 06:57:21 2012 (r230368) > @@ -0,0 +1,12 @@ > +# $FreeBSD$ > + > +TESTS= float > +CFLAGS+=-lm > + > +.PHONY: tests > +tests: ${TESTS} > + for p in ${TESTS}; do ${.OBJDIR}/$$p; done > + > +.PHONY: clean > +clean: > + -rm -f ${TESTS} > > Added: head/tools/regression/usr.bin/cc/float.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/regression/usr.bin/cc/float.c Fri Jan 20 06:57:21 2012 (r230368) > @@ -0,0 +1,271 @@ > +/*- > + * Copyright (c) 2012 David Schultz > + * 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. > + */ > + > +/* > + * Test that floating-point arithmetic works as specified by the C standard. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > + > +#ifdef __i386__ > +#include > +#endif > + > +#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ > + FE_OVERFLOW | FE_UNDERFLOW) > + > +#define TWICE(x) ((x) + (x)) > +#define test(desc, pass) test1((desc), (pass), 0) > +#define skiptest(desc, pass) test1((desc), (pass), 1) > + > +#pragma STDC FENV_ACCESS ON > + > +static const float one_f = 1.0 + FLT_EPSILON / 2; > +static const double one_d = 1.0 + DBL_EPSILON / 2; > +static const long double one_ld = 1.0L + LDBL_EPSILON / 2; > + > +static int testnum, failures; > + > +static void > +test1(const char *testdesc, int pass, int skip) > +{ > + > + testnum++; > + printf("%sok %d - %s%s\n", pass || skip ? "" : "not ", testnum, > + skip ? "(SKIPPED) " : "", testdesc); > + if (!pass && !skip) > + failures++; > +} > + > +/* > + * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. > + */ > +static int > +fpequal(long double d1, long double d2) > +{ > + > + if (d1 != d2) > + return (isnan(d1) && isnan(d2)); > + return (copysignl(1.0, d1) == copysignl(1.0, d2)); > +} > + > +void > +run_zero_opt_test(double d1, double d2) > +{ > + > + test("optimizations don't break the sign of 0", > + fpequal(d1 - d2, 0.0) > + && fpequal(-d1 + 0.0, 0.0) > + && fpequal(-d1 - d2, -0.0) > + && fpequal(-(d1 - d2), -0.0) > + && fpequal(-d1 - (-d2), 0.0)); > +} > + > +void > +run_inf_opt_test(double d) > +{ > + > + test("optimizations don't break infinities", > + fpequal(d / d, NAN) && fpequal(0.0 * d, NAN)); > +} > + > +static inline double > +todouble(long double ld) > +{ > + > + return (ld); > +} > + > +static inline float > +tofloat(double d) > +{ > + > + return (d); > +} > + > +void > +run_tests(void) > +{ > + volatile long double vld; > + long double ld; > + volatile double vd; > + double d; > + volatile float vf; > + float f; > + int x; > + > + test("sign bits", fpequal(-0.0, -0.0) && !fpequal(0.0, -0.0)); > + > + vd = NAN; > + test("NaN equality", fpequal(NAN, NAN) && NAN != NAN && vd != vd); > + > + feclearexcept(ALL_STD_EXCEPT); > + test("NaN comparison returns false", !(vd <= vd)); > + /* > + * XXX disabled; gcc/amd64 botches this IEEE 754 requirement by > + * emitting ucomisd instead of comisd. > + */ > + skiptest("FENV_ACCESS: NaN comparison raises invalid exception", > + fetestexcept(ALL_STD_EXCEPT) == FE_INVALID); > + > + vd = 0.0; > + run_zero_opt_test(vd, vd); > + > + vd = INFINITY; > + run_inf_opt_test(vd); > + > + feclearexcept(ALL_STD_EXCEPT); > + vd = INFINITY; > + x = (int)vd; > + /* XXX disabled (works with -O0); gcc doesn't support FENV_ACCESS */ > + skiptest("FENV_ACCESS: Inf->int conversion raises invalid exception", > + fetestexcept(ALL_STD_EXCEPT) == FE_INVALID); > + > + /* Raising an inexact exception here is an IEEE-854 requirement. */ > + feclearexcept(ALL_STD_EXCEPT); > + vd = 0.75; > + x = (int)vd; > + test("0.75->int conversion rounds toward 0, raises inexact exception", > + x == 0 && fetestexcept(ALL_STD_EXCEPT) == FE_INEXACT); > + > + feclearexcept(ALL_STD_EXCEPT); > + vd = -42.0; > + x = (int)vd; > + test("-42.0->int conversion is exact, raises no exception", > + x == -42 && fetestexcept(ALL_STD_EXCEPT) == 0); > + > + feclearexcept(ALL_STD_EXCEPT); > + x = (int)INFINITY; > + /* XXX disabled; gcc doesn't support FENV_ACCESS */ > + skiptest("FENV_ACCESS: const Inf->int conversion raises invalid", > + fetestexcept(ALL_STD_EXCEPT) == FE_INVALID); > + > + feclearexcept(ALL_STD_EXCEPT); > + x = (int)0.5; > + /* XXX disabled; gcc doesn't support FENV_ACCESS */ > + skiptest("FENV_ACCESS: const double->int conversion raises inexact", > + x == 0 && fetestexcept(ALL_STD_EXCEPT) == FE_INEXACT); > + > + test("compile-time constants don't have too much precision", > + one_f == 1.0L && one_d == 1.0L && one_ld == 1.0L); > + > + test("const minimum rounding precision", > + 1.0F + FLT_EPSILON != 1.0F && > + 1.0 + DBL_EPSILON != 1.0 && > + 1.0L + LDBL_EPSILON != 1.0L); > + > + /* It isn't the compiler's fault if this fails on FreeBSD/i386. */ > + vf = FLT_EPSILON; > + vd = DBL_EPSILON; > + vld = LDBL_EPSILON; > + test("runtime minimum rounding precision", > + 1.0F + vf != 1.0F && 1.0 + vd != 1.0 && 1.0L + vld != 1.0L); > + > + test("explicit float to float conversion discards extra precision", > + (float)(1.0F + FLT_EPSILON * 0.5F) == 1.0F && > + (float)(1.0F + vf * 0.5F) == 1.0F); > + test("explicit double to float conversion discards extra precision", > + (float)(1.0 + FLT_EPSILON * 0.5) == 1.0F && > + (float)(1.0 + vf * 0.5) == 1.0F); > + test("explicit ldouble to float conversion discards extra precision", > + (float)(1.0L + FLT_EPSILON * 0.5L) == 1.0F && > + (float)(1.0L + vf * 0.5L) == 1.0F); > + > + test("explicit double to double conversion discards extra precision", > + (double)(1.0 + DBL_EPSILON * 0.5) == 1.0 && > + (double)(1.0 + vd * 0.5) == 1.0); > + test("explicit ldouble to double conversion discards extra precision", > + (double)(1.0L + DBL_EPSILON * 0.5L) == 1.0 && > + (double)(1.0L + vd * 0.5L) == 1.0); > + > + /* > + * FLT_EVAL_METHOD > 1 implies that float expressions are always > + * evaluated in double precision or higher, but some compilers get > + * this wrong when registers spill to memory. The following expression > + * forces a spill when there are at most 8 FP registers. > + */ > + test("implicit promption to double or higher precision is consistent", > +#if FLT_EVAL_METHOD == 1 || FLT_EVAL_METHOD == 2 || defined(__i386__) > + TWICE(TWICE(TWICE(TWICE(TWICE( > + TWICE(TWICE(TWICE(TWICE(1.0F + vf * 0.5F))))))))) > + == (1.0 + FLT_EPSILON * 0.5) * 512.0 > +#else > + 1 > +#endif > + ); > + > + f = 1.0 + FLT_EPSILON * 0.5; > + d = 1.0L + DBL_EPSILON * 0.5L; > + test("const assignment discards extra precision", f == 1.0F && d == 1.0); > + > + f = 1.0 + vf * 0.5; > + d = 1.0L + vd * 0.5L; > + test("variable assignment discards explicit extra precision", > + f == 1.0F && d == 1.0); > + f = 1.0F + vf * 0.5F; > + d = 1.0 + vd * 0.5; > + test("variable assignment discards implicit extra precision", > + f == 1.0F && d == 1.0); > + > + test("return discards extra precision", > + tofloat(1.0 + vf * 0.5) == 1.0F && > + todouble(1.0L + vd * 0.5L) == 1.0); > + > + fesetround(FE_UPWARD); > + /* XXX disabled (works with -frounding-math) */ > + skiptest("FENV_ACCESS: constant arithmetic respects rounding mode", > + 1.0F + FLT_MIN == 1.0F + FLT_EPSILON && > + 1.0 + DBL_MIN == 1.0 + DBL_EPSILON && > + 1.0L + LDBL_MIN == 1.0L + LDBL_EPSILON); > + fesetround(FE_TONEAREST); > + > + ld = vld * 0.5; > + test("associativity is respected", > + 1.0L + ld + (LDBL_EPSILON * 0.5) == 1.0L && > + 1.0L + (LDBL_EPSILON * 0.5) + ld == 1.0L && > + ld + 1.0 + (LDBL_EPSILON * 0.5) == 1.0L && > + ld + (LDBL_EPSILON * 0.5) + 1.0 == 1.0L + LDBL_EPSILON); > +} > + > +int > +main(int argc, char *argv[]) > +{ > + > + printf("1..26\n"); > + > +#ifdef __i386__ > + fpsetprec(FP_PE); > +#endif > + run_tests(); > + > + return (failures); > +} > > Added: head/tools/regression/usr.bin/cc/float.t > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/regression/usr.bin/cc/float.t Fri Jan 20 06:57:21 2012 (r230368) > @@ -0,0 +1,10 @@ > +#!/bin/sh > +# $FreeBSD$ > + > +cd `dirname $0` > + > +executable=`basename $0 .t` > + > +make $executable 2>&1 > /dev/null > + > +exec ./$executable From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 10:06:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BA6E106566B; Fri, 20 Jan 2012 10:06:29 +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 EEF3C8FC14; Fri, 20 Jan 2012 10:06:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KA6Sje034786; Fri, 20 Jan 2012 10:06:28 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KA6SHZ034784; Fri, 20 Jan 2012 10:06:28 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201201006.q0KA6SHZ034784@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 20 Jan 2012 10:06: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: r230373 - head/sbin/mount X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 10:06:29 -0000 Author: jh Date: Fri Jan 20 10:06:28 2012 New Revision: 230373 URL: http://svn.freebsd.org/changeset/base/230373 Log: Change mount_fs() to not exit on error. The "failok" mount option requires that errors are passed to the caller. PR: 163668 Reviewed by: Garrett Cooper Modified: head/sbin/mount/mount_fs.c Modified: head/sbin/mount/mount_fs.c ============================================================================== --- head/sbin/mount/mount_fs.c Fri Jan 20 07:29:29 2012 (r230372) +++ head/sbin/mount/mount_fs.c Fri Jan 20 10:06:28 2012 (r230373) @@ -82,7 +82,6 @@ mount_fs(const char *vfstype, int argc, char fstype[32]; char errmsg[255]; char *p, *val; - int ret; strlcpy(fstype, vfstype, sizeof(fstype)); memset(errmsg, 0, sizeof(errmsg)); @@ -128,10 +127,10 @@ mount_fs(const char *vfstype, int argc, build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); build_iovec(&iov, &iovlen, "from", dev, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - - ret = nmount(iov, iovlen, mntflags); - if (ret < 0) - err(1, "%s %s", dev, errmsg); - return (ret); + if (nmount(iov, iovlen, mntflags) == -1) { + warn("%s: %s", dev, errmsg); + return (1); + } + return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 10:31:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9D24106564A; Fri, 20 Jan 2012 10:31:27 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D48148FC08; Fri, 20 Jan 2012 10:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KAVRSm035831; Fri, 20 Jan 2012 10:31:27 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KAVRoc035829; Fri, 20 Jan 2012 10:31:27 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201201031.q0KAVRoc035829@svn.freebsd.org> From: Doug Barton Date: Fri, 20 Jan 2012 10:31: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: r230374 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 10:31:28 -0000 Author: dougb Date: Fri Jan 20 10:31:27 2012 New Revision: 230374 URL: http://svn.freebsd.org/changeset/base/230374 Log: If we're booting there is no need to waste time determining if the service is running or not. PR: conf/150752 Submitted by: YIN Xiaofeng <75394094@qq.com> Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Fri Jan 20 10:06:28 2012 (r230373) +++ head/etc/rc.subr Fri Jan 20 10:31:27 2012 (r230374) @@ -641,7 +641,7 @@ run_rc_command() fi fi - eval $_pidcmd # determine the pid if necessary + [ -z "$autoboot" ] && eval $_pidcmd # determine the pid if necessary for _elem in $_keywords; do if [ "$_elem" != "$rc_arg" ]; then From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 11:06:07 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B41C1065674; Fri, 20 Jan 2012 11:06:07 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id A4CF48FC0C; Fri, 20 Jan 2012 11:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=V2H1TfaMa2ZpsShGasOgse9LVcSpL+FM3PcJenMGhMk=; b=nxHRAi6WwKPnEeACqawNIOI4qG9mUSzGxBhxk54KiaDvTO0eWjJmZH8sUts/E9iu38Ev2Zj5R7gIqUoIXjtPkD3Vx/2uWKzIm3iM4ipJ6kmf/sdTuY1rk+iDiYaD9C7rN9PW4luPuF6QQlPSvVEKY73T4aIjjyusNd8N0CPHMSKYV0it0u1kATpnH7FStTKcVGX1oopO0Vu2+uzdovHCtNEzGVPf4TjbvnQpr/jHxOzqDN2pU5aAGgIUUC2ur+1GjEiIyZx4WN3LisROpDIJxLKPDYYn9VjX8qAyCnNhOI3PGq/dKXqwfGafP4oELUROKcKwBJAxAQeg44fJcT+hjQ==; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1RoCIH-0008gj-Dy; Fri, 20 Jan 2012 14:06:05 +0300 Date: Fri, 20 Jan 2012 15:06:02 +0400 From: Eygene Ryabinkin To: Brooks Davis Message-ID: <7dcvawMgnE9O34bJ7H3SrdYasTs@HbohoBmewgxm0atwUoKO7zhAAgw> References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201120748.28564.jhb@freebsd.org> <201201121438.16674.jhb@freebsd.org> <20120119172759.GC60214@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Uwl7UQhJk99r8jnw" Content-Disposition: inline In-Reply-To: <20120119172759.GC60214@lor.one-eyed-alien.net> Sender: rea@codelabs.ru Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 11:06:07 -0000 --Uwl7UQhJk99r8jnw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thu, Jan 19, 2012 at 11:27:59AM -0600, Brooks Davis wrote: > On Fri, Jan 13, 2012 at 11:21:48AM +0400, Eygene Ryabinkin wrote: > > The related topic: in the process of grepping for dhclient within > > /etc, I had found that /etc/netstart still wants to invoke it. But it > > will do a lone '/etc/rc.d/dhclient quietstart' and this will never > > be useful in the current state of dhclient: it will refuse to process > > any commands without the interface being specified. And since we > > have the invocation of /etc/rc.d/netif just two lines above, I think > > that it will be good to remove call to dhclient from /etc/netstart. [...] >=20 > Removing it from /etc/netstart is the right thing to do. Will do it today. > Arguably it should be moved to /libexec since it's not an rc.d > script and simply uses the framework because it had similar needs Well, I fear that some user scripts may rely on the dhclient path to be /etc/rc.d/dhclient, so such a change could lead to the POLA violation. So, all pros and cons of such a change should be carefully weighted. What is the gain from moving it to /libexec apart from avoiding pollution of /etc/rc.d by non-rc.d scripts? It is a good thing to have for the clear design, but having dhclient in /etc/rc.d has no effect on the boot process, since it is marked 'nostart' and it allows people to use 'service dhclient restart $if' without hacking the service to still allow to use this command. We can, of course, move it to /libexec/rc.d/ and add this path to the local_startup, but I doubt that this approach will give any real gain, though I can be missing some important points. --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --Uwl7UQhJk99r8jnw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk8ZSpoACgkQFq+eroFS7PsM9QD/TlfxrPer4UoXt/WjC1Ez2qUM z4uWjMpRLGzUCJfzzHoA/jdcmHHjORdPq5NPY2/R/AB07/uZEguSbXZFRRbrTDcl =eaQT -----END PGP SIGNATURE----- --Uwl7UQhJk99r8jnw-- From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 11:42:03 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07101106564A; Fri, 20 Jan 2012 11:42:03 +0000 (UTC) (envelope-from theraven@theravensnest.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 9283E8FC08; Fri, 20 Jan 2012 11:42:02 +0000 (UTC) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com [82.20.153.2]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id q0KBEoLh011123 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 20 Jan 2012 11:16:02 GMT (envelope-from theraven@theravensnest.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: David Chisnall In-Reply-To: <4F18B951.6080404@gmail.com> Date: Fri, 20 Jan 2012 11:14:45 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <4F178CDC.3030807@gmail.com> <4F17B0DE.3060008@gmail.com> <201201191023.28426.jhb@freebsd.org> <20120120030456.O1411@besplex.bde.org> <4F18B951.6080404@gmail.com> To: davidxu@FreeBSD.org X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin , Bruce Evans Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 11:42:03 -0000 On 20 Jan 2012, at 00:46, David Xu wrote: > It depends on hardware, if it is a large machine with lots of cpu, > a small conflict on dual-core machine can become a large conflict > on large machine because it is possible more cpus are now > running same code which becomes a bottleneck. On a large machine > which has 1024 cores, many code need to be redesigned. You'll also find that the relative cost of atomic instructions varies a = lot between CPU models. Between Core 2 and Sandy Bridge Core i7, the = relative cost of an atomic add (full barrier) dropped by about two = thirds. The cache coherency logic has been significantly improved on = the newer chips. =20 For portable code, it's worth remembering that ARMv8 (which doesn't = entirely exist yet) contains a set of barriers that closely match the = semantics of the C[++]11 memory ordering. They do this not for = performance (directly), but for power efficiency - so using the = least-restrictive required locking will eventually result in code for = mobile devices that uses less battery power, if it's in a hot path. =20 David= From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 12:59:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEF86106566B; Fri, 20 Jan 2012 12:59: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 99F5D8FC19; Fri, 20 Jan 2012 12:59:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KCxCc6042588; Fri, 20 Jan 2012 12:59:12 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KCxClE042586; Fri, 20 Jan 2012 12:59:12 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201201259.q0KCxClE042586@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 20 Jan 2012 12:59: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: r230377 - head/sbin/mount X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 12:59:12 -0000 Author: jh Date: Fri Jan 20 12:59:12 2012 New Revision: 230377 URL: http://svn.freebsd.org/changeset/base/230377 Log: Don't print the nmount(2) provided error message if it is empty. Modified: head/sbin/mount/mount_fs.c Modified: head/sbin/mount/mount_fs.c ============================================================================== --- head/sbin/mount/mount_fs.c Fri Jan 20 12:52:38 2012 (r230376) +++ head/sbin/mount/mount_fs.c Fri Jan 20 12:59:12 2012 (r230377) @@ -129,7 +129,10 @@ mount_fs(const char *vfstype, int argc, build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); if (nmount(iov, iovlen, mntflags) == -1) { - warn("%s: %s", dev, errmsg); + if (*errmsg != '\0') + warn("%s: %s", dev, errmsg); + else + warn("%s", dev); return (1); } return (0); From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 13:21:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7ADE106564A; Fri, 20 Jan 2012 13:21:01 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 0BE008FC14; Fri, 20 Jan 2012 13:21:01 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 829F025D37C3; Fri, 20 Jan 2012 13:20:59 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 913CDBD994A; Fri, 20 Jan 2012 13:20:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 0Q8dBHs-699J; Fri, 20 Jan 2012 13:20:57 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id DA402BD9949; Fri, 20 Jan 2012 13:20:56 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201201200616.q0K6GEwT026852@svn.freebsd.org> Date: Fri, 20 Jan 2012 13:20:55 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <5F82639B-ACD9-493B-8F91-FE6F5BAD8B35@lists.zabbadoz.net> References: <201201200616.q0K6GEwT026852@svn.freebsd.org> To: David Schultz X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230363 - in head/lib/libc/softfloat: . bits32 bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 13:21:01 -0000 On 20. Jan 2012, at 06:16 , David Schultz wrote: > Author: das > Date: Fri Jan 20 06:16:14 2012 > New Revision: 230363 > URL: http://svn.freebsd.org/changeset/base/230363 >=20 > Log: > Merge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the > original vendor, but we're using their heavily modified version.) > This brings in functions for long double emulation (both extended and > quad formats), which may be useful for testing, and also for = replacing > libc/sparc64/fpu/. >=20 > Added: > head/lib/libc/softfloat/eqtf2.c (contents, props changed) > head/lib/libc/softfloat/getf2.c (contents, props changed) > head/lib/libc/softfloat/gexf2.c (contents, props changed) > head/lib/libc/softfloat/gttf2.c (contents, props changed) > head/lib/libc/softfloat/gtxf2.c (contents, props changed) > head/lib/libc/softfloat/letf2.c (contents, props changed) > head/lib/libc/softfloat/lttf2.c (contents, props changed) > head/lib/libc/softfloat/negtf2.c (contents, props changed) > head/lib/libc/softfloat/negxf2.c (contents, props changed) > head/lib/libc/softfloat/netf2.c (contents, props changed) > head/lib/libc/softfloat/nexf2.c (contents, props changed) > Modified: > head/lib/libc/softfloat/Makefile.inc > head/lib/libc/softfloat/bits32/softfloat-macros > head/lib/libc/softfloat/bits64/softfloat-macros > head/lib/libc/softfloat/bits64/softfloat.c > head/lib/libc/softfloat/softfloat-for-gcc.h > head/lib/libc/softfloat/softfloat-source.txt > head/lib/libc/softfloat/softfloat-specialize > head/lib/libc/softfloat/softfloat.txt I assume it's been this commit... mips.mips64eb buildworld failed, check _.mips.mips64eb.buildworld for = details mips.mipseb buildworld failed, check _.mips.mipseb.buildworld for = details mips.mipsn32eb buildworld failed, check _.mips.mipsn32eb.buildworld for = details mips.mipsel buildworld failed, check _.mips.mipsel.buildworld for = details mips.mips64el buildworld failed, check _.mips.mips64el.buildworld for = details = _.mips.mips64eb.buildworld:/scratch/tmp/bz/obj//mips.mips64eb/scratch/tmp/= bz/head.svn/tmp/usr/lib/libc.a(softfloat.o): In function = `__floatunsidf': _.mips.mips64eb.buildworld:softfloat.c:(.text+0x1440): multiple = definition of `__floatunsidf' = _.mips.mips64eb.buildworld:/scratch/tmp/bz/obj//mips.mips64eb/scratch/tmp/= bz/head.svn/tmp/usr/lib/libgcc.a(floatunsidf.o):floatunsidf.c:(.text+0x0):= first defined here = _.mips.mips64el.buildworld:/scratch/tmp/bz/obj//mips.mips64el/scratch/tmp/= bz/head.svn/tmp/usr/lib/libc.a(softfloat.o): In function = `__floatunsidf': _.mips.mips64el.buildworld:softfloat.c:(.text+0x1440): multiple = definition of `__floatunsidf' = _.mips.mips64el.buildworld:/scratch/tmp/bz/obj//mips.mips64el/scratch/tmp/= bz/head.svn/tmp/usr/lib/libgcc.a(floatunsidf.o):floatunsidf.c:(.text+0x0):= first defined here = _.mips.mipseb.buildworld:/scratch/tmp/bz/obj//mips.mipseb/scratch/tmp/bz/h= ead.svn/tmp/usr/lib/libc.a(softfloat.o): In function `__floatunsidf': _.mips.mipseb.buildworld:softfloat.c:(.text+0x1b1c): multiple definition = of `__floatunsidf' = _.mips.mipseb.buildworld:/scratch/tmp/bz/obj//mips.mipseb/scratch/tmp/bz/h= ead.svn/tmp/usr/lib/libgcc.a(floatunsidf.o):floatunsidf.c:(.text+0x0): = first defined here = _.mips.mipsel.buildworld:/scratch/tmp/bz/obj//mips.mipsel/scratch/tmp/bz/h= ead.svn/tmp/usr/lib/libc.a(softfloat.o): In function `__floatunsidf': _.mips.mipsel.buildworld:softfloat.c:(.text+0x1b10): multiple definition = of `__floatunsidf' = _.mips.mipsel.buildworld:/scratch/tmp/bz/obj//mips.mipsel/scratch/tmp/bz/h= ead.svn/tmp/usr/lib/libgcc.a(floatunsidf.o):floatunsidf.c:(.text+0x0): = first defined here = _.mips.mipsn32eb.buildworld:/scratch/tmp/bz/obj//mips.mipsn32eb/scratch/tm= p/bz/head.svn/tmp/usr/lib/libc.a(softfloat.o): In function = `__floatunsidf': _.mips.mipsn32eb.buildworld:softfloat.c:(.text+0x1368): multiple = definition of `__floatunsidf' = _.mips.mipsn32eb.buildworld:/scratch/tmp/bz/obj//mips.mipsn32eb/scratch/tm= p/bz/head.svn/tmp/usr/lib/libgcc.a(floatunsidf.o):floatunsidf.c:(.text+0x0= ): first defined here Could you please investigate? /bz --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 13:26:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 093511065678; Fri, 20 Jan 2012 13:26:12 +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 E7C368FC1A; Fri, 20 Jan 2012 13:26:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KDQBJI043566; Fri, 20 Jan 2012 13:26:11 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KDQBsZ043564; Fri, 20 Jan 2012 13:26:11 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201201326.q0KDQBsZ043564@svn.freebsd.org> From: Michael Tuexen Date: Fri, 20 Jan 2012 13:26: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: r230379 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 13:26:12 -0000 Author: tuexen Date: Fri Jan 20 13:26:11 2012 New Revision: 230379 URL: http://svn.freebsd.org/changeset/base/230379 Log: Fix a problem when using the CBAPI. While there, remove an old comment which does not apply anymore. Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Jan 20 13:10:40 2012 (r230378) +++ head/sys/netinet/sctp_input.c Fri Jan 20 13:26:11 2012 (r230379) @@ -1024,12 +1024,11 @@ sctp_handle_shutdown_ack(struct sctp_shu sctp_send_shutdown_complete(stcb, net, 0); /* notify upper layer protocol */ if (stcb->sctp_socket) { - sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - /* Set the connected flag to disconnected */ stcb->sctp_socket->so_snd.sb_cc = 0; } + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 14:05:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FF67106566B; Fri, 20 Jan 2012 14:05:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) 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 192FC8FC0A; Fri, 20 Jan 2012 14:05:00 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:8a:1f4c:2188:3a23] (unknown [IPv6:2001:7b8:3a7:0:8a:1f4c:2188:3a23]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4C7535C37; Fri, 20 Jan 2012 15:04:58 +0100 (CET) Message-ID: <4F19748F.3010906@FreeBSD.org> Date: Fri, 20 Jan 2012 15:05:03 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: Roman Divacky References: <201201200657.q0K6vMhf028463@svn.freebsd.org> <20120120075551.GA28975@freebsd.org> In-Reply-To: <20120120075551.GA28975@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, David Schultz , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230368 - head/tools/regression/usr.bin/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 14:05:00 -0000 On 2012-01-20 08:55, Roman Divacky wrote: > http://llvm.org/bugs/show_bug.cgi?id=11406 says this has been > fixed, is this just problem with us having older clang in base? Obviously, it has only been fixed in llvm trunk. If this is a pressing problem, we can backport the fix. Otherwise, it will be fixed when we import a more recent snapshot. From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 14:44:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 523F11065670; Fri, 20 Jan 2012 14:44:22 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0B48FC08; Fri, 20 Jan 2012 14:44:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KEiMdG046084; Fri, 20 Jan 2012 14:44:22 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KEiMC8046082; Fri, 20 Jan 2012 14:44:22 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201201444.q0KEiMC8046082@svn.freebsd.org> From: David Schultz Date: Fri, 20 Jan 2012 14:44: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: r230380 - head/lib/libc/softfloat/bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 14:44:22 -0000 Author: das Date: Fri Jan 20 14:44:21 2012 New Revision: 230380 URL: http://svn.freebsd.org/changeset/base/230380 Log: Conditionalize the __floatunsisf and __floatunsidf functions, added in NetBSD's rev 1.6 of this file, on !defined(SOFTFLOAT_FOR_GCC). These functions are provided by libgcc, so we don't need them. This should unbreak mips. Modified: head/lib/libc/softfloat/bits64/softfloat.c Modified: head/lib/libc/softfloat/bits64/softfloat.c ============================================================================== --- head/lib/libc/softfloat/bits64/softfloat.c Fri Jan 20 13:26:11 2012 (r230379) +++ head/lib/libc/softfloat/bits64/softfloat.c Fri Jan 20 14:44:21 2012 (r230380) @@ -1126,6 +1126,7 @@ float32 int32_to_float32( int32 a ) } +#ifndef SOFTFLOAT_FOR_GCC /* __floatunsisf is in libgcc */ float32 uint32_to_float32( uint32 a ) { if ( a == 0 ) return 0; @@ -1133,6 +1134,7 @@ float32 uint32_to_float32( uint32 a ) return normalizeRoundAndPackFloat32( 0, 0x9D, a >> 1 ); return normalizeRoundAndPackFloat32( 0, 0x9C, a ); } +#endif /* @@ -1158,6 +1160,7 @@ float64 int32_to_float64( int32 a ) } +#ifndef SOFTFLOAT_FOR_GCC /* __floatunsidf is in libgcc */ float64 uint32_to_float64( uint32 a ) { int8 shiftCount; @@ -1168,6 +1171,7 @@ float64 uint32_to_float64( uint32 a ) return packFloat64( 0, 0x432 - shiftCount, zSig< Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 097C8106564A; Fri, 20 Jan 2012 14:52:48 +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 D01DF8FC14; Fri, 20 Jan 2012 14:52:47 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 858A746B06; Fri, 20 Jan 2012 09:52:47 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C75D6B926; Fri, 20 Jan 2012 09:52:46 -0500 (EST) From: John Baldwin To: David Schultz Date: Fri, 20 Jan 2012 07:53:13 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201200616.q0K6GEwT026852@svn.freebsd.org> <20120120065006.GA80490@zim.MIT.EDU> In-Reply-To: <20120120065006.GA80490@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201200753.13232.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 20 Jan 2012 09:52:46 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230363 - in head/lib/libc/softfloat: . bits32 bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 14:52:48 -0000 On Friday, January 20, 2012 1:50:06 am David Schultz wrote: > On Fri, Jan 20, 2012, David Schultz wrote: > > Merge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the > > original vendor, but we're using their heavily modified version.) > > This brings in functions for long double emulation (both extended and > > quad formats), which may be useful for testing, and also for replacing > > libc/sparc64/fpu/. > > I'd appreciate it if an svn guru could let me know if anything > needs to be done to record the fact that this is a merged copy of > /vendor/NetBSD/softfloat/dist@230364. `svn merge --record-only $url' > didn't do anything, I'm guessing because there's no history yet. > The previous libc/softfloat sources were a mishmash, so I didn't try > to recreate any merge history for those. Did you use 'svn cp' to add the bits in from the vendor tree? If so, there's no need to do an record-only merge. In general we only need to do record-only merge to bootstrap mergeinfo when doing the first merge for a vendor tree after the CVS -> SVN conversion. For new vendor sources that are 'svn cp'd from the vendor area, SVN will just DTRT from the start. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 14:52:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE7981065670; Fri, 20 Jan 2012 14:52:50 +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 7EFE58FC1F; Fri, 20 Jan 2012 14:52:50 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 35B3846B0C; Fri, 20 Jan 2012 09:52:50 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2299DB9A1; Fri, 20 Jan 2012 09:52:49 -0500 (EST) From: John Baldwin To: davidxu@freebsd.org Date: Fri, 20 Jan 2012 08:29:12 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201160615.q0G6FE9r019542@svn.freebsd.org> <201201191023.28426.jhb@freebsd.org> <4F18B711.9000406@gmail.com> In-Reply-To: <4F18B711.9000406@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201200829.12616.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 20 Jan 2012 09:52:49 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230201 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 14:52:50 -0000 On Thursday, January 19, 2012 7:36:33 pm David Xu wrote: > On 2012/1/19 23:23, John Baldwin wrote: > > On Thursday, January 19, 2012 12:57:50 am David Xu wrote: > >> rdtsc() may not work on SMP, so I have updated it to use clock_gettime > >> to get total time. > >> http://people.freebsd.org/~davidxu/bench/semaphore2/ > >> > >> > >> Still, lfence is a lot faster than atomic lock. > > http://www.freebsd.org/~jhb/patches/amd64_fence.patch > > > > This the patch I've had for quite a while. Can you retest with this? You'll > > probably have to install the updated header in /usr/include as well. > > > The lines in atomic_load_acq() seem not what I want: > > + v = *p; \ > + __asm __volatile("lfence" ::: "memory"); \ > > I think they should be swapped ? No, the point is that any subsequent loads cannot pass the '*p'. If you swap the order, then the compiler (and CPU) are free to reorder '*p' to be later than some other load later in program order. > + __asm __volatile("lfence" ::: "memory"); \ > + v = *p; \ > > What I need in the semaphore code is read can not pass write in such a special case. Hmm, it seems you need the equivalent of an 'mfence'. Note that for your first change in your diff, it should not have made a difference on x86. atomic_add_rel_int() already has the equivalent of an 'mfence' (on x86 the non-load/store ops all end up with full fences since that is what 'lock' provides, the architecture doesn't let us do more fine-grained barriers). It may be that you still have a race and that the barrier just changed the timing enough to fix your test case. Specifically, note that an 'rmb' (or 'lfence') does not force other CPUs to flush any pending writes, or wait for other CPUs to flush pending writes. Even with the lfence, you can still read a "stale" value of _has_waiters. This is why in-kernel locking primitives encode this state in the lock cookie via contested flags and use cmpset's to set them (and retry the loop if the cmpset fails). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 14:53:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B494F106598A; Fri, 20 Jan 2012 14:53:15 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id D6A778FC13; Fri, 20 Jan 2012 14:53:05 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0KEr5lw012018; Fri, 20 Jan 2012 09:53:05 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0KEr50x012011; Fri, 20 Jan 2012 09:53:05 -0500 (EST) (envelope-from das@freebsd.org) Date: Fri, 20 Jan 2012 09:53:05 -0500 From: David Schultz To: "Bjoern A. Zeeb" Message-ID: <20120120145305.GA306@zim.MIT.EDU> Mail-Followup-To: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201200616.q0K6GEwT026852@svn.freebsd.org> <5F82639B-ACD9-493B-8F91-FE6F5BAD8B35@lists.zabbadoz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5F82639B-ACD9-493B-8F91-FE6F5BAD8B35@lists.zabbadoz.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230363 - in head/lib/libc/softfloat: . bits32 bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 14:53:15 -0000 On Fri, Jan 20, 2012, Bjoern A. Zeeb wrote: > I assume it's been this commit... > > mips.mips64eb buildworld failed, check _.mips.mips64eb.buildworld for details > mips.mipseb buildworld failed, check _.mips.mipseb.buildworld for details > mips.mipsn32eb buildworld failed, check _.mips.mipsn32eb.buildworld for details > mips.mipsel buildworld failed, check _.mips.mipsel.buildworld for details > mips.mips64el buildworld failed, check _.mips.mips64el.buildworld for details > > _.mips.mips64eb.buildworld:/scratch/tmp/bz/obj//mips.mips64eb/scratch/tmp/bz/head.svn/tmp/usr/lib/libc.a(softfloat.o): In function `__floatunsidf': Yep, sorry about that, and thanks for your vigilance. That code is used by mips and arm, and thanks to Murphy's Law, I did a full build of the one that didn't break. I can't tell from the log excerpt exactly where the build failed, but it should be fixed in r230380. I'm still waiting for a buildworld to complete. From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 15:01:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A7A3106566C; Fri, 20 Jan 2012 15:01:45 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 05D1E8FC15; Fri, 20 Jan 2012 15:01:44 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0KF1i6U035276; Fri, 20 Jan 2012 10:01:44 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0KF1imL035275; Fri, 20 Jan 2012 10:01:44 -0500 (EST) (envelope-from das@freebsd.org) Date: Fri, 20 Jan 2012 10:01:44 -0500 From: David Schultz To: Dimitry Andric Message-ID: <20120120150144.GB306@zim.MIT.EDU> Mail-Followup-To: Dimitry Andric , Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201200657.q0K6vMhf028463@svn.freebsd.org> <20120120075551.GA28975@freebsd.org> <4F19748F.3010906@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F19748F.3010906@FreeBSD.org> Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230368 - head/tools/regression/usr.bin/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 15:01:45 -0000 On Fri, Jan 20, 2012, Dimitry Andric wrote: > On 2012-01-20 08:55, Roman Divacky wrote: > >http://llvm.org/bugs/show_bug.cgi?id=11406 says this has been > >fixed, is this just problem with us having older clang in base? > > Obviously, it has only been fixed in llvm trunk. If this is a pressing > problem, we can backport the fix. Otherwise, it will be fixed when we > import a more recent snapshot. It isn't a pressing issue. The test was failing due to an even more basic bug than the one I was trying to test; adding two constants was producing the wrong answer. Therefore, I can't confirm that the test now passes, but they did fix *a* bug. By the way, having dealt with gcc bugs in the past, I found reporting a clang bug to be an unexpectedly pleasant experience. From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 15:20:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B121065674 for ; Fri, 20 Jan 2012 15:20:31 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [93.89.92.32]) by mx1.freebsd.org (Postfix) with ESMTP id E44B68FC26 for ; Fri, 20 Jan 2012 15:20:30 +0000 (UTC) Received: from uucp by gromit.grondar.org with local-rmail (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RoGBG-000EZ4-RY for svn-src-head@freebsd.org; Fri, 20 Jan 2012 15:15:06 +0000 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1RoG98-000DiP-0Y; Fri, 20 Jan 2012 15:12:54 +0000 To: Andrey Chernov In-reply-to: <20120120055823.GA28177@vniz.net> References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> <20120120055823.GA28177@vniz.net> From: Mark Murray From: Mark Murray Date: Fri, 20 Jan 2012 15:12:53 +0000 Message-Id: Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 15:20:31 -0000 Andrey Chernov writes: > > Look at the function random_yarrow_unblock(). Thats where yopu want to > > be doing this. This function is where the random device is unblocked > > once safely seeded. > > Thanx for your hint, but I fear one moment using random_yarrow_unblock(). > It is called under mtx_lock(&random_reseed_mtx) in reseed(). > And when arc4rand() seeding is called, it uses read_random(), so I see > possible deadlock can happens. The usual way round this is with a flag. Set a static, volatile flag, defaulting "off", and set it to "on" when the seeding has happened. Then arc4random() can do the right thing, depending on this flag. > In my version arc4rand() seeding happens only when this lock is released, > so no blocking is possible. Sure, but the dependancies created are problematic in their own right. M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 17:04:44 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8674C106564A; Fri, 20 Jan 2012 17:04:44 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 947E28FC0C; Fri, 20 Jan 2012 17:04:42 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id q0KH3eWa087278; Fri, 20 Jan 2012 11:03:40 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id q0KH3eYd087277; Fri, 20 Jan 2012 11:03:40 -0600 (CST) (envelope-from brooks) Date: Fri, 20 Jan 2012 11:03:40 -0600 From: Brooks Davis To: Eygene Ryabinkin Message-ID: <20120120170340.GD87047@lor.one-eyed-alien.net> References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201120748.28564.jhb@freebsd.org> <201201121438.16674.jhb@freebsd.org> <20120119172759.GC60214@lor.one-eyed-alien.net> <7dcvawMgnE9O34bJ7H3SrdYasTs@HbohoBmewgxm0atwUoKO7zhAAgw> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xB0nW4MQa6jZONgY" Content-Disposition: inline In-Reply-To: <7dcvawMgnE9O34bJ7H3SrdYasTs@HbohoBmewgxm0atwUoKO7zhAAgw> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 17:04:44 -0000 --xB0nW4MQa6jZONgY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 20, 2012 at 03:06:02PM +0400, Eygene Ryabinkin wrote: > Thu, Jan 19, 2012 at 11:27:59AM -0600, Brooks Davis wrote: > > Arguably it should be moved to /libexec since it's not an rc.d > > script and simply uses the framework because it had similar needs >=20 > Well, I fear that some user scripts may rely on the dhclient path > to be /etc/rc.d/dhclient, so such a change could lead to the POLA > violation. So, all pros and cons of such a change should be carefully > weighted. What is the gain from moving it to /libexec apart from > avoiding pollution of /etc/rc.d by non-rc.d scripts? It is a good > thing to have for the clear design, but having dhclient in /etc/rc.d > has no effect on the boot process, since it is marked 'nostart' and > it allows people to use 'service dhclient restart $if' without hacking > the service to still allow to use this command. We can, of course, > move it to /libexec/rc.d/ and add this path to the local_startup, but > I doubt that this approach will give any real gain, though I can be > missing some important points. That's basically why I didn't move it in the first place. It's clearly in the wrong place, but people will expect it there so there isn't much point in moving it. -- Brooks --xB0nW4MQa6jZONgY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFPGZ5rXY6L6fI4GtQRAgdiAJ4qj0iTTyE6LoVE560pUjnoFzW9hwCcCErw ce9DsyPJpJC1zAM4vN/99SY= =PCJs -----END PGP SIGNATURE----- --xB0nW4MQa6jZONgY-- From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 17:18:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C1A106566B; Fri, 20 Jan 2012 17:18:55 +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 0115E8FC0C; Fri, 20 Jan 2012 17:18:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KHIsqg051149; Fri, 20 Jan 2012 17:18:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KHIsii051147; Fri, 20 Jan 2012 17:18:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201201718.q0KHIsii051147@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 20 Jan 2012 17:18: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: r230387 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 17:18:55 -0000 Author: bz Date: Fri Jan 20 17:18:54 2012 New Revision: 230387 URL: http://svn.freebsd.org/changeset/base/230387 Log: Remove a superfluous INET6 check (no opt_inet6.h included anyway). MFC after: 3 days Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Jan 20 16:34:14 2012 (r230386) +++ head/sys/netinet/if_ether.c Fri Jan 20 17:18:54 2012 (r230387) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET) || defined(INET6) +#if defined(INET) #include #endif From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 17:19:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2ED7106566B; Fri, 20 Jan 2012 17:19:50 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADEF18FC20; Fri, 20 Jan 2012 17:19:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KHJoxY051212; Fri, 20 Jan 2012 17:19:50 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KHJoii051210; Fri, 20 Jan 2012 17:19:50 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201201201719.q0KHJoii051210@svn.freebsd.org> From: Eygene Ryabinkin Date: Fri, 20 Jan 2012 17:19: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: r230388 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 17:19:50 -0000 Author: rea (ports committer) Date: Fri Jan 20 17:19:50 2012 New Revision: 230388 URL: http://svn.freebsd.org/changeset/base/230388 Log: dhclient: don't use syslog for logging non-DHCP interface errors We should show the error to user, but it doesn't deserve syslog. Approved by: jhb Modified: head/etc/rc.d/dhclient Modified: head/etc/rc.d/dhclient ============================================================================== --- head/etc/rc.d/dhclient Fri Jan 20 17:18:54 2012 (r230387) +++ head/etc/rc.d/dhclient Fri Jan 20 17:19:50 2012 (r230388) @@ -25,11 +25,11 @@ dhclient_pre_check() local msg msg="'$ifn' is not a DHCP-enabled interface" if [ -z "${rc_quiet}" ]; then - err 1 "$msg" + echo "$msg" else debug "$msg" - exit 1 fi + exit 1 fi } From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 17:25:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF942106567A; Fri, 20 Jan 2012 17:25:15 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BABA98FC19; Fri, 20 Jan 2012 17:25:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KHPFqT051429; Fri, 20 Jan 2012 17:25:15 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KHPFhg051427; Fri, 20 Jan 2012 17:25:15 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201201201725.q0KHPFhg051427@svn.freebsd.org> From: Eygene Ryabinkin Date: Fri, 20 Jan 2012 17:25: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: r230389 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 17:25:16 -0000 Author: rea (ports committer) Date: Fri Jan 20 17:25:15 2012 New Revision: 230389 URL: http://svn.freebsd.org/changeset/base/230389 Log: /etc/netstart: remove invocation of dhclient dhclient is no longer a real service, it is a helper script for /etc/rc.d/netif and devd. Its direct invocation isn't needed to bring the network up. Approved by: jhb Modified: head/etc/netstart Modified: head/etc/netstart ============================================================================== --- head/etc/netstart Fri Jan 20 17:19:50 2012 (r230388) +++ head/etc/netstart Fri Jan 20 17:25:15 2012 (r230389) @@ -52,7 +52,6 @@ _start=quietstart # . /etc/rc.d/atm3.sh ${_start} /etc/rc.d/netif ${_start} /etc/rc.d/ipsec ${_start} -/etc/rc.d/dhclient ${_start} /etc/rc.d/ppp ${_start} /etc/rc.d/ipfw ${_start} /etc/rc.d/routing ${_start} From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 18:11:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5B77106564A; Fri, 20 Jan 2012 18:11:09 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 855A68FC0C; Fri, 20 Jan 2012 18:11:09 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0KIB86Q039790; Fri, 20 Jan 2012 13:11:08 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0KIB8pH039789; Fri, 20 Jan 2012 13:11:08 -0500 (EST) (envelope-from das@freebsd.org) Date: Fri, 20 Jan 2012 13:11:08 -0500 From: David Schultz To: John Baldwin Message-ID: <20120120181108.GA39735@zim.MIT.EDU> Mail-Followup-To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201200616.q0K6GEwT026852@svn.freebsd.org> <20120120065006.GA80490@zim.MIT.EDU> <201201200753.13232.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201200753.13232.jhb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230363 - in head/lib/libc/softfloat: . bits32 bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 18:11:09 -0000 On Fri, Jan 20, 2012, John Baldwin wrote: > On Friday, January 20, 2012 1:50:06 am David Schultz wrote: > > On Fri, Jan 20, 2012, David Schultz wrote: > > > Merge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the > > > original vendor, but we're using their heavily modified version.) > > > This brings in functions for long double emulation (both extended and > > > quad formats), which may be useful for testing, and also for replacing > > > libc/sparc64/fpu/. > > > > I'd appreciate it if an svn guru could let me know if anything > > needs to be done to record the fact that this is a merged copy of > > /vendor/NetBSD/softfloat/dist@230364. `svn merge --record-only $url' > > didn't do anything, I'm guessing because there's no history yet. > > The previous libc/softfloat sources were a mishmash, so I didn't try > > to recreate any merge history for those. > > Did you use 'svn cp' to add the bits in from the vendor tree? If so, there's > no need to do an record-only merge. In general we only need to do record-only > merge to bootstrap mergeinfo when doing the first merge for a vendor tree > after the CVS -> SVN conversion. For new vendor sources that are 'svn cp'd > from the vendor area, SVN will just DTRT from the start. Unfortunately, no. The prior contents of the directory were taken from NetBSD at different points in time as early as 2002 and then modified. I updated them to a consistent snapshot outside of svn, and then decided only in retrospect that it would be nice to be able to track the vendor sources in the tree directly. From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 18:49:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49557106566C; Fri, 20 Jan 2012 18:49:48 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 336CE8FC15; Fri, 20 Jan 2012 18:49:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KInmVC054088; Fri, 20 Jan 2012 18:49:48 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KInmic054086; Fri, 20 Jan 2012 18:49:48 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201201849.q0KInmic054086@svn.freebsd.org> From: Andreas Tobler Date: Fri, 20 Jan 2012 18: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: r230390 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 18:49:48 -0000 Author: andreast Date: Fri Jan 20 18:49:47 2012 New Revision: 230390 URL: http://svn.freebsd.org/changeset/base/230390 Log: Disable GUPROF on archs other than i386/amd64 since the fine details are not implemented. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Jan 20 17:25:15 2012 (r230389) +++ head/sys/conf/kern.pre.mk Fri Jan 20 18:49:47 2012 (r230390) @@ -103,11 +103,14 @@ ASM_CFLAGS= -x assembler-with-cpp -DLOCO .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 CFLAGS+= -DGPROF -falign-functions=16 +PROF= -pg .if ${PROFLEVEL} >= 2 CFLAGS+= -DGPROF4 -DGUPROF -PROF= -pg -mprofiler-epilogue +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +PROF+= -mprofiler-epilogue .else -PROF= -pg +.error "GUPROF not supported on ${MACHINE_CPUARCH}." +.endif .endif .endif DEFINED_PROF= ${PROF} From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 18:52:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D928106564A; Fri, 20 Jan 2012 18:52:31 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D7BE8FC0A; Fri, 20 Jan 2012 18:52:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KIqVwU054212; Fri, 20 Jan 2012 18:52:31 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KIqVrY054210; Fri, 20 Jan 2012 18:52:31 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201201852.q0KIqVrY054210@svn.freebsd.org> From: Andreas Tobler Date: Fri, 20 Jan 2012 18:52: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: r230391 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 18:52:31 -0000 Author: andreast Date: Fri Jan 20 18:52:31 2012 New Revision: 230391 URL: http://svn.freebsd.org/changeset/base/230391 Log: Add the .opd section, this is helps booting a profiled kernel. Adjust the OUTPUT_ARCH and use the builtin ALIGN() to adjust the data segment. Modified: head/sys/conf/ldscript.powerpc64 Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Fri Jan 20 18:49:47 2012 (r230390) +++ head/sys/conf/ldscript.powerpc64 Fri Jan 20 18:52:31 2012 (r230391) @@ -1,7 +1,7 @@ /* $FreeBSD$ */ OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", "elf64-powerpc") -OUTPUT_ARCH(powerpc) +OUTPUT_ARCH(powerpc:common64) ENTRY(__start) SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); @@ -56,15 +56,19 @@ SECTIONS .sdata2 : { *(.sdata2) } .sbss2 : { *(.sbss2) } /* Adjust the address for the data segment to the next page up. */ - . = ((. + 0x1000) & ~(0x1000 - 1)); + . = ALIGN(4096); .data : { *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS } - .data1 : { *(.data1) } - .got1 : { *(.got1) } + .data1 : { *(.data1) } + .toc1 : ALIGN(8) { *(.toc1) } + .opd : ALIGN(8) { KEEP (*(.opd)) } + .branch_lt : ALIGN(8) { *(.branch_lt) } + .got : ALIGN(8) { *(.got .toc) } + .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. @@ -81,10 +85,6 @@ SECTIONS .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. */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 18:55:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACF94106566C; Fri, 20 Jan 2012 18:55:56 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 987538FC0C; Fri, 20 Jan 2012 18:55:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KItudq054362; Fri, 20 Jan 2012 18:55:56 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KItudc054360; Fri, 20 Jan 2012 18:55:56 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201201201855.q0KItudc054360@svn.freebsd.org> From: Robert Millan Date: Fri, 20 Jan 2012 18:55:56 +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: r230392 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 18:55:56 -0000 Author: rmh Date: Fri Jan 20 18:55:56 2012 New Revision: 230392 URL: http://svn.freebsd.org/changeset/base/230392 Log: Map foreign architecture names to FreeBSD naming convention. Approved by: kib (mentor) Modified: head/usr.bin/make/main.c Modified: head/usr.bin/make/main.c ============================================================================== --- head/usr.bin/make/main.c Fri Jan 20 18:52:31 2012 (r230391) +++ head/usr.bin/make/main.c Fri Jan 20 18:55:56 2012 (r230392) @@ -146,6 +146,14 @@ uint32_t warn_nocmd; /* command line no- time_t now; /* Time at start of make */ struct GNode *DEFAULT; /* .DEFAULT node */ +static struct { + const char *foreign_name; + const char *freebsd_name; +} arch_aliases[] = { + { "x86_64", "amd64" }, + { "mipsel", "mips" }, +}; + /** * Exit with usage message. */ @@ -939,10 +947,19 @@ main(int argc, char **argv) */ if ((machine = getenv("MACHINE")) == NULL) { static struct utsname utsname; + unsigned int i; if (uname(&utsname) == -1) err(2, "uname"); machine = utsname.machine; + + /* Canonicalize non-FreeBSD naming conventions */ + for (i = 0; i < sizeof(arch_aliases) + / sizeof(arch_aliases[0]); i++) + if (!strcmp(machine, arch_aliases[i].foreign_name)) { + machine = arch_aliases[i].freebsd_name; + break; + } } if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) { From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 19:18:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF0801065739; Fri, 20 Jan 2012 19:18:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9CC48FC14; Fri, 20 Jan 2012 19:18:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KJIBGo055078; Fri, 20 Jan 2012 19:18:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KJIBFv055076; Fri, 20 Jan 2012 19:18:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201201918.q0KJIBFv055076@svn.freebsd.org> From: Dimitry Andric Date: Fri, 20 Jan 2012 19:18: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: r230393 - head/contrib/llvm/lib/Target/X86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 19:18:12 -0000 Author: dim Date: Fri Jan 20 19:18:11 2012 New Revision: 230393 URL: http://svn.freebsd.org/changeset/base/230393 Log: Pull in r148240 from upstream llvm trunk: Make sure the non-SSE lowering for fences correctly clobbers EFLAGS. PR11768. In particular, this fixes segfaults during the build of devel/icu on i386. The __sync_synchronize() builtin used for implementing icu's internal barrier could lead to incorrect behaviour. MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Fri Jan 20 18:55:56 2012 (r230392) +++ head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Fri Jan 20 19:18:11 2012 (r230393) @@ -533,7 +533,7 @@ def ATOMSWAP6432 : I<0, Pseudo, (outs GR // Memory barriers // TODO: Get this to fold the constant into the instruction. -let isCodeGenOnly = 1 in +let isCodeGenOnly = 1, Defs = [EFLAGS] in def OR32mrLocked : I<0x09, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$zero), "lock\n\t" "or{l}\t{$zero, $dst|$dst, $zero}", From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 19:38:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E5F9106566B; Fri, 20 Jan 2012 19:38:31 +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 6F80E8FC0C; Fri, 20 Jan 2012 19:38:31 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 26A7C46B2C; Fri, 20 Jan 2012 14:38:31 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7E4E6B93F; Fri, 20 Jan 2012 14:38:30 -0500 (EST) From: John Baldwin To: David Schultz Date: Fri, 20 Jan 2012 14:37:52 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201200616.q0K6GEwT026852@svn.freebsd.org> <201201200753.13232.jhb@freebsd.org> <20120120181108.GA39735@zim.MIT.EDU> In-Reply-To: <20120120181108.GA39735@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201201437.52252.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 20 Jan 2012 14:38:30 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230363 - in head/lib/libc/softfloat: . bits32 bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 19:38:31 -0000 On Friday, January 20, 2012 1:11:08 pm David Schultz wrote: > On Fri, Jan 20, 2012, John Baldwin wrote: > > On Friday, January 20, 2012 1:50:06 am David Schultz wrote: > > > On Fri, Jan 20, 2012, David Schultz wrote: > > > > Merge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the > > > > original vendor, but we're using their heavily modified version.) > > > > This brings in functions for long double emulation (both extended and > > > > quad formats), which may be useful for testing, and also for replacing > > > > libc/sparc64/fpu/. > > > > > > I'd appreciate it if an svn guru could let me know if anything > > > needs to be done to record the fact that this is a merged copy of > > > /vendor/NetBSD/softfloat/dist@230364. `svn merge --record-only $url' > > > didn't do anything, I'm guessing because there's no history yet. > > > The previous libc/softfloat sources were a mishmash, so I didn't try > > > to recreate any merge history for those. > > > > Did you use 'svn cp' to add the bits in from the vendor tree? If so, there's > > no need to do an record-only merge. In general we only need to do record-only > > merge to bootstrap mergeinfo when doing the first merge for a vendor tree > > after the CVS -> SVN conversion. For new vendor sources that are 'svn cp'd > > from the vendor area, SVN will just DTRT from the start. > > Unfortunately, no. The prior contents of the directory were taken > from NetBSD at different points in time as early as 2002 and then > modified. I updated them to a consistent snapshot outside of svn, > and then decided only in retrospect that it would be nice to be > able to track the vendor sources in the tree directly. Hmm, but when you added the files in this commit, did you just do a local 'svn add' of files you had, or did you do an 'svn cp' from the vendor files? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 20:02:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A0911065675; Fri, 20 Jan 2012 20:02: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 127B18FC12; Fri, 20 Jan 2012 20:02:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KK22GJ056481; Fri, 20 Jan 2012 20:02:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KK21M6056471; Fri, 20 Jan 2012 20:02:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201202002.q0KK21M6056471@svn.freebsd.org> From: John Baldwin Date: Fri, 20 Jan 2012 20:02: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: r230394 - in head/sys: fs/nfsclient kern nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 20:02:02 -0000 Author: jhb Date: Fri Jan 20 20:02:01 2012 New Revision: 230394 URL: http://svn.freebsd.org/changeset/base/230394 Log: Close a race in NFS lookup processing that could result in stale name cache entries on one client when a directory was renamed on another client. The root cause for the stale entry being trusted is that each per-vnode nfsnode structure has a single 'n_ctime' timestamp used to validate positive name cache entries. However, if there are multiple entries for a single vnode, they all share a single timestamp. To fix this, extend the name cache to allow filesystems to optionally store a timestamp value in each name cache entry. The NFS clients now fetch the timestamp associated with each name cache entry and use that to validate cache hits instead of the timestamps previously stored in the nfsnode. Another part of the fix is that the NFS clients now use timestamps from the post-op attributes of RPCs when adding name cache entries rather than pulling the timestamps out of the file's attribute cache. The latter is subject to races with other lookups updating the attribute cache concurrently. Some more details: - Add a variant of nfsm_postop_attr() to the old NFS client that can return a vattr structure with a copy of the post-op attributes. - Handle lookups of "." as a special case in the NFS clients since the name cache does not store name cache entries for ".", so we cannot get a useful timestamp. It didn't really make much sense to recheck the attributes on the the directory to validate the namecache hit for "." anyway. - ABI compat shims for the name cache routines are present in this commit so that it is safe to MFC. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsclient/nfsnode.h head/sys/kern/vfs_cache.c head/sys/nfsclient/nfs_subs.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsclient/nfsm_subs.h head/sys/nfsclient/nfsnode.h head/sys/sys/vnode.h Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jan 20 20:02:01 2012 (r230394) @@ -3317,8 +3317,9 @@ nfsrpc_readdirplus(vnode_t vp, struct ui ndp->ni_vp = newvp; NFSCNHASH(cnp, HASHINIT); if (cnp->cn_namelen <= NCHNAMLEN) { - np->n_ctime = np->n_vattr.na_ctime; - cache_enter(ndp->ni_dvp,ndp->ni_vp,cnp); + cache_enter_time(ndp->ni_dvp, + ndp->ni_vp, cnp, + &nfsva.na_ctime); } if (unlocknewvp) vput(newvp); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri Jan 20 20:02:01 2012 (r230394) @@ -1016,12 +1016,12 @@ nfs_lookup(struct vop_lookup_args *ap) struct vnode *newvp; struct nfsmount *nmp; struct nfsnode *np, *newnp; - int error = 0, attrflag, dattrflag, ltype; + int error = 0, attrflag, dattrflag, ltype, ncticks; struct thread *td = cnp->cn_thread; struct nfsfh *nfhp; struct nfsvattr dnfsva, nfsva; struct vattr vattr; - struct timespec dmtime; + struct timespec nctime; *vpp = NULLVP; if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) && @@ -1042,11 +1042,24 @@ nfs_lookup(struct vop_lookup_args *ap) if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { /* + * Lookups of "." are special and always return the + * current directory. cache_lookup() already handles + * associated locking bookkeeping, etc. + */ + if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { + /* XXX: Is this really correct? */ + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (0); + } + + /* * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback @@ -1073,7 +1086,7 @@ nfs_lookup(struct vop_lookup_args *ap) } if (nfscl_nodeleg(newvp, 0) == 0 || (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_ctime, &newnp->n_ctime, ==))) { + timespeccmp(&vattr.va_ctime, &nctime, ==))) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -1092,36 +1105,21 @@ nfs_lookup(struct vop_lookup_args *ap) /* * We only accept a negative hit in the cache if the * modification time of the parent directory matches - * our cached copy. Otherwise, we discard all of the - * negative cache entries for this directory. We also - * only trust -ve cache entries for less than - * nm_negative_namecache_timeout seconds. + * the cached copy in the name cache entry. + * Otherwise, we discard all of the negative cache + * entries for this directory. We also only trust + * negative cache entries for up to nm_negnametimeo + * seconds. */ - if ((u_int)(ticks - np->n_dmtime_ticks) < - (nmp->nm_negnametimeo * hz) && + if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) && VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_mtime, &np->n_dmtime, ==)) { + timespeccmp(&vattr.va_mtime, &nctime, ==)) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); return (ENOENT); } cache_purge_negative(dvp); - mtx_lock(&np->n_mtx); - timespecclear(&np->n_dmtime); - mtx_unlock(&np->n_mtx); } - /* - * Cache the modification time of the parent directory in case - * the lookup fails and results in adding the first negative - * name cache entry for the directory. Since this is reading - * a single time_t, don't bother with locking. The - * modification time may be a bit stale, but it must be read - * before performing the lookup RPC to prevent a race where - * another lookup updates the timestamp on the directory after - * the lookup RPC has been performed on the server but before - * n_dmtime is set at the end of this function. - */ - dmtime = np->n_vattr.na_mtime; error = 0; newvp = NULLVP; NFSINCRGLOBAL(newnfsstats.lookupcache_misses); @@ -1157,30 +1155,22 @@ nfs_lookup(struct vop_lookup_args *ap) return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) { + if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && + dattrflag) { /* - * Maintain n_dmtime as the modification time - * of the parent directory when the oldest -ve - * name cache entry for this directory was - * added. If a -ve cache entry has already - * been added with a newer modification time - * by a concurrent lookup, then don't bother - * adding a cache entry. The modification - * time of the directory might have changed - * due to the file this lookup failed to find - * being created. In that case a subsequent - * lookup would incorrectly use the entry - * added here instead of doing an extra - * lookup. + * Cache the modification time of the parent + * directory from the post-op attributes in + * the name cache entry. The negative cache + * entry will be ignored once the directory + * has changed. Don't bother adding the entry + * if the directory has already changed. */ mtx_lock(&np->n_mtx); - if (timespeccmp(&np->n_dmtime, &dmtime, <=)) { - if (!timespecisset(&np->n_dmtime)) { - np->n_dmtime = dmtime; - np->n_dmtime_ticks = ticks; - } + if (timespeccmp(&np->n_vattr.na_mtime, + &dnfsva.na_mtime, ==)) { mtx_unlock(&np->n_mtx); - cache_enter(dvp, NULL, cnp); + cache_enter_time(dvp, NULL, cnp, + &dnfsva.na_mtime); } else mtx_unlock(&np->n_mtx); } @@ -1279,9 +1269,8 @@ nfs_lookup(struct vop_lookup_args *ap) if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; if ((cnp->cn_flags & MAKEENTRY) && - (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))) { - np->n_ctime = np->n_vattr.na_vattr.va_ctime; - cache_enter(dvp, newvp, cnp); + (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN)) && attrflag) { + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime); } *vpp = newvp; return (0); Modified: head/sys/fs/nfsclient/nfsnode.h ============================================================================== --- head/sys/fs/nfsclient/nfsnode.h Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/fs/nfsclient/nfsnode.h Fri Jan 20 20:02:01 2012 (r230394) @@ -99,9 +99,6 @@ struct nfsnode { time_t n_attrstamp; /* Attr. cache timestamp */ struct nfs_accesscache n_accesscache[NFS_ACCESSCACHESIZE]; struct timespec n_mtime; /* Prev modify time. */ - struct timespec n_ctime; /* Prev create time. */ - struct timespec n_dmtime; /* Prev dir modify time. */ - int n_dmtime_ticks; /* Tick of -ve cache entry */ struct nfsfh *n_fhp; /* NFS File Handle */ struct vnode *n_vnode; /* associated vnode */ struct vnode *n_dvp; /* parent vnode */ Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/kern/vfs_cache.c Fri Jan 20 20:02:01 2012 (r230394) @@ -97,6 +97,8 @@ struct namecache { TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ struct vnode *nc_dvp; /* vnode of parent of name */ struct vnode *nc_vp; /* vnode the name refers to */ + struct timespec nc_time; /* timespec provided by fs */ + int nc_ticks; /* ticks value when entry was added */ u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ char nc_name[0]; /* segment name + nul */ @@ -394,10 +396,12 @@ cache_zap(ncp) */ int -cache_lookup(dvp, vpp, cnp) +cache_lookup_times(dvp, vpp, cnp, tsp, ticksp) struct vnode *dvp; struct vnode **vpp; struct componentname *cnp; + struct timespec *tsp; + int *ticksp; { struct namecache *ncp; uint32_t hash; @@ -422,6 +426,10 @@ retry_wlocked: dothits++; SDT_PROBE(vfs, namecache, lookup, hit, dvp, ".", *vpp, 0, 0); + if (tsp != NULL) + timespecclear(tsp); + if (ticksp != NULL) + *ticksp = ticks; goto success; } if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { @@ -440,19 +448,22 @@ retry_wlocked: CACHE_WUNLOCK(); return (0); } - if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) - *vpp = dvp->v_cache_dd->nc_vp; + ncp = dvp->v_cache_dd; + if (ncp->nc_flag & NCF_ISDOTDOT) + *vpp = ncp->nc_vp; else - *vpp = dvp->v_cache_dd->nc_dvp; + *vpp = ncp->nc_dvp; /* Return failure if negative entry was found. */ - if (*vpp == NULL) { - ncp = dvp->v_cache_dd; + if (*vpp == NULL) goto negative_success; - } CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", dvp, cnp->cn_nameptr, *vpp); SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..", *vpp, 0, 0); + if (tsp != NULL) + *tsp = ncp->nc_time; + if (ticksp != NULL) + *ticksp = ncp->nc_ticks; goto success; } } @@ -499,6 +510,10 @@ retry_wlocked: dvp, cnp->cn_nameptr, *vpp, ncp); SDT_PROBE(vfs, namecache, lookup, hit, dvp, ncp->nc_name, *vpp, 0, 0); + if (tsp != NULL) + *tsp = ncp->nc_time; + if (ticksp != NULL) + *ticksp = ncp->nc_ticks; goto success; } @@ -530,6 +545,10 @@ negative_success: cnp->cn_flags |= ISWHITEOUT; SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, ncp->nc_name, 0, 0, 0); + if (tsp != NULL) + *tsp = ncp->nc_time; + if (ticksp != NULL) + *ticksp = ncp->nc_ticks; CACHE_WUNLOCK(); return (ENOENT); @@ -616,10 +635,11 @@ unlock: * Add an entry to the cache. */ void -cache_enter(dvp, vp, cnp) +cache_enter_time(dvp, vp, cnp, tsp) struct vnode *dvp; struct vnode *vp; struct componentname *cnp; + struct timespec *tsp; { struct namecache *ncp, *n2; struct nchashhead *ncpp; @@ -692,6 +712,11 @@ cache_enter(dvp, vp, cnp) ncp->nc_vp = vp; ncp->nc_dvp = dvp; ncp->nc_flag = flag; + if (tsp != NULL) + ncp->nc_time = *tsp; + else + timespecclear(&ncp->nc_time); + ncp->nc_ticks = ticks; len = ncp->nc_nlen = cnp->cn_namelen; hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT); strlcpy(ncp->nc_name, cnp->cn_nameptr, len + 1); @@ -708,6 +733,8 @@ cache_enter(dvp, vp, cnp) if (n2->nc_dvp == dvp && n2->nc_nlen == cnp->cn_namelen && !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { + n2->nc_time = ncp->nc_time; + n2->nc_ticks = ncp->nc_ticks; CACHE_WUNLOCK(); cache_free(ncp); return; @@ -1280,6 +1307,29 @@ vn_commname(struct vnode *vp, char *buf, return (0); } +/* ABI compat shims for old kernel modules. */ +#undef cache_enter +#undef cache_lookup + +void cache_enter(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp); +int cache_lookup(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp); + +void +cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) +{ + + cache_enter_time(dvp, vp, cnp, NULL); +} + +int +cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) +{ + + return (cache_lookup_times(dvp, vpp, cnp, NULL, NULL)); +} + /* * This function updates path string to vnode's full global path * and checks the size of the new path string against the pathlen argument. Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/nfsclient/nfs_subs.c Fri Jan 20 20:02:01 2012 (r230394) @@ -978,8 +978,8 @@ nfsm_loadattr_xx(struct vnode **v, struc } int -nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md, - caddr_t *dpos) +nfsm_postop_attr_xx(struct vnode **v, int *f, struct vattr *va, + struct mbuf **md, caddr_t *dpos) { u_int32_t *tl; int t1; @@ -990,7 +990,7 @@ nfsm_postop_attr_xx(struct vnode **v, in return EBADRPC; *f = fxdr_unsigned(int, *tl); if (*f != 0) { - t1 = nfs_loadattrcache(&ttvp, md, dpos, NULL, 1); + t1 = nfs_loadattrcache(&ttvp, md, dpos, va, 1); if (t1 != 0) { *f = 0; return t1; @@ -1020,7 +1020,7 @@ nfsm_wcc_data_xx(struct vnode **v, int * VTONFS(*v)->n_mtime.tv_nsec == fxdr_unsigned(u_int32_t, *(tl + 3))); mtx_unlock(&(VTONFS(*v))->n_mtx); } - t1 = nfsm_postop_attr_xx(v, &ttattrf, md, dpos); + t1 = nfsm_postop_attr_xx(v, &ttattrf, NULL, md, dpos); if (t1) return t1; if (*f) Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/nfsclient/nfs_vnops.c Fri Jan 20 20:02:01 2012 (r230394) @@ -913,7 +913,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct vnode **vpp = ap->a_vpp; struct mount *mp = dvp->v_mount; struct vattr vattr; - struct timespec dmtime; + struct timespec nctime; int flags = cnp->cn_flags; struct vnode *newvp; struct nfsmount *nmp; @@ -922,7 +922,7 @@ nfs_lookup(struct vop_lookup_args *ap) long len; nfsfh_t *fhp; struct nfsnode *np, *newnp; - int error = 0, attrflag, fhsize, ltype; + int error = 0, attrflag, dattrflag, fhsize, ltype, ncticks; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; @@ -938,11 +938,24 @@ nfs_lookup(struct vop_lookup_args *ap) *vpp = NULLVP; return (error); } - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { /* + * Lookups of "." are special and always return the + * current directory. cache_lookup() already handles + * associated locking bookkeeping, etc. + */ + if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { + /* XXX: Is this really correct? */ + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (0); + } + + /* * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback @@ -968,7 +981,7 @@ nfs_lookup(struct vop_lookup_args *ap) mtx_unlock(&newnp->n_mtx); } if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_ctime, &newnp->n_ctime, ==)) { + timespeccmp(&vattr.va_ctime, &nctime, ==)) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -987,36 +1000,22 @@ nfs_lookup(struct vop_lookup_args *ap) /* * We only accept a negative hit in the cache if the * modification time of the parent directory matches - * our cached copy. Otherwise, we discard all of the - * negative cache entries for this directory. We also - * only trust -ve cache entries for less than - * nm_negative_namecache_timeout seconds. + * the cached copy in the name cache entry. + * Otherwise, we discard all of the negative cache + * entries for this directory. We also only trust + * negative cache entries for up to nm_negnametimeo + * seconds. */ - if ((u_int)(ticks - np->n_dmtime_ticks) < - (nmp->nm_negnametimeo * hz) && + if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) && VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && - timespeccmp(&vattr.va_mtime, &np->n_dmtime, ==)) { + timespeccmp(&vattr.va_mtime, &nctime, ==)) { nfsstats.lookupcache_hits++; return (ENOENT); } cache_purge_negative(dvp); - mtx_lock(&np->n_mtx); - timespecclear(&np->n_dmtime); - mtx_unlock(&np->n_mtx); } - /* - * Cache the modification time of the parent directory in case - * the lookup fails and results in adding the first negative - * name cache entry for the directory. Since this is reading - * a single time_t, don't bother with locking. The - * modification time may be a bit stale, but it must be read - * before performing the lookup RPC to prevent a race where - * another lookup updates the timestamp on the directory after - * the lookup RPC has been performed on the server but before - * n_dmtime is set at the end of this function. - */ - dmtime = np->n_vattr.va_mtime; + attrflag = dattrflag = 0; error = 0; newvp = NULLVP; nfsstats.lookupcache_misses++; @@ -1031,7 +1030,7 @@ nfs_lookup(struct vop_lookup_args *ap) nfsm_request(dvp, NFSPROC_LOOKUP, cnp->cn_thread, cnp->cn_cred); if (error) { if (v3) { - nfsm_postop_attr(dvp, attrflag); + nfsm_postop_attr_va(dvp, dattrflag, &vattr); m_freem(mrep); } goto nfsmout; @@ -1127,16 +1126,17 @@ nfs_lookup(struct vop_lookup_args *ap) } } if (v3) { - nfsm_postop_attr(newvp, attrflag); - nfsm_postop_attr(dvp, attrflag); - } else - nfsm_loadattr(newvp, NULL); + nfsm_postop_attr_va(newvp, attrflag, &vattr); + nfsm_postop_attr(dvp, dattrflag); + } else { + nfsm_loadattr(newvp, &vattr); + attrflag = 1; + } if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; if ((cnp->cn_flags & MAKEENTRY) && - (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))) { - np->n_ctime = np->n_vattr.va_ctime; - cache_enter(dvp, newvp, cnp); + (cnp->cn_nameiop != DELETE || !(flags & ISLASTCN)) && attrflag) { + cache_enter_time(dvp, newvp, cnp, &vattr.va_ctime); } *vpp = newvp; m_freem(mrep); @@ -1164,30 +1164,22 @@ nfsmout: return (EJUSTRETURN); } - if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) { + if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE && + dattrflag) { /* - * Maintain n_dmtime as the modification time - * of the parent directory when the oldest -ve - * name cache entry for this directory was - * added. If a -ve cache entry has already - * been added with a newer modification time - * by a concurrent lookup, then don't bother - * adding a cache entry. The modification - * time of the directory might have changed - * due to the file this lookup failed to find - * being created. In that case a subsequent - * lookup would incorrectly use the entry - * added here instead of doing an extra - * lookup. + * Cache the modification time of the parent + * directory from the post-op attributes in + * the name cache entry. The negative cache + * entry will be ignored once the directory + * has changed. Don't bother adding the entry + * if the directory has already changed. */ mtx_lock(&np->n_mtx); - if (timespeccmp(&np->n_dmtime, &dmtime, <=)) { - if (!timespecisset(&np->n_dmtime)) { - np->n_dmtime = dmtime; - np->n_dmtime_ticks = ticks; - } + if (timespeccmp(&np->n_vattr.va_mtime, + &vattr.va_mtime, ==)) { mtx_unlock(&np->n_mtx); - cache_enter(dvp, NULL, cnp); + cache_enter_time(dvp, NULL, cnp, + &vattr.va_mtime); } else mtx_unlock(&np->n_mtx); } @@ -2473,6 +2465,7 @@ nfs_readdirplusrpc(struct vnode *vp, str nfsuint64 cookie; struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct nfsnode *dnp = VTONFS(vp), *np; + struct vattr vattr; nfsfh_t *fhp; u_quad_t fileno; int error = 0, tlen, more_dirs = 1, blksiz = 0, doit, bigenough = 1, i; @@ -2653,18 +2646,13 @@ nfs_readdirplusrpc(struct vnode *vp, str dpos = dpossav1; mdsav2 = md; md = mdsav1; - nfsm_loadattr(newvp, NULL); + nfsm_loadattr(newvp, &vattr); dpos = dpossav2; md = mdsav2; - dp->d_type = - IFTODT(VTTOIF(np->n_vattr.va_type)); + dp->d_type = IFTODT(VTTOIF(vattr.va_type)); ndp->ni_vp = newvp; - /* - * Update n_ctime so subsequent lookup - * doesn't purge entry. - */ - np->n_ctime = np->n_vattr.va_ctime; - cache_enter(ndp->ni_dvp, ndp->ni_vp, cnp); + cache_enter_time(ndp->ni_dvp, ndp->ni_vp, cnp, + &vattr.va_ctime); } } else { /* Just skip over the file handle */ Modified: head/sys/nfsclient/nfsm_subs.h ============================================================================== --- head/sys/nfsclient/nfsm_subs.h Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/nfsclient/nfsm_subs.h Fri Jan 20 20:02:01 2012 (r230394) @@ -152,8 +152,8 @@ int nfsm_getfh_xx(nfsfh_t **f, int *s, i caddr_t *dpos); int nfsm_loadattr_xx(struct vnode **v, struct vattr *va, struct mbuf **md, caddr_t *dpos); -int nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md, - caddr_t *dpos); +int nfsm_postop_attr_xx(struct vnode **v, int *f, struct vattr *va, + struct mbuf **md, caddr_t *dpos); int nfsm_wcc_data_xx(struct vnode **v, int *f, struct mbuf **md, caddr_t *dpos); @@ -181,7 +181,14 @@ do { \ #define nfsm_postop_attr(v, f) \ do { \ int32_t t1; \ - t1 = nfsm_postop_attr_xx(&v, &f, &md, &dpos); \ + t1 = nfsm_postop_attr_xx(&v, &f, NULL, &md, &dpos); \ + nfsm_dcheck(t1, mrep); \ +} while (0) + +#define nfsm_postop_attr_va(v, f, va) \ +do { \ + int32_t t1; \ + t1 = nfsm_postop_attr_xx(&v, &f, va, &md, &dpos); \ nfsm_dcheck(t1, mrep); \ } while (0) Modified: head/sys/nfsclient/nfsnode.h ============================================================================== --- head/sys/nfsclient/nfsnode.h Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/nfsclient/nfsnode.h Fri Jan 20 20:02:01 2012 (r230394) @@ -104,9 +104,6 @@ struct nfsnode { time_t n_attrstamp; /* Attr. cache timestamp */ struct nfs_accesscache n_accesscache[NFS_ACCESSCACHESIZE]; struct timespec n_mtime; /* Prev modify time. */ - struct timespec n_ctime; /* Prev create time. */ - struct timespec n_dmtime; /* Prev dir modify time. */ - int n_dmtime_ticks; /* Tick of -ve cache entry */ nfsfh_t *n_fhp; /* NFS File Handle */ struct vnode *n_vnode; /* associated vnode */ struct vnode *n_dvp; /* parent vnode */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Jan 20 19:18:11 2012 (r230393) +++ head/sys/sys/vnode.h Fri Jan 20 20:02:01 2012 (r230394) @@ -578,10 +578,14 @@ struct vattr; struct vnode; /* cache_* may belong in namei.h. */ -void cache_enter(struct vnode *dvp, struct vnode *vp, - struct componentname *cnp); -int cache_lookup(struct vnode *dvp, struct vnode **vpp, - struct componentname *cnp); +#define cache_enter(dvp, vp, cnp) \ + cache_enter_time(dvp, vp, cnp, NULL) +void cache_enter_time(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp, struct timespec *tsp); +#define cache_lookup(dvp, vpp, cnp) \ + cache_lookup_times(dvp, vpp, cnp, NULL, NULL) +int cache_lookup_times(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp, struct timespec *tsp, int *ticksp); void cache_purge(struct vnode *vp); void cache_purge_negative(struct vnode *vp); void cache_purgevfs(struct mount *mp); From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 20:11:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1BF106566C; Fri, 20 Jan 2012 20:11:56 +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 BCC338FC0A; Fri, 20 Jan 2012 20:11:56 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6D70646B0C; Fri, 20 Jan 2012 15:11:56 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E76A6B91C; Fri, 20 Jan 2012 15:11:55 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 20 Jan 2012 15:11:41 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201202002.q0KK21M6056471@svn.freebsd.org> In-Reply-To: <201201202002.q0KK21M6056471@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201201511.41522.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 20 Jan 2012 15:11:56 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230394 - in head/sys: fs/nfsclient kern nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 20:11:57 -0000 On Friday, January 20, 2012 3:02:01 pm John Baldwin wrote: > Author: jhb > Date: Fri Jan 20 20:02:01 2012 > New Revision: 230394 > URL: http://svn.freebsd.org/changeset/base/230394 > > Log: > Close a race in NFS lookup processing that could result in stale name cache > entries on one client when a directory was renamed on another client. The > root cause for the stale entry being trusted is that each per-vnode nfsnode > structure has a single 'n_ctime' timestamp used to validate positive name > cache entries. However, if there are multiple entries for a single vnode, > they all share a single timestamp. To fix this, extend the name cache > to allow filesystems to optionally store a timestamp value in each name > cache entry. The NFS clients now fetch the timestamp associated with > each name cache entry and use that to validate cache hits instead of the > timestamps previously stored in the nfsnode. Another part of the fix is > that the NFS clients now use timestamps from the post-op attributes of > RPCs when adding name cache entries rather than pulling the timestamps out > of the file's attribute cache. The latter is subject to races with other > lookups updating the attribute cache concurrently. Some more details: > - Add a variant of nfsm_postop_attr() to the old NFS client that can return > a vattr structure with a copy of the post-op attributes. > - Handle lookups of "." as a special case in the NFS clients since the name > cache does not store name cache entries for ".", so we cannot get a > useful timestamp. It didn't really make much sense to recheck the > attributes on the the directory to validate the namecache hit for "." > anyway. > - ABI compat shims for the name cache routines are present in this commit > so that it is safe to MFC. More details can be found in the thread on fs@ for the curious: http://lists.freebsd.org/pipermail/freebsd-fs/2012-January/013442.html -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 20:13:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00F42106566B; Fri, 20 Jan 2012 20:13:05 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 996538FC17; Fri, 20 Jan 2012 20:13:04 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0KKD3ko040236; Fri, 20 Jan 2012 15:13:03 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0KKD3PP040235; Fri, 20 Jan 2012 15:13:03 -0500 (EST) (envelope-from das@freebsd.org) Date: Fri, 20 Jan 2012 15:13:03 -0500 From: David Schultz To: John Baldwin Message-ID: <20120120201303.GA40208@zim.MIT.EDU> Mail-Followup-To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201200616.q0K6GEwT026852@svn.freebsd.org> <201201200753.13232.jhb@freebsd.org> <20120120181108.GA39735@zim.MIT.EDU> <201201201437.52252.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201201437.52252.jhb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230363 - in head/lib/libc/softfloat: . bits32 bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 20:13:05 -0000 On Fri, Jan 20, 2012, John Baldwin wrote: > On Friday, January 20, 2012 1:11:08 pm David Schultz wrote: > > On Fri, Jan 20, 2012, John Baldwin wrote: > > > On Friday, January 20, 2012 1:50:06 am David Schultz wrote: > > > > On Fri, Jan 20, 2012, David Schultz wrote: > > > > > Merge in the latest SoftFloat changes from NetBSD. (NetBSD isn't the > > > > > original vendor, but we're using their heavily modified version.) > > > > > This brings in functions for long double emulation (both extended and > > > > > quad formats), which may be useful for testing, and also for replacing > > > > > libc/sparc64/fpu/. > > > > > > > > I'd appreciate it if an svn guru could let me know if anything > > > > needs to be done to record the fact that this is a merged copy of > > > > /vendor/NetBSD/softfloat/dist@230364. `svn merge --record-only $url' > > > > didn't do anything, I'm guessing because there's no history yet. > > > > The previous libc/softfloat sources were a mishmash, so I didn't try > > > > to recreate any merge history for those. > > > > > > Did you use 'svn cp' to add the bits in from the vendor tree? If so, there's > > > no need to do an record-only merge. In general we only need to do record-only > > > merge to bootstrap mergeinfo when doing the first merge for a vendor tree > > > after the CVS -> SVN conversion. For new vendor sources that are 'svn cp'd > > > from the vendor area, SVN will just DTRT from the start. > > > > Unfortunately, no. The prior contents of the directory were taken > > from NetBSD at different points in time as early as 2002 and then > > modified. I updated them to a consistent snapshot outside of svn, > > and then decided only in retrospect that it would be nice to be > > able to track the vendor sources in the tree directly. > > Hmm, but when you added the files in this commit, did you just do a local > 'svn add' of files you had, or did you do an 'svn cp' from the vendor > files? I just did an svn add. (Most of the files were there already.) From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 21:45:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE0A8106566C; Fri, 20 Jan 2012 21:45:24 +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 C1F048FC08; Fri, 20 Jan 2012 21:45:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KLjOxf060042; Fri, 20 Jan 2012 21:45:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KLjO1V060039; Fri, 20 Jan 2012 21:45:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201202145.q0KLjO1V060039@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 Jan 2012 21:45: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: r230395 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 21:45:25 -0000 Author: pjd Date: Fri Jan 20 21:45:24 2012 New Revision: 230395 URL: http://svn.freebsd.org/changeset/base/230395 Log: Remove unused token 'port'. MFC after: 3 days Modified: head/sbin/hastd/parse.y head/sbin/hastd/token.l Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Fri Jan 20 20:02:01 2012 (r230394) +++ head/sbin/hastd/parse.y Fri Jan 20 21:45:24 2012 (r230395) @@ -369,7 +369,7 @@ yy_config_free(struct hastd_config *conf } %} -%token CONTROL PIDFILE LISTEN PORT REPLICATION CHECKSUM COMPRESSION METAFLUSH +%token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH %token TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE SOURCE ON OFF %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB Modified: head/sbin/hastd/token.l ============================================================================== --- head/sbin/hastd/token.l Fri Jan 20 20:02:01 2012 (r230394) +++ head/sbin/hastd/token.l Fri Jan 20 21:45:24 2012 (r230395) @@ -51,7 +51,6 @@ int lineno; control { DP; return CONTROL; } pidfile { DP; return PIDFILE; } listen { DP; return LISTEN; } -port { DP; return PORT; } replication { DP; return REPLICATION; } checksum { DP; return CHECKSUM; } compression { DP; return COMPRESSION; } From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 21:49:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D74E8106566B; Fri, 20 Jan 2012 21:49:56 +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 C67F88FC12; Fri, 20 Jan 2012 21:49:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KLnueS060202; Fri, 20 Jan 2012 21:49:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KLnu28060200; Fri, 20 Jan 2012 21:49:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201202149.q0KLnu28060200@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 Jan 2012 21:49:56 +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: r230396 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 21:49:56 -0000 Author: pjd Date: Fri Jan 20 21:49:56 2012 New Revision: 230396 URL: http://svn.freebsd.org/changeset/base/230396 Log: Remove another unused token. MFC after: 3 days Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Fri Jan 20 21:45:24 2012 (r230395) +++ head/sbin/hastd/parse.y Fri Jan 20 21:49:56 2012 (r230396) @@ -370,7 +370,7 @@ yy_config_free(struct hastd_config *conf %} %token CONTROL PIDFILE LISTEN REPLICATION CHECKSUM COMPRESSION METAFLUSH -%token TIMEOUT EXEC EXTENTSIZE RESOURCE NAME LOCAL REMOTE SOURCE ON OFF +%token TIMEOUT EXEC RESOURCE NAME LOCAL REMOTE SOURCE ON OFF %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 21:56:54 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EC3E1065675; Fri, 20 Jan 2012 21:56:54 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 847AA8FC0A; Fri, 20 Jan 2012 21:56:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0KLupA3040055; Sat, 21 Jan 2012 01:56:51 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0KLuoux040054; Sat, 21 Jan 2012 01:56:51 +0400 (MSK) (envelope-from ache) Date: Sat, 21 Jan 2012 01:56:49 +0400 From: Andrey Chernov To: Mark Murray , Mark Murray Message-ID: <20120120215649.GA40016@vniz.net> Mail-Followup-To: Andrey Chernov , Mark Murray , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> <20120120055823.GA28177@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 21:56:54 -0000 On Fri, Jan 20, 2012 at 03:12:53PM +0000, Mark Murray wrote: > Andrey Chernov writes: > > > Look at the function random_yarrow_unblock(). Thats where yopu want to > > > be doing this. This function is where the random device is unblocked > > > once safely seeded. > > > > Thanx for your hint, but I fear one moment using random_yarrow_unblock(). > > It is called under mtx_lock(&random_reseed_mtx) in reseed(). > > And when arc4rand() seeding is called, it uses read_random(), so I see > > possible deadlock can happens. > > The usual way round this is with a flag. Set a static, volatile flag, defaulting > "off", and set it to "on" when the seeding has happened. Then arc4random() can > do the right thing, depending on this flag. Ok, what about this version, is it right? libkern/arc4rand.c is not a module but always present in the kernel, so "arc4rand_iniseed_state" will be always accessible. --- dev/random/randomdev_soft.c.old 2011-09-26 07:35:48.000000000 +0400 +++ dev/random/randomdev_soft.c 2012-01-21 01:41:37.000000000 +0400 @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD: src/sys/dev/random/r #define RANDOM_FIFO_MAX 256 /* How many events to queue up */ +extern int arc4rand_iniseed_state; + static void random_kthread(void *); static void random_harvest_internal(u_int64_t, const void *, u_int, @@ -361,6 +363,8 @@ random_yarrow_write(void *buf, int count void random_yarrow_unblock(void) { + if (arc4rand_iniseed_state == 0) + arc4rand_iniseed_state = 1; if (!random_systat.seeded) { random_systat.seeded = 1; selwakeuppri(&random_systat.rsel, PUSER); --- libkern/arc4random.c.old 2011-09-26 07:37:23.000000000 +0400 +++ libkern/arc4random.c 2012-01-21 01:46:53.000000000 +0400 @@ -24,6 +24,8 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 #define ARC4_RESEED_SECONDS 300 #define ARC4_KEYBYTES (256 / 8) +int arc4rand_iniseed_state = 0; + static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -130,10 +132,13 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (reseed || arc4rand_iniseed_state == 1 || (arc4_numruns > ARC4_RESEED_BYTES) || - (tv.tv_sec > arc4_t_reseed)) + (tv.tv_sec > arc4_t_reseed)) { + if (arc4rand_iniseed_state == 1) + arc4rand_iniseed_state = -1; arc4_randomstir(); + } mtx_lock(&arc4_mtx); arc4_numruns += len; -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 22:04:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A837E106564A; Fri, 20 Jan 2012 22:04:59 +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 9687C8FC14; Fri, 20 Jan 2012 22:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KM4xhM060704; Fri, 20 Jan 2012 22:04:59 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KM4xTN060702; Fri, 20 Jan 2012 22:04:59 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201202204.q0KM4xTN060702@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 20 Jan 2012 22:04: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: r230397 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 22:04:59 -0000 Author: pjd Date: Fri Jan 20 22:04:59 2012 New Revision: 230397 URL: http://svn.freebsd.org/changeset/base/230397 Log: By default turn off prefetch when listing snapshots. In my tests it makes listing snapshots 19% faster with cold cache and 47% faster with warm cache. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jan 20 21:49:56 2012 (r230396) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jan 20 22:04:59 2012 (r230397) @@ -81,6 +81,12 @@ CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX); +static int snapshot_list_prefetch; +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.snapshot_list_prefetch", &snapshot_list_prefetch); +SYSCTL_INT(_vfs_zfs, OID_AUTO, snapshot_list_prefetch, CTLFLAG_RW, + &snapshot_list_prefetch, 0, "Prefetch data when listing snapshots"); + static struct cdev *zfsdev; extern void zfs_init(void); @@ -2044,7 +2050,7 @@ zfs_ioc_snapshot_list_next(zfs_cmd_t *zc int error; top: - if (zc->zc_cookie == 0) + if (snapshot_list_prefetch && zc->zc_cookie == 0) (void) dmu_objset_find(zc->zc_name, dmu_objset_prefetch, NULL, DS_FIND_SNAPSHOTS); From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 22:24:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 772EE1065670; Fri, 20 Jan 2012 22:24:40 +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 659628FC12; Fri, 20 Jan 2012 22:24:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KMOeRX061389; Fri, 20 Jan 2012 22:24:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KMOeot061386; Fri, 20 Jan 2012 22:24:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201202224.q0KMOeot061386@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 20 Jan 2012 22:24: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: r230398 - in head/sys/powerpc: ofw powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 22:24:40 -0000 Author: nwhitehorn Date: Fri Jan 20 22:24:39 2012 New Revision: 230398 URL: http://svn.freebsd.org/changeset/base/230398 Log: Prevent an error resulting from signed/unsigned comparison on systems that do not comply with the OF spec. Submitted by: Anders Gavare MFC after: 1 week Modified: head/sys/powerpc/ofw/ofw_machdep.c head/sys/powerpc/powermac/macio.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Fri Jan 20 22:04:59 2012 (r230397) +++ head/sys/powerpc/ofw/ofw_machdep.c Fri Jan 20 22:24:39 2012 (r230398) @@ -171,10 +171,10 @@ parse_ofw_memory(phandle_t node, const c */ phandle = OF_finddevice("/"); if (OF_getprop(phandle, "#address-cells", &address_cells, - sizeof(address_cells)) < sizeof(address_cells)) + sizeof(address_cells)) < (ssize_t)sizeof(address_cells)) address_cells = 1; if (OF_getprop(phandle, "#size-cells", &size_cells, - sizeof(size_cells)) < sizeof(size_cells)) + sizeof(size_cells)) < (ssize_t)sizeof(size_cells)) size_cells = 1; /* Modified: head/sys/powerpc/powermac/macio.c ============================================================================== --- head/sys/powerpc/powermac/macio.c Fri Jan 20 22:04:59 2012 (r230397) +++ head/sys/powerpc/powermac/macio.c Fri Jan 20 22:24:39 2012 (r230398) @@ -293,7 +293,7 @@ macio_attach(device_t dev) * Locate the device node and it's base address */ if (OF_getprop(root, "assigned-addresses", - reg, sizeof(reg)) < sizeof(reg)) { + reg, sizeof(reg)) < (ssize_t)sizeof(reg)) { return (ENXIO); } From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 22:34:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F898106564A; Fri, 20 Jan 2012 22:34:20 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BCBD8FC15; Fri, 20 Jan 2012 22:34:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KMYKrc061843; Fri, 20 Jan 2012 22:34:20 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KMYKTc061833; Fri, 20 Jan 2012 22:34:20 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201202234.q0KMYKTc061833@svn.freebsd.org> From: Andreas Tobler Date: Fri, 20 Jan 2012 22:34: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: r230400 - in head: lib/libc/powerpc64/sys sys/powerpc/aim sys/powerpc/include sys/powerpc/ofw sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 22:34:20 -0000 Author: andreast Date: Fri Jan 20 22:34:19 2012 New Revision: 230400 URL: http://svn.freebsd.org/changeset/base/230400 Log: This commit adds profiling support for powerpc64. Now we can do application profiling and kernel profiling. To enable kernel profiling one has to build kgmon(8). I will enable the build once I managed to build and test powerpc (32-bit) kernels with profiling support. - add a powerpc64 PROF_PROLOGUE for _mcount. - add macros to avoid adding the PROF_PROLOGUE in certain assembly entries. - apply these macros where needed. - add size information to the MCOUNT function. MFC after: 3 weeks, together with r230291 Modified: head/lib/libc/powerpc64/sys/cerror.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/swtch64.S head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/include/asm.h head/sys/powerpc/include/profile.h head/sys/powerpc/ofw/ofwcall64.S head/sys/powerpc/powerpc/atomic.S head/sys/powerpc/powerpc/setjmp.S Modified: head/lib/libc/powerpc64/sys/cerror.S ============================================================================== --- head/lib/libc/powerpc64/sys/cerror.S Fri Jan 20 22:31:52 2012 (r230399) +++ head/lib/libc/powerpc64/sys/cerror.S Fri Jan 20 22:34:19 2012 (r230400) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); * programs and the initial threaded in threaded programs, * it returns a pointer to the global errno variable. */ -ENTRY(HIDENAME(cerror)) +ENTRY_NOPROF(HIDENAME(cerror)) mflr %r0 std %r0,16(%r1) /* save lr */ stdu %r1,-64(%r1) /* allocate new stack frame */ Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Fri Jan 20 22:31:52 2012 (r230399) +++ head/sys/powerpc/aim/locore64.S Fri Jan 20 22:34:19 2012 (r230400) @@ -115,7 +115,7 @@ kernel_text: * segment! */ .text -ASENTRY(__start) +ASENTRY_NOPROF(__start) li 8,0 li 9,0x100 mtctr 9 @@ -202,7 +202,7 @@ tocbase: * or the (currently used) C code optimized, so it doesn't use any non-volatile * registers. */ -ASENTRY(setfault) +ASENTRY_NOPROF(setfault) mflr 0 mfcr 12 mfsprg 4,0 Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Fri Jan 20 22:31:52 2012 (r230399) +++ head/sys/powerpc/aim/swtch64.S Fri Jan 20 22:34:19 2012 (r230400) @@ -68,7 +68,7 @@ /* * void cpu_throw(struct thread *old, struct thread *new) */ -ENTRY(cpu_throw) +ENTRY_NOPROF(cpu_throw) mr %r13, %r4 b cpu_switchin @@ -79,7 +79,7 @@ ENTRY(cpu_throw) * * Switch to a new thread saving the current state in the old thread. */ -ENTRY(cpu_switch) +ENTRY_NOPROF(cpu_switch) ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. These can now be used for scratch */ @@ -237,7 +237,7 @@ blocked_loop: * savectx(pcb) * Update pcb, saving current processor state */ -ENTRY(savectx) +ENTRY_NOPROF(savectx) std %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs. */ std %r13,PCB_CONTEXT+1*8(%r3) std %r14,PCB_CONTEXT+2*8(%r3) @@ -268,7 +268,8 @@ ENTRY(savectx) * fork_trampoline() * Set up the return from cpu_fork() */ -ENTRY(fork_trampoline) + +ENTRY_NOPROF(fork_trampoline) ld %r3,CF_FUNC(%r1) ld %r4,CF_ARG0(%r1) ld %r5,CF_ARG1(%r1) Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Fri Jan 20 22:31:52 2012 (r230399) +++ head/sys/powerpc/aim/trap_subr64.S Fri Jan 20 22:34:19 2012 (r230400) @@ -703,7 +703,7 @@ CNAME(asttrapexit): /* * Deliberate entry to dbtrap */ -ASENTRY(breakpoint) +ASENTRY_NOPROF(breakpoint) mtsprg1 %r1 mfmsr %r3 mtsrr1 %r3 Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Fri Jan 20 22:31:52 2012 (r230399) +++ head/sys/powerpc/include/asm.h Fri Jan 20 22:34:19 2012 (r230400) @@ -76,15 +76,35 @@ #endif #if defined(PROF) || (defined(_KERNEL) && defined(GPROF)) -# define _PROF_PROLOGUE mflr 0; stw 0,4(1); bl _mcount +# ifdef __powerpc64__ +# define _PROF_PROLOGUE mflr 0; \ + std 3,48(1); \ + std 4,56(1); \ + std 5,64(1); \ + std 0,16(1); \ + stdu 1,-112(1); \ + bl _mcount; \ + nop; \ + ld 0,112+16(1); \ + ld 3,112+48(1); \ + ld 4,112+56(1); \ + ld 5,112+64(1); \ + mtlr 0; \ + addi 1,1,112 +# else +# define _PROF_PROLOGUE mflr 0; stw 0,4(1); bl _mcount +# endif #else # define _PROF_PROLOGUE #endif -#define ENTRY(y) _ENTRY(CNAME(y)); _PROF_PROLOGUE #define ASENTRY(y) _ENTRY(ASMNAME(y)); _PROF_PROLOGUE +#define ENTRY(y) _ENTRY(CNAME(y)); _PROF_PROLOGUE #define GLOBAL(y) _GLOBAL(CNAME(y)) +#define ASENTRY_NOPROF(y) _ENTRY(ASMNAME(y)) +#define ENTRY_NOPROF(y) _ENTRY(CNAME(y)) + #define ASMSTR .asciz #define RCSID(x) .text; .asciz x Modified: head/sys/powerpc/include/profile.h ============================================================================== --- head/sys/powerpc/include/profile.h Fri Jan 20 22:31:52 2012 (r230399) +++ head/sys/powerpc/include/profile.h Fri Jan 20 22:34:19 2012 (r230400) @@ -85,6 +85,7 @@ __asm( " .text \n" \ "_mcount: \n" \ " .quad .L._mcount,.TOC.@tocbase,0\n" \ " .previous \n" \ + " .size main,24 \n" \ " .type _mcount,@function \n" \ " .align 4 \n" \ ".L._mcount: \n" \ Modified: head/sys/powerpc/ofw/ofwcall64.S ============================================================================== --- head/sys/powerpc/ofw/ofwcall64.S Fri Jan 20 22:31:52 2012 (r230399) +++ head/sys/powerpc/ofw/ofwcall64.S Fri Jan 20 22:34:19 2012 (r230400) @@ -56,7 +56,7 @@ GLOBAL(rtas_entry) * Open Firmware Real-mode Entry Point. This is a huge pain. */ -ASENTRY(ofwcall) +ASENTRY_NOPROF(ofwcall) mflr %r0 std %r0,16(%r1) stdu %r1,-208(%r1) @@ -175,7 +175,7 @@ ASENTRY(ofwcall) * C prototype: int rtascall(void *callbuffer, void *rtas_privdat); */ -ASENTRY(rtascall) +ASENTRY_NOPROF(rtascall) mflr %r0 std %r0,16(%r1) stdu %r1,-208(%r1) Modified: head/sys/powerpc/powerpc/atomic.S ============================================================================== --- head/sys/powerpc/powerpc/atomic.S Fri Jan 20 22:31:52 2012 (r230399) +++ head/sys/powerpc/powerpc/atomic.S Fri Jan 20 22:34:19 2012 (r230400) @@ -30,7 +30,7 @@ .text -ASENTRY(atomic_set_8) +ASENTRY_NOPROF(atomic_set_8) 0: lwarx 0, 0, 3 /* load old value */ slwi 4, 4, 24 /* shift the byte so it's in the right place */ or 0, 0, 4 /* generate new value */ @@ -40,7 +40,7 @@ ASENTRY(atomic_set_8) sync blr /* return */ -ASENTRY(atomic_clear_8) +ASENTRY_NOPROF(atomic_clear_8) 0: lwarx 0, 0, 3 /* load old value */ slwi 4, 4, 24 /* shift the byte so it's in the right place */ andc 0, 0, 4 /* generate new value */ @@ -50,7 +50,7 @@ ASENTRY(atomic_clear_8) sync blr /* return */ -ASENTRY(atomic_add_8) +ASENTRY_NOPROF(atomic_add_8) 0: lwarx 9, 0, 3 /* load old value */ srwi 0, 9, 24 /* byte alignment */ add 0, 4, 0 /* calculate new value */ @@ -63,7 +63,7 @@ ASENTRY(atomic_add_8) sync blr /* return */ -ASENTRY(atomic_subtract_8) +ASENTRY_NOPROF(atomic_subtract_8) 0: lwarx 9, 0, 3 /* load old value */ srwi 0, 9, 24 /* byte alignment */ subf 0, 4, 0 /* calculate new value */ @@ -76,7 +76,7 @@ ASENTRY(atomic_subtract_8) sync blr /* return */ -ASENTRY(atomic_set_16) +ASENTRY_NOPROF(atomic_set_16) li 11, 3 /* mask to test for alignment */ andc. 11, 3, 11 /* force address to be word-aligned */ 0: lwarx 12, 0, 11 /* load old value */ @@ -89,7 +89,7 @@ ASENTRY(atomic_set_16) sync blr /* return */ -ASENTRY(atomic_clear_16) +ASENTRY_NOPROF(atomic_clear_16) li 11, 3 /* mask to test for alignment */ andc. 11, 3, 11 /* force address to be word-aligned */ 0: lwarx 12, 0, 11 /* load old value */ @@ -102,7 +102,7 @@ ASENTRY(atomic_clear_16) sync blr /* return */ -ASENTRY(atomic_add_16) +ASENTRY_NOPROF(atomic_add_16) li 11, 3 /* mask to test for alignment */ andc. 11, 3, 11 /* force address to be word-aligned */ 0: lwarx 12, 0, 11 /* load old value */ @@ -119,7 +119,7 @@ ASENTRY(atomic_add_16) sync blr /* return */ -ASENTRY(atomic_subtract_16) +ASENTRY_NOPROF(atomic_subtract_16) li 11, 3 /* mask to test for alignment */ andc. 11, 3, 11 /* force address to be word-aligned */ 0: lwarx 12, 0, 11 /* load old value */ Modified: head/sys/powerpc/powerpc/setjmp.S ============================================================================== --- head/sys/powerpc/powerpc/setjmp.S Fri Jan 20 22:31:52 2012 (r230399) +++ head/sys/powerpc/powerpc/setjmp.S Fri Jan 20 22:34:19 2012 (r230400) @@ -42,7 +42,7 @@ #define JMP_xer 24*REGWIDTH #define JMP_sig 25*REGWIDTH -ASENTRY(setjmp) +ASENTRY_NOPROF(setjmp) ST_REG 31, JMP_r31(3) /* r1, r2, r14-r30 */ ST_REG 1, JMP_r1 (3) @@ -79,7 +79,7 @@ ASENTRY(setjmp) .extern sigsetmask -ASENTRY(longjmp) +ASENTRY_NOPROF(longjmp) LD_REG 31, JMP_r31(3) /* r1, r2, r14-r30 */ LD_REG 1, JMP_r1 (3) From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 22:37:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22E2F106564A; Fri, 20 Jan 2012 22:37:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F06BD8FC08; Fri, 20 Jan 2012 22:37:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KMbAoF061965; Fri, 20 Jan 2012 22:37:10 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KMbA8f061960; Fri, 20 Jan 2012 22:37:10 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201202237.q0KMbA8f061960@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 20 Jan 2012 22:37: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: r230401 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/maestro3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 22:37:11 -0000 Author: pfg Date: Fri Jan 20 22:37:10 2012 New Revision: 230401 URL: http://svn.freebsd.org/changeset/base/230401 Log: Replace GPLd headers from the Maestro3 driver with BSD licensed versions derived from /usr/ports/audio/oss. The particular headers used were taken from the attic/drv/oss_allegro directory and are mostly identical to the previous files. The Maestro3 driver is now free from the GPL. NOTE: due to lack of testers this driver is being considered for deprecation and removal. PR: kern/153920 Approved by: jhb (mentor) MFC after: 2 weeks Added: head/sys/dev/sound/pci/allegro_code.h (contents, props changed) head/sys/dev/sound/pci/allegro_reg.h (contents, props changed) Deleted: head/sys/gnu/dev/sound/pci/maestro3_dsp.h head/sys/gnu/dev/sound/pci/maestro3_reg.h Modified: head/sys/conf/files head/sys/dev/sound/pci/maestro3.c head/sys/modules/sound/driver/maestro3/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jan 20 22:34:19 2012 (r230400) +++ head/sys/conf/files Fri Jan 20 22:37:10 2012 (r230401) @@ -1741,8 +1741,7 @@ dev/sound/pci/es137x.c optional snd_es1 dev/sound/pci/fm801.c optional snd_fm801 pci dev/sound/pci/ich.c optional snd_ich pci dev/sound/pci/maestro.c optional snd_maestro pci -dev/sound/pci/maestro3.c optional snd_maestro3 pci \ - warning "kernel contains GPL contaminated maestro3 headers" +dev/sound/pci/maestro3.c optional snd_maestro3 pci dev/sound/pci/neomagic.c optional snd_neomagic pci dev/sound/pci/solo.c optional snd_solo pci dev/sound/pci/spicds.c optional snd_spicds pci Added: head/sys/dev/sound/pci/allegro_code.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sound/pci/allegro_code.h Fri Jan 20 22:37:10 2012 (r230401) @@ -0,0 +1,218 @@ +/* $FreeBSD$ */ +/*- + * Copyright (C) 1996-2008, 4Front Technologies + * Copyright (C) 1997-1999 ESS Technology, Inc + * 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 source code, its compiled object code, and its associated data sets + * are copyright (C) 1997-1999 ESS Technology, Inc. This source code and its + * associated data sets are trade secrets of ESS Technology, Inc. + *--------------------------------------------------------------------------- + * DESCRIPTION: DSP binaries + *--------------------------------------------------------------------------- + * AUTHOR: Henry Tang / Hong Kim / Alger Yeung/Don Kim + *--------------------------------------------------------------------------- + * For practical purposes we only include what is necessary for current + * Maestro3 driver. Files used in this header include: + * kernel.dat + * 400m_src.dat + * mini_src_lpf from srcmgr.h + *--------------------------------------------------------------------------- + */ +#ifndef _DEV_SOUND_PCI_ALLEGRO_CODE_H +#define _DEV_SOUND_PCI_ALLEGRO_CODE_H + +/* + * Kernel + */ + +uint16_t gaw_kernel_vect_code[] = { + 0x7980, 0x0030, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x00FB, 0x7980, + 0x00DD, 0x7980, 0x03B4, 0x7980, 0x0332, 0x7980, 0x0287, 0x7980, 0x03B4, + 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x031A, 0x7980, + 0x03B4, 0x7980, 0x022F, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, + 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x0063, 0x7980, 0x006B, 0x7980, + 0x03B4, 0x7980, 0x03B4, 0xBF80, 0x2C7C, 0x8806, 0x8804, 0xBE40, 0xBC20, + 0xAE09, 0x1000, 0xAE0A, 0x0001, 0x6938, 0xEB08, 0x0053, 0x695A, 0xEB08, + 0x00D6, 0x0009, 0x8B88, 0x6980, 0xE388, 0x0036, 0xBE30, 0xBC20, 0x6909, + 0xB801, 0x9009, 0xBE41, 0xBE41, 0x6928, 0xEB88, 0x0078, 0xBE41, 0xBE40, + 0x7980, 0x0038, 0xBE41, 0xBE41, 0x903A, 0x6938, 0xE308, 0x0056, 0x903A, + 0xBE41, 0xBE40, 0xEF00, 0x903A, 0x6939, 0xE308, 0x005E, 0x903A, 0xEF00, + 0x690B, 0x660C, 0xEF8C, 0x690A, 0x660C, 0x620B, 0x6609, 0xEF00, 0x6910, + 0x660F, 0xEF04, 0xE388, 0x0075, 0x690E, 0x660F, 0x6210, 0x660D, 0xEF00, + 0x690E, 0x660D, 0xEF00, 0xAE70, 0x0001, 0xBC20, 0xAE27, 0x0001, 0x6939, + 0xEB08, 0x005D, 0x6926, 0xB801, 0x9026, 0x0026, 0x8B88, 0x6980, 0xE388, + 0x00CB, 0x9028, 0x0D28, 0x4211, 0xE100, 0x007A, 0x4711, 0xE100, 0x00A0, + 0x7A80, 0x0063, 0xB811, 0x660A, 0x6209, 0xE304, 0x007A, 0x0C0B, 0x4005, + 0x100A, 0xBA01, 0x9012, 0x0C12, 0x4002, 0x7980, 0x00AF, 0x7A80, 0x006B, + 0xBE02, 0x620E, 0x660D, 0xBA10, 0xE344, 0x007A, 0x0C10, 0x4005, 0x100E, + 0xBA01, 0x9012, 0x0C12, 0x4002, 0x1003, 0xBA02, 0x9012, 0x0C12, 0x4000, + 0x1003, 0xE388, 0x00BA, 0x1004, 0x7980, 0x00BC, 0x1004, 0xBA01, 0x9012, + 0x0C12, 0x4001, 0x0C05, 0x4003, 0x0C06, 0x4004, 0x1011, 0xBFB0, 0x01FF, + 0x9012, 0x0C12, 0x4006, 0xBC20, 0xEF00, 0xAE26, 0x1028, 0x6970, 0xBFD0, + 0x0001, 0x9070, 0xE388, 0x007A, 0xAE28, 0x0000, 0xEF00, 0xAE70, 0x0300, + 0x0C70, 0xB00C, 0xAE5A, 0x0000, 0xEF00, 0x7A80, 0x038A, 0x697F, 0xB801, + 0x907F, 0x0056, 0x8B88, 0x0CA0, 0xB008, 0xAF71, 0xB000, 0x4E71, 0xE200, + 0x00F3, 0xAE56, 0x1057, 0x0056, 0x0CA0, 0xB008, 0x8056, 0x7980, 0x03A1, + 0x0810, 0xBFA0, 0x1059, 0xE304, 0x03A1, 0x8056, 0x7980, 0x03A1, 0x7A80, + 0x038A, 0xBF01, 0xBE43, 0xBE59, 0x907C, 0x6937, 0xE388, 0x010D, 0xBA01, + 0xE308, 0x010C, 0xAE71, 0x0004, 0x0C71, 0x5000, 0x6936, 0x9037, 0xBF0A, + 0x109E, 0x8B8A, 0xAF80, 0x8014, 0x4C80, 0xBF0A, 0x0560, 0xF500, 0xBF0A, + 0x0520, 0xB900, 0xBB17, 0x90A0, 0x6917, 0xE388, 0x0148, 0x0D17, 0xE100, + 0x0127, 0xBF0C, 0x0578, 0xBF0D, 0x057C, 0x7980, 0x012B, 0xBF0C, 0x0538, + 0xBF0D, 0x053C, 0x6900, 0xE308, 0x0135, 0x8B8C, 0xBE59, 0xBB07, 0x90A0, + 0xBC20, 0x7980, 0x0157, 0x030C, 0x8B8B, 0xB903, 0x8809, 0xBEC6, 0x013E, + 0x69AC, 0x90AB, 0x69AD, 0x90AB, 0x0813, 0x660A, 0xE344, 0x0144, 0x0309, + 0x830C, 0xBC20, 0x7980, 0x0157, 0x6955, 0xE388, 0x0157, 0x7C38, 0xBF0B, + 0x0578, 0xF500, 0xBF0B, 0x0538, 0xB907, 0x8809, 0xBEC6, 0x0156, 0x10AB, + 0x90AA, 0x6974, 0xE388, 0x0163, 0xAE72, 0x0540, 0xF500, 0xAE72, 0x0500, + 0xAE61, 0x103B, 0x7A80, 0x02F6, 0x6978, 0xE388, 0x0182, 0x8B8C, 0xBF0C, + 0x0560, 0xE500, 0x7C40, 0x0814, 0xBA20, 0x8812, 0x733D, 0x7A80, 0x0380, + 0x733E, 0x7A80, 0x0380, 0x8B8C, 0xBF0C, 0x056C, 0xE500, 0x7C40, 0x0814, + 0xBA2C, 0x8812, 0x733F, 0x7A80, 0x0380, 0x7340, 0x7A80, 0x0380, 0x6975, + 0xE388, 0x018E, 0xAE72, 0x0548, 0xF500, 0xAE72, 0x0508, 0xAE61, 0x1041, + 0x7A80, 0x02F6, 0x6979, 0xE388, 0x01AD, 0x8B8C, 0xBF0C, 0x0560, 0xE500, + 0x7C40, 0x0814, 0xBA18, 0x8812, 0x7343, 0x7A80, 0x0380, 0x7344, 0x7A80, + 0x0380, 0x8B8C, 0xBF0C, 0x056C, 0xE500, 0x7C40, 0x0814, 0xBA24, 0x8812, + 0x7345, 0x7A80, 0x0380, 0x7346, 0x7A80, 0x0380, 0x6976, 0xE388, 0x01B9, + 0xAE72, 0x0558, 0xF500, 0xAE72, 0x0518, 0xAE61, 0x1047, 0x7A80, 0x02F6, + 0x697A, 0xE388, 0x01D8, 0x8B8C, 0xBF0C, 0x0560, 0xE500, 0x7C40, 0x0814, + 0xBA08, 0x8812, 0x7349, 0x7A80, 0x0380, 0x734A, 0x7A80, 0x0380, 0x8B8C, + 0xBF0C, 0x056C, 0xE500, 0x7C40, 0x0814, 0xBA14, 0x8812, 0x734B, 0x7A80, + 0x0380, 0x734C, 0x7A80, 0x0380, 0xBC21, 0xAE1C, 0x1090, 0x8B8A, 0xBF0A, + 0x0560, 0xE500, 0x7C40, 0x0812, 0xB804, 0x8813, 0x8B8D, 0xBF0D, 0x056C, + 0xE500, 0x7C40, 0x0815, 0xB804, 0x8811, 0x7A80, 0x034A, 0x8B8A, 0xBF0A, + 0x0560, 0xE500, 0x7C40, 0x731F, 0xB903, 0x8809, 0xBEC6, 0x01F9, 0x548A, + 0xBE03, 0x98A0, 0x7320, 0xB903, 0x8809, 0xBEC6, 0x0201, 0x548A, 0xBE03, + 0x98A0, 0x1F20, 0x2F1F, 0x9826, 0xBC20, 0x6935, 0xE388, 0x03A1, 0x6933, + 0xB801, 0x9033, 0xBFA0, 0x02EE, 0xE308, 0x03A1, 0x9033, 0xBF00, 0x6951, + 0xE388, 0x021F, 0x7334, 0xBE80, 0x5760, 0xBE03, 0x9F7E, 0xBE59, 0x9034, + 0x697E, 0x0D51, 0x9013, 0xBC20, 0x695C, 0xE388, 0x03A1, 0x735E, 0xBE80, + 0x5760, 0xBE03, 0x9F7E, 0xBE59, 0x905E, 0x697E, 0x0D5C, 0x9013, 0x7980, + 0x03A1, 0x7A80, 0x038A, 0xBF01, 0xBE43, 0x6977, 0xE388, 0x024E, 0xAE61, + 0x104D, 0x0061, 0x8B88, 0x6980, 0xE388, 0x024E, 0x9071, 0x0D71, 0x000B, + 0xAFA0, 0x8010, 0xAFA0, 0x8010, 0x0810, 0x660A, 0xE308, 0x0249, 0x0009, + 0x0810, 0x660C, 0xE388, 0x024E, 0x800B, 0xBC20, 0x697B, 0xE388, 0x03A1, + 0xBF0A, 0x109E, 0x8B8A, 0xAF80, 0x8014, 0x4C80, 0xE100, 0x0266, 0x697C, + 0xBF90, 0x0560, 0x9072, 0x0372, 0x697C, 0xBF90, 0x0564, 0x9073, 0x0473, + 0x7980, 0x0270, 0x697C, 0xBF90, 0x0520, 0x9072, 0x0372, 0x697C, 0xBF90, + 0x0524, 0x9073, 0x0473, 0x697C, 0xB801, 0x907C, 0xBF0A, 0x10FD, 0x8B8A, + 0xAF80, 0x8010, 0x734F, 0x548A, 0xBE03, 0x9880, 0xBC21, 0x7326, 0x548B, + 0xBE03, 0x618B, 0x988C, 0xBE03, 0x6180, 0x9880, 0x7980, 0x03A1, 0x7A80, + 0x038A, 0x0D28, 0x4711, 0xE100, 0x02BE, 0xAF12, 0x4006, 0x6912, 0xBFB0, + 0x0C00, 0xE388, 0x02B6, 0xBFA0, 0x0800, 0xE388, 0x02B2, 0x6912, 0xBFB0, + 0x0C00, 0xBFA0, 0x0400, 0xE388, 0x02A3, 0x6909, 0x900B, 0x7980, 0x02A5, + 0xAF0B, 0x4005, 0x6901, 0x9005, 0x6902, 0x9006, 0x4311, 0xE100, 0x02ED, + 0x6911, 0xBFC0, 0x2000, 0x9011, 0x7980, 0x02ED, 0x6909, 0x900B, 0x7980, + 0x02B8, 0xAF0B, 0x4005, 0xAF05, 0x4003, 0xAF06, 0x4004, 0x7980, 0x02ED, + 0xAF12, 0x4006, 0x6912, 0xBFB0, 0x0C00, 0xE388, 0x02E7, 0xBFA0, 0x0800, + 0xE388, 0x02E3, 0x6912, 0xBFB0, 0x0C00, 0xBFA0, 0x0400, 0xE388, 0x02D4, + 0x690D, 0x9010, 0x7980, 0x02D6, 0xAF10, 0x4005, 0x6901, 0x9005, 0x6902, + 0x9006, 0x4311, 0xE100, 0x02ED, 0x6911, 0xBFC0, 0x2000, 0x9011, 0x7980, + 0x02ED, 0x690D, 0x9010, 0x7980, 0x02E9, 0xAF10, 0x4005, 0xAF05, 0x4003, + 0xAF06, 0x4004, 0xBC20, 0x6970, 0x9071, 0x7A80, 0x0078, 0x6971, 0x9070, + 0x7980, 0x03A1, 0xBC20, 0x0361, 0x8B8B, 0x6980, 0xEF88, 0x0272, 0x0372, + 0x7804, 0x9071, 0x0D71, 0x8B8A, 0x000B, 0xB903, 0x8809, 0xBEC6, 0x0309, + 0x69A8, 0x90AB, 0x69A8, 0x90AA, 0x0810, 0x660A, 0xE344, 0x030F, 0x0009, + 0x0810, 0x660C, 0xE388, 0x0314, 0x800B, 0xBC20, 0x6961, 0xB801, 0x9061, + 0x7980, 0x02F7, 0x7A80, 0x038A, 0x5D35, 0x0001, 0x6934, 0xB801, 0x9034, + 0xBF0A, 0x109E, 0x8B8A, 0xAF80, 0x8014, 0x4880, 0xAE72, 0x0550, 0xF500, + 0xAE72, 0x0510, 0xAE61, 0x1051, 0x7A80, 0x02F6, 0x7980, 0x03A1, 0x7A80, + 0x038A, 0x5D35, 0x0002, 0x695E, 0xB801, 0x905E, 0xBF0A, 0x109E, 0x8B8A, + 0xAF80, 0x8014, 0x4780, 0xAE72, 0x0558, 0xF500, 0xAE72, 0x0518, 0xAE61, + 0x105C, 0x7A80, 0x02F6, 0x7980, 0x03A1, 0x001C, 0x8B88, 0x6980, 0xEF88, + 0x901D, 0x0D1D, 0x100F, 0x6610, 0xE38C, 0x0358, 0x690E, 0x6610, 0x620F, + 0x660D, 0xBA0F, 0xE301, 0x037A, 0x0410, 0x8B8A, 0xB903, 0x8809, 0xBEC6, + 0x036C, 0x6A8C, 0x61AA, 0x98AB, 0x6A8C, 0x61AB, 0x98AD, 0x6A8C, 0x61AD, + 0x98A9, 0x6A8C, 0x61A9, 0x98AA, 0x7C04, 0x8B8B, 0x7C04, 0x8B8D, 0x7C04, + 0x8B89, 0x7C04, 0x0814, 0x660E, 0xE308, 0x0379, 0x040D, 0x8410, 0xBC21, + 0x691C, 0xB801, 0x901C, 0x7980, 0x034A, 0xB903, 0x8809, 0x8B8A, 0xBEC6, + 0x0388, 0x54AC, 0xBE03, 0x618C, 0x98AA, 0xEF00, 0xBC20, 0xBE46, 0x0809, + 0x906B, 0x080A, 0x906C, 0x080B, 0x906D, 0x081A, 0x9062, 0x081B, 0x9063, + 0x081E, 0x9064, 0xBE59, 0x881E, 0x8065, 0x8166, 0x8267, 0x8368, 0x8469, + 0x856A, 0xEF00, 0xBC20, 0x696B, 0x8809, 0x696C, 0x880A, 0x696D, 0x880B, + 0x6962, 0x881A, 0x6963, 0x881B, 0x6964, 0x881E, 0x0065, 0x0166, 0x0267, + 0x0368, 0x0469, 0x056A, 0xBE3A, +}; + +/* + * MINI Sample Rate Conversion + */ + +uint16_t gaw_minisrc_code_0400[] = { + 0xBF80, 0x101E, 0x906E, 0x006E, 0x8B88, 0x6980, 0xEF88, 0x906F, 0x0D6F, + 0x6900, 0xEB08, 0x0412, 0xBC20, 0x696E, 0xB801, 0x906E, 0x7980, 0x0403, + 0xB90E, 0x8807, 0xBE43, 0xBF01, 0xBE47, 0xBE41, 0x7A80, 0x002A, 0xBE40, + 0x3029, 0xEFCC, 0xBE41, 0x7A80, 0x0028, 0xBE40, 0x3028, 0xEFCC, 0x6907, + 0xE308, 0x042A, 0x6909, 0x902C, 0x7980, 0x042C, 0x690D, 0x902C, 0x1009, + 0x881A, 0x100A, 0xBA01, 0x881B, 0x100D, 0x881C, 0x100E, 0xBA01, 0x881D, + 0xBF80, 0x00ED, 0x881E, 0x050C, 0x0124, 0xB904, 0x9027, 0x6918, 0xE308, + 0x04B3, 0x902D, 0x6913, 0xBFA0, 0x7598, 0xF704, 0xAE2D, 0x00FF, 0x8B8D, + 0x6919, 0xE308, 0x0463, 0x691A, 0xE308, 0x0456, 0xB907, 0x8809, 0xBEC6, + 0x0453, 0x10A9, 0x90AD, 0x7980, 0x047C, 0xB903, 0x8809, 0xBEC6, 0x0460, + 0x1889, 0x6C22, 0x90AD, 0x10A9, 0x6E23, 0x6C22, 0x90AD, 0x7980, 0x047C, + 0x101A, 0xE308, 0x046F, 0xB903, 0x8809, 0xBEC6, 0x046C, 0x10A9, 0x90A0, + 0x90AD, 0x7980, 0x047C, 0xB901, 0x8809, 0xBEC6, 0x047B, 0x1889, 0x6C22, + 0x90A0, 0x90AD, 0x10A9, 0x6E23, 0x6C22, 0x90A0, 0x90AD, 0x692D, 0xE308, + 0x049C, 0x0124, 0xB703, 0xB902, 0x8818, 0x8B89, 0x022C, 0x108A, 0x7C04, + 0x90A0, 0x692B, 0x881F, 0x7E80, 0x055B, 0x692A, 0x8809, 0x8B89, 0x99A0, + 0x108A, 0x90A0, 0x692B, 0x881F, 0x7E80, 0x055B, 0x692A, 0x8809, 0x8B89, + 0x99AF, 0x7B99, 0x0484, 0x0124, 0x060F, 0x101B, 0x2013, 0x901B, 0xBFA0, + 0x7FFF, 0xE344, 0x04AC, 0x901B, 0x8B89, 0x7A80, 0x051A, 0x6927, 0xBA01, + 0x9027, 0x7A80, 0x0523, 0x6927, 0xE308, 0x049E, 0x7980, 0x050F, 0x0624, + 0x1026, 0x2013, 0x9026, 0xBFA0, 0x7FFF, 0xE304, 0x04C0, 0x8B8D, 0x7A80, + 0x051A, 0x7980, 0x04B4, 0x9026, 0x1013, 0x3026, 0x901B, 0x8B8D, 0x7A80, + 0x051A, 0x7A80, 0x0523, 0x1027, 0xBA01, 0x9027, 0xE308, 0x04B4, 0x0124, + 0x060F, 0x8B89, 0x691A, 0xE308, 0x04EA, 0x6919, 0xE388, 0x04E0, 0xB903, + 0x8809, 0xBEC6, 0x04DD, 0x1FA0, 0x2FAE, 0x98A9, 0x7980, 0x050F, 0xB901, + 0x8818, 0xB907, 0x8809, 0xBEC6, 0x04E7, 0x10EE, 0x90A9, 0x7980, 0x050F, + 0x6919, 0xE308, 0x04FE, 0xB903, 0x8809, 0xBE46, 0xBEC6, 0x04FA, 0x17A0, + 0xBE1E, 0x1FAE, 0xBFBF, 0xFF00, 0xBE13, 0xBFDF, 0x8080, 0x99A9, 0xBE47, + 0x7980, 0x050F, 0xB901, 0x8809, 0xBEC6, 0x050E, 0x16A0, 0x26A0, 0xBFB7, + 0xFF00, 0xBE1E, 0x1EA0, 0x2EAE, 0xBFBF, 0xFF00, 0xBE13, 0xBFDF, 0x8080, + 0x99A9, 0x850C, 0x860F, 0x6907, 0xE388, 0x0516, 0x0D07, 0x8510, 0xBE59, + 0x881E, 0xBE4A, 0xEF00, 0x101E, 0x901C, 0x101F, 0x901D, 0x10A0, 0x901E, + 0x10A0, 0x901F, 0xEF00, 0x101E, 0x301C, 0x9020, 0x731B, 0x5420, 0xBE03, + 0x9825, 0x1025, 0x201C, 0x9025, 0x7325, 0x5414, 0xBE03, 0x8B8E, 0x9880, + 0x692F, 0xE388, 0x0539, 0xBE59, 0xBB07, 0x6180, 0x9880, 0x8BA0, 0x101F, + 0x301D, 0x9021, 0x731B, 0x5421, 0xBE03, 0x982E, 0x102E, 0x201D, 0x902E, + 0x732E, 0x5415, 0xBE03, 0x9880, 0x692F, 0xE388, 0x054F, 0xBE59, 0xBB07, + 0x6180, 0x9880, 0x8BA0, 0x6918, 0xEF08, 0x7325, 0x5416, 0xBE03, 0x98A0, + 0x732E, 0x5417, 0xBE03, 0x98A0, 0xEF00, 0x8BA0, 0xBEC6, 0x056B, 0xBE59, + 0xBB04, 0xAA90, 0xBE04, 0xBE1E, 0x99E0, 0x8BE0, 0x69A0, 0x90D0, 0x69A0, + 0x90D0, 0x081F, 0xB805, 0x881F, 0x8B90, 0x69A0, 0x90D0, 0x69A0, 0x9090, + 0x8BD0, 0x8BD8, 0xBE1F, 0xEF00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +}; + +uint16_t minisrc_lpf[10] = { + 0X0743, 0X1104, 0X0A4C, 0XF88D, 0X242C, + 0X1023, 0X1AA9, 0X0B60, 0XEFDD, 0X186F +}; + +#endif /* !_DEV_SOUND_PCI_ALLEGRO_CODE_H */ Added: head/sys/dev/sound/pci/allegro_reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sound/pci/allegro_reg.h Fri Jan 20 22:37:10 2012 (r230401) @@ -0,0 +1,790 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 1996-2008, 4Front Technologies + * Copyright (C) 1992-2000 Don Kim (don.kim@esstech.com) + * 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, WHETHERIN 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. + * + */ + +/*--------------------------------------------------------------------------- + * Copyright (C) 1997-1999, ESS Technology, Inc. + * This source code, its compiled object code, and its associated data sets + * are copyright (C) 1997-1999 ESS Technology, Inc. + *--------------------------------------------------------------------------- + * This header contains data structures and registers taken from the + * 4Front OSS Allegro BSD licensed driver (in the Attic/ directory). + * Files used for this header include: + * hardware.h + * kernel.h and hckernel.h + * srcmgr.h + *--------------------------------------------------------------------------- + */ + +#ifndef _DEV_SOUND_PCI_ALLEGRO_REG_H +#define _DEV_SOUND_PCI_ALLEGRO_REG_H + +/* Allegro PCI configuration registers */ +#define PCI_LEGACY_AUDIO_CTRL 0x40 +#define SOUND_BLASTER_ENABLE 0x00000001 +#define FM_SYNTHESIS_ENABLE 0x00000002 +#define GAME_PORT_ENABLE 0x00000004 +#define MPU401_IO_ENABLE 0x00000008 +#define MPU401_IRQ_ENABLE 0x00000010 +#define ALIAS_10BIT_IO 0x00000020 +#define SB_DMA_MASK 0x000000C0 +#define SB_DMA_0 0x00000040 +#define SB_DMA_1 0x00000040 +#define SB_DMA_R 0x00000080 +#define SB_DMA_3 0x000000C0 +#define SB_IRQ_MASK 0x00000700 +#define SB_IRQ_5 0x00000000 +#define SB_IRQ_7 0x00000100 +#define SB_IRQ_9 0x00000200 +#define SB_IRQ_10 0x00000300 +#define MIDI_IRQ_MASK 0x00003800 +#define SERIAL_IRQ_ENABLE 0x00004000 +#define DISABLE_LEGACY 0x00008000 + +#define PCI_ALLEGRO_CONFIG 0x50 +#define SB_ADDR_240 0x00000004 +#define MPU_ADDR_MASK 0x00000018 +#define MPU_ADDR_330 0x00000000 +#define MPU_ADDR_300 0x00000008 +#define MPU_ADDR_320 0x00000010 +#define MPU_ADDR_340 0x00000018 +#define USE_PCI_TIMING 0x00000040 +#define POSTED_WRITE_ENABLE 0x00000080 +#define DMA_POLICY_MASK 0x00000700 +#define DMA_DDMA 0x00000000 +#define DMA_TDMA 0x00000100 +#define DMA_PCPCI 0x00000200 +#define DMA_WBDMA16 0x00000400 +#define DMA_WBDMA4 0x00000500 +#define DMA_WBDMA2 0x00000600 +#define DMA_WBDMA1 0x00000700 +#define DMA_SAFE_GUARD 0x00000800 +#define HI_PERF_GP_ENABLE 0x00001000 +#define PIC_SNOOP_MODE_0 0x00002000 +#define PIC_SNOOP_MODE_1 0x00004000 +#define SOUNDBLASTER_IRQ_MASK 0x00008000 +#define RING_IN_ENABLE 0x00010000 +#define SPDIF_TEST_MODE 0x00020000 +#define CLK_MULT_MODE_SELECT_2 0x00040000 +#define EEPROM_WRITE_ENABLE 0x00080000 +#define CODEC_DIR_IN 0x00100000 +#define HV_BUTTON_FROM_GD 0x00200000 +#define REDUCED_DEBOUNCE 0x00400000 +#define HV_CTRL_ENABLE 0x00800000 +#define SPDIF_ENABLE 0x01000000 +#define CLK_DIV_SELECT 0x06000000 +#define CLK_DIV_BY_48 0x00000000 +#define CLK_DIV_BY_49 0x02000000 +#define CLK_DIV_BY_50 0x04000000 +#define CLK_DIV_RESERVED 0x06000000 +#define PM_CTRL_ENABLE 0x08000000 +#define CLK_MULT_MODE_SELECT 0x30000000 +#define CLK_MULT_MODE_SHIFT 28 +#define CLK_MULT_MODE_0 0x00000000 +#define CLK_MULT_MODE_1 0x10000000 +#define CLK_MULT_MODE_2 0x20000000 +#define CLK_MULT_MODE_3 0x30000000 +#define INT_CLK_SELECT 0x40000000 +#define INT_CLK_MULT_RESET 0x80000000 + +/* M3 */ +#define INT_CLK_SRC_NOT_PCI 0x00100000 +#define INT_CLK_MULT_ENABLE 0x80000000 + +#define PCI_ACPI_CONTROL 0x54 +#define PCI_ACPI_D0 0x00000000 +#define PCI_ACPI_D1 0xB4F70000 +#define PCI_ACPI_D2 0xB4F7B4F7 + +#define PCI_USER_CONFIG 0x58 +#define EXT_PCI_MASTER_ENABLE 0x00000001 +#define SPDIF_OUT_SELECT 0x00000002 +#define TEST_PIN_DIR_CTRL 0x00000004 +#define AC97_CODEC_TEST 0x00000020 +#define TRI_STATE_BUFFER 0x00000080 +#define IN_CLK_12MHZ_SELECT 0x00000100 +#define MULTI_FUNC_DISABLE 0x00000200 +#define EXT_MASTER_PAIR_SEL 0x00000400 +#define PCI_MASTER_SUPPORT 0x00000800 +#define STOP_CLOCK_ENABLE 0x00001000 +#define EAPD_DRIVE_ENABLE 0x00002000 +#define REQ_TRI_STATE_ENABLE 0x00004000 +#define REQ_LOW_ENABLE 0x00008000 +#define MIDI_1_ENABLE 0x00010000 +#define MIDI_2_ENABLE 0x00020000 +#define SB_AUDIO_SYNC 0x00040000 +#define HV_CTRL_TEST 0x00100000 +#define SOUNDBLASTER_TEST 0x00400000 + +#define PCI_USER_CONFIG_C 0x5C + +#define PCI_DDMA_CTRL 0x60 +#define DDMA_ENABLE 0x00000001 + + +/* Allegro registers */ +#define HOST_INT_CTRL 0x18 +#define SB_INT_ENABLE 0x0001 +#define MPU401_INT_ENABLE 0x0002 +#define ASSP_INT_ENABLE 0x0010 +#define RING_INT_ENABLE 0x0020 +#define HV_INT_ENABLE 0x0040 +#define CLKRUN_GEN_ENABLE 0x0100 +#define HV_CTRL_TO_PME 0x0400 +#define SOFTWARE_RESET_ENABLE 0x8000 + +#define HOST_INT_STATUS 0x1A +#define SB_INT_PENDING 0x01 +#define MPU401_INT_PENDING 0x02 +#define ASSP_INT_PENDING 0x10 +#define RING_INT_PENDING 0x20 +#define HV_INT_PENDING 0x40 + +#define HARDWARE_VOL_CTRL 0x1B +#define SHADOW_MIX_REG_VOICE 0x1C +#define HW_VOL_COUNTER_VOICE 0x1D +#define SHADOW_MIX_REG_MASTER 0x1E +#define HW_VOL_COUNTER_MASTER 0x1F + +#define CODEC_COMMAND 0x30 +#define CODEC_READ_B 0x80 + +#define CODEC_STATUS 0x30 +#define CODEC_BUSY_B 0x01 + +#define CODEC_DATA 0x32 + +/* AC97 registers */ +#ifndef M3_MODEL +#define AC97_RESET 0x00 +#endif + +#define AC97_VOL_MUTE_B 0x8000 +#define AC97_VOL_M 0x1F +#define AC97_LEFT_VOL_S 8 + +#define AC97_MASTER_VOL 0x02 +#define AC97_LINE_LEVEL_VOL 0x04 +#define AC97_MASTER_MONO_VOL 0x06 +#define AC97_PC_BEEP_VOL 0x0A +#define AC97_PC_BEEP_VOL_M 0x0F +#define AC97_SROUND_MASTER_VOL 0x38 +#define AC97_PC_BEEP_VOL_S 1 + +#ifndef M3_MODEL +#define AC97_PHONE_VOL 0x0C +#define AC97_MIC_VOL 0x0E +#endif +#define AC97_MIC_20DB_ENABLE 0x40 + +#ifndef M3_MODEL +#define AC97_LINEIN_VOL 0x10 +#define AC97_CD_VOL 0x12 +#define AC97_VIDEO_VOL 0x14 +#define AC97_AUX_VOL 0x16 +#endif +#define AC97_PCM_OUT_VOL 0x18 +#ifndef M3_MODEL +#define AC97_RECORD_SELECT 0x1A +#endif +#define AC97_RECORD_MIC 0x00 +#define AC97_RECORD_CD 0x01 +#define AC97_RECORD_VIDEO 0x02 +#define AC97_RECORD_AUX 0x03 +#define AC97_RECORD_MONO_MUX 0x02 +#define AC97_RECORD_DIGITAL 0x03 +#define AC97_RECORD_LINE 0x04 +#define AC97_RECORD_STEREO 0x05 +#define AC97_RECORD_MONO 0x06 +#define AC97_RECORD_PHONE 0x07 + +#ifndef M3_MODEL +#define AC97_RECORD_GAIN 0x1C +#endif +#define AC97_RECORD_VOL_M 0x0F + +#ifndef M3_MODEL +#define AC97_GENERAL_PURPOSE 0x20 +#endif +#define AC97_POWER_DOWN_CTRL 0x26 +#define AC97_ADC_READY 0x0001 +#define AC97_DAC_READY 0x0002 +#define AC97_ANALOG_READY 0x0004 +#define AC97_VREF_ON 0x0008 +#define AC97_PR0 0x0100 +#define AC97_PR1 0x0200 +#define AC97_PR2 0x0400 +#define AC97_PR3 0x0800 +#define AC97_PR4 0x1000 + +#define AC97_RESERVED1 0x28 + +#define AC97_VENDOR_TEST 0x5A + +#define AC97_CLOCK_DELAY 0x5C +#define AC97_LINEOUT_MUX_SEL 0x0001 +#define AC97_MONO_MUX_SEL 0x0002 +#define AC97_CLOCK_DELAY_SEL 0x1F +#define AC97_DAC_CDS_SHIFT 6 +#define AC97_ADC_CDS_SHIFT 11 + +#define AC97_MULTI_CHANNEL_SEL 0x74 + +#ifndef M3_MODEL +#define AC97_VENDOR_ID1 0x7C +#define AC97_VENDOR_ID2 0x7E +#endif + +#define RING_BUS_CTRL_A 0x36 +#define RAC_PME_ENABLE 0x0100 +#define RAC_SDFS_ENABLE 0x0200 +#define LAC_PME_ENABLE 0x0400 +#define LAC_SDFS_ENABLE 0x0800 +#define SERIAL_AC_LINK_ENABLE 0x1000 +#define IO_SRAM_ENABLE 0x2000 +#define IIS_INPUT_ENABLE 0x8000 + +#define RING_BUS_CTRL_B 0x38 +#define SECOND_CODEC_ID_MASK 0x0003 +#define SPDIF_FUNC_ENABLE 0x0010 +#define SECOND_AC_ENABLE 0x0020 +#define SB_MODULE_INTF_ENABLE 0x0040 +#define SSPE_ENABLE 0x0040 +#define M3I_DOCK_ENABLE 0x0080 + +#define SDO_OUT_DEST_CTRL 0x3A +#define COMMAND_ADDR_OUT 0x0003 +#define PCM_LR_OUT_LOCAL 0x0000 +#define PCM_LR_OUT_REMOTE 0x0004 +#define PCM_LR_OUT_MUTE 0x0008 +#define PCM_LR_OUT_BOTH 0x000C +#define LINE1_DAC_OUT_LOCAL 0x0000 +#define LINE1_DAC_OUT_REMOTE 0x0010 +#define LINE1_DAC_OUT_MUTE 0x0020 +#define LINE1_DAC_OUT_BOTH 0x0030 +#define PCM_CLS_OUT_LOCAL 0x0000 +#define PCM_CLS_OUT_REMOTE 0x0040 +#define PCM_CLS_OUT_MUTE 0x0080 +#define PCM_CLS_OUT_BOTH 0x00C0 +#define PCM_RLF_OUT_LOCAL 0x0000 +#define PCM_RLF_OUT_REMOTE 0x0100 +#define PCM_RLF_OUT_MUTE 0x0200 +#define PCM_RLF_OUT_BOTH 0x0300 +#define LINE2_DAC_OUT_LOCAL 0x0000 +#define LINE2_DAC_OUT_REMOTE 0x0400 +#define LINE2_DAC_OUT_MUTE 0x0800 +#define LINE2_DAC_OUT_BOTH 0x0C00 +#define HANDSET_OUT_LOCAL 0x0000 +#define HANDSET_OUT_REMOTE 0x1000 +#define HANDSET_OUT_MUTE 0x2000 +#define HANDSET_OUT_BOTH 0x3000 +#define IO_CTRL_OUT_LOCAL 0x0000 +#define IO_CTRL_OUT_REMOTE 0x4000 +#define IO_CTRL_OUT_MUTE 0x8000 +#define IO_CTRL_OUT_BOTH 0xC000 + +#define SDO_IN_DEST_CTRL 0x3C +#define STATUS_ADDR_IN 0x0003 +#define PCM_LR_IN_LOCAL 0x0000 +#define PCM_LR_IN_REMOTE 0x0004 +#define PCM_LR_RESERVED 0x0008 +#define PCM_LR_IN_BOTH 0x000C +#define LINE1_ADC_IN_LOCAL 0x0000 +#define LINE1_ADC_IN_REMOTE 0x0010 +#define LINE1_ADC_IN_MUTE 0x0020 +#define MIC_ADC_IN_LOCAL 0x0000 +#define MIC_ADC_IN_REMOTE 0x0040 +#define MIC_ADC_IN_MUTE 0x0080 +#define LINE2_DAC_IN_LOCAL 0x0000 +#define LINE2_DAC_IN_REMOTE 0x0400 +#define LINE2_DAC_IN_MUTE 0x0800 +#define HANDSET_IN_LOCAL 0x0000 +#define HANDSET_IN_REMOTE 0x1000 +#define HANDSET_IN_MUTE 0x2000 +#define IO_STATUS_IN_LOCAL 0x0000 +#define IO_STATUS_IN_REMOTE 0x4000 + +#define SPDIF_IN_CTRL 0x3E +#define SPDIF_IN_ENABLE 0x0001 + +#define GPIO_DATA 0x60 +#define GPIO_DATA_MASK 0x0FFF +#define GPIO_HV_STATUS 0x3000 +#define GPIO_PME_STATUS 0x4000 + +#define GPIO_MASK 0x64 +#define GPIO_DIRECTION 0x68 +#define GPO_PRIMARY_AC97 0x0001 +#define GPI_LINEOUT_SENSE 0x0004 +#define GPO_SECONDARY_AC97 0x0008 +#define GPI_VOL_DOWN 0x0010 +#define GPI_VOL_UP 0x0020 +#define GPI_IIS_CLK 0x0040 +#define GPI_IIS_LRCLK 0x0080 +#define GPI_IIS_DATA 0x0100 +#define GPI_DOCKING_STATUS 0x0100 +#define GPI_HEADPHONE_SENSE 0x0200 +#define GPO_EXT_AMP_SHUTDOWN 0x1000 + +/* M3 */ +#define GPO_M3_EXT_AMP_SHUTDN 0x0002 + +#define ASSP_INDEX_PORT 0x80 +#define ASSP_MEMORY_PORT 0x82 +#define ASSP_DATA_PORT 0x84 + +#define MPU401_DATA_PORT 0x98 +#define MPU401_STATUS_PORT 0x99 + +#define CLK_MULT_DATA_PORT 0x9C + +#define ASSP_CONTROL_A 0xA2 +#define ASSP_0_WS_ENABLE 0x01 +#define ASSP_CTRL_A_RESERVED1 0x02 +#define ASSP_CTRL_A_RESERVED2 0x04 +#define ASSP_CLK_49MHZ_SELECT 0x08 +#define FAST_PLU_ENABLE 0x10 +#define ASSP_CTRL_A_RESERVED3 0x20 +#define DSP_CLK_36MHZ_SELECT 0x40 + +#define ASSP_CONTROL_B 0xA4 +#define RESET_ASSP 0x00 +#define RUN_ASSP 0x01 +#define ENABLE_ASSP_CLOCK 0x00 +#define STOP_ASSP_CLOCK 0x10 +#define RESET_TOGGLE 0x40 + +#define ASSP_CONTROL_C 0xA6 +#define ASSP_HOST_INT_ENABLE 0x01 +#define FM_ADDR_REMAP_DISABLE 0x02 +#define HOST_WRITE_PORT_ENABLE 0x08 + +#define ASSP_HOST_INT_STATUS 0xAC +#define DSP2HOST_REQ_PIORECORD 0x01 +#define DSP2HOST_REQ_I2SRATE 0x02 +#define DSP2HOST_REQ_TIMER 0x04 + +/* + * DSP memory map + */ + +#define REV_A_CODE_MEMORY_BEGIN 0x0000 +#define REV_A_CODE_MEMORY_END 0x0FFF +#define REV_A_CODE_MEMORY_UNIT_LENGTH 0x0040 +#define REV_A_CODE_MEMORY_LENGTH (REV_A_CODE_MEMORY_END - REV_A_CODE_MEMORY_BEGIN + 1) + +#define REV_B_CODE_MEMORY_BEGIN 0x0000 +#define REV_B_CODE_MEMORY_END 0x0BFF +#define REV_B_CODE_MEMORY_UNIT_LENGTH 0x0040 +#define REV_B_CODE_MEMORY_LENGTH (REV_B_CODE_MEMORY_END - REV_B_CODE_MEMORY_BEGIN + 1) + +#if (REV_A_CODE_MEMORY_LENGTH % REV_A_CODE_MEMORY_UNIT_LENGTH) +#error Assumption about code memory unit length failed. +#endif +#if (REV_B_CODE_MEMORY_LENGTH % REV_B_CODE_MEMORY_UNIT_LENGTH) +#error Assumption about code memory unit length failed. +#endif + +#define REV_A_DATA_MEMORY_BEGIN 0x1000 +#define REV_A_DATA_MEMORY_END 0x2FFF +#define REV_A_DATA_MEMORY_UNIT_LENGTH 0x0080 +#define REV_A_DATA_MEMORY_LENGTH (REV_A_DATA_MEMORY_END - REV_A_DATA_MEMORY_BEGIN + 1) + +#define REV_B_DATA_MEMORY_BEGIN 0x1000 +/*#define REV_B_DATA_MEMORY_END 0x23FF */ +#define REV_B_DATA_MEMORY_END 0x2BFF +#define REV_B_DATA_MEMORY_UNIT_LENGTH 0x0080 +#define REV_B_DATA_MEMORY_LENGTH (REV_B_DATA_MEMORY_END - REV_B_DATA_MEMORY_BEGIN + 1) + +#if (REV_A_DATA_MEMORY_LENGTH % REV_A_DATA_MEMORY_UNIT_LENGTH) +#error Assumption about data memory unit length failed. +#endif +#if (REV_B_DATA_MEMORY_LENGTH % REV_B_DATA_MEMORY_UNIT_LENGTH) +#error Assumption about data memory unit length failed. +#endif + +#define CODE_MEMORY_MAP_LENGTH (64 + 1) +#define DATA_MEMORY_MAP_LENGTH (64 + 1) + +#if (CODE_MEMORY_MAP_LENGTH < ((REV_A_CODE_MEMORY_LENGTH / REV_A_CODE_MEMORY_UNIT_LENGTH) + 1)) +#error Code memory map length too short. +#endif +#if (DATA_MEMORY_MAP_LENGTH < ((REV_A_DATA_MEMORY_LENGTH / REV_A_DATA_MEMORY_UNIT_LENGTH) + 1)) +#error Data memory map length too short. +#endif +#if (CODE_MEMORY_MAP_LENGTH < ((REV_B_CODE_MEMORY_LENGTH / REV_B_CODE_MEMORY_UNIT_LENGTH) + 1)) +#error Code memory map length too short. +#endif +#if (DATA_MEMORY_MAP_LENGTH < ((REV_B_DATA_MEMORY_LENGTH / REV_B_DATA_MEMORY_UNIT_LENGTH) + 1)) +#error Data memory map length too short. +#endif + + +/* + * Kernel code memory definition + */ + +#define KCODE_VECTORS_BEGIN 0x0000 +#define KCODE_VECTORS_END 0x002F +#define KCODE_VECTORS_UNIT_LENGTH 0x0002 +#define KCODE_VECTORS_LENGTH (KCODE_VECTORS_END - KCODE_VECTORS_BEGIN + 1) + + +/* + * Kernel data memory definition + */ + +#define KDATA_BASE_ADDR 0x1000 +#define KDATA_BASE_ADDR2 0x1080 + +#define KDATA_TASK0 (KDATA_BASE_ADDR + 0x0000) +#define KDATA_TASK1 (KDATA_BASE_ADDR + 0x0001) +#define KDATA_TASK2 (KDATA_BASE_ADDR + 0x0002) +#define KDATA_TASK3 (KDATA_BASE_ADDR + 0x0003) +#define KDATA_TASK4 (KDATA_BASE_ADDR + 0x0004) +#define KDATA_TASK5 (KDATA_BASE_ADDR + 0x0005) +#define KDATA_TASK6 (KDATA_BASE_ADDR + 0x0006) +#define KDATA_TASK7 (KDATA_BASE_ADDR + 0x0007) +#define KDATA_TASK_ENDMARK (KDATA_BASE_ADDR + 0x0008) + +#define KDATA_CURRENT_TASK (KDATA_BASE_ADDR + 0x0009) +#define KDATA_TASK_SWITCH (KDATA_BASE_ADDR + 0x000A) + +#define KDATA_INSTANCE0_POS3D (KDATA_BASE_ADDR + 0x000B) +#define KDATA_INSTANCE1_POS3D (KDATA_BASE_ADDR + 0x000C) +#define KDATA_INSTANCE2_POS3D (KDATA_BASE_ADDR + 0x000D) +#define KDATA_INSTANCE3_POS3D (KDATA_BASE_ADDR + 0x000E) +#define KDATA_INSTANCE4_POS3D (KDATA_BASE_ADDR + 0x000F) +#define KDATA_INSTANCE5_POS3D (KDATA_BASE_ADDR + 0x0010) +#define KDATA_INSTANCE6_POS3D (KDATA_BASE_ADDR + 0x0011) +#define KDATA_INSTANCE7_POS3D (KDATA_BASE_ADDR + 0x0012) +#define KDATA_INSTANCE8_POS3D (KDATA_BASE_ADDR + 0x0013) +#define KDATA_INSTANCE_POS3D_ENDMARK (KDATA_BASE_ADDR + 0x0014) + +#define KDATA_INSTANCE0_SPKVIRT (KDATA_BASE_ADDR + 0x0015) +#define KDATA_INSTANCE_SPKVIRT_ENDMARK (KDATA_BASE_ADDR + 0x0016) + +#define KDATA_INSTANCE0_SPDIF (KDATA_BASE_ADDR + 0x0017) +#define KDATA_INSTANCE_SPDIF_ENDMARK (KDATA_BASE_ADDR + 0x0018) + +#define KDATA_INSTANCE0_MODEM (KDATA_BASE_ADDR + 0x0019) +#define KDATA_INSTANCE_MODEM_ENDMARK (KDATA_BASE_ADDR + 0x001A) + +#define KDATA_INSTANCE0_SRC (KDATA_BASE_ADDR + 0x001B) +#define KDATA_INSTANCE1_SRC (KDATA_BASE_ADDR + 0x001C) +#define KDATA_INSTANCE_SRC_ENDMARK (KDATA_BASE_ADDR + 0x001D) + +#define KDATA_INSTANCE0_MINISRC (KDATA_BASE_ADDR + 0x001E) +#define KDATA_INSTANCE1_MINISRC (KDATA_BASE_ADDR + 0x001F) +#define KDATA_INSTANCE2_MINISRC (KDATA_BASE_ADDR + 0x0020) +#define KDATA_INSTANCE3_MINISRC (KDATA_BASE_ADDR + 0x0021) +#define KDATA_INSTANCE_MINISRC_ENDMARK (KDATA_BASE_ADDR + 0x0022) + +#define KDATA_INSTANCE0_CPYTHRU (KDATA_BASE_ADDR + 0x0023) +#define KDATA_INSTANCE1_CPYTHRU (KDATA_BASE_ADDR + 0x0024) +#define KDATA_INSTANCE_CPYTHRU_ENDMARK (KDATA_BASE_ADDR + 0x0025) + +#define KDATA_CURRENT_DMA (KDATA_BASE_ADDR + 0x0026) +#define KDATA_DMA_SWITCH (KDATA_BASE_ADDR + 0x0027) +#define KDATA_DMA_ACTIVE (KDATA_BASE_ADDR + 0x0028) + +#define KDATA_DMA_XFER0 (KDATA_BASE_ADDR + 0x0029) +#define KDATA_DMA_XFER1 (KDATA_BASE_ADDR + 0x002A) +#define KDATA_DMA_XFER2 (KDATA_BASE_ADDR + 0x002B) +#define KDATA_DMA_XFER3 (KDATA_BASE_ADDR + 0x002C) +#define KDATA_DMA_XFER4 (KDATA_BASE_ADDR + 0x002D) +#define KDATA_DMA_XFER5 (KDATA_BASE_ADDR + 0x002E) +#define KDATA_DMA_XFER6 (KDATA_BASE_ADDR + 0x002F) +#define KDATA_DMA_XFER7 (KDATA_BASE_ADDR + 0x0030) +#define KDATA_DMA_XFER8 (KDATA_BASE_ADDR + 0x0031) +#define KDATA_DMA_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0032) + +#define KDATA_I2S_SAMPLE_COUNT (KDATA_BASE_ADDR + 0x0033) +#define KDATA_I2S_INT_METER (KDATA_BASE_ADDR + 0x0034) +#define KDATA_I2S_ACTIVE (KDATA_BASE_ADDR + 0x0035) + +#define KDATA_TIMER_COUNT_RELOAD (KDATA_BASE_ADDR + 0x0036) +#define KDATA_TIMER_COUNT_CURRENT (KDATA_BASE_ADDR + 0x0037) + +#define KDATA_HALT_SYNCH_CLIENT (KDATA_BASE_ADDR + 0x0038) +#define KDATA_HALT_SYNCH_DMA (KDATA_BASE_ADDR + 0x0039) +#define KDATA_HALT_ACKNOWLEDGE (KDATA_BASE_ADDR + 0x003A) + +#define KDATA_ADC1_XFER0 (KDATA_BASE_ADDR + 0x003B) +#define KDATA_ADC1_XFER_ENDMARK (KDATA_BASE_ADDR + 0x003C) +#define KDATA_ADC1_LEFT_VOLUME (KDATA_BASE_ADDR + 0x003D) +#define KDATA_ADC1_RIGHT_VOLUME (KDATA_BASE_ADDR + 0x003E) +#define KDATA_ADC1_LEFT_SUR_VOL (KDATA_BASE_ADDR + 0x003F) +#define KDATA_ADC1_RIGHT_SUR_VOL (KDATA_BASE_ADDR + 0x0040) + +#define KDATA_ADC2_XFER0 (KDATA_BASE_ADDR + 0x0041) +#define KDATA_ADC2_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0042) +#define KDATA_ADC2_LEFT_VOLUME (KDATA_BASE_ADDR + 0x0043) +#define KDATA_ADC2_RIGHT_VOLUME (KDATA_BASE_ADDR + 0x0044) +#define KDATA_ADC2_LEFT_SUR_VOL (KDATA_BASE_ADDR + 0x0045) +#define KDATA_ADC2_RIGHT_SUR_VOL (KDATA_BASE_ADDR + 0x0046) + +#define KDATA_CD_XFER0 (KDATA_BASE_ADDR + 0x0047) +#define KDATA_CD_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0048) +#define KDATA_CD_LEFT_VOLUME (KDATA_BASE_ADDR + 0x0049) +#define KDATA_CD_RIGHT_VOLUME (KDATA_BASE_ADDR + 0x004A) +#define KDATA_CD_LEFT_SUR_VOL (KDATA_BASE_ADDR + 0x004B) +#define KDATA_CD_RIGHT_SUR_VOL (KDATA_BASE_ADDR + 0x004C) + +#define KDATA_MIC_XFER0 (KDATA_BASE_ADDR + 0x004D) +#define KDATA_MIC_XFER_ENDMARK (KDATA_BASE_ADDR + 0x004E) +#define KDATA_MIC_VOLUME (KDATA_BASE_ADDR + 0x004F) +#define KDATA_MIC_SUR_VOL (KDATA_BASE_ADDR + 0x0050) + +#define KDATA_I2S_XFER0 (KDATA_BASE_ADDR + 0x0051) +#define KDATA_I2S_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0052) + +#define KDATA_CHI_XFER0 (KDATA_BASE_ADDR + 0x0053) +#define KDATA_CHI_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0054) + +#define KDATA_SPDIF_XFER (KDATA_BASE_ADDR + 0x0055) +#define KDATA_SPDIF_CURRENT_FRAME (KDATA_BASE_ADDR + 0x0056) +#define KDATA_SPDIF_FRAME0 (KDATA_BASE_ADDR + 0x0057) +#define KDATA_SPDIF_FRAME1 (KDATA_BASE_ADDR + 0x0058) +#define KDATA_SPDIF_FRAME2 (KDATA_BASE_ADDR + 0x0059) + +#define KDATA_SPDIF_REQUEST (KDATA_BASE_ADDR + 0x005A) +#define KDATA_SPDIF_TEMP (KDATA_BASE_ADDR + 0x005B) + +/*AY SPDIF IN */ +#define KDATA_SPDIFIN_XFER0 (KDATA_BASE_ADDR + 0x005C) +#define KDATA_SPDIFIN_XFER_ENDMARK (KDATA_BASE_ADDR + 0x005D) +#define KDATA_SPDIFIN_INT_METER (KDATA_BASE_ADDR + 0x005E) + +#define KDATA_DSP_RESET_COUNT (KDATA_BASE_ADDR + 0x005F) +#define KDATA_DEBUG_OUTPUT (KDATA_BASE_ADDR + 0x0060) + +#define KDATA_KERNEL_ISR_LIST (KDATA_BASE_ADDR + 0x0061) + +#define KDATA_KERNEL_ISR_CBSR1 (KDATA_BASE_ADDR + 0x0062) +#define KDATA_KERNEL_ISR_CBER1 (KDATA_BASE_ADDR + 0x0063) +#define KDATA_KERNEL_ISR_CBCR (KDATA_BASE_ADDR + 0x0064) +#define KDATA_KERNEL_ISR_AR0 (KDATA_BASE_ADDR + 0x0065) +#define KDATA_KERNEL_ISR_AR1 (KDATA_BASE_ADDR + 0x0066) +#define KDATA_KERNEL_ISR_AR2 (KDATA_BASE_ADDR + 0x0067) +#define KDATA_KERNEL_ISR_AR3 (KDATA_BASE_ADDR + 0x0068) +#define KDATA_KERNEL_ISR_AR4 (KDATA_BASE_ADDR + 0x0069) +#define KDATA_KERNEL_ISR_AR5 (KDATA_BASE_ADDR + 0x006A) +#define KDATA_KERNEL_ISR_BRCR (KDATA_BASE_ADDR + 0x006B) +#define KDATA_KERNEL_ISR_PASR (KDATA_BASE_ADDR + 0x006C) +#define KDATA_KERNEL_ISR_PAER (KDATA_BASE_ADDR + 0x006D) + +#define KDATA_CLIENT_SCRATCH0 (KDATA_BASE_ADDR + 0x006E) +#define KDATA_CLIENT_SCRATCH1 (KDATA_BASE_ADDR + 0x006F) +#define KDATA_KERNEL_SCRATCH (KDATA_BASE_ADDR + 0x0070) +#define KDATA_KERNEL_ISR_SCRATCH (KDATA_BASE_ADDR + 0x0071) + +#define KDATA_OUEUE_LEFT (KDATA_BASE_ADDR + 0x0072) +#define KDATA_QUEUE_RIGHT (KDATA_BASE_ADDR + 0x0073) + +#define KDATA_ADC1_REQUEST (KDATA_BASE_ADDR + 0x0074) +#define KDATA_ADC2_REQUEST (KDATA_BASE_ADDR + 0x0075) +#define KDATA_CD_REQUEST (KDATA_BASE_ADDR + 0x0076) +#define KDATA_MIC_REQUEST (KDATA_BASE_ADDR + 0x0077) + +#define KDATA_ADC1_MIXER_REQUEST (KDATA_BASE_ADDR + 0x0078) +#define KDATA_ADC2_MIXER_REQUEST (KDATA_BASE_ADDR + 0x0079) +#define KDATA_CD_MIXER_REQUEST (KDATA_BASE_ADDR + 0x007A) +#define KDATA_MIC_MIXER_REQUEST (KDATA_BASE_ADDR + 0x007B) +#define KDATA_MIC_SYNC_COUNTER (KDATA_BASE_ADDR + 0x007C) + +/* + * second segment + */ + +/* smart mixer buffer */ + +#define KDATA_MIXER_WORD0 (KDATA_BASE_ADDR2 + 0x0000) +#define KDATA_MIXER_WORD1 (KDATA_BASE_ADDR2 + 0x0001) +#define KDATA_MIXER_WORD2 (KDATA_BASE_ADDR2 + 0x0002) +#define KDATA_MIXER_WORD3 (KDATA_BASE_ADDR2 + 0x0003) +#define KDATA_MIXER_WORD4 (KDATA_BASE_ADDR2 + 0x0004) +#define KDATA_MIXER_WORD5 (KDATA_BASE_ADDR2 + 0x0005) +#define KDATA_MIXER_WORD6 (KDATA_BASE_ADDR2 + 0x0006) +#define KDATA_MIXER_WORD7 (KDATA_BASE_ADDR2 + 0x0007) +#define KDATA_MIXER_WORD8 (KDATA_BASE_ADDR2 + 0x0008) +#define KDATA_MIXER_WORD9 (KDATA_BASE_ADDR2 + 0x0009) +#define KDATA_MIXER_WORDA (KDATA_BASE_ADDR2 + 0x000A) +#define KDATA_MIXER_WORDB (KDATA_BASE_ADDR2 + 0x000B) +#define KDATA_MIXER_WORDC (KDATA_BASE_ADDR2 + 0x000C) +#define KDATA_MIXER_WORDD (KDATA_BASE_ADDR2 + 0x000D) +#define KDATA_MIXER_WORDE (KDATA_BASE_ADDR2 + 0x000E) +#define KDATA_MIXER_WORDF (KDATA_BASE_ADDR2 + 0x000F) + +#define KDATA_MIXER_XFER0 (KDATA_BASE_ADDR2 + 0x0010) +#define KDATA_MIXER_XFER1 (KDATA_BASE_ADDR2 + 0x0011) +#define KDATA_MIXER_XFER2 (KDATA_BASE_ADDR2 + 0x0012) +#define KDATA_MIXER_XFER3 (KDATA_BASE_ADDR2 + 0x0013) +#define KDATA_MIXER_XFER4 (KDATA_BASE_ADDR2 + 0x0014) +#define KDATA_MIXER_XFER5 (KDATA_BASE_ADDR2 + 0x0015) +#define KDATA_MIXER_XFER6 (KDATA_BASE_ADDR2 + 0x0016) +#define KDATA_MIXER_XFER7 (KDATA_BASE_ADDR2 + 0x0017) +#define KDATA_MIXER_XFER8 (KDATA_BASE_ADDR2 + 0x0018) +#define KDATA_MIXER_XFER9 (KDATA_BASE_ADDR2 + 0x0019) +#define KDATA_MIXER_XFER_ENDMARK (KDATA_BASE_ADDR2 + 0x001A) + +#define KDATA_MIXER_TASK_NUMBER (KDATA_BASE_ADDR2 + 0x001B) +#define KDATA_CURRENT_MIXER (KDATA_BASE_ADDR2 + 0x001C) +#define KDATA_MIXER_ACTIVE (KDATA_BASE_ADDR2 + 0x001D) +#define KDATA_MIXER_BANK_STATUS (KDATA_BASE_ADDR2 + 0x001E) +#define KDATA_DAC_LEFT_VOLUME (KDATA_BASE_ADDR2 + 0x001F) +#define KDATA_DAC_RIGHT_VOLUME (KDATA_BASE_ADDR2 + 0x0020) + +/* + * Client data memory definition + */ + +#define CDATA_INSTANCE_READY 0x00 + +#define CDATA_HOST_SRC_ADDRL 0x01 +#define CDATA_HOST_SRC_ADDRH 0x02 +#define CDATA_HOST_SRC_END_PLUS_1L 0x03 +#define CDATA_HOST_SRC_END_PLUS_1H 0x04 +#define CDATA_HOST_SRC_CURRENTL 0x05 +#define CDATA_HOST_SRC_CURRENTH 0x06 + +#define CDATA_IN_BUF_CONNECT 0x07 +#define CDATA_OUT_BUF_CONNECT 0x08 + +#define CDATA_IN_BUF_BEGIN 0x09 +#define CDATA_IN_BUF_END_PLUS_1 0x0A +#define CDATA_IN_BUF_HEAD 0x0B +#define CDATA_IN_BUF_TAIL 0x0C + +#define CDATA_OUT_BUF_BEGIN 0x0D +#define CDATA_OUT_BUF_END_PLUS_1 0x0E +#define CDATA_OUT_BUF_HEAD 0x0F +#define CDATA_OUT_BUF_TAIL 0x10 + +#define CDATA_DMA_CONTROL 0x11 +#define CDATA_RESERVED 0x12 + +#define CDATA_FREQUENCY 0x13 +#define CDATA_LEFT_VOLUME 0x14 +#define CDATA_RIGHT_VOLUME 0x15 +#define CDATA_LEFT_SUR_VOL 0x16 +#define CDATA_RIGHT_SUR_VOL 0x17 + +/* These are from Allegro hckernel.h */ +#define CDATA_HEADER_LEN 0x18 +#define SRC3_DIRECTION_OFFSET CDATA_HEADER_LEN +#define SRC3_MODE_OFFSET CDATA_HEADER_LEN + 1 +#define SRC3_WORD_LENGTH_OFFSET CDATA_HEADER_LEN + 2 +#define SRC3_PARAMETER_OFFSET CDATA_HEADER_LEN + 3 +#define SRC3_COEFF_ADDR_OFFSET CDATA_HEADER_LEN + 8 +#define SRC3_FILTAP_ADDR_OFFSET CDATA_HEADER_LEN + 10 +#define SRC3_TEMP_INBUF_ADDR_OFFSET CDATA_HEADER_LEN + 16 +#define SRC3_TEMP_OUTBUF_ADDR_OFFSET CDATA_HEADER_LEN + 17 +#define FOR_FUTURE_USE 10 /* for storing temporary variable in future */ + +/* + * DMA control definition + */ + +#define DMACONTROL_BLOCK_MASK 0x000F +#define DMAC_BLOCK0_SELECTOR 0x0000 +#define DMAC_BLOCK1_SELECTOR 0x0001 +#define DMAC_BLOCK2_SELECTOR 0x0002 +#define DMAC_BLOCK3_SELECTOR 0x0003 +#define DMAC_BLOCK4_SELECTOR 0x0004 +#define DMAC_BLOCK5_SELECTOR 0x0005 +#define DMAC_BLOCK6_SELECTOR 0x0006 +#define DMAC_BLOCK7_SELECTOR 0x0007 +#define DMAC_BLOCK8_SELECTOR 0x0008 +#define DMAC_BLOCK9_SELECTOR 0x0009 +#define DMAC_BLOCKA_SELECTOR 0x000A +#define DMAC_BLOCKB_SELECTOR 0x000B +#define DMAC_BLOCKC_SELECTOR 0x000C +#define DMAC_BLOCKD_SELECTOR 0x000D +#define DMAC_BLOCKE_SELECTOR 0x000E +#define DMAC_BLOCKF_SELECTOR 0x000F +#define DMACONTROL_PAGE_MASK 0x00F0 +#define DMAC_PAGE0_SELECTOR 0x0030 +#define DMAC_PAGE1_SELECTOR 0x0020 +#define DMAC_PAGE2_SELECTOR 0x0010 +#define DMAC_PAGE3_SELECTOR 0x0000 +#define DMACONTROL_AUTOREPEAT 0x1000 +#define DMACONTROL_STOPPED 0x2000 +#define DMACONTROL_DIRECTION 0x0100 + +/* + * Kernel/client memory allocation + */ + +#define NUM_UNITS_KERNEL_CODE 16 +#define NUM_UNITS_KERNEL_DATA 2 + +#define NUM_UNITS_KERNEL_CODE_WITH_HSP 16 +#ifdef M3_MODEL +#define NUM_UNITS_KERNEL_DATA_WITH_HSP 5 +#else +#define NUM_UNITS_KERNEL_DATA_WITH_HSP 4 +#endif + +#define NUM_UNITS( BYTES, UNITLEN ) ((((BYTES+1)>>1) + (UNITLEN-1)) / UNITLEN) + +/* + * DSP hardware + */ + +#define DSP_PORT_TIMER_COUNT 0x06 +#define DSP_PORT_MEMORY_INDEX 0x80 +#define DSP_PORT_MEMORY_TYPE 0x82 +#define DSP_PORT_MEMORY_DATA 0x84 +#define DSP_PORT_CONTROL_REG_A 0xA2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 22:55:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BAC6106566B; Fri, 20 Jan 2012 22:55:17 +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 49DEA8FC15; Fri, 20 Jan 2012 22:55:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KMtHcE062578; Fri, 20 Jan 2012 22:55:17 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KMtH7q062575; Fri, 20 Jan 2012 22:55:17 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201202255.q0KMtH7q062575@svn.freebsd.org> From: Martin Matuska Date: Fri, 20 Jan 2012 22:55: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: r230402 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 22:55:17 -0000 Author: mm Date: Fri Jan 20 22:55:16 2012 New Revision: 230402 URL: http://svn.freebsd.org/changeset/base/230402 Log: Add accidentially removed copyright lines in r228103 Reported by: pjd MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jan 20 22:37:10 2012 (r230401) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jan 20 22:55:16 2012 (r230402) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . + * All rights reserved. * Copyright (c) 2011 Martin Matuska . All rights reserved. */ Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jan 20 22:37:10 2012 (r230401) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jan 20 22:55:16 2012 (r230402) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek . * Copyright (c) 2011 by Delphix. All rights reserved. * All rights reserved. */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 22:55:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EAD1065670; Fri, 20 Jan 2012 22:55:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00E808FC17; Fri, 20 Jan 2012 22:55:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KMtJPA062618; Fri, 20 Jan 2012 22:55:19 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KMtJEW062616; Fri, 20 Jan 2012 22:55:19 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201201202255.q0KMtJEW062616@svn.freebsd.org> From: Brooks Davis Date: Fri, 20 Jan 2012 22:55: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: r230403 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 22:55:20 -0000 Author: brooks Date: Fri Jan 20 22:55:19 2012 New Revision: 230403 URL: http://svn.freebsd.org/changeset/base/230403 Log: When creating the jails /dev/log symlink, do it by full path to avoid creating stray "log" symlinks if the mount fails. That apparently happens in some ezjail configs. PR: conf/143084 Submitted by: Dirk Engling Reviewed by: simon MFC after: 2 weeks Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Fri Jan 20 22:55:16 2012 (r230402) +++ head/etc/rc.d/jail Fri Jan 20 22:55:19 2012 (r230403) @@ -601,10 +601,7 @@ jail_start() devfs_mount_jail "${_devdir}" ${_ruleset} # Transitional symlink for old binaries if [ ! -L "${_devdir}/log" ]; then - __pwd="`pwd`" - cd "${_devdir}" - ln -sf ../var/run/log log - cd "$__pwd" + ln -sf ../var/run/log "${_devdir}/log" fi fi From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 22:56:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C93F1065670; Fri, 20 Jan 2012 22:56:58 +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 2B3E38FC0A; Fri, 20 Jan 2012 22:56:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KMuwJ3062704; Fri, 20 Jan 2012 22:56:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KMuv62062702; Fri, 20 Jan 2012 22:56:57 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201202256.q0KMuv62062702@svn.freebsd.org> From: Martin Matuska Date: Fri, 20 Jan 2012 22:56: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: r230404 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 22:56:58 -0000 Author: mm Date: Fri Jan 20 22:56:57 2012 New Revision: 230404 URL: http://svn.freebsd.org/changeset/base/230404 Log: Add one more copyright line accidentially removed in r228103 MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jan 20 22:55:19 2012 (r230403) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jan 20 22:56:57 2012 (r230404) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . + * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * All rights reserved. */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 20 23:37:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 603FD1065677; Fri, 20 Jan 2012 23:37:05 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E4A68FC26; Fri, 20 Jan 2012 23:37:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KNb5iv064094; Fri, 20 Jan 2012 23:37:05 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KNb5Qg064091; Fri, 20 Jan 2012 23:37:05 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201202337.q0KNb5Qg064091@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 20 Jan 2012 23:37: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: r230405 - head/sys/mips/cavium/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 23:37:05 -0000 Author: gonzo Date: Fri Jan 20 23:37:04 2012 New Revision: 230405 URL: http://svn.freebsd.org/changeset/base/230405 Log: We use port_index field of struct octusb_qh to reference USB state of root HUB. Although it is initialized with port index of the device's parent hub, which is worng. So track the USB tree up to root HUB and initialize this filed ptroprly Rename port_index to root_port_index in order to reflect its real semantics. Modified: head/sys/mips/cavium/usb/octusb.c head/sys/mips/cavium/usb/octusb.h Modified: head/sys/mips/cavium/usb/octusb.c ============================================================================== --- head/sys/mips/cavium/usb/octusb.c Fri Jan 20 22:56:57 2012 (r230404) +++ head/sys/mips/cavium/usb/octusb.c Fri Jan 20 23:37:04 2012 (r230405) @@ -159,7 +159,7 @@ octusb_host_alloc_endpoint(struct octusb sc = td->qh->sc; ep_handle = cvmx_usb_open_pipe( - &sc->sc_port[td->qh->port_index].state, + &sc->sc_port[td->qh->root_port_index].state, 0, td->qh->dev_addr, td->qh->ep_num & UE_ADDR, @@ -173,11 +173,13 @@ octusb_host_alloc_endpoint(struct octusb td->qh->hs_hub_addr, td->qh->hs_hub_port); - if (ep_handle < 0) + if (ep_handle < 0) { + DPRINTFN(1, "cvmx_usb_open_pipe failed: %d\n", ep_handle); return (1); /* busy */ + } cvmx_usb_set_toggle( - &sc->sc_port[td->qh->port_index].state, + &sc->sc_port[td->qh->root_port_index].state, ep_handle, td->qh->ep_toggle_next); td->qh->fixup_handle = -1; @@ -206,10 +208,10 @@ octusb_host_free_endpoint(struct octusb_ if (td->qh->fixup_handle >= 0) { /* cancel, if any */ - cvmx_usb_cancel(&sc->sc_port[td->qh->port_index].state, + cvmx_usb_cancel(&sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, td->qh->fixup_handle); } - cvmx_usb_close_pipe(&sc->sc_port[td->qh->port_index].state, td->qh->ep_handle); + cvmx_usb_close_pipe(&sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle); td->qh->ep_allocated = 0; } @@ -301,7 +303,7 @@ octusb_host_control_header_tx(struct oct usb_pc_cpu_flush(td->qh->fixup_pc); status = cvmx_usb_submit_control( - &sc->sc_port[td->qh->port_index].state, + &sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, td->qh->fixup_phys, td->qh->fixup_phys + 8, td->qh->fixup_len, &octusb_complete_cb, td); @@ -410,7 +412,7 @@ octusb_host_control_status_tx(struct oct /* start USB transfer */ status = cvmx_usb_submit_control( - &sc->sc_port[td->qh->port_index].state, + &sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, td->qh->fixup_phys, td->qh->fixup_phys + 8, td->qh->fixup_len, &octusb_complete_cb, td); @@ -493,19 +495,19 @@ octusb_non_control_data_tx(struct octusb td->qh->iso_pkt.length = rem; td->qh->iso_pkt.status = 0; /* start USB transfer */ - status = cvmx_usb_submit_isochronous(&sc->sc_port[td->qh->port_index].state, + status = cvmx_usb_submit_isochronous(&sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, 1, CVMX_USB_ISOCHRONOUS_FLAGS_ALLOW_SHORT | CVMX_USB_ISOCHRONOUS_FLAGS_ASAP, 1, &td->qh->iso_pkt, td->qh->fixup_phys, rem, &octusb_complete_cb, td); break; case UE_BULK: /* start USB transfer */ - status = cvmx_usb_submit_bulk(&sc->sc_port[td->qh->port_index].state, + status = cvmx_usb_submit_bulk(&sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, td->qh->fixup_phys, rem, &octusb_complete_cb, td); break; case UE_INTERRUPT: /* start USB transfer (interrupt or interrupt) */ - status = cvmx_usb_submit_interrupt(&sc->sc_port[td->qh->port_index].state, + status = cvmx_usb_submit_interrupt(&sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, td->qh->fixup_phys, rem, &octusb_complete_cb, td); break; default: @@ -612,19 +614,19 @@ octusb_non_control_data_rx(struct octusb td->qh->iso_pkt.length = rem; td->qh->iso_pkt.status = 0; /* start USB transfer */ - status = cvmx_usb_submit_isochronous(&sc->sc_port[td->qh->port_index].state, + status = cvmx_usb_submit_isochronous(&sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, 1, CVMX_USB_ISOCHRONOUS_FLAGS_ALLOW_SHORT | CVMX_USB_ISOCHRONOUS_FLAGS_ASAP, 1, &td->qh->iso_pkt, td->qh->fixup_phys, rem, &octusb_complete_cb, td); break; case UE_BULK: /* start USB transfer */ - status = cvmx_usb_submit_bulk(&sc->sc_port[td->qh->port_index].state, + status = cvmx_usb_submit_bulk(&sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, td->qh->fixup_phys, rem, &octusb_complete_cb, td); break; case UE_INTERRUPT: /* start USB transfer */ - status = cvmx_usb_submit_interrupt(&sc->sc_port[td->qh->port_index].state, + status = cvmx_usb_submit_interrupt(&sc->sc_port[td->qh->root_port_index].state, td->qh->ep_handle, td->qh->fixup_phys, rem, &octusb_complete_cb, td); break; default: @@ -798,7 +800,7 @@ done: xfer->endpoint->toggle_next = cvmx_usb_get_toggle( - &sc->sc_port[qh->port_index].state, + &sc->sc_port[qh->root_port_index].state, qh->ep_handle) ? 1 : 0; octusb_device_done(xfer, error); @@ -1729,6 +1731,7 @@ octusb_xfer_setup(struct usb_setup_param struct octusb_softc *sc; struct octusb_qh *qh; struct usb_xfer *xfer; + struct usb_device *hub; void *last_obj; uint32_t n; uint32_t ntd; @@ -1774,7 +1777,13 @@ octusb_xfer_setup(struct usb_setup_param qh->ep_type = xfer->endpoint->edesc->bmAttributes; qh->dev_addr = xfer->address; qh->dev_speed = usbd_get_speed(xfer->xroot->udev); - qh->port_index = xfer->xroot->udev->port_index; + qh->root_port_index = xfer->xroot->udev->port_index; + /* We need Octeon USB HUB's port index, not the local port */ + hub = xfer->xroot->udev->parent_hub; + while(hub && hub->parent_hub) { + qh->root_port_index = hub->port_index; + hub = hub->parent_hub; + } switch (xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) { case UE_INTERRUPT: Modified: head/sys/mips/cavium/usb/octusb.h ============================================================================== --- head/sys/mips/cavium/usb/octusb.h Fri Jan 20 22:56:57 2012 (r230404) +++ head/sys/mips/cavium/usb/octusb.h Fri Jan 20 23:37:04 2012 (r230405) @@ -80,7 +80,7 @@ struct octusb_qh { uint8_t ep_num; uint8_t ep_type; uint8_t ep_toggle_next; - uint8_t port_index; + uint8_t root_port_index; uint8_t fixup_complete; uint8_t fixup_pending; uint8_t hs_hub_addr; From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 00:05:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A13D7106567A; Sat, 21 Jan 2012 00:05:28 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7FE448FC12; Sat, 21 Jan 2012 00:05:27 +0000 (UTC) Received: by lahe6 with SMTP id e6so853216lah.13 for ; Fri, 20 Jan 2012 16:05:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=2KW1KBts5o+cB2pjjgEJBBu+02s3yY/7V9dCEdKrNKg=; b=LcdbjxzQaJwe4YGk9AkCYCvQsuQK/z8gnQIqKdgZIa+tu8nDow3CqgJfMXR7+LU3Tf Wmxx3MqzvXoG+ACZPVMHrObRNZlqEES1iayz0c8W13FhkjUzs8jSLTZKCgjf+B/exqOH nBt44cGowTxXPB1E6maMmG5sGRa1gqqGSOnqg= Received: by 10.112.87.169 with SMTP id az9mr8092554lbb.63.1327104326133; Fri, 20 Jan 2012 16:05:26 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.196 with HTTP; Fri, 20 Jan 2012 16:04:55 -0800 (PST) In-Reply-To: <20120120.123256.1432718473132856309.hrs@allbsd.org> References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> From: Eitan Adler Date: Fri, 20 Jan 2012 19:04:55 -0500 X-Google-Sender-Auth: LN8E5x0-kZ3hJiwwmCzyfLMKJZE Message-ID: To: Hiroki Sato Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 00:05:28 -0000 On Thu, Jan 19, 2012 at 10:32 PM, Hiroki Sato wrote: > Eitan Adler wrote > =C2=A0in <201201200138.q0K1cSou016739@svn.freebsd.org>: > > ea> Author: eadler > ea> Date: Fri Jan 20 01:38:28 2012 > ea> New Revision: 230354 > ea> URL: http://svn.freebsd.org/changeset/base/230354 > ea> > ea> Log: > ea> =C2=A0 Fix a variety of warnings when compiling with gcc46 > ea> > ea> =C2=A0 Approved by: =C2=A0 =C2=A0 =C2=A0dim, cperciva (mentor, blanke= t for pre-mentorship already-approved commits) > ea> =C2=A0 MFC after: =C2=A0 =C2=A0 =C2=A0 =C2=A03 days > ea> > ea> Modified: > ea> =C2=A0 head/usr.sbin/makefs/cd9660.c > > =C2=A0Removing the dot handling part and leaving a comment in lines > =C2=A01106-1117 make people confused. I missed that - sorry. > =C2=A0In addition to that, I personally don't think this should be remove= d > =C2=A0because our cd9660.c is still based on NetBSD's one in any > =C2=A0way---bugfixes on our side have been reported to the upstream and w= e > =C2=A0will import useful changes from there if any. =C2=A0Although the cu= rrent > =C2=A0dot handling is useless, keeping the difference between the two sma= ll > =C2=A0still has a meaning. I was was unaware this code was contributed. I just looked at the NetBSD version and I don't think it suffers from the same problem - the loop appears to be used later. If that is because of some other bug fix which could be upstreamed that would be great. On the other hand I would like to continue with my goal of making the non-contrib world compilable with CC=3Dgcc46. Should I revert this commit? --=20 Eitan Adler Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 00:06:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F7781065670; Sat, 21 Jan 2012 00:06:22 +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 8E8958FC1E; Sat, 21 Jan 2012 00:06:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0L06MS2065076; Sat, 21 Jan 2012 00:06:22 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0L06MB3065074; Sat, 21 Jan 2012 00:06:22 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201210006.q0L06MB3065074@svn.freebsd.org> From: Martin Matuska Date: Sat, 21 Jan 2012 00:06: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: r230407 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 00:06:22 -0000 Author: mm Date: Sat Jan 21 00:06:21 2012 New Revision: 230407 URL: http://svn.freebsd.org/changeset/base/230407 Log: Use separate buffer for global path to avoid overflow of path buffer. Reviewed by: jamie@ MFC after: 3 weeks Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Jan 20 23:48:14 2012 (r230406) +++ head/sys/kern/kern_jail.c Sat Jan 21 00:06:21 2012 (r230407) @@ -521,6 +521,7 @@ kern_jail_set(struct thread *td, struct struct prison *pr, *deadpr, *mypr, *ppr, *tpr; struct vnode *root; char *domain, *errmsg, *host, *name, *namelc, *p, *path, *uuid; + char *g_path; #if defined(INET) || defined(INET6) struct prison *tppr; void *op; @@ -575,6 +576,7 @@ kern_jail_set(struct thread *td, struct #ifdef INET6 ip6 = NULL; #endif + g_path = NULL; error = vfs_copyopt(opts, "jid", &jid, sizeof(jid)); if (error == ENOENT) @@ -907,13 +909,17 @@ kern_jail_set(struct thread *td, struct vfslocked = NDHASGIANT(&nd); root = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); - error = vn_path_to_global_path(td, root, path, MAXPATHLEN); - if (error == ENODEV) { + g_path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + strlcpy(g_path, path, MAXPATHLEN); + error = vn_path_to_global_path(td, root, g_path, MAXPATHLEN); + if (error == 0) + path = g_path; + else if (error == ENODEV) { /* proceed if sysctl debug.disablefullpath == 1 */ fullpath_disabled = 1; if (len < 2 || (len == 2 && path[0] == '/')) path = NULL; - } else if (error != 0) { + } else { /* exit on other errors */ VFS_UNLOCK_GIANT(vfslocked); goto done_free; @@ -1819,6 +1825,8 @@ kern_jail_set(struct thread *td, struct #ifdef INET6 free(ip6, M_PRISON); #endif + if (g_path != NULL) + free(g_path, M_TEMP); vfs_freeopts(opts); return (error); } From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 00:13:17 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A423D1065670; Sat, 21 Jan 2012 00:13:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 291D68FC0A; Sat, 21 Jan 2012 00:13:16 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0L0DEM6019254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Jan 2012 11:13:15 +1100 Date: Sat, 21 Jan 2012 11:13:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hiroki Sato In-Reply-To: <20120120.123256.1432718473132856309.hrs@allbsd.org> Message-ID: <20120121103348.Q1254@besplex.bde.org> References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> 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, eadler@FreeBSD.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 00:13:17 -0000 On Fri, 20 Jan 2012, Hiroki Sato wrote: > Eitan Adler wrote > in <201201200138.q0K1cSou016739@svn.freebsd.org>: > > ea> Log: > ea> Fix a variety of warnings when compiling with gcc46 > ea> > ea> Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) > ea> MFC after: 3 days > ea> > ea> Modified: > ea> head/usr.sbin/makefs/cd9660.c > > Removing the dot handling part and leaving a comment in lines > 1106-1117 make people confused. > > In addition to that, I personally don't think this should be removed > because our cd9660.c is still based on NetBSD's one in any > way---bugfixes on our side have been reported to the upstream and we > will import useful changes from there if any. Although the current > dot handling is useless, keeping the difference between the two small > still has a meaning. I agree. Never fix vendor code. Especially style bugs in it. Not all vendor code is in contrib. Here is another comment nonsensified by removing its code: % Author: eadler % Date: Fri Jan 20 01:39:16 2012 % New Revision: 230360 % URL: http://svn.freebsd.org/changeset/base/230360 % % Log: % Fix warning when compiling with gcc46: % error: variable 'flags' set but not used % % Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) % MFC after: 3 days % % Modified: % head/usr.sbin/cpucontrol/via.c % % Modified: head/usr.sbin/cpucontrol/via.c % ============================================================================== % --- head/usr.sbin/cpucontrol/via.c Fri Jan 20 01:39:08 2012 (r230359) % +++ head/usr.sbin/cpucontrol/via.c Fri Jan 20 01:39:16 2012 (r230360) % @@ -82,7 +82,7 @@ via_update(const char *dev, const char * % unsigned int i; % size_t payload_size; % via_fw_header_t *fw_header; % - uint32_t signature, flags; % + uint32_t signature; % int32_t revision; % void *fw_data; % size_t data_size, total_size; % @@ -121,7 +121,6 @@ via_update(const char *dev, const char * % /* % * MSR_IA32_PLATFORM_ID contains flag in BCD in bits 52-50. % */ % - flags = 1 << ((msrargs.data >> 50) & 7); % msrargs.msr = MSR_BIOS_SIGN; % error = ioctl(devfd, CPUCTL_RDMSR, &msrargs); % if (error < 0) { % `flag' in bits 52-50 is apparently important enough to start a new section of code with a block comment for, but was not used. It can't be important enough to start a new section of code with a block comment for deleted code. in the block. In fact, it seems that there there was a very large amount of unused code, and this commit only removes the tip of it. There is lots more code to initialize msrargs.data in the above, but now msrargs.data is unised too. This is apparently too complicated for the compiler to see that it is unused: % cpuctl_msr_args_t msrargs = { % .msr = MSR_IA32_PLATFORM_ID, % }; I don't like the style of this: - initialization in declaration - fairly complicated initialization in declaration - 3 lines when 1 would do. These obfuscations make it harder to see that this code is not really used (it seems to be used only to initialize other variables that are not used). It initializes the full struct, but only msr in it is used, and for later uses, the other parts are left as garbage (which is good for saving space and indicating their non-use to the reader). Later uses initialize msr in a statement. All uses should initialize it like that. I don't like this API. style(9) forbids using typedefs to obfuscate structs. Here we have to know that it is a struct just to initialize it. So the typedef negatively opaque. % cpuctl_cpuid_args_t idargs = { % .level = 1, /* Signature. */ % }; % cpuctl_update_args_t args; % int error; % % assert(path); % assert(dev); % % fd = -1; % devfd = -1; % fw_image = MAP_FAILED; % devfd = open(dev, O_RDWR); % if (devfd < 0) { % WARN(0, "could not open %s for writing", dev); % return; % } % error = ioctl(devfd, CPUCTL_CPUID, &idargs); % if (error < 0) { % WARN(0, "ioctl(%s)", dev); % goto fail; % } % signature = idargs.data[0]; % error = ioctl(devfd, CPUCTL_RDMSR, &msrargs); Here we use msrargs.msr to initialize the full struct to useful values. We previously initialized it fully, but to not very useful values: - we initialized its msr to MSR_IA32_PLATFORM_ID, to obfuscate the msr that we are asking for here - we initialized the rest of it to 0, to obfuscate that the rest is not used % if (error < 0) { % WARN(0, "ioctl(%s)", dev); % goto fail; % } % % /* % * MSR_IA32_PLATFORM_ID contains flag in BCD in bits 52-50. % */ Now we have the result of requesting the msr in msrargs.data. We used to have the useless use of that, of assigning it to the unused `flags' variable. Now we don't have even that. We only have its ghost in the comment. % msrargs.msr = MSR_BIOS_SIGN; % error = ioctl(devfd, CPUCTL_RDMSR, &msrargs); Here we ask for another msr. This overwrites msrargs.data, leaving no possible subsequent use for the result of the first ioctl. % if (error < 0) { % WARN(0, "ioctl(%s)", dev); % goto fail; % } % revision = msrargs.data >> 32; /* Revision in the high dword. */ Here the result of the second ioctl is actually used. Another bug in this API is that its struct members don't have prefixes. One has the common English and programming name `data' so it is especially hard to grep for. I don't understand this code well enough to fix it. Fixing it requires understanding whether the unused variable was unused because of another bug. Another bug seems likely here, since there is so much dead code. Or maybe I'm just confused, and the dead code is actually undead. It is complicated enough for this to be unclear. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 00:23:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD207106567A; Sat, 21 Jan 2012 00:23:14 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 92CA48FC26; Sat, 21 Jan 2012 00:23:13 +0000 (UTC) Received: by lahe6 with SMTP id e6so860543lah.13 for ; Fri, 20 Jan 2012 16:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=7683+zfbBT6S5SuU10UXZFYlDBCRUQPsXvbXNyjaWmU=; b=N6L2HBlvD9bB6qwNMdtcerUTGMafWVvgz1bBN+q2Xdivik8AO69L8T81+FXlesnUUk gK3X8kwTqfTfesWsGLC0xXr0QOsUaho3vT5BBuUL7fQoGC+lB3gpqCKH6zx+mRvrakAP qH2KMT7isGxoXDCrAXDvzm9H2DHR+01IxM7/o= Received: by 10.152.135.105 with SMTP id pr9mr15721754lab.19.1327105392211; Fri, 20 Jan 2012 16:23:12 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.196 with HTTP; Fri, 20 Jan 2012 16:22:41 -0800 (PST) In-Reply-To: <20120121103348.Q1254@besplex.bde.org> References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> <20120121103348.Q1254@besplex.bde.org> From: Eitan Adler Date: Fri, 20 Jan 2012 19:22:41 -0500 X-Google-Sender-Auth: Ik7DMNqXSSbUlp-AyDpPeVVE5ys Message-ID: To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 00:23:14 -0000 On Fri, Jan 20, 2012 at 7:13 PM, Bruce Evans wrote: > I agree. =C2=A0Never fix vendor code. =C2=A0Especially style bugs in it. = =C2=A0Not all > vendor code is in contrib. I'm sure this is a silly question, but why isn't this utility in a contrib/ folder? > In fact, it seems that there there was a very large amount of unused code= , > and this commit only removes the tip of it. =C2=A0There is lots more code= to > initialize msrargs.data in the above, but now msrargs.data is unised too. > This is apparently too complicated for the compiler to see that it is > unused: I had more patches which this conversation is making me hold back on: this code is contributed it doesn't fall under my goal of making the world buildable with gcc46. [snip other fixes to the api] > I don't understand this code well enough to fix it. =C2=A0Fixing it requi= res > understanding whether the unused variable was unused because of another > bug. =C2=A0Another bug seems likely here, since there is so much dead cod= e. > Or maybe I'm just confused, and the dead code is actually undead. =C2=A0I= t > is complicated enough for this to be unclear. I did not just rely on the compiler - I went through the code manually to ensure it was correct. --=20 Eitan Adler Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 00:38:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 491F61065677; Sat, 21 Jan 2012 00:38:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36FA68FC08; Sat, 21 Jan 2012 00:38:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0L0cJ8t066147; Sat, 21 Jan 2012 00:38:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0L0cJac066145; Sat, 21 Jan 2012 00:38:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201210038.q0L0cJac066145@svn.freebsd.org> From: Adrian Chadd Date: Sat, 21 Jan 2012 00:38: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: r230408 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 00:38:19 -0000 Author: adrian Date: Sat Jan 21 00:38:18 2012 New Revision: 230408 URL: http://svn.freebsd.org/changeset/base/230408 Log: Change the hwmp debugging to use %6D rather than ether_sprintf(). This allows for multiple MAC addresses to be printed on the same debugging line. ether_sprintf() uses a static char buffer and thus isn't very useful here. Submitted by: Monthadar Al Jaberi Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Sat Jan 21 00:06:21 2012 (r230407) +++ head/sys/net80211/ieee80211_hwmp.c Sat Jan 21 00:38:18 2012 (r230408) @@ -33,15 +33,15 @@ __FBSDID("$FreeBSD$"); /* * IEEE 802.11s Hybrid Wireless Mesh Protocol, HWMP. - * + * * Based on March 2009, D3.0 802.11s draft spec. */ #include "opt_inet.h" #include "opt_wlan.h" #include -#include -#include +#include +#include #include #include @@ -692,7 +692,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, return; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "received PREQ, source %s", ether_sprintf(preq->preq_origaddr)); + "received PREQ, source %6D", preq->preq_origaddr, ":"); /* * Acceptance criteria: if the PREQ is not for us and @@ -718,8 +718,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, if (HWMP_SEQ_LEQ(preq->preq_id, hrorig->hr_preqid) && HWMP_SEQ_LEQ(preq->preq_origseq, hrorig->hr_seq)) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "discard PREQ from %s, old seq no %u <= %u", - ether_sprintf(preq->preq_origaddr), + "discard PREQ from %6D, old seq no %u <= %u", + preq->preq_origaddr, ":", preq->preq_origseq, hrorig->hr_seq); return; } @@ -731,7 +731,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ if (IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0))) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "reply to %s", ether_sprintf(preq->preq_origaddr)); + "reply to %6D", preq->preq_origaddr, ":"); /* * Build and send a PREP frame. */ @@ -771,14 +771,14 @@ hwmp_recv_preq(struct ieee80211vap *vap, rt = ieee80211_mesh_rt_add(vap, rootmac); if (rt == NULL) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "unable to add root mesh path to %s", - ether_sprintf(rootmac)); + "unable to add root mesh path to %6D", + rootmac, ":"); vap->iv_stats.is_mesh_rtaddfailed++; return; } } IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "root mesh station @ %s", ether_sprintf(rootmac)); + "root mesh station @ %6D", rootmac, ":"); /* * Reply with a PREP if we don't have a path to the root @@ -819,8 +819,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, if (preq->preq_ttl > 1 && preq->preq_hopcount < hs->hs_maxhops) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "forward PREQ from %s", - ether_sprintf(preq->preq_origaddr)); + "forward PREQ from %6D", + preq->preq_origaddr, ":"); /* * Propagate the original PREQ. */ @@ -847,8 +847,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_meshprep_ie prep; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "intermediate reply for PREQ from %s", - ether_sprintf(preq->preq_origaddr)); + "intermediate reply for PREQ from %6D", + preq->preq_origaddr, ":"); prep.prep_flags = 0; prep.prep_hopcount = rt->rt_nhops + 1; prep.prep_ttl = ms->ms_ttl; @@ -873,9 +873,10 @@ hwmp_recv_preq(struct ieee80211vap *vap, if (rt == NULL) { rt = ieee80211_mesh_rt_add(vap, PREQ_TADDR(0)); if (rt == NULL) { - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, - ni, "unable to add PREQ path to %s", - ether_sprintf(PREQ_TADDR(0))); + IEEE80211_NOTE(vap, + IEEE80211_MSG_HWMP, ni, + "unable to add PREQ path to %6D", + PREQ_TADDR(0), ":"); vap->iv_stats.is_mesh_rtaddfailed++; return; } @@ -888,8 +889,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, hrorig->hr_preqid = preq->preq_id; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "forward PREQ from %s", - ether_sprintf(preq->preq_origaddr)); + "forward PREQ from %6D", + preq->preq_origaddr, ":"); ppreq.preq_hopcount += 1; ppreq.preq_ttl -= 1; ppreq.preq_metric += ms->ms_pmetric->mpm_metric(ni); @@ -956,7 +957,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, return; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "received PREP from %s", ether_sprintf(prep->prep_targetaddr)); + "received PREP from %6D", prep->prep_targetaddr, ":"); rt = ieee80211_mesh_rt_find(vap, prep->prep_targetaddr); if (rt == NULL) { @@ -967,8 +968,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, rt = ieee80211_mesh_rt_add(vap, prep->prep_targetaddr); if (rt == NULL) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, - ni, "unable to add PREP path to %s", - ether_sprintf(prep->prep_targetaddr)); + ni, "unable to add PREP path to %6D", + prep->prep_targetaddr, ":"); vap->iv_stats.is_mesh_rtaddfailed++; return; } @@ -991,8 +992,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); if (HWMP_SEQ_LEQ(prep->prep_targetseq, hr->hr_seq)) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "discard PREP from %s, old seq no %u <= %u", - ether_sprintf(prep->prep_targetaddr), + "discard PREP from %6D, old seq no %u <= %u", + prep->prep_targetaddr, ":", prep->prep_targetseq, hr->hr_seq); return; } @@ -1005,8 +1006,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_meshprep_ie pprep; /* propagated PREP */ IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "propagate PREP from %s", - ether_sprintf(prep->prep_targetaddr)); + "propagate PREP from %6D", + prep->prep_targetaddr, ":"); memcpy(&pprep, prep, sizeof(pprep)); pprep.prep_hopcount += 1; @@ -1019,8 +1020,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, if (rt->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY) { /* NB: never clobber a proxy entry */; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "discard PREP for %s, route is marked PROXY", - ether_sprintf(prep->prep_targetaddr)); + "discard PREP for %6D, route is marked PROXY", + prep->prep_targetaddr, ":"); vap->iv_stats.is_hwmp_proxy++; } else if (prep->prep_origseq == hr->hr_origseq) { /* @@ -1032,10 +1033,10 @@ hwmp_recv_prep(struct ieee80211vap *vap, (prep->prep_hopcount < rt->rt_nhops || prep->prep_metric < rt->rt_metric)) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "%s path to %s, hopcount %d:%d metric %d:%d", + "%s path to %6D, hopcount %d:%d metric %d:%d", rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ? "prefer" : "update", - ether_sprintf(prep->prep_origaddr), + prep->prep_origaddr, ":", rt->rt_nhops, prep->prep_hopcount, rt->rt_metric, prep->prep_metric); IEEE80211_ADDR_COPY(rt->rt_nexthop, wh->i_addr2); @@ -1045,8 +1046,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; } else { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "ignore PREP for %s, hopcount %d:%d metric %d:%d", - ether_sprintf(prep->prep_targetaddr), + "ignore PREP for %6D, hopcount %d:%d metric %d:%d", + prep->prep_targetaddr, ":", rt->rt_nhops, prep->prep_hopcount, rt->rt_metric, prep->prep_metric); } @@ -1179,7 +1180,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, */ if (forward && perr->perr_ttl > 1) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "propagate PERR from %s", ether_sprintf(wh->i_addr2)); + "propagate PERR from %6D", wh->i_addr2, ":"); memcpy(&pperr, perr, sizeof(*perr)); pperr.perr_ttl--; hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, @@ -1306,8 +1307,8 @@ hwmp_discover(struct ieee80211vap *vap, rt = ieee80211_mesh_rt_add(vap, dest); if (rt == NULL) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, - ni, "unable to add discovery path to %s", - ether_sprintf(dest)); + ni, "unable to add discovery path to %6D", + dest, ":"); vap->iv_stats.is_mesh_rtaddfailed++; goto done; } From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 00:42:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EDF6106564A; Sat, 21 Jan 2012 00:42:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C9B68FC0C; Sat, 21 Jan 2012 00:42:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0L0gT1K066303; Sat, 21 Jan 2012 00:42:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0L0gTwK066301; Sat, 21 Jan 2012 00:42:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201210042.q0L0gTwK066301@svn.freebsd.org> From: Adrian Chadd Date: Sat, 21 Jan 2012 00:42: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: r230409 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 00:42:29 -0000 Author: adrian Date: Sat Jan 21 00:42:28 2012 New Revision: 230409 URL: http://svn.freebsd.org/changeset/base/230409 Log: Fix the hwmp code to handle nodes in a "line" topology. For example, this particular topology didn't work correctly from all nodes: [A] - [B] - [C] - [D] Submitted by: Monthadar Al Jaberi Reviewed by: bschmidt, adrian Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Sat Jan 21 00:38:18 2012 (r230408) +++ head/sys/net80211/ieee80211_hwmp.c Sat Jan 21 00:42:28 2012 (r230409) @@ -139,9 +139,13 @@ static const uint8_t broadcastaddr[IEEE8 typedef uint32_t ieee80211_hwmp_seq; #define HWMP_SEQ_LT(a, b) ((int32_t)((a)-(b)) < 0) #define HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) +#define HWMP_SEQ_EQ(a, b) ((int32_t)((a)-(b)) == 0) #define HWMP_SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0) #define HWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) +/* The longer one of the lifetime should be stored as new lifetime */ +#define MESH_ROUTE_LIFETIME_MAX(a, b) (a > b ? a : b) + /* * Private extension of ieee80211_mesh_route. */ @@ -677,7 +681,9 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt = NULL; struct ieee80211_mesh_route *rtorig = NULL; - struct ieee80211_hwmp_route *hrorig; + struct ieee80211_mesh_route *rttarg = NULL; + struct ieee80211_hwmp_route *hrorig = NULL; + struct ieee80211_hwmp_route *hrtarg = NULL; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; struct ieee80211_meshprep_ie prep; @@ -695,36 +701,79 @@ hwmp_recv_preq(struct ieee80211vap *vap, "received PREQ, source %6D", preq->preq_origaddr, ":"); /* - * Acceptance criteria: if the PREQ is not for us and - * forwarding is disabled, discard this PREQ. + * Acceptance criteria: if the PREQ is not for us or not broadcast + * AND forwarding is disabled, discard this PREQ. + * XXX: need to check PROXY */ - if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0)) && + if ((!IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0)) || + !IEEE80211_IS_MULTICAST(PREQ_TADDR(0))) && !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_HWMP, preq->preq_origaddr, NULL, "%s", "not accepting PREQ"); return; } + /* + * Acceptance criteria: if unicast addressed + * AND no valid forwarding for Target of PREQ, discard this PREQ. + */ + rttarg = ieee80211_mesh_rt_find(vap, PREQ_TADDR(0)); + if(rttarg != NULL) + hrtarg = IEEE80211_MESH_ROUTE_PRIV(rttarg, + struct ieee80211_hwmp_route); + /* Address mode: ucast */ + if((preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AM) == 0 && + rttarg == NULL && + !IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0))) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_HWMP, + preq->preq_origaddr, NULL, + "unicast addressed PREQ of unknown target %6D", + PREQ_TADDR(0), ":"); + return; + } + + /* PREQ ACCEPTED */ + rtorig = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); - if (rtorig == NULL) + if (rtorig == NULL) { rtorig = ieee80211_mesh_rt_add(vap, preq->preq_origaddr); + IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, + "adding originator %6D", preq->preq_origaddr, ":"); + } if (rtorig == NULL) { /* XXX stat */ return; } hrorig = IEEE80211_MESH_ROUTE_PRIV(rtorig, struct ieee80211_hwmp_route); - /* - * Sequence number validation. + + /* Data creation and update of forwarding information + * according to Table 11C-8 for originator mesh STA. */ - if (HWMP_SEQ_LEQ(preq->preq_id, hrorig->hr_preqid) && - HWMP_SEQ_LEQ(preq->preq_origseq, hrorig->hr_seq)) { + if(HWMP_SEQ_GT(preq->preq_origseq, hrorig->hr_seq) || + (HWMP_SEQ_EQ(preq->preq_origseq, hrorig->hr_seq) && + preq->preq_metric < rtorig->rt_metric)) { + hrorig->hr_seq = preq->preq_origseq; + IEEE80211_ADDR_COPY(rtorig->rt_nexthop, wh->i_addr2); + rtorig->rt_metric = preq->preq_metric + + ms->ms_pmetric->mpm_metric(ni); + rtorig->rt_nhops = preq->preq_hopcount + 1; + rtorig->rt_lifetime = MESH_ROUTE_LIFETIME_MAX( + preq->preq_lifetime, rtorig->rt_lifetime); + /* path to orig is valid now */ + rtorig->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; + }else if(hrtarg != NULL && + HWMP_SEQ_EQ(hrtarg->hr_seq, PREQ_TSEQ(0)) && + (rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "discard PREQ from %6D, old seq no %u <= %u", preq->preq_origaddr, ":", preq->preq_origseq, hrorig->hr_seq); return; } - hrorig->hr_preqid = preq->preq_id; - hrorig->hr_seq = preq->preq_origseq; + + /* + * Forwarding information for transmitter mesh STA + * [OPTIONAL: if metric improved] + */ /* * Check if the PREQ is addressed to us. @@ -823,21 +872,24 @@ hwmp_recv_preq(struct ieee80211vap *vap, preq->preq_origaddr, ":"); /* * Propagate the original PREQ. + * PREQ is unicast now to rt->rt_nexthop */ + ppreq.preq_flags &= + ~IEEE80211_MESHPREQ_FLAGS_AM; ppreq.preq_hopcount += 1; ppreq.preq_ttl -= 1; ppreq.preq_metric += ms->ms_pmetric->mpm_metric(ni); /* - * Set TO and unset RF bits because we are going - * to send a PREP next. + * Set TO and unset RF bits because we are + * going to send a PREP next. */ ppreq.preq_targets[0].target_flags |= IEEE80211_MESHPREQ_TFLAGS_TO; ppreq.preq_targets[0].target_flags &= ~IEEE80211_MESHPREQ_TFLAGS_RF; hwmp_send_preq(ni, vap->iv_myaddr, - broadcastaddr, &ppreq); + rt->rt_nexthop, &ppreq); } /* * Check if we can send an intermediate Path Reply, @@ -898,7 +950,6 @@ hwmp_recv_preq(struct ieee80211vap *vap, &ppreq); } } - } #undef PREQ_TFLAGS #undef PREQ_TADDR @@ -922,7 +973,7 @@ hwmp_send_preq(struct ieee80211_node *ni /* * mesh preq action frame format * [6] da - * [6] sa + * [6] sa * [6] addr3 = sa * [1] action * [1] category @@ -944,6 +995,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = vap->iv_ifp; struct mbuf *m, *next; + uint32_t metric = 0; /* * Acceptance criteria: if the corresponding PREQ was not generated @@ -963,6 +1015,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, if (rt == NULL) { /* * If we have no entry this could be a reply to a root PREQ. + * XXX: not true anymore cause we dont create entry for target + * when propagating PREQs like the old code did. */ if (hs->hs_rootmode != IEEE80211_HWMP_ROOTMODE_DISABLED) { rt = ieee80211_mesh_rt_add(vap, prep->prep_targetaddr); @@ -979,11 +1033,11 @@ hwmp_recv_prep(struct ieee80211vap *vap, rt->rt_metric = prep->prep_metric; rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "add root path to %s nhops %d metric %d (PREP)", - ether_sprintf(prep->prep_targetaddr), + "add root path to %6D nhops %d metric %lu (PREP)", + prep->prep_targetaddr, ":", rt->rt_nhops, rt->rt_metric); return; - } + } return; } /* @@ -997,6 +1051,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, prep->prep_targetseq, hr->hr_seq); return; } + hr->hr_seq = prep->prep_targetseq; /* * If it's NOT for us, propagate the PREP. @@ -1004,7 +1059,6 @@ hwmp_recv_prep(struct ieee80211vap *vap, if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_origaddr) && prep->prep_ttl > 1 && prep->prep_hopcount < hs->hs_maxhops) { struct ieee80211_meshprep_ie pprep; /* propagated PREP */ - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "propagate PREP from %6D", prep->prep_targetaddr, ":"); @@ -1013,7 +1067,6 @@ hwmp_recv_prep(struct ieee80211vap *vap, pprep.prep_hopcount += 1; pprep.prep_ttl -= 1; pprep.prep_metric += ms->ms_pmetric->mpm_metric(ni); - IEEE80211_ADDR_COPY(pprep.prep_targetaddr, vap->iv_myaddr); hwmp_send_prep(ni, vap->iv_myaddr, broadcastaddr, &pprep); } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); @@ -1023,7 +1076,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, "discard PREP for %6D, route is marked PROXY", prep->prep_targetaddr, ":"); vap->iv_stats.is_hwmp_proxy++; - } else if (prep->prep_origseq == hr->hr_origseq) { + /* NB: first path discovery always fails */ + } else if (hr->hr_origseq == 0 || + prep->prep_origseq == hr->hr_origseq) { /* * Check if we already have a path to this node. * If we do, check if this path reply contains a @@ -1032,6 +1087,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0 || (prep->prep_hopcount < rt->rt_nhops || prep->prep_metric < rt->rt_metric)) { + hr->hr_origseq = prep->prep_origseq; + metric = prep->prep_metric + + ms->ms_pmetric->mpm_metric(ni); IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "%s path to %6D, hopcount %d:%d metric %d:%d", rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ? @@ -1040,9 +1098,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, rt->rt_nhops, prep->prep_hopcount, rt->rt_metric, prep->prep_metric); IEEE80211_ADDR_COPY(rt->rt_nexthop, wh->i_addr2); - rt->rt_nhops = prep->prep_hopcount; + rt->rt_nhops = prep->prep_hopcount + 1; rt->rt_lifetime = prep->prep_lifetime; - rt->rt_metric = prep->prep_metric; + rt->rt_metric = metric; rt->rt_flags |= IEEE80211_MESHRT_FLAGS_VALID; } else { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, @@ -1053,11 +1111,11 @@ hwmp_recv_prep(struct ieee80211vap *vap, } } else { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "discard PREP for %s, wrong seqno %u != %u", - ether_sprintf(prep->prep_targetaddr), prep->prep_origseq, - hr->hr_seq); + "discard PREP for %6D, wrong orig seqno %u != %u", + prep->prep_targetaddr, ":", prep->prep_origseq, + hr->hr_origseq); vap->iv_stats.is_hwmp_wrongseq++; - } + } /* * Check for frames queued awaiting path discovery. * XXX probably can tell exactly and avoid remove call @@ -1065,9 +1123,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, * stuck back on the stageq because there won't be * a path. */ - m = ieee80211_ageq_remove(&ic->ic_stageq, + m = ieee80211_ageq_remove(&ic->ic_stageq, (struct ieee80211_node *)(uintptr_t) - ieee80211_mac_hash(ic, rt->rt_dest)); + ieee80211_mac_hash(ic, rt->rt_dest)); for (; m != NULL; m = next) { next = m->m_nextpkt; m->m_nextpkt = NULL; @@ -1088,7 +1146,7 @@ hwmp_send_prep(struct ieee80211_node *ni /* * mesh prep action frame format * [6] da - * [6] sa + * [6] sa * [6] addr3 = sa * [1] action * [1] category @@ -1147,7 +1205,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt = NULL; struct ieee80211_hwmp_route *hr; - struct ieee80211_meshperr_ie pperr; + struct ieee80211_meshperr_ie pperr; int i, forward = 0; /* @@ -1166,7 +1224,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, if (rt == NULL) continue; hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); - if (!(PERR_DFLAGS(0) & IEEE80211_MESHPERR_DFLAGS_USN) && + if (!(PERR_DFLAGS(0) & IEEE80211_MESHPERR_DFLAGS_USN) && HWMP_SEQ_GEQ(PERR_DSEQ(i), hr->hr_seq)) { ieee80211_mesh_rt_del(vap, rt->rt_dest); ieee80211_mesh_rt_flush_peer(vap, rt->rt_dest); @@ -1268,7 +1326,7 @@ hwmp_send_rann(struct ieee80211_node *ni /* * mesh rann action frame format * [6] da - * [6] sa + * [6] sa * [6] addr3 = sa * [1] action * [1] category @@ -1324,13 +1382,15 @@ hwmp_discover(struct ieee80211vap *vap, /* XXX check preq retries */ sendpreq = 1; IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, dest, - "start path discovery (src %s)", + "start path discovery (src %s), target seq %u", m == NULL ? "" : ether_sprintf( - mtod(m, struct ether_header *)->ether_shost)); + mtod(m, struct ether_header *)->ether_shost), + hr->hr_seq); /* * Try to discover the path for this node. + * Group addressed PREQ Case A */ - preq.preq_flags = 0; + preq.preq_flags = IEEE80211_MESHPREQ_FLAGS_AM; preq.preq_hopcount = 0; preq.preq_ttl = ms->ms_ttl; preq.preq_id = ++hs->hs_preqid; @@ -1346,7 +1406,7 @@ hwmp_discover(struct ieee80211vap *vap, if (ieee80211_hwmp_replyforward) PREQ_TFLAGS(0) |= IEEE80211_MESHPREQ_TFLAGS_RF; PREQ_TFLAGS(0) |= IEEE80211_MESHPREQ_TFLAGS_USN; - PREQ_TSEQ(0) = 0; + PREQ_TSEQ(0) = hr->hr_seq; /* XXX check return value */ hwmp_send_preq(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &preq); @@ -1392,7 +1452,7 @@ hwmp_ioctl_get80211(struct ieee80211vap { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; int error; - + if (vap->iv_opmode != IEEE80211_M_MBSS) return ENOSYS; error = 0; From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 02:41:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B194A106564A; Sat, 21 Jan 2012 02:41:14 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (stark.strangled.net [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 98A988FC19; Sat, 21 Jan 2012 02:41:14 +0000 (UTC) Received: from [66.109.103.71] (unknown [66.109.103.71]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id AE8493981E; Fri, 20 Jan 2012 18:41:13 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1256.1) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201201210038.q0L0cJac066145@svn.freebsd.org> Date: Fri, 20 Jan 2012 18:41:13 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201210038.q0L0cJac066145@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1256.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230408 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 02:41:14 -0000 On 2012/01/20, at 16:38, Adrian Chadd wrote: > Author: adrian > Date: Sat Jan 21 00:38:18 2012 > New Revision: 230408 > URL: http://svn.freebsd.org/changeset/base/230408 >=20 > Log: > Change the hwmp debugging to use %6D rather than ether_sprintf(). >=20 > This allows for multiple MAC addresses to be printed on the same > debugging line. ether_sprintf() uses a static char buffer and > thus isn't very useful here. >=20 > Submitted by: Monthadar Al Jaberi This commit doesn't help much and keeps us more toolchain dependent like = Alexander pointed out in IRC. Since ether_sprintf() wasn't causing any = trouble, please consider backing this out. This commit also introduces unnecessary changes which make reviewing = harder. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 02:42:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4417D106566B; Sat, 21 Jan 2012 02:42:58 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (stark.strangled.net [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCB78FC08; Sat, 21 Jan 2012 02:42:58 +0000 (UTC) Received: from [66.109.103.71] (unknown [66.109.103.71]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id F168039823; Fri, 20 Jan 2012 18:42:56 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1256.1) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201201210042.q0L0gTwK066301@svn.freebsd.org> Date: Fri, 20 Jan 2012 18:42:57 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <92FCD394-73E5-42A4-BA56-5E39EA36EF75@FreeBSD.org> References: <201201210042.q0L0gTwK066301@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1256.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230409 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 02:42:58 -0000 On 2012/01/20, at 16:42, Adrian Chadd wrote: > Author: adrian > Date: Sat Jan 21 00:42:28 2012 > New Revision: 230409 > URL: http://svn.freebsd.org/changeset/base/230409 >=20 > Log: > Fix the hwmp code to handle nodes in a "line" topology. >=20 > For example, this particular topology didn't work correctly from all > nodes: >=20 > [A] - [B] - [C] - [D] >=20 > Submitted by: Monthadar Al Jaberi > Reviewed by: bschmidt, adrian I tested this exact topology when I implemented HWMP, so I don't know = what went wrong. The commit log doesn't say much about what was wrong = and the code changes are, again, mixed with style changes so I haven't = had time to fully appreciate these changes. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 02:52:52 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F9F9106566B; Sat, 21 Jan 2012 02:52:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id C027E8FC08; Sat, 21 Jan 2012 02:52:50 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0L2qmx9029320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Jan 2012 13:52:48 +1100 Date: Sat, 21 Jan 2012 13:52:47 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andreas Tobler In-Reply-To: <201201201849.q0KInmic054086@svn.freebsd.org> Message-ID: <20120121131914.W1596@besplex.bde.org> References: <201201201849.q0KInmic054086@svn.freebsd.org> 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 Subject: Re: svn commit: r230390 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 02:52:52 -0000 On Fri, 20 Jan 2012, Andreas Tobler wrote: > Log: > Disable GUPROF on archs other than i386/amd64 since the fine details are not > implemented. This was intentionally not done. Just don't use config -pp on arches that don't suppport it. "profile 2" is already left out of NOTES for all arches except amd64, i386 and powerpc. But the configuration of "profile" in the NOTES for these arches is broken anyway. It doesn't exist. Thus even normal profiling is not tested by NOTES on these arches. > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > --- head/sys/conf/kern.pre.mk Fri Jan 20 17:25:15 2012 (r230389) > +++ head/sys/conf/kern.pre.mk Fri Jan 20 18:49:47 2012 (r230390) > @@ -103,11 +103,14 @@ ASM_CFLAGS= -x assembler-with-cpp -DLOCO > > .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 > CFLAGS+= -DGPROF -falign-functions=16 > +PROF= -pg > .if ${PROFLEVEL} >= 2 > CFLAGS+= -DGPROF4 -DGUPROF > -PROF= -pg -mprofiler-epilogue > +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" Style bug: unsorted tests. > +PROF+= -mprofiler-epilogue GUPROF is completely broken in amd64 and i386 too: - -mprofiler-epilogue is broken in gcc-4. It used to be possible to work around this by building kernels with gcc-3, but I think there are now some build problems with this. - certain optimizations break GUPROF: - -O2 breaks it even with gcc-3 - optimizations in gcc-4 break it further. Especially, -funit-at-a-time -finline-functions-called-once. These also break ordinary profiling, debugging, and stack traces in debuggers and panics. These and -O2 are now the defaults :-(. - GUPROF never worked with SMP (except in my version). OTOH, using GUPROF with SMP avoids some deadlocks on amd64 and i386. See MCOUNT_ENTER() and MCOUNT_EXIT() on these arches. These use an atomic_cmpset() which deadlocks any time a trap occurs in mcount() (since the trap code is profiled). Tracing through mcount() always causes such traps. This bug is accidentally avoided by GUPROF, since it doesn't pretend to support SMP so it doesn't do any cmpset- type locking. This is fixed in my version by doing more delicate locking in mcount() for both GUPROF and !GUPROF. All arches need this. Other arches mostly only do intr_disable()/restore() in MCOUNT_ENTER()/ EXIT(). Thus for the SMP case they have common races instead of not-so- common deadlocks. These arches don't pretend to support SMP any more than GUPROF does. The exceptions are mips and sparc64. mips has the cmpsets, and sparc64 has rdpr()/wrpr() which I think are are just lower-level forms of interrupt disabling (they mask ALL interrupts, while intr_disable() only masks most interrupts?) Masking of traps too would prevent deadlocks and avoid the need for cmpsets, but is not possible. Important traps like NMIs and debugger traps are not maskable. > .else > -PROF= -pg > +.error "GUPROF not supported on ${MACHINE_CPUARCH}." Style bug: error messages are not terminated with a "." in KNF. > +.endif > .endif > .endif > DEFINED_PROF= ${PROF} Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 05:52:57 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C015106564A; Sat, 21 Jan 2012 05:52:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by mx1.freebsd.org (Postfix) with ESMTP id D2B5C8FC0C; Sat, 21 Jan 2012 05:52:55 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0L5qqLM029921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Jan 2012 16:52:53 +1100 Date: Sat, 21 Jan 2012 16:52:52 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler In-Reply-To: Message-ID: <20120121164200.I2292@besplex.bde.org> References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> <20120121103348.Q1254@besplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1597002112-1327125172=:2292" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Hiroki Sato , Bruce Evans , src-committers@FreeBSD.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 05:52:57 -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-1597002112-1327125172=:2292 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 20 Jan 2012, Eitan Adler wrote: > On Fri, Jan 20, 2012 at 7:13 PM, Bruce Evans wrote= : >> I agree. =C2=A0Never fix vendor code. =C2=A0Especially style bugs in it.= =C2=A0Not all >> vendor code is in contrib. > > I'm sure this is a silly question, but why isn't this utility in a > contrib/ folder? Probably historical, but src/contrib/ still has little more than `file' and lukemftpd from NetBSD. I think those are there mainly because they got portabilized and complicated by their use of autoconfig, so they don't fit naturally in the BSD build framework any more. > [snip other fixes to the api] [for cpucontrol] >> I don't understand this code well enough to fix it. =C2=A0Fixing it requ= ires >> understanding whether the unused variable was unused because of another >> bug. =C2=A0Another bug seems likely here, since there is so much dead co= de. >> Or maybe I'm just confused, and the dead code is actually undead. =C2=A0= It >> is complicated enough for this to be unclear. > > I did not just rely on the compiler - I went through the code manually > to ensure it was correct. It can take too long to see correctness for an apparently-simple change. Bruce --0-1597002112-1327125172=:2292-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 06:27:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AFB01065670; Sat, 21 Jan 2012 06:27:46 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 47AEF8FC17; Sat, 21 Jan 2012 06:27:44 +0000 (UTC) Received: by lahe6 with SMTP id e6so975804lah.13 for ; Fri, 20 Jan 2012 22:27:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:x-gm-message-state :content-type:content-transfer-encoding; bh=ld57SGBNomMJN14Mw1E6YUC2YdmUhd2mXj+aKO5OhhQ=; b=V49PZEP2yQ3yVaqFdXpAfuouu/RDFnnGQPZPjU37yVCinUTaE2UL4gm6zW7YxB47jj 5RJnolyAvGuc08cXQrd0SbUyRaHAmJq4ktMSWcwseE41OYSnzT3btd+8tng8G9SfKCq0 NPF949ZV17ihDZh9JRlU8sOoqKh/g+PHsooLQ= Received: by 10.112.100.199 with SMTP id fa7mr162334lbb.89.1327127263139; Fri, 20 Jan 2012 22:27:43 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.196 with HTTP; Fri, 20 Jan 2012 22:27:12 -0800 (PST) In-Reply-To: <20120121164200.I2292@besplex.bde.org> References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> <20120121103348.Q1254@besplex.bde.org> <20120121164200.I2292@besplex.bde.org> From: Eitan Adler Date: Sat, 21 Jan 2012 01:27:12 -0500 X-Google-Sender-Auth: V4C2du9ekJJuGdnKyrnc_psXX5I Message-ID: To: Bruce Evans X-Gm-Message-State: ALoCoQmj4i2nmZNJUG/hb0RmfBc4Sk4qf5msFEXg5fMgKSxPXm2rwysYw2YnQC6fU6RJLQGjf48t Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 06:27:46 -0000 On Sat, Jan 21, 2012 at 12:52 AM, Bruce Evans wrote: > On Fri, 20 Jan 2012, Eitan Adler wrote: > >> On Fri, Jan 20, 2012 at 7:13 PM, Bruce Evans wrot= e: >>> >>> I agree. =C2=A0Never fix vendor code. =C2=A0Especially style bugs in it= . =C2=A0Not all >>> vendor code is in contrib. >> I'm sure this is a silly question, but why isn't this utility in a >> contrib/ folder? > Probably historical, but src/contrib/ still has little more than `file' > and lukemftpd from NetBSD. =C2=A0I think those are there mainly because t= hey > got portabilized and complicated by their use of autoconfig, so they > don't fit naturally in the BSD build framework any more. I'll check http://wiki.freebsd.org/ContribSoftware for now on before making such fixes. >>> I don't understand this code well enough to fix it. =C2=A0Fixing it req= uires >>> understanding whether the unused variable was unused because of another >>> bug. =C2=A0Another bug seems likely here, since there is so much dead c= ode. >>> Or maybe I'm just confused, and the dead code is actually undead. =C2= =A0It >>> is complicated enough for this to be unclear. >> I did not just rely on the compiler - I went through the code manually >> to ensure it was correct. > > It can take too long to see correctness for an apparently-simple change. I won't revert this commit because it doesn't seem to have broken anything from the end user perspective, but I won't complain if a future import causes a regression. Thanks for your time! --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 06:50:31 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0AD3106564A; Sat, 21 Jan 2012 06:50:31 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 52A778FC15; Sat, 21 Jan 2012 06:50:30 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q0L6ixKh022685; Sat, 21 Jan 2012 07:45:00 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <4F1A6032.2040900@FreeBSD.org> Date: Sat, 21 Jan 2012 07:50:26 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Bruce Evans References: <201201201849.q0KInmic054086@svn.freebsd.org> <20120121131914.W1596@besplex.bde.org> In-Reply-To: <20120121131914.W1596@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230390 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 06:50:31 -0000 On 21.01.12 03:52, Bruce Evans wrote: > On Fri, 20 Jan 2012, Andreas Tobler wrote: > >> Log: >> Disable GUPROF on archs other than i386/amd64 since the fine details are not >> implemented. > > This was intentionally not done. Just don't use config -pp on arches that > don't suppport it. "profile 2" is already left out of NOTES for all > arches except amd64, i386 and powerpc. But the configuration of "profile" > in the NOTES for these arches is broken anyway. It doesn't exist. Thus > even normal profiling is not tested by NOTES on these arches. I sent this patch to -CURRENT: http://lists.freebsd.org/pipermail/freebsd-current/2012-January/031095.html ...and got no feedback. Is there a better place to send such patches for review? I got positive feedback from marius regarding the sparc64 case. >> Modified: head/sys/conf/kern.pre.mk >> ============================================================================== >> --- head/sys/conf/kern.pre.mk Fri Jan 20 17:25:15 2012 (r230389) >> +++ head/sys/conf/kern.pre.mk Fri Jan 20 18:49:47 2012 (r230390) >> @@ -103,11 +103,14 @@ ASM_CFLAGS= -x assembler-with-cpp -DLOCO >> >> .if defined(PROFLEVEL)&& ${PROFLEVEL}>= 1 >> CFLAGS+= -DGPROF -falign-functions=16 >> +PROF= -pg >> .if ${PROFLEVEL}>= 2 >> CFLAGS+= -DGPROF4 -DGUPROF >> -PROF= -pg -mprofiler-epilogue >> +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" > > Style bug: unsorted tests. Copied from here: sys/conf/kern.post.mk: line 174 > >> +PROF+= -mprofiler-epilogue > > GUPROF is completely broken in amd64 and i386 too: > - -mprofiler-epilogue is broken in gcc-4. It used to be possible to > work around this by building kernels with gcc-3, but I think there > are now some build problems with this. > - certain optimizations break GUPROF: > - -O2 breaks it even with gcc-3 > - optimizations in gcc-4 break it further. Especially, -funit-at-a-time > -finline-functions-called-once. These also break ordinary profiling, > debugging, and stack traces in debuggers and panics. These and -O2 > are now the defaults :-(. > - GUPROF never worked with SMP (except in my version). > > OTOH, using GUPROF with SMP avoids some deadlocks on amd64 and i386. > See MCOUNT_ENTER() and MCOUNT_EXIT() on these arches. These use an > atomic_cmpset() which deadlocks any time a trap occurs in mcount() > (since the trap code is profiled). Tracing through mcount() always > causes such traps. This bug is accidentally avoided by GUPROF, since > it doesn't pretend to support SMP so it doesn't do any cmpset- type > locking. This is fixed in my version by doing more delicate locking > in mcount() for both GUPROF and !GUPROF. All arches need this. > > Other arches mostly only do intr_disable()/restore() in MCOUNT_ENTER()/ > EXIT(). Thus for the SMP case they have common races instead of not-so- > common deadlocks. These arches don't pretend to support SMP any more > than GUPROF does. The exceptions are mips and sparc64. mips has the > cmpsets, and sparc64 has rdpr()/wrpr() which I think are are just > lower-level forms of interrupt disabling (they mask ALL interrupts, > while intr_disable() only masks most interrupts?) Masking of traps > too would prevent deadlocks and avoid the need for cmpsets, but is not > possible. Important traps like NMIs and debugger traps are not > maskable. > >> .else >> -PROF= -pg >> +.error "GUPROF not supported on ${MACHINE_CPUARCH}." > > Style bug: error messages are not terminated with a "." in KNF. > >> +.endif >> .endif >> .endif >> DEFINED_PROF= ${PROF} Do you want me to revert? Thanks for the review. Andreas From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 08:32:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23F12106567B; Sat, 21 Jan 2012 08:32:49 +0000 (UTC) (envelope-from andreast@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 7AC468FC25; Sat, 21 Jan 2012 08:32:47 +0000 (UTC) Received: from t43.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q0L84aOu044757; Sat, 21 Jan 2012 09:04:42 +0100 (CET) (envelope-from andreast@fgznet.ch) Message-ID: <4F1A72DC.7020107@fgznet.ch> Date: Sat, 21 Jan 2012 09:10:04 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:9.0) Gecko/20111223 Thunderbird/9.0 MIME-Version: 1.0 To: Bruce Evans References: <201201060921.q069Lfi8081051@svn.freebsd.org> <20120106225728.G9027@besplex.bde.org> In-Reply-To: <20120106225728.G9027@besplex.bde.org> Content-Type: multipart/mixed; boundary="------------020307030102060007060008" X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andreas Tobler Subject: Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 08:32:49 -0000 This is a multi-part message in MIME format. --------------020307030102060007060008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I write this reply from another machine... Here is what I have tested so far. Is this the right approach? Thank you in advance, Andreas --------------020307030102060007060008 Content-Type: text/plain; name="weak_ref.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="weak_ref.diff" Index: lib/libc/powerpc/SYS.h =================================================================== --- lib/libc/powerpc/SYS.h (revision 230383) +++ lib/libc/powerpc/SYS.h (working copy) @@ -33,38 +33,38 @@ #include #include -#define _SYSCALL(x) \ - .text; \ - .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ +#define _SYSCALL(name) \ + .text; \ + .align 2; \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ - .text; \ - .align 2; \ -2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +#define SYSCALL(name) \ + .text; \ + .align 2; \ +2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ - .text; \ - .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ - bnslr; \ +#define PSEUDO(name) \ + .text; \ + .align 2; \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ + bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) -#define RSYSCALL(x) \ - .text; \ - .align 2; \ -2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ - bnslr; \ +#define RSYSCALL(name) \ + .text; \ + .align 2; \ +2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ + bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) Index: lib/libc/powerpc/gen/setjmp.S =================================================================== --- lib/libc/powerpc/gen/setjmp.S (revision 230383) +++ lib/libc/powerpc/gen/setjmp.S (working copy) @@ -69,7 +69,7 @@ li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(CNAME(__longjmp), longjmp) ENTRY(__longjmp) lmw %r9,20(%r3) /* restore regs */ mr %r6,%r4 /* save val param */ Index: lib/libc/powerpc64/SYS.h =================================================================== --- lib/libc/powerpc64/SYS.h (revision 230383) +++ lib/libc/powerpc64/SYS.h (working copy) @@ -33,62 +33,62 @@ #include #include -#define _SYSCALL(x) \ - .text; \ - .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ +#define _SYSCALL(name) \ + .text; \ + .align 2; \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ - .text; \ - .align 2; \ -2: mflr %r0; \ - std %r0,16(%r1); \ - stdu %r1,-48(%r1); \ - bl CNAME(HIDENAME(cerror)); \ - nop; \ - addi %r1,%r1,48; \ - ld %r0,16(%r1); \ - mtlr %r0; \ - blr; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +#define SYSCALL(name) \ + .text; \ + .align 2; \ +2: mflr %r0; \ + std %r0,16(%r1); \ + stdu %r1,-48(%r1); \ + bl CNAME(HIDENAME(cerror)); \ + nop; \ + addi %r1,%r1,48; \ + ld %r0,16(%r1); \ + mtlr %r0; \ + blr; \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ - .text; \ - .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ - bnslr; \ - mflr %r0; \ - std %r0,16(%r1); \ - stdu %r1,-48(%r1); \ - bl CNAME(HIDENAME(cerror)); \ - nop; \ - addi %r1,%r1,48; \ - ld %r0,16(%r1); \ - mtlr %r0; \ +#define PSEUDO(name) \ + .text; \ + .align 2; \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ + bnslr; \ + mflr %r0; \ + std %r0,16(%r1); \ + stdu %r1,-48(%r1); \ + bl CNAME(HIDENAME(cerror)); \ + nop; \ + addi %r1,%r1,48; \ + ld %r0,16(%r1); \ + mtlr %r0; \ blr; -#define RSYSCALL(x) \ - .text; \ - .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ - bnslr; \ - \ - mflr %r0; \ - std %r0,16(%r1); \ - stdu %r1,-48(%r1); \ - bl CNAME(HIDENAME(cerror)); \ - nop; \ - addi %r1,%r1,48; \ - ld %r0,16(%r1); \ - mtlr %r0; \ +#define RSYSCALL(name) \ + .text; \ + .align 2; \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ + bnslr; \ + \ + mflr %r0; \ + std %r0,16(%r1); \ + stdu %r1,-48(%r1); \ + bl CNAME(HIDENAME(cerror)); \ + nop; \ + addi %r1,%r1,48; \ + ld %r0,16(%r1); \ + mtlr %r0; \ blr; Index: lib/libc/powerpc64/gen/setjmp.S =================================================================== --- lib/libc/powerpc64/gen/setjmp.S (revision 230396) +++ lib/libc/powerpc64/gen/setjmp.S (working copy) @@ -93,7 +93,7 @@ li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) Index: sys/powerpc/include/asm.h =================================================================== --- sys/powerpc/include/asm.h (revision 230401) +++ sys/powerpc/include/asm.h (working copy) @@ -116,9 +116,9 @@ #define __FBSDID(s) /* nothing */ #endif /* not lint and not STRIP_FBSDID */ -#define WEAK_ALIAS(alias,sym) \ +#define WEAK_REFERENCE(sym, alias) \ .weak alias; \ - alias = sym + .equ alias, sym #ifdef __STDC__ #define WARN_REFERENCES(_sym,_msg) \ --------------020307030102060007060008-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 11:16:26 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A871065670; Sat, 21 Jan 2012 11:16:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 6CF258FC13; Sat, 21 Jan 2012 11:16:24 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0LBGKgS024169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Jan 2012 22:16:22 +1100 Date: Sat, 21 Jan 2012 22:16:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andreas Tobler In-Reply-To: <4F1A6032.2040900@FreeBSD.org> Message-ID: <20120121194019.J2720@besplex.bde.org> References: <201201201849.q0KInmic054086@svn.freebsd.org> <20120121131914.W1596@besplex.bde.org> <4F1A6032.2040900@FreeBSD.org> 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, Bruce Evans Subject: Re: svn commit: r230390 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 11:16:26 -0000 On Sat, 21 Jan 2012, Andreas Tobler wrote: > On 21.01.12 03:52, Bruce Evans wrote: >> On Fri, 20 Jan 2012, Andreas Tobler wrote: >> >>> Log: >>> Disable GUPROF on archs other than i386/amd64 since the fine details are >>> not >>> implemented. >> >> This was intentionally not done. Just don't use config -pp on arches that >> don't suppport it. "profile 2" is already left out of NOTES for all >> arches except amd64, i386 and powerpc. But the configuration of "profile" >> in the NOTES for these arches is broken anyway. It doesn't exist. Thus >> even normal profiling is not tested by NOTES on these arches. > > I sent this patch to -CURRENT: > > http://lists.freebsd.org/pipermail/freebsd-current/2012-January/031095.html > > ...and got no feedback. > > Is there a better place to send such patches for review? Probably not, but I don't read -current. > I got positive feedback from marius regarding the sparc64 case. > >>> Modified: head/sys/conf/kern.pre.mk >>> ============================================================================== >>> --- head/sys/conf/kern.pre.mk Fri Jan 20 17:25:15 2012 >>> (r230389) >>> +++ head/sys/conf/kern.pre.mk Fri Jan 20 18:49:47 2012 >>> (r230390) >>> @@ -103,11 +103,14 @@ ASM_CFLAGS= -x assembler-with-cpp -DLOCO >>> >>> .if defined(PROFLEVEL)&& ${PROFLEVEL}>= 1 >>> CFLAGS+= -DGPROF -falign-functions=16 >>> +PROF= -pg >>> .if ${PROFLEVEL}>= 2 >>> CFLAGS+= -DGPROF4 -DGUPROF >>> -PROF= -pg -mprofiler-epilogue >>> +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" >> >> Style bug: unsorted tests. > > Copied from here: > > sys/conf/kern.post.mk: line 174 There are lots of bad examples to copy from. I sometimes complain about them to try to stop them spreading :-). > >> >>> +PROF+= -mprofiler-epilogue > Do you want me to revert? Yes. There is no point in having several layers of ifdefs for this. I have already reduced the ifdef tangle for this once before. In 2006 I removed the ifdefs for icc. These reduced to a .error failure followed by about 8 unreachable lines. I changed this to just the .error failure. Someone later removed the icc support. But none of this was messy enough to be correct even on i386. i386 NOTES puts sets PROFLEVEL to 2 unconditionally, so icc can never have possibly worked with NOTES. Bute you might want to look at the porability of the ordinary profiling case. Here it is again, copied from above. Beware that something mangled the whitespace (space characters but not tabs): % .if defined(PROFLEVEL)&& ${PROFLEVEL}>= 1 % CFLAGS+= -DGPROF -falign-functions=16 % +PROF= -pg % .if ${PROFLEVEL}>= 2 % ... -DGPROF sets a kernel option so is OK. -pg is unportable but the same for all supported arches (?) so OK. -falign-functions=LARGE is used to reduce the size of profiling buffs. Function alignment used to default to 4 on i386 but is now often 16 or more. Probably it is larger on other arches. It should match the definition of FUNCTION_ALIGNMENT in , and in fact matches for all arches except powerpc* and sparc64: % amd64/include/profile.h:#define FUNCTION_ALIGNMENT 16 % amd64/include/profile.h:#define FUNCTION_ALIGNMENT 4 % arm/include/profile.h:#define FUNCTION_ALIGNMENT 16 The tab after #define is corrupt only for arm. % i386/include/profile.h:#define FUNCTION_ALIGNMENT 16 % i386/include/profile.h:#define FUNCTION_ALIGNMENT 4 On amd64 and i386, 4 is for userland and 16 is for the kernel. Userland should use the same as the kernel to save space in the same way, but I never got around to fixing it. (Same for the histcounter size. It should be 32 or 64 bits, since 16 bits overflows after as little as 64 seconds with profhz = 1024, or after a fraction of a second with an adequately large profhz. GUPROF uses 64-bit counters since even 32 bits overflowed ~10 years ago when the profiling pseudo-frequency of the CPU clock frequency reached ~1GHz). % ia64/include/profile.h:#define FUNCTION_ALIGNMENT 16 arm and ia64 use 16 for userland too. This seems too large for arm. arm's ALIGN_TEXT gives no aligment at all (.align 0. Isn't that impossible? It may be a misspelling of .p2align 0). This seems too small for ia64. ia64's ALIGN_TEXT gives 32-byte alignment. % mips/include/profile.h:#define FUNCTION_ALIGNMENT 16 % mips/include/profile.h:#define FUNCTION_ALIGNMENT 4 Mips copies i386 for the different kernel/user alignments. Its asm.h doesn't define ALIGN_TEXT, and only has one alignment statement -- an apparently nonsensical ".align 3" one. Maybe .align still means .p2align on arm and mips, but this .align is weirdly placed (after a data allocation for a string instead of before). In asm code, mips uses just 3 alignment statements: 1 .align 4 for data, 1 .align 4 for a label, and 1 .align 5 for another label. Apparently .align does still mean .p2align on mips. % powerpc/include/profile.h:#define FUNCTION_ALIGNMENT 4 powerpc* mostly uses .align 2. This agrees with FUNCTION_ALIGNMENT, assuming that .align actually means .p2align. There are the following warts and strangenesses: - libc/powerpc*/SYS.h doesn't use ALIGN_TEXT from asm.h, but hard-codes .align 2 in 4 places in each. No other arch uses hard-coded alignment in SYS.h. Maybe you already fixed this (I checked the current version but not your latest patch). - sys/powerpc/include/asm.h doesn't define ALIGN_TEXT. It seems to use .align 4 for the function alignment in _ENTRY(). This doesn't match SYS.h, and assuming that .align actually means .p2align, it doesn't match FUNCTION_ALIGNMENT. But it matches kern.pre.mk. In asm code, powerpc uses many more hard-coded alignments than mips. These are mostly .align 4, but INTERRUPT() uses .align 5 (i386 uses SUPERALIGN_TEXT for interrupts; this has always been 32). Most of the hard-coded aligments are for data. % sparc64/include/profile.h:#define FUNCTION_ALIGNMENT 32 This agrees with ALIGN_TEXT but not with kern.pre.mk. I think the only consequence of making this too small in kern.pre.mk is wasting space. The alignments are too hard-coded even in the ALIGN_* macros. Compilers vary the alignment for C code a lot depending on -march -and -Os. For example, the default on i386 is now 16-byte alignment, and all march's that I tried except i386 don't change change this. -march=i386 changes to 4-byte alignment. -Os changes this to 1-byte alignment. But ALIGN_TEXT on i386 still always gives 4-byte alignment, since it was tuned for original i386's and never changed. Compilers now vary the alignment even more for branch targets, but asm code mostly doesn't try to align labels to any better than what ALIGN_TEXT gives. It also mostly doesn't bother with the not-so-new syntax that allows padding to a large alignment if and only if the padding isn't very large or slow to execute. No one really notices the time and space losses and gains from getting this wrong or accidentally right, since the differences are even tinier than from using -arch. But it is inelegant to have macros ALIGN_* for changing this easily and then not use them to change anything for almost 20 years on i386. The unportability of .align is (mis)documented in as.info, as a list of systems on which .align gives the alignment in bytes. The systems on which .align gives the log2 of the aligmment in bytes is mostly only documented as "other". Since amd64 is too new to be ever mentioned in as.info, it is claimed to have the log2 method, but it is actually too new to have ever have had that. The .p2align directive should probably used for clarity, although it is only portable within gas. gas also provides .balign. i386 was supposed to have been converted to use .p2align because of the possible confusion from this (IIRC, .align for it used to mean .p2align. as.info says that .align for i386 means .p2align for aout but actually means .align for elf). Most places in i386 were converted, but some weren't (with the help of too man hard-coded .align's), leaving them quite broken: - acpica/acpi_wakecode.S: uses .align 4. It's not clear whether it wants 4 or 16. This is 16-bit code (with the .align misplaced outside of the .code16 section so I would expect it to have no effect on that section). 4-byte alignment is more than adequate for 16-bit code. Most hard-coded .align's break FUNCTION_ALIGNMENT for the profiling case by not using the switch to that alignment given by using the macros, but here this doesn't matter since the profiling code doesn't support 16-bit code. - acpica/acpi_wakeup.c: uses .align 4. This one is garbage and has no effect. It is inside an inline asm for a whole function, which does the alignment correctly for the function using .p2align 2. Then the .align 4 misplaced after the function label has no effect, since th alignment is already 4. Profiling of this function is null (broken). The C macro ALIGN_TEXT is hard to use in inline functions (requires messy stringization and string concatenation.) The inline asm is fairly horrible and has 2 functions in one asm statement. The horriblness for the .align 4 is only in the first of these. - bios/smapi_bios.S. This starts with a .align directive with no args. I don't know what that means. Profiling is null (broken) in this file. This file abuses the user header . The kernel header for asm files is . (asmacros.h was originally a mistake, but I found it useful for keeping the kernel definitions separate). Using the correct header should fix profiling, but profiling near the BIOS or 16-bit code might be fragile. - i386/exception.s: kdtrace breakage: hard-coded .align 4, unlike in all old code in the file, but only for data. - include/asmacros.h: xen breakage: the disgusting ELFNOTE() macro is only used by xen, but is defined unconditionally. Other style bugs in it include: - duplication to support K&R (it even says that it is for the -traditional case, which gcc stopped supporting 10 years or so ago) - formatting totally unlike the rest of the file, with no indentation except 2 spaces for some directives, and for comments, and for the semicolons and backslashes which least need it - hard-coded alignment (only for data) - uses .align instead of .p2align for alignment. So i386 was mostly converted to use .p2align. In FreeBSD-4, the only .align's in it were the 2 in acpica and many in biosboot, and biosboot needed them since it was aout. amd64 is cleaner because it somehow doesn't have any .align's in acpica/, and it doesn't have bios/ or xen. It only has the kdtrace breakage. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 11:19:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F8E0106564A; Sat, 21 Jan 2012 11:19:25 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id D41A18FC08; Sat, 21 Jan 2012 11:19:24 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id BD64EAB2; Sat, 21 Jan 2012 12:19:21 +0100 (CET) Date: Sat, 21 Jan 2012 12:18:10 +0100 From: Pawel Jakub Dawidek To: Dag-Erling Smorgrav Message-ID: <20120121111809.GB1723@garage.freebsd.pl> References: <201201181513.q0IFDMb1045392@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0ntfKIWw70PvrIHh" Content-Disposition: inline In-Reply-To: <201201181513.q0IFDMb1045392@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230307 - in head: lib/libfetch usr.bin/fetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 11:19:25 -0000 --0ntfKIWw70PvrIHh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 18, 2012 at 03:13:22PM +0000, Dag-Erling Smorgrav wrote: > Author: des > Date: Wed Jan 18 15:13:21 2012 > New Revision: 230307 > URL: http://svn.freebsd.org/changeset/base/230307 >=20 > Log: > Fix two issues related to the use of SIGINFO in fetch(1) to display > progress information. The first is that fetch_read() (used in the HTTP > code but not the FTP code) can enter an infinite loop if it has previou= sly > been interrupted by a signal. The second is that when it is interrupte= d, > fetch_read() will discard any data it may have read up to that point. > Luckily, both bugs are extremely timing-sensitive and therefore difficu= lt > to trigger. > =20 > PR: bin/153240 > Submitted by: Mark > MFC after: 3 weeks [...] > +static int > +fetch_cache_data(conn_t *conn, char *src, size_t nbytes) > +{ > + char *tmp; > + > + if (conn->cache.size < nbytes) { > + tmp =3D realloc(conn->cache.buf, nbytes); > + if (tmp =3D=3D NULL) { > + errno =3D ENOMEM; realloc(3) on failures sets errno to ENOMEM for you already. > + conn->cache.len -=3D total; > + conn->cache.pos +=3D total; > + len -=3D total; > + buf+=3D total; Style nit (missing space before +=3D). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --0ntfKIWw70PvrIHh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8anvEACgkQForvXbEpPzT5wACfYqA6AdeqJcQo0pkRIRWG+NQL m3AAoMucxtqJSBCQYSgRPlJZZWSGZnNj =cSPT -----END PGP SIGNATURE----- --0ntfKIWw70PvrIHh-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 11:42:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6191106564A; Sat, 21 Jan 2012 11:42:40 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94DBD8FC16; Sat, 21 Jan 2012 11:42:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LBge5c090448; Sat, 21 Jan 2012 11:42:40 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LBgeHl090446; Sat, 21 Jan 2012 11:42:40 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201211142.q0LBgeHl090446@svn.freebsd.org> From: Andreas Tobler Date: Sat, 21 Jan 2012 11:42: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: r230422 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 11:42:40 -0000 Author: andreast Date: Sat Jan 21 11:42:40 2012 New Revision: 230422 URL: http://svn.freebsd.org/changeset/base/230422 Log: Revert r230390. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat Jan 21 08:26:41 2012 (r230421) +++ head/sys/conf/kern.pre.mk Sat Jan 21 11:42:40 2012 (r230422) @@ -103,14 +103,11 @@ ASM_CFLAGS= -x assembler-with-cpp -DLOCO .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 CFLAGS+= -DGPROF -falign-functions=16 -PROF= -pg .if ${PROFLEVEL} >= 2 CFLAGS+= -DGPROF4 -DGUPROF -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -PROF+= -mprofiler-epilogue +PROF= -pg -mprofiler-epilogue .else -.error "GUPROF not supported on ${MACHINE_CPUARCH}." -.endif +PROF= -pg .endif .endif DEFINED_PROF= ${PROF} From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 11:47:13 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E766F106564A; Sat, 21 Jan 2012 11:47:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 659F88FC08; Sat, 21 Jan 2012 11:47:12 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0LBkqrW014951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Jan 2012 22:46:54 +1100 Date: Sat, 21 Jan 2012 22:46:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andreas Tobler In-Reply-To: <4F1A72DC.7020107@fgznet.ch> Message-ID: <20120121224511.R3269@besplex.bde.org> References: <201201060921.q069Lfi8081051@svn.freebsd.org> <20120106225728.G9027@besplex.bde.org> <4F1A72DC.7020107@fgznet.ch> 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, Andreas Tobler , Bruce Evans Subject: Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 11:47:14 -0000 On Sat, 21 Jan 2012, Andreas Tobler wrote: > I write this reply from another machine... > > Here is what I have tested so far. > > Is this the right approach? Seems mostly what I want. I wouldn't change the right-justification of the backslashes, since most places don't need it and it gives unreadable diffs. More later. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 11:48:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D52A106564A; Sat, 21 Jan 2012 11:48:49 +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 314FE8FC1A; Sat, 21 Jan 2012 11:48:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LBmnaS090683; Sat, 21 Jan 2012 11:48:49 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LBmn36090681; Sat, 21 Jan 2012 11:48:49 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201201211148.q0LBmn36090681@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 21 Jan 2012 11:48: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: r230423 - head/sbin/mdconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 11:48:49 -0000 Author: trasz Date: Sat Jan 21 11:48:48 2012 New Revision: 230423 URL: http://svn.freebsd.org/changeset/base/230423 Log: Replace the beerware license on mdconfig(8) with standard 2-clause BSD. Approved by: phk@ Modified: head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Sat Jan 21 11:42:40 2012 (r230422) +++ head/sbin/mdconfig/mdconfig.c Sat Jan 21 11:48:48 2012 (r230423) @@ -1,14 +1,31 @@ -/* - * ---------------------------------------------------------------------------- - * "THE BEER-WARE LICENSE" (Revision 42): - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you think - * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp - * ---------------------------------------------------------------------------- +/*- + * Copyright (c) 2000-2004 Poul-Henning Kamp + * All rights reserved. * - * $FreeBSD$ + * 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$ */ + #include #include #include From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 13:31:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91A4A1065670; Sat, 21 Jan 2012 13:31:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EBB08FC0C; Sat, 21 Jan 2012 13:31:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LDVcRP093977; Sat, 21 Jan 2012 13:31:38 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LDVc3N093974; Sat, 21 Jan 2012 13:31:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201211331.q0LDVc3N093974@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 21 Jan 2012 13:31: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: r230424 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 13:31:38 -0000 Author: hselasky Date: Sat Jan 21 13:31:38 2012 New Revision: 230424 URL: http://svn.freebsd.org/changeset/base/230424 Log: Add support for the DesignWare USB 2.0 OTG controller chipset. Currently the code is not built by any modules. That will be fixed later. The Atmel ARM bus interface file part of this commit is just for sake of example. All registers and bits are declared like macros and not C-structures like in official Synopsis header files. This driver mostly origins from the musb_otg.c driver in FreeBSD except that the chip specific programming has been replaced by the one for DWC 2.0 USB OTG. Some parts related to system suspend and resume have been left like empty functions for the future. USB suspend and resume is fully supported. Added: head/sys/dev/usb/controller/dwc_otg.c (contents, props changed) head/sys/dev/usb/controller/dwc_otg.h (contents, props changed) head/sys/dev/usb/controller/dwc_otg_atmelarm.c (contents, props changed) Added: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/dwc_otg.c Sat Jan 21 13:31:38 2012 (r230424) @@ -0,0 +1,2612 @@ +/*- + * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This file contains the driver for the DesignWare series USB 2.0 OTG + * Controller. This driver currently only supports the device mode of + * the USB hardware. + */ + +/* + * LIMITATION: Drivers must be bound to all OUT endpoints in the + * active configuration for this driver to work properly. Blocking any + * OUT endpoint will block all OUT endpoints including the control + * endpoint. Usually this is not a problem. + */ + +/* + * NOTE: Writing to non-existing registers appears to cause an + * internal reset. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define USB_DEBUG_VAR dwc_otg_debug + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define DWC_OTG_BUS2SC(bus) \ + ((struct dwc_otg_softc *)(((uint8_t *)(bus)) - \ + ((uint8_t *)&(((struct dwc_otg_softc *)0)->sc_bus)))) + +#define DWC_OTG_PC2SC(pc) \ + DWC_OTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) + +#define DWC_OTG_MSK_GINT_ENABLED \ + (DWC_OTG_MSK_GINT_ENUM_DONE | \ + DWC_OTG_MSK_GINT_USB_SUSPEND | \ + DWC_OTG_MSK_GINT_INEP | \ + DWC_OTG_MSK_GINT_RXFLVL | \ + DWC_OTG_MSK_GINT_SESSREQINT) + +#define DWC_OTG_USE_HSIC 0 + +#ifdef USB_DEBUG +static int dwc_otg_debug = 0; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC OTG"); +SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, debug, CTLFLAG_RW, + &dwc_otg_debug, 0, "DWC OTG debug level"); +#endif + +#define DWC_OTG_INTR_ENDPT 1 + +/* prototypes */ + +struct usb_bus_methods dwc_otg_bus_methods; +struct usb_pipe_methods dwc_otg_device_non_isoc_methods; +struct usb_pipe_methods dwc_otg_device_isoc_fs_methods; + +static dwc_otg_cmd_t dwc_otg_setup_rx; +static dwc_otg_cmd_t dwc_otg_data_rx; +static dwc_otg_cmd_t dwc_otg_data_tx; +static dwc_otg_cmd_t dwc_otg_data_tx_sync; +static void dwc_otg_device_done(struct usb_xfer *, usb_error_t); +static void dwc_otg_do_poll(struct usb_bus *); +static void dwc_otg_standard_done(struct usb_xfer *); +static void dwc_otg_root_intr(struct dwc_otg_softc *sc); + +/* + * Here is a configuration that the chip supports. + */ +static const struct usb_hw_ep_profile dwc_otg_ep_profile[1] = { + + [0] = { + .max_in_frame_size = 64,/* fixed */ + .max_out_frame_size = 64, /* fixed */ + .is_simplex = 1, + .support_control = 1, + } +}; + +static void +dwc_otg_get_hw_ep_profile(struct usb_device *udev, + const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) +{ + struct dwc_otg_softc *sc; + + sc = DWC_OTG_BUS2SC(udev->bus); + + if (ep_addr < sc->sc_dev_ep_max) + *ppf = &sc->sc_hw_ep_profile[ep_addr].usb; + else + *ppf = NULL; +} + +static int +dwc_otg_init_fifo(struct dwc_otg_softc *sc) +{ + struct dwc_otg_profile *pf; + uint32_t fifo_size; + uint32_t fifo_regs; + uint32_t tx_start; + uint8_t x; + + fifo_size = sc->sc_fifo_size; + + fifo_regs = 4 * (sc->sc_dev_ep_max + sc->sc_dev_in_ep_max); + + if (fifo_size >= fifo_regs) + fifo_size -= fifo_regs; + else + fifo_size = 0; + + /* split equally for IN and OUT */ + fifo_size /= 2; + + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRXFSIZ, fifo_size / 4); + + /* align to 4-bytes */ + fifo_size &= ~3; + + tx_start = fifo_size; + + if (fifo_size < 0x40) { + DPRINTFN(-1, "Not enough data space for EP0 FIFO.\n"); + USB_BUS_UNLOCK(&sc->sc_bus); + return (EINVAL); + } + + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GNPTXFSIZ, (0x10 << 16) | (tx_start / 4)); + fifo_size -= 0x40; + tx_start += 0x40; + + /* setup control endpoint profile */ + sc->sc_hw_ep_profile[0].usb = dwc_otg_ep_profile[0]; + + for (x = 1; x != sc->sc_dev_ep_max; x++) { + + pf = sc->sc_hw_ep_profile + x; + + pf->usb.max_out_frame_size = 1024 * 3; + pf->usb.is_simplex = 0; /* assume duplex */ + pf->usb.support_bulk = 1; + pf->usb.support_interrupt = 1; + pf->usb.support_isochronous = 1; + pf->usb.support_out = 1; + + if (x < sc->sc_dev_in_ep_max) { + uint32_t limit; + + limit = (x == 1) ? DWC_OTG_MAX_TXN : + (DWC_OTG_MAX_TXN / 2); + + if (fifo_size >= limit) { + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + ((limit / 4) << 16) | + (tx_start / 4)); + tx_start += limit; + fifo_size -= limit; + pf->usb.max_in_frame_size = 0x200; + pf->usb.support_in = 1; + pf->max_buffer = limit; + + } else if (fifo_size >= 0x80) { + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + ((0x80 / 4) << 16) | (tx_start / 4)); + tx_start += 0x80; + fifo_size -= 0x80; + pf->usb.max_in_frame_size = 0x40; + pf->usb.support_in = 1; + + } else { + pf->usb.is_simplex = 1; + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTXF(x), + (0x0 << 16) | (tx_start / 4)); + } + } else { + pf->usb.is_simplex = 1; + } + + DPRINTF("FIFO%d = IN:%d / OUT:%d\n", x, + pf->usb.max_in_frame_size, + pf->usb.max_out_frame_size); + } + + /* reset RX FIFO */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, + DWC_OTG_MSK_GRSTCTL_RXFFLUSH); + + /* reset all TX FIFOs */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, + DWC_OTG_MSK_GRSTCTL_TXFIFO(0x10) | + DWC_OTG_MSK_GRSTCTL_TXFFLUSH); + + return (0); +} + +static void +dwc_otg_clocks_on(struct dwc_otg_softc *sc) +{ + if (sc->sc_flags.clocks_off && + sc->sc_flags.port_powered) { + + DPRINTFN(5, "\n"); + + /* TODO - platform specific */ + + sc->sc_flags.clocks_off = 0; + } +} + +static void +dwc_otg_clocks_off(struct dwc_otg_softc *sc) +{ + if (!sc->sc_flags.clocks_off) { + + DPRINTFN(5, "\n"); + + /* TODO - platform specific */ + + sc->sc_flags.clocks_off = 1; + } +} + +static void +dwc_otg_pull_up(struct dwc_otg_softc *sc) +{ + uint32_t temp; + + /* pullup D+, if possible */ + + if (!sc->sc_flags.d_pulled_up && + sc->sc_flags.port_powered) { + sc->sc_flags.d_pulled_up = 1; + + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); + temp &= ~DWC_OTG_MSK_DCTL_SOFT_DISC; + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + } +} + +static void +dwc_otg_pull_down(struct dwc_otg_softc *sc) +{ + uint32_t temp; + + /* pulldown D+, if possible */ + + if (sc->sc_flags.d_pulled_up) { + sc->sc_flags.d_pulled_up = 0; + + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); + temp |= DWC_OTG_MSK_DCTL_SOFT_DISC; + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + } +} + +static void +dwc_otg_resume_irq(struct dwc_otg_softc *sc) +{ + if (sc->sc_flags.status_suspend) { + /* update status bits */ + sc->sc_flags.status_suspend = 0; + sc->sc_flags.change_suspend = 1; + + /* + * Disable resume interrupt and enable suspend + * interrupt: + */ + sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_WKUPINT; + sc->sc_irq_mask |= DWC_OTG_MSK_GINT_USB_SUSPEND; + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + + /* complete root HUB interrupt endpoint */ + dwc_otg_root_intr(sc); + } +} + +static void +dwc_otg_wakeup_peer(struct dwc_otg_softc *sc) +{ + uint32_t temp; + + if (!sc->sc_flags.status_suspend) + return; + + DPRINTFN(5, "Remote wakeup\n"); + + /* enable remote wakeup signalling */ + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); + temp |= DWC_OTG_MSK_DCTL_REMOTE_WAKEUP; + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + + /* Wait 8ms for remote wakeup to complete. */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); + + temp &= ~DWC_OTG_MSK_DCTL_REMOTE_WAKEUP; + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); + + /* need to fake resume IRQ */ + dwc_otg_resume_irq(sc); +} + +static void +dwc_otg_set_address(struct dwc_otg_softc *sc, uint8_t addr) +{ + uint32_t temp; + + DPRINTFN(5, "addr=%d\n", addr); + + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCFG); + temp &= ~DWC_OTG_MSK_DCFG_SET_DEV_ADDR(0x7F); + temp |= DWC_OTG_MSK_DCFG_SET_DEV_ADDR(addr); + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCFG, temp); +} + +static void +dwc_otg_common_rx_ack(struct dwc_otg_softc *sc) +{ + DPRINTFN(5, "RX status clear\n"); + + /* enable RX FIFO level interrupt */ + sc->sc_irq_mask |= DWC_OTG_MSK_GINT_RXFLVL; + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); + + /* clear cached status */ + sc->sc_last_rx_status = 0; +} + +static uint8_t +dwc_otg_setup_rx(struct dwc_otg_td *td) +{ + struct dwc_otg_softc *sc; + struct usb_device_request req __aligned(4); + uint32_t temp; + uint16_t count; + + /* get pointer to softc */ + sc = DWC_OTG_PC2SC(td->pc); + + /* check endpoint status */ + + if (sc->sc_last_rx_status == 0) + goto not_complete; + + if (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(sc->sc_last_rx_status) != 0) + goto not_complete; + + if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PID) != + DWC_OTG_MSK_GRXSTS_PID_DATA0) { + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + goto not_complete; + } + + if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) != + DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + goto not_complete; + } + + DPRINTFN(5, "GRXSTSR=0x%08x\n", sc->sc_last_rx_status); + + /* clear did stall */ + td->did_stall = 0; + + /* get the packet byte count */ + count = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status); + + /* verify data length */ + if (count != td->remainder) { + DPRINTFN(0, "Invalid SETUP packet " + "length, %d bytes\n", count); + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + goto not_complete; + } + if (count != sizeof(req)) { + DPRINTFN(0, "Unsupported SETUP packet " + "length, %d bytes\n", count); + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + goto not_complete; + } + + /* copy in control request */ + memcpy(&req, sc->sc_rx_bounce_buffer, sizeof(req)); + + /* copy data into real buffer */ + usbd_copy_in(td->pc, 0, &req, sizeof(req)); + + td->offset = sizeof(req); + td->remainder = 0; + + /* sneak peek the set address */ + if ((req.bmRequestType == UT_WRITE_DEVICE) && + (req.bRequest == UR_SET_ADDRESS)) { + /* must write address before ZLP */ + dwc_otg_set_address(sc, req.wValue[0] & 0x7F); + } + + /* don't send any data by default */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTSIZ(0), + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(0) | + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(0)); + + temp = sc->sc_in_ctl[0]; + + /* enable IN endpoint */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), + temp | DWC_OTG_MSK_DIEPCTL_ENABLE); + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), + temp | DWC_OTG_MSK_DIEPCTL_SET_NAK); + + /* reset IN endpoint buffer */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, + DWC_OTG_MSK_GRSTCTL_TXFIFO(0) | + DWC_OTG_MSK_GRSTCTL_TXFFLUSH); + + /* acknowledge RX status */ + dwc_otg_common_rx_ack(sc); + return (0); /* complete */ + +not_complete: + /* abort any ongoing transfer, before enabling again */ + + temp = sc->sc_out_ctl[0]; + + temp |= DWC_OTG_MSK_DOEPCTL_ENABLE | + DWC_OTG_MSK_DOEPCTL_SET_NAK; + + /* enable OUT endpoint */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(0), temp); + + if (!td->did_stall) { + td->did_stall = 1; + + DPRINTFN(5, "stalling IN and OUT direction\n"); + + /* set stall after enabling endpoint */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(0), + temp | DWC_OTG_MSK_DOEPCTL_STALL); + + temp = sc->sc_in_ctl[0]; + + /* set stall assuming endpoint is enabled */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), + temp | DWC_OTG_MSK_DIEPCTL_STALL); + } + + /* setup number of buffers to receive */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(0), + DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(3) | + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(1) | + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(sizeof(req))); + + return (1); /* not complete */ +} + +static uint8_t +dwc_otg_data_rx(struct dwc_otg_td *td) +{ + struct dwc_otg_softc *sc; + uint32_t temp; + uint16_t count; + uint8_t got_short; + + got_short = 0; + + /* get pointer to softc */ + sc = DWC_OTG_PC2SC(td->pc); + + /* check endpoint status */ + if (sc->sc_last_rx_status == 0) + goto not_complete; + + if (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(sc->sc_last_rx_status) != td->ep_no) + goto not_complete; + + /* check for SETUP packet */ + if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) == + DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + if (td->remainder == 0) { + /* + * We are actually complete and have + * received the next SETUP + */ + DPRINTFN(5, "faking complete\n"); + return (0); /* complete */ + } + /* + * USB Host Aborted the transfer. + */ + td->error = 1; + return (0); /* complete */ + } + + if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) != + DWC_OTG_MSK_GRXSTS_DEV_OUT_DATA) { + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + goto not_complete; + } + + /* get the packet byte count */ + count = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status); + + /* verify the packet byte count */ + if (count != td->max_packet_size) { + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error = 1; + + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + return (0); /* we are complete */ + } + } + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error = 1; + + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + return (0); /* we are complete */ + } + + usbd_copy_in(td->pc, td->offset, sc->sc_rx_bounce_buffer, count); + td->remainder -= count; + td->offset += count; + + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + + /* check if we are complete */ + if ((td->remainder == 0) || got_short) { + if (td->short_pkt) { + /* we are complete */ + return (0); + } + /* else need to receive a zero length packet */ + } + +not_complete: + + temp = sc->sc_out_ctl[td->ep_no]; + + temp |= DWC_OTG_MSK_DOEPCTL_ENABLE | + DWC_OTG_MSK_DOEPCTL_CLR_NAK; + + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(td->ep_no), temp); + + /* enable SETUP and transfer complete interrupt */ + if (td->ep_no == 0) { + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(0), + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(1) | + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(td->max_packet_size)); + } else { + /* allow reception of multiple packets */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(td->ep_no), + DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(1) | + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(4) | + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(4 * + ((td->max_packet_size + 3) & ~3))); + } + return (1); /* not complete */ +} + +static uint8_t +dwc_otg_data_tx(struct dwc_otg_td *td) +{ + struct dwc_otg_softc *sc; + uint32_t max_buffer; + uint32_t count; + uint32_t fifo_left; + uint32_t mpkt; + uint32_t temp; + uint8_t to; + + to = 3; /* don't loop forever! */ + + /* get pointer to softc */ + sc = DWC_OTG_PC2SC(td->pc); + + max_buffer = sc->sc_hw_ep_profile[td->ep_no].max_buffer; + +repeat: + /* check for for endpoint 0 data */ + + temp = sc->sc_last_rx_status; + + if ((td->ep_no == 0) && (temp != 0) && + (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(temp) == 0)) { + + if ((temp & DWC_OTG_MSK_GRXSTS_PACKET_STS) != + DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + + /* dump data - wrong direction */ + dwc_otg_common_rx_ack(sc); + } else { + /* + * The current transfer was cancelled + * by the USB Host: + */ + td->error = 1; + return (0); /* complete */ + } + } + + /* fill in more TX data, if possible */ + if (td->tx_bytes != 0) { + + uint16_t cpkt; + + /* check if packets have been transferred */ + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + + /* get current packet number */ + cpkt = DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp); + + if (cpkt >= td->npkt) { + fifo_left = 0; + } else { + if (max_buffer != 0) { + fifo_left = (td->npkt - cpkt) * + td->max_packet_size; + + if (fifo_left > max_buffer) + fifo_left = max_buffer; + } else { + fifo_left = td->max_packet_size; + } + } + + count = td->tx_bytes; + if (count > fifo_left) + count = fifo_left; + + if (count != 0) { + + /* clear topmost word before copy */ + sc->sc_tx_bounce_buffer[(count - 1) / 4] = 0; + + /* copy out data */ + usbd_copy_out(td->pc, td->offset, + sc->sc_tx_bounce_buffer, count); + + /* transfer data into FIFO */ + bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, + DWC_OTG_REG_DFIFO(td->ep_no), + sc->sc_tx_bounce_buffer, (count + 3) / 4); + + td->tx_bytes -= count; + td->remainder -= count; + td->offset += count; + td->npkt = cpkt; + } + if (td->tx_bytes != 0) + goto not_complete; + + /* check remainder */ + if (td->remainder == 0) { + if (td->short_pkt) + return (0); /* complete */ + + /* else we need to transmit a short packet */ + } + } + + /* check if no packets have been transferred */ + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + + if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { + + DPRINTFN(5, "busy ep=%d npkt=%d DIEPTSIZ=0x%08x " + "DIEPCTL=0x%08x\n", td->ep_no, + DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp), + temp, DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPCTL(td->ep_no))); + + goto not_complete; + } + + DPRINTFN(5, "rem=%u ep=%d\n", td->remainder, td->ep_no); + + /* try to optimise by sending more data */ + if ((max_buffer != 0) && ((td->max_packet_size & 3) == 0)) { + + /* send multiple packets at the same time */ + mpkt = max_buffer / td->max_packet_size; + + if (mpkt > 0x3FE) + mpkt = 0x3FE; + + count = td->remainder; + if (count > 0x7FFFFF) + count = 0x7FFFFF - (0x7FFFFF % td->max_packet_size); + + td->npkt = count / td->max_packet_size; + + /* + * NOTE: We could use 0x3FE instead of "mpkt" in the + * check below to get more throughput, but then we + * have a dependency towards non-generic chip features + * to disable the TX-FIFO-EMPTY interrupts on a per + * endpoint basis. Increase the maximum buffer size of + * the IN endpoint to increase the performance. + */ + if (td->npkt > mpkt) { + td->npkt = mpkt; + count = td->max_packet_size * mpkt; + } else if ((count == 0) || (count % td->max_packet_size)) { + /* we are transmitting a short packet */ + td->npkt++; + td->short_pkt = 1; + } + } else { + /* send one packet at a time */ + mpkt = 1; + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } + td->npkt = 1; + } + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no), + DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(1) | + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(td->npkt) | + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(count)); + + /* make room for buffering */ + td->npkt += mpkt; + + temp = sc->sc_in_ctl[td->ep_no]; + + /* must enable before writing data to FIFO */ + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(td->ep_no), temp | + DWC_OTG_MSK_DIEPCTL_ENABLE | + DWC_OTG_MSK_DIEPCTL_CLR_NAK); + + td->tx_bytes = count; + + /* check remainder */ + if (td->tx_bytes == 0 && + td->remainder == 0) { + if (td->short_pkt) + return (0); /* complete */ + + /* else we need to transmit a short packet */ + } + + if (--to) + goto repeat; + +not_complete: + return (1); /* not complete */ +} + +static uint8_t +dwc_otg_data_tx_sync(struct dwc_otg_td *td) +{ + struct dwc_otg_softc *sc; + uint32_t temp; + + /* get pointer to softc */ + sc = DWC_OTG_PC2SC(td->pc); + + /* + * If all packets are transferred we are complete: + */ + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); + + /* check that all packets have been transferred */ + if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { + DPRINTFN(5, "busy ep=%d\n", td->ep_no); + goto not_complete; + } + return (0); + +not_complete: + + /* we only want to know if there is a SETUP packet or free IN packet */ + + temp = sc->sc_last_rx_status; + + if ((td->ep_no == 0) && (temp != 0) && + (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(temp) == 0)) { + + if ((temp & DWC_OTG_MSK_GRXSTS_PACKET_STS) == + DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { + DPRINTFN(5, "faking complete\n"); + /* + * Race condition: We are complete! + */ + return (0); + } else { + /* dump data - wrong direction */ + dwc_otg_common_rx_ack(sc); + } + } + return (1); /* not complete */ +} + +static uint8_t +dwc_otg_xfer_do_fifo(struct usb_xfer *xfer) +{ + struct dwc_otg_td *td; + + DPRINTFN(9, "\n"); + + td = xfer->td_transfer_cache; + while (1) { + if ((td->func) (td)) { + /* operation in progress */ + break; + } + if (((void *)td) == xfer->td_transfer_last) { + goto done; + } + if (td->error) { + goto done; + } else if (td->remainder > 0) { + /* + * We had a short transfer. If there is no alternate + * next, stop processing ! + */ + if (!td->alt_next) + goto done; + } + + /* + * Fetch the next transfer descriptor and transfer + * some flags to the next transfer descriptor + */ + td = td->obj_next; + xfer->td_transfer_cache = td; + } + return (1); /* not complete */ + +done: + /* compute all actual lengths */ + + dwc_otg_standard_done(xfer); + return (0); /* complete */ +} + +static void +dwc_otg_interrupt_poll(struct dwc_otg_softc *sc) +{ + struct usb_xfer *xfer; + uint32_t temp; + uint8_t got_rx_status; + +repeat: + if (sc->sc_last_rx_status == 0) { + + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GINTSTS); + if (temp & DWC_OTG_MSK_GINT_RXFLVL) { + /* pop current status */ + sc->sc_last_rx_status = + DWC_OTG_READ_4(sc, DWC_OTG_REG_GRXSTSP); + } + + if (sc->sc_last_rx_status != 0) { + + uint32_t temp; + uint8_t ep_no; + + temp = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT( + sc->sc_last_rx_status); + ep_no = DWC_OTG_MSK_GRXSTS_GET_CHANNEL( + sc->sc_last_rx_status); + + /* receive data, if any */ + if (temp != 0) { + DPRINTF("Reading %d bytes from ep %d\n", temp, ep_no); + bus_space_read_region_4(sc->sc_io_tag, sc->sc_io_hdl, + DWC_OTG_REG_DFIFO(ep_no), + sc->sc_rx_bounce_buffer, (temp + 3) / 4); + } + + temp = sc->sc_last_rx_status & + DWC_OTG_MSK_GRXSTS_PACKET_STS; + + /* non-data messages we simply skip */ + if (temp != DWC_OTG_MSK_GRXSTS_DEV_STP_DATA && + temp != DWC_OTG_MSK_GRXSTS_DEV_OUT_DATA) { + dwc_otg_common_rx_ack(sc); + goto repeat; + } + + /* check if we should dump the data */ + if (!(sc->sc_active_out_ep & (1U << ep_no))) { + dwc_otg_common_rx_ack(sc); + goto repeat; + } + + got_rx_status = 1; + + DPRINTFN(5, "RX status = 0x%08x: ch=%d pid=%d bytes=%d sts=%d\n", + sc->sc_last_rx_status, ep_no, + (sc->sc_last_rx_status >> 15) & 3, + DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT(sc->sc_last_rx_status), + (sc->sc_last_rx_status >> 17) & 15); + } else { + got_rx_status = 0; + } + } else { + uint8_t ep_no; + + ep_no = DWC_OTG_MSK_GRXSTS_GET_CHANNEL( + sc->sc_last_rx_status); + + /* check if we should dump the data */ + if (!(sc->sc_active_out_ep & (1U << ep_no))) { + dwc_otg_common_rx_ack(sc); + goto repeat; + } + + got_rx_status = 1; + } + + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + if (!dwc_otg_xfer_do_fifo(xfer)) { + /* queue has been modified */ + goto repeat; + } + } + + if (got_rx_status) { + if (sc->sc_last_rx_status == 0) + goto repeat; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 13:45:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CA17106564A; Sat, 21 Jan 2012 13:45:23 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id ADE328FC0C; Sat, 21 Jan 2012 13:45:22 +0000 (UTC) Received: by bkbc12 with SMTP id c12so1682438bkb.13 for ; Sat, 21 Jan 2012 05:45:21 -0800 (PST) Received: by 10.205.26.67 with SMTP id rl3mr650549bkb.45.1327153520000; Sat, 21 Jan 2012 05:45:20 -0800 (PST) Received: from rnote.ddteam.net (58-37-133-95.pool.ukrtel.net. [95.133.37.58]) by mx.google.com with ESMTPS id d2sm13609937bky.11.2012.01.21.05.45.17 (version=SSLv3 cipher=OTHER); Sat, 21 Jan 2012 05:45:19 -0800 (PST) Date: Sat, 21 Jan 2012 15:45:07 +0200 From: Aleksandr Rybalko To: Hans Petter Selasky Message-Id: <20120121154507.0f1cd659.ray@ddteam.net> In-Reply-To: <201201211331.q0LDVc3N093974@svn.freebsd.org> References: <201201211331.q0LDVc3N093974@svn.freebsd.org> X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 X-Gm-Message-State: ALoCoQlcKWq/hSZTK9fA23qlUwdWRId9ntkGo/jtWXz5w7igQV3CcWf+vYXVYgazOcoeSF3fxlT/ 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: r230424 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 13:45:23 -0000 On Sat, 21 Jan 2012 13:31:38 +0000 (UTC) Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Jan 21 13:31:38 2012 > New Revision: 230424 > URL: http://svn.freebsd.org/changeset/base/230424 > > Log: > Add support for the DesignWare USB 2.0 OTG controller chipset. > Currently the code is not built by any modules. That will > be fixed later. The Atmel ARM bus interface file part of this > commit is just for sake of example. All registers and bits are > declared like macros and not C-structures like in official > Synopsis header files. This driver mostly origins from the > musb_otg.c driver in FreeBSD except that the chip specific > programming has been replaced by the one for DWC 2.0 USB OTG. > Some parts related to system suspend and resume have been left > like empty functions for the future. USB suspend and resume is > fully supported. Wow, it is very cool! This is same controller about which i mailed you year ago Hans. It can be found not only in Atmel ARM, but also in: 1. Cavium Octeon SoC's (some have EHCI, but most DWC OTG) 2. many PowerPC SoC's 3. Ralink RT3050F/RT3052F And I think list much longer. Last (#3) answer your question to me (Subject: Where is controller/dotg.h ?). sorry for long silent about that. But I will rework a bit mips/rt305x and reconnect it with your new driver. Thank you so much! > > Added: > head/sys/dev/usb/controller/dwc_otg.c (contents, props changed) > head/sys/dev/usb/controller/dwc_otg.h (contents, props changed) > head/sys/dev/usb/controller/dwc_otg_atmelarm.c (contents, props > changed) > > Added: head/sys/dev/usb/controller/dwc_otg.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is > newly added) +++ head/sys/dev/usb/controller/dwc_otg.c Sat Jan > 21 13:31:38 2012 (r230424) @@ -0,0 +1,2612 @@ > +/*- > + * Copyright (c) 2012 Hans Petter Selasky. All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above > copyright > + * notice, this list of conditions and the following disclaimer > in the > + * documentation and/or other materials provided with the > distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS > IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE > LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE > GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN > ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +/* > + * This file contains the driver for the DesignWare series USB 2.0 > OTG > + * Controller. This driver currently only supports the device mode of > + * the USB hardware. > + */ > + > +/* > + * LIMITATION: Drivers must be bound to all OUT endpoints in the > + * active configuration for this driver to work properly. Blocking > any > + * OUT endpoint will block all OUT endpoints including the control > + * endpoint. Usually this is not a problem. > + */ > + > +/* > + * NOTE: Writing to non-existing registers appears to cause an > + * internal reset. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#define USB_DEBUG_VAR dwc_otg_debug > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > + > +#define DWC_OTG_BUS2SC(bus) \ > + ((struct dwc_otg_softc *)(((uint8_t *)(bus)) - \ > + ((uint8_t *)&(((struct dwc_otg_softc *)0)->sc_bus)))) > + > +#define DWC_OTG_PC2SC(pc) \ > + DWC_OTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) > + > +#define DWC_OTG_MSK_GINT_ENABLED \ > + (DWC_OTG_MSK_GINT_ENUM_DONE | \ > + DWC_OTG_MSK_GINT_USB_SUSPEND | \ > + DWC_OTG_MSK_GINT_INEP | \ > + DWC_OTG_MSK_GINT_RXFLVL | \ > + DWC_OTG_MSK_GINT_SESSREQINT) > + > +#define DWC_OTG_USE_HSIC 0 > + > +#ifdef USB_DEBUG > +static int dwc_otg_debug = 0; > + > +static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB > DWC OTG"); +SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, debug, CTLFLAG_RW, > + &dwc_otg_debug, 0, "DWC OTG debug level"); > +#endif > + > +#define DWC_OTG_INTR_ENDPT 1 > + > +/* prototypes */ > + > +struct usb_bus_methods dwc_otg_bus_methods; > +struct usb_pipe_methods dwc_otg_device_non_isoc_methods; > +struct usb_pipe_methods dwc_otg_device_isoc_fs_methods; > + > +static dwc_otg_cmd_t dwc_otg_setup_rx; > +static dwc_otg_cmd_t dwc_otg_data_rx; > +static dwc_otg_cmd_t dwc_otg_data_tx; > +static dwc_otg_cmd_t dwc_otg_data_tx_sync; > +static void dwc_otg_device_done(struct usb_xfer *, usb_error_t); > +static void dwc_otg_do_poll(struct usb_bus *); > +static void dwc_otg_standard_done(struct usb_xfer *); > +static void dwc_otg_root_intr(struct dwc_otg_softc *sc); > + > +/* > + * Here is a configuration that the chip supports. > + */ > +static const struct usb_hw_ep_profile dwc_otg_ep_profile[1] = { > + > + [0] = { > + .max_in_frame_size = 64,/* fixed */ > + .max_out_frame_size = 64, /* fixed */ > + .is_simplex = 1, > + .support_control = 1, > + } > +}; > + > +static void > +dwc_otg_get_hw_ep_profile(struct usb_device *udev, > + const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) > +{ > + struct dwc_otg_softc *sc; > + > + sc = DWC_OTG_BUS2SC(udev->bus); > + > + if (ep_addr < sc->sc_dev_ep_max) > + *ppf = &sc->sc_hw_ep_profile[ep_addr].usb; > + else > + *ppf = NULL; > +} > + > +static int > +dwc_otg_init_fifo(struct dwc_otg_softc *sc) > +{ > + struct dwc_otg_profile *pf; > + uint32_t fifo_size; > + uint32_t fifo_regs; > + uint32_t tx_start; > + uint8_t x; > + > + fifo_size = sc->sc_fifo_size; > + > + fifo_regs = 4 * (sc->sc_dev_ep_max + sc->sc_dev_in_ep_max); > + > + if (fifo_size >= fifo_regs) > + fifo_size -= fifo_regs; > + else > + fifo_size = 0; > + > + /* split equally for IN and OUT */ > + fifo_size /= 2; > + > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRXFSIZ, fifo_size / 4); > + > + /* align to 4-bytes */ > + fifo_size &= ~3; > + > + tx_start = fifo_size; > + > + if (fifo_size < 0x40) { > + DPRINTFN(-1, "Not enough data space for EP0 FIFO. > \n"); > + USB_BUS_UNLOCK(&sc->sc_bus); > + return (EINVAL); > + } > + > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GNPTXFSIZ, (0x10 << 16) | > (tx_start / 4)); > + fifo_size -= 0x40; > + tx_start += 0x40; > + > + /* setup control endpoint profile */ > + sc->sc_hw_ep_profile[0].usb = dwc_otg_ep_profile[0]; > + > + for (x = 1; x != sc->sc_dev_ep_max; x++) { > + > + pf = sc->sc_hw_ep_profile + x; > + > + pf->usb.max_out_frame_size = 1024 * 3; > + pf->usb.is_simplex = 0; /* assume duplex */ > + pf->usb.support_bulk = 1; > + pf->usb.support_interrupt = 1; > + pf->usb.support_isochronous = 1; > + pf->usb.support_out = 1; > + > + if (x < sc->sc_dev_in_ep_max) { > + uint32_t limit; > + > + limit = (x == 1) ? DWC_OTG_MAX_TXN : > + (DWC_OTG_MAX_TXN / 2); > + > + if (fifo_size >= limit) { > + DWC_OTG_WRITE_4(sc, > DWC_OTG_REG_DIEPTXF(x), > + ((limit / 4) << 16) | > + (tx_start / 4)); > + tx_start += limit; > + fifo_size -= limit; > + pf->usb.max_in_frame_size = 0x200; > + pf->usb.support_in = 1; > + pf->max_buffer = limit; > + > + } else if (fifo_size >= 0x80) { > + DWC_OTG_WRITE_4(sc, > DWC_OTG_REG_DIEPTXF(x), > + ((0x80 / 4) << 16) | (tx_start / > 4)); > + tx_start += 0x80; > + fifo_size -= 0x80; > + pf->usb.max_in_frame_size = 0x40; > + pf->usb.support_in = 1; > + > + } else { > + pf->usb.is_simplex = 1; > + DWC_OTG_WRITE_4(sc, > DWC_OTG_REG_DIEPTXF(x), > + (0x0 << 16) | (tx_start / 4)); > + } > + } else { > + pf->usb.is_simplex = 1; > + } > + > + DPRINTF("FIFO%d = IN:%d / OUT:%d\n", x, > + pf->usb.max_in_frame_size, > + pf->usb.max_out_frame_size); > + } > + > + /* reset RX FIFO */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, > + DWC_OTG_MSK_GRSTCTL_RXFFLUSH); > + > + /* reset all TX FIFOs */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, > + DWC_OTG_MSK_GRSTCTL_TXFIFO(0x10) | > + DWC_OTG_MSK_GRSTCTL_TXFFLUSH); > + > + return (0); > +} > + > +static void > +dwc_otg_clocks_on(struct dwc_otg_softc *sc) > +{ > + if (sc->sc_flags.clocks_off && > + sc->sc_flags.port_powered) { > + > + DPRINTFN(5, "\n"); > + > + /* TODO - platform specific */ > + > + sc->sc_flags.clocks_off = 0; > + } > +} > + > +static void > +dwc_otg_clocks_off(struct dwc_otg_softc *sc) > +{ > + if (!sc->sc_flags.clocks_off) { > + > + DPRINTFN(5, "\n"); > + > + /* TODO - platform specific */ > + > + sc->sc_flags.clocks_off = 1; > + } > +} > + > +static void > +dwc_otg_pull_up(struct dwc_otg_softc *sc) > +{ > + uint32_t temp; > + > + /* pullup D+, if possible */ > + > + if (!sc->sc_flags.d_pulled_up && > + sc->sc_flags.port_powered) { > + sc->sc_flags.d_pulled_up = 1; > + > + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); > + temp &= ~DWC_OTG_MSK_DCTL_SOFT_DISC; > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); > + } > +} > + > +static void > +dwc_otg_pull_down(struct dwc_otg_softc *sc) > +{ > + uint32_t temp; > + > + /* pulldown D+, if possible */ > + > + if (sc->sc_flags.d_pulled_up) { > + sc->sc_flags.d_pulled_up = 0; > + > + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); > + temp |= DWC_OTG_MSK_DCTL_SOFT_DISC; > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); > + } > +} > + > +static void > +dwc_otg_resume_irq(struct dwc_otg_softc *sc) > +{ > + if (sc->sc_flags.status_suspend) { > + /* update status bits */ > + sc->sc_flags.status_suspend = 0; > + sc->sc_flags.change_suspend = 1; > + > + /* > + * Disable resume interrupt and enable suspend > + * interrupt: > + */ > + sc->sc_irq_mask &= ~DWC_OTG_MSK_GINT_WKUPINT; > + sc->sc_irq_mask |= DWC_OTG_MSK_GINT_USB_SUSPEND; > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, > sc->sc_irq_mask); + > + /* complete root HUB interrupt endpoint */ > + dwc_otg_root_intr(sc); > + } > +} > + > +static void > +dwc_otg_wakeup_peer(struct dwc_otg_softc *sc) > +{ > + uint32_t temp; > + > + if (!sc->sc_flags.status_suspend) > + return; > + > + DPRINTFN(5, "Remote wakeup\n"); > + > + /* enable remote wakeup signalling */ > + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCTL); > + temp |= DWC_OTG_MSK_DCTL_REMOTE_WAKEUP; > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); > + > + /* Wait 8ms for remote wakeup to complete. */ > + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); > + > + temp &= ~DWC_OTG_MSK_DCTL_REMOTE_WAKEUP; > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCTL, temp); > + > + /* need to fake resume IRQ */ > + dwc_otg_resume_irq(sc); > +} > + > +static void > +dwc_otg_set_address(struct dwc_otg_softc *sc, uint8_t addr) > +{ > + uint32_t temp; > + > + DPRINTFN(5, "addr=%d\n", addr); > + > + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DCFG); > + temp &= ~DWC_OTG_MSK_DCFG_SET_DEV_ADDR(0x7F); > + temp |= DWC_OTG_MSK_DCFG_SET_DEV_ADDR(addr); > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DCFG, temp); > +} > + > +static void > +dwc_otg_common_rx_ack(struct dwc_otg_softc *sc) > +{ > + DPRINTFN(5, "RX status clear\n"); > + > + /* enable RX FIFO level interrupt */ > + sc->sc_irq_mask |= DWC_OTG_MSK_GINT_RXFLVL; > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GINTMSK, sc->sc_irq_mask); > + > + /* clear cached status */ > + sc->sc_last_rx_status = 0; > +} > + > +static uint8_t > +dwc_otg_setup_rx(struct dwc_otg_td *td) > +{ > + struct dwc_otg_softc *sc; > + struct usb_device_request req __aligned(4); > + uint32_t temp; > + uint16_t count; > + > + /* get pointer to softc */ > + sc = DWC_OTG_PC2SC(td->pc); > + > + /* check endpoint status */ > + > + if (sc->sc_last_rx_status == 0) > + goto not_complete; > + > + if (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(sc->sc_last_rx_status) != > 0) > + goto not_complete; > + > + if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PID) != > + DWC_OTG_MSK_GRXSTS_PID_DATA0) { > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + goto not_complete; > + } > + > + if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) ! > = > + DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + goto not_complete; > + } > + > + DPRINTFN(5, "GRXSTSR=0x%08x\n", sc->sc_last_rx_status); > + > + /* clear did stall */ > + td->did_stall = 0; > + > + /* get the packet byte count */ > + count = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT > (sc->sc_last_rx_status); + > + /* verify data length */ > + if (count != td->remainder) { > + DPRINTFN(0, "Invalid SETUP packet " > + "length, %d bytes\n", count); > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + goto not_complete; > + } > + if (count != sizeof(req)) { > + DPRINTFN(0, "Unsupported SETUP packet " > + "length, %d bytes\n", count); > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + goto not_complete; > + } > + > + /* copy in control request */ > + memcpy(&req, sc->sc_rx_bounce_buffer, sizeof(req)); > + > + /* copy data into real buffer */ > + usbd_copy_in(td->pc, 0, &req, sizeof(req)); > + > + td->offset = sizeof(req); > + td->remainder = 0; > + > + /* sneak peek the set address */ > + if ((req.bmRequestType == UT_WRITE_DEVICE) && > + (req.bRequest == UR_SET_ADDRESS)) { > + /* must write address before ZLP */ > + dwc_otg_set_address(sc, req.wValue[0] & 0x7F); > + } > + > + /* don't send any data by default */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTSIZ(0), > + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(0) | > + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(0)); > + > + temp = sc->sc_in_ctl[0]; > + > + /* enable IN endpoint */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), > + temp | DWC_OTG_MSK_DIEPCTL_ENABLE); > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), > + temp | DWC_OTG_MSK_DIEPCTL_SET_NAK); > + > + /* reset IN endpoint buffer */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_GRSTCTL, > + DWC_OTG_MSK_GRSTCTL_TXFIFO(0) | > + DWC_OTG_MSK_GRSTCTL_TXFFLUSH); > + > + /* acknowledge RX status */ > + dwc_otg_common_rx_ack(sc); > + return (0); /* complete */ > + > +not_complete: > + /* abort any ongoing transfer, before enabling again */ > + > + temp = sc->sc_out_ctl[0]; > + > + temp |= DWC_OTG_MSK_DOEPCTL_ENABLE | > + DWC_OTG_MSK_DOEPCTL_SET_NAK; > + > + /* enable OUT endpoint */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(0), temp); > + > + if (!td->did_stall) { > + td->did_stall = 1; > + > + DPRINTFN(5, "stalling IN and OUT direction\n"); > + > + /* set stall after enabling endpoint */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(0), > + temp | DWC_OTG_MSK_DOEPCTL_STALL); > + > + temp = sc->sc_in_ctl[0]; > + > + /* set stall assuming endpoint is enabled */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(0), > + temp | DWC_OTG_MSK_DIEPCTL_STALL); > + } > + > + /* setup number of buffers to receive */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(0), > + DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(3) | > + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(1) | > + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(sizeof(req))); > + > + return (1); /* not complete */ > +} > + > +static uint8_t > +dwc_otg_data_rx(struct dwc_otg_td *td) > +{ > + struct dwc_otg_softc *sc; > + uint32_t temp; > + uint16_t count; > + uint8_t got_short; > + > + got_short = 0; > + > + /* get pointer to softc */ > + sc = DWC_OTG_PC2SC(td->pc); > + > + /* check endpoint status */ > + if (sc->sc_last_rx_status == 0) > + goto not_complete; > + > + if (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(sc->sc_last_rx_status) != > td->ep_no) > + goto not_complete; > + > + /* check for SETUP packet */ > + if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) > == > + DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { > + if (td->remainder == 0) { > + /* > + * We are actually complete and have > + * received the next SETUP > + */ > + DPRINTFN(5, "faking complete\n"); > + return (0); /* complete */ > + } > + /* > + * USB Host Aborted the transfer. > + */ > + td->error = 1; > + return (0); /* complete */ > + } > + > + if ((sc->sc_last_rx_status & DWC_OTG_MSK_GRXSTS_PACKET_STS) ! > = > + DWC_OTG_MSK_GRXSTS_DEV_OUT_DATA) { > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + goto not_complete; > + } > + > + /* get the packet byte count */ > + count = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT > (sc->sc_last_rx_status); + > + /* verify the packet byte count */ > + if (count != td->max_packet_size) { > + if (count < td->max_packet_size) { > + /* we have a short packet */ > + td->short_pkt = 1; > + got_short = 1; > + } else { > + /* invalid USB packet */ > + td->error = 1; > + > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + return (0); /* we are complete */ > + } > + } > + /* verify the packet byte count */ > + if (count > td->remainder) { > + /* invalid USB packet */ > + td->error = 1; > + > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + return (0); /* we are complete */ > + } > + > + usbd_copy_in(td->pc, td->offset, sc->sc_rx_bounce_buffer, > count); > + td->remainder -= count; > + td->offset += count; > + > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + > + /* check if we are complete */ > + if ((td->remainder == 0) || got_short) { > + if (td->short_pkt) { > + /* we are complete */ > + return (0); > + } > + /* else need to receive a zero length packet */ > + } > + > +not_complete: > + > + temp = sc->sc_out_ctl[td->ep_no]; > + > + temp |= DWC_OTG_MSK_DOEPCTL_ENABLE | > + DWC_OTG_MSK_DOEPCTL_CLR_NAK; > + > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPCTL(td->ep_no), temp); > + > + /* enable SETUP and transfer complete interrupt */ > + if (td->ep_no == 0) { > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(0), > + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(1) | > + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES > (td->max_packet_size)); > + } else { > + /* allow reception of multiple packets */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DOEPTSIZ(td->ep_no), > + DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(1) | > + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(4) | > + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(4 * > + ((td->max_packet_size + 3) & ~3))); > + } > + return (1); /* not complete */ > +} > + > +static uint8_t > +dwc_otg_data_tx(struct dwc_otg_td *td) > +{ > + struct dwc_otg_softc *sc; > + uint32_t max_buffer; > + uint32_t count; > + uint32_t fifo_left; > + uint32_t mpkt; > + uint32_t temp; > + uint8_t to; > + > + to = 3; /* don't loop > forever! */ + > + /* get pointer to softc */ > + sc = DWC_OTG_PC2SC(td->pc); > + > + max_buffer = sc->sc_hw_ep_profile[td->ep_no].max_buffer; > + > +repeat: > + /* check for for endpoint 0 data */ > + > + temp = sc->sc_last_rx_status; > + > + if ((td->ep_no == 0) && (temp != 0) && > + (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(temp) == 0)) { > + > + if ((temp & DWC_OTG_MSK_GRXSTS_PACKET_STS) != > + DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { > + > + /* dump data - wrong direction */ > + dwc_otg_common_rx_ack(sc); > + } else { > + /* > + * The current transfer was cancelled > + * by the USB Host: > + */ > + td->error = 1; > + return (0); /* complete */ > + } > + } > + > + /* fill in more TX data, if possible */ > + if (td->tx_bytes != 0) { > + > + uint16_t cpkt; > + > + /* check if packets have been transferred */ > + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ > (td->ep_no)); + > + /* get current packet number */ > + cpkt = DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp); > + > + if (cpkt >= td->npkt) { > + fifo_left = 0; > + } else { > + if (max_buffer != 0) { > + fifo_left = (td->npkt - cpkt) * > + td->max_packet_size; > + > + if (fifo_left > max_buffer) > + fifo_left = max_buffer; > + } else { > + fifo_left = td->max_packet_size; > + } > + } > + > + count = td->tx_bytes; > + if (count > fifo_left) > + count = fifo_left; > + > + if (count != 0) { > + > + /* clear topmost word before copy */ > + sc->sc_tx_bounce_buffer[(count - 1) / 4] = 0; > + > + /* copy out data */ > + usbd_copy_out(td->pc, td->offset, > + sc->sc_tx_bounce_buffer, count); > + > + /* transfer data into FIFO */ > + bus_space_write_region_4(sc->sc_io_tag, > sc->sc_io_hdl, > + DWC_OTG_REG_DFIFO(td->ep_no), > + sc->sc_tx_bounce_buffer, (count + 3) / > 4); + > + td->tx_bytes -= count; > + td->remainder -= count; > + td->offset += count; > + td->npkt = cpkt; > + } > + if (td->tx_bytes != 0) > + goto not_complete; > + > + /* check remainder */ > + if (td->remainder == 0) { > + if (td->short_pkt) > + return (0); /* complete */ > + > + /* else we need to transmit a short packet */ > + } > + } > + > + /* check if no packets have been transferred */ > + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); > + > + if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { > + > + DPRINTFN(5, "busy ep=%d npkt=%d DIEPTSIZ=0x%08x " > + "DIEPCTL=0x%08x\n", td->ep_no, > + DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp), > + temp, DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPCTL > (td->ep_no))); + > + goto not_complete; > + } > + > + DPRINTFN(5, "rem=%u ep=%d\n", td->remainder, td->ep_no); > + > + /* try to optimise by sending more data */ > + if ((max_buffer != 0) && ((td->max_packet_size & 3) == 0)) { > + > + /* send multiple packets at the same time */ > + mpkt = max_buffer / td->max_packet_size; > + > + if (mpkt > 0x3FE) > + mpkt = 0x3FE; > + > + count = td->remainder; > + if (count > 0x7FFFFF) > + count = 0x7FFFFF - (0x7FFFFF % > td->max_packet_size); + > + td->npkt = count / td->max_packet_size; > + > + /* > + * NOTE: We could use 0x3FE instead of "mpkt" in the > + * check below to get more throughput, but then we > + * have a dependency towards non-generic chip > features > + * to disable the TX-FIFO-EMPTY interrupts on a per > + * endpoint basis. Increase the maximum buffer size > of > + * the IN endpoint to increase the performance. > + */ > + if (td->npkt > mpkt) { > + td->npkt = mpkt; > + count = td->max_packet_size * mpkt; > + } else if ((count == 0) || (count % > td->max_packet_size)) { > + /* we are transmitting a short packet */ > + td->npkt++; > + td->short_pkt = 1; > + } > + } else { > + /* send one packet at a time */ > + mpkt = 1; > + count = td->max_packet_size; > + if (td->remainder < count) { > + /* we have a short packet */ > + td->short_pkt = 1; > + count = td->remainder; > + } > + td->npkt = 1; > + } > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no), > + DWC_OTG_MSK_DXEPTSIZ_SET_MULTI(1) | > + DWC_OTG_MSK_DXEPTSIZ_SET_NPKT(td->npkt) | > + DWC_OTG_MSK_DXEPTSIZ_SET_NBYTES(count)); > + > + /* make room for buffering */ > + td->npkt += mpkt; > + > + temp = sc->sc_in_ctl[td->ep_no]; > + > + /* must enable before writing data to FIFO */ > + DWC_OTG_WRITE_4(sc, DWC_OTG_REG_DIEPCTL(td->ep_no), temp | > + DWC_OTG_MSK_DIEPCTL_ENABLE | > + DWC_OTG_MSK_DIEPCTL_CLR_NAK); > + > + td->tx_bytes = count; > + > + /* check remainder */ > + if (td->tx_bytes == 0 && > + td->remainder == 0) { > + if (td->short_pkt) > + return (0); /* complete */ > + > + /* else we need to transmit a short packet */ > + } > + > + if (--to) > + goto repeat; > + > +not_complete: > + return (1); /* not complete */ > +} > + > +static uint8_t > +dwc_otg_data_tx_sync(struct dwc_otg_td *td) > +{ > + struct dwc_otg_softc *sc; > + uint32_t temp; > + > + /* get pointer to softc */ > + sc = DWC_OTG_PC2SC(td->pc); > + > + /* > + * If all packets are transferred we are complete: > + */ > + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_DIEPTSIZ(td->ep_no)); > + > + /* check that all packets have been transferred */ > + if (DWC_OTG_MSK_DXEPTSIZ_GET_NPKT(temp) != 0) { > + DPRINTFN(5, "busy ep=%d\n", td->ep_no); > + goto not_complete; > + } > + return (0); > + > +not_complete: > + > + /* we only want to know if there is a SETUP packet or free > IN packet */ + > + temp = sc->sc_last_rx_status; > + > + if ((td->ep_no == 0) && (temp != 0) && > + (DWC_OTG_MSK_GRXSTS_GET_CHANNEL(temp) == 0)) { > + > + if ((temp & DWC_OTG_MSK_GRXSTS_PACKET_STS) == > + DWC_OTG_MSK_GRXSTS_DEV_STP_DATA) { > + DPRINTFN(5, "faking complete\n"); > + /* > + * Race condition: We are complete! > + */ > + return (0); > + } else { > + /* dump data - wrong direction */ > + dwc_otg_common_rx_ack(sc); > + } > + } > + return (1); /* not complete */ > +} > + > +static uint8_t > +dwc_otg_xfer_do_fifo(struct usb_xfer *xfer) > +{ > + struct dwc_otg_td *td; > + > + DPRINTFN(9, "\n"); > + > + td = xfer->td_transfer_cache; > + while (1) { > + if ((td->func) (td)) { > + /* operation in progress */ > + break; > + } > + if (((void *)td) == xfer->td_transfer_last) { > + goto done; > + } > + if (td->error) { > + goto done; > + } else if (td->remainder > 0) { > + /* > + * We had a short transfer. If there is no > alternate > + * next, stop processing ! > + */ > + if (!td->alt_next) > + goto done; > + } > + > + /* > + * Fetch the next transfer descriptor and transfer > + * some flags to the next transfer descriptor > + */ > + td = td->obj_next; > + xfer->td_transfer_cache = td; > + } > + return (1); /* not complete */ > + > +done: > + /* compute all actual lengths */ > + > + dwc_otg_standard_done(xfer); > + return (0); /* complete */ > +} > + > +static void > +dwc_otg_interrupt_poll(struct dwc_otg_softc *sc) > +{ > + struct usb_xfer *xfer; > + uint32_t temp; > + uint8_t got_rx_status; > + > +repeat: > + if (sc->sc_last_rx_status == 0) { > + > + temp = DWC_OTG_READ_4(sc, DWC_OTG_REG_GINTSTS); > + if (temp & DWC_OTG_MSK_GINT_RXFLVL) { > + /* pop current status */ > + sc->sc_last_rx_status = > + DWC_OTG_READ_4(sc, DWC_OTG_REG_GRXSTSP); > + } > + > + if (sc->sc_last_rx_status != 0) { > + > + uint32_t temp; > + uint8_t ep_no; > + > + temp = DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT( > + sc->sc_last_rx_status); > + ep_no = DWC_OTG_MSK_GRXSTS_GET_CHANNEL( > + sc->sc_last_rx_status); > + > + /* receive data, if any */ > + if (temp != 0) { > + DPRINTF("Reading %d bytes from ep %d > \n", temp, ep_no); > + bus_space_read_region_4 > (sc->sc_io_tag, sc->sc_io_hdl, > + DWC_OTG_REG_DFIFO(ep_no), > + sc->sc_rx_bounce_buffer, (temp + > 3) / 4); > + } > + > + temp = sc->sc_last_rx_status & > + DWC_OTG_MSK_GRXSTS_PACKET_STS; > + > + /* non-data messages we simply skip */ > + if (temp != DWC_OTG_MSK_GRXSTS_DEV_STP_DATA > && > + temp != DWC_OTG_MSK_GRXSTS_DEV_OUT_DATA) > { > + dwc_otg_common_rx_ack(sc); > + goto repeat; > + } > + > + /* check if we should dump the data */ > + if (!(sc->sc_active_out_ep & (1U << ep_no))) > { > + dwc_otg_common_rx_ack(sc); > + goto repeat; > + } > + > + got_rx_status = 1; > + > + DPRINTFN(5, "RX status = 0x%08x: ch=%d pid=% > d bytes=%d sts=%d\n", > + sc->sc_last_rx_status, ep_no, > + (sc->sc_last_rx_status >> 15) & 3, > + DWC_OTG_MSK_GRXSTS_GET_BYTE_CNT > (sc->sc_last_rx_status), > + (sc->sc_last_rx_status >> 17) & 15); > + } else { > + got_rx_status = 0; > + } > + } else { > + uint8_t ep_no; > + > + ep_no = DWC_OTG_MSK_GRXSTS_GET_CHANNEL( > + sc->sc_last_rx_status); > + > + /* check if we should dump the data */ > + if (!(sc->sc_active_out_ep & (1U << ep_no))) { > + dwc_otg_common_rx_ack(sc); > + goto repeat; > + } > + > + got_rx_status = 1; > + } > + > + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { > + if (!dwc_otg_xfer_do_fifo(xfer)) { > + /* queue has been modified */ > + goto repeat; > + } > + } > + > + if (got_rx_status) { > + if (sc->sc_last_rx_status == 0) > + goto repeat; > + > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 14:30:06 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51A45106566C; Sat, 21 Jan 2012 14:30:06 +0000 (UTC) (envelope-from andreast@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 904478FC13; Sat, 21 Jan 2012 14:30:04 +0000 (UTC) Received: from t43.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q0LEOVMi053278; Sat, 21 Jan 2012 15:24:32 +0100 (CET) (envelope-from andreast@fgznet.ch) Message-ID: <4F1ACBE8.2000404@fgznet.ch> Date: Sat, 21 Jan 2012 15:30:00 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:9.0) Gecko/20111223 Thunderbird/9.0 MIME-Version: 1.0 To: Bruce Evans References: <201201060921.q069Lfi8081051@svn.freebsd.org> <20120106225728.G9027@besplex.bde.org> <4F1A72DC.7020107@fgznet.ch> <20120121224511.R3269@besplex.bde.org> In-Reply-To: <20120121224511.R3269@besplex.bde.org> Content-Type: multipart/mixed; boundary="------------090503000802090601060501" X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andreas Tobler Subject: Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 14:30:06 -0000 This is a multi-part message in MIME format. --------------090503000802090601060501 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 01/21/12 12:46, Bruce Evans wrote: > On Sat, 21 Jan 2012, Andreas Tobler wrote: > >> I write this reply from another machine... >> >> Here is what I have tested so far. >> >> Is this the right approach? > > Seems mostly what I want. I wouldn't change the right-justification > of the backslashes, since most places don't need it and it gives > unreadable diffs. More later. Ok, removed right-justification. Would you like to see the ALIGN_TEXT in the same diff/commit or do you agree if I do two steps? Thanks again for the review. I appreciate your input! Andreas --------------090503000802090601060501 Content-Type: text/plain; name="weak_ref-20120121-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="weak_ref-20120121-1.diff" Index: sys/powerpc/include/asm.h =================================================================== --- sys/powerpc/include/asm.h (revision 230401) +++ sys/powerpc/include/asm.h (working copy) @@ -116,9 +116,9 @@ #define __FBSDID(s) /* nothing */ #endif /* not lint and not STRIP_FBSDID */ -#define WEAK_ALIAS(alias,sym) \ +#define WEAK_REFERENCE(sym, alias) \ .weak alias; \ - alias = sym + .equ alias, sym #ifdef __STDC__ #define WARN_REFERENCES(_sym,_msg) \ Index: lib/libc/powerpc/SYS.h =================================================================== --- lib/libc/powerpc/SYS.h (revision 230383) +++ lib/libc/powerpc/SYS.h (working copy) @@ -33,38 +33,38 @@ #include #include -#define _SYSCALL(x) \ +#define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ +#define SYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ +#define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) -#define RSYSCALL(x) \ +#define RSYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) Index: lib/libc/powerpc/gen/setjmp.S =================================================================== --- lib/libc/powerpc/gen/setjmp.S (revision 230383) +++ lib/libc/powerpc/gen/setjmp.S (working copy) @@ -69,7 +69,7 @@ li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(CNAME(__longjmp), longjmp) ENTRY(__longjmp) lmw %r9,20(%r3) /* restore regs */ mr %r6,%r4 /* save val param */ Index: lib/libc/powerpc64/SYS.h =================================================================== --- lib/libc/powerpc64/SYS.h (revision 230383) +++ lib/libc/powerpc64/SYS.h (working copy) @@ -33,13 +33,13 @@ #include #include -#define _SYSCALL(x) \ +#define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ +#define SYSCALL(name) \ .text; \ .align 2; \ 2: mflr %r0; \ @@ -51,18 +51,18 @@ ld %r0,16(%r1); \ mtlr %r0; \ blr; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ +#define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bnslr; \ mflr %r0; \ std %r0,16(%r1); \ @@ -74,13 +74,13 @@ mtlr %r0; \ blr; -#define RSYSCALL(x) \ +#define RSYSCALL(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ \ mflr %r0; \ Index: lib/libc/powerpc64/gen/setjmp.S =================================================================== --- lib/libc/powerpc64/gen/setjmp.S (revision 230396) +++ lib/libc/powerpc64/gen/setjmp.S (working copy) @@ -93,7 +93,7 @@ li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) --------------090503000802090601060501-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 17:45:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3A98106566C; Sat, 21 Jan 2012 17:45:27 +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 890368FC08; Sat, 21 Jan 2012 17:45:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LHjRUT002434; Sat, 21 Jan 2012 17:45:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LHjRoH002422; Sat, 21 Jan 2012 17:45:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201211745.q0LHjRoH002422@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jan 2012 17:45: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: r230426 - in head/sys: amd64/acpica amd64/amd64 amd64/ia32 amd64/include compat/ia32 conf crypto/aesni crypto/via dev/random i386/i386 i386/include i386/isa pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 17:45:27 -0000 Author: kib Date: Sat Jan 21 17:45:27 2012 New Revision: 230426 URL: http://svn.freebsd.org/changeset/base/230426 Log: Add support for the extended FPU states on amd64, both for native 64bit and 32bit ABIs. As a side-effect, it enables AVX on capable CPUs. In particular: - Query the CPU support for XSAVE, list of the supported extensions and the required size of FPU save area. The hw.use_xsave tunable is provided for disabling XSAVE, and hw.xsave_mask may be used to select the enabled extensions. - Remove the FPU save area from PCB and dynamically allocate the (run-time sized) user save area on the top of the kernel stack, right above the PCB. Reorganize the thread0 PCB initialization to postpone it after BSP is queried for save area size. - The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as well. FPU state is only useful for suspend, where it is saved in dynamically allocated suspfpusave area. - Use XSAVE and XRSTOR to save/restore FPU state, if supported and enabled. - Define new mcontext_t flag _MC_HASFPXSTATE, indicating that mcontext_t has a valid pointer to out-of-struct extended FPU state. Signal handlers are supplied with stack-allocated fpu state. The sigreturn(2) and setcontext(2) syscall honour the flag, allowing the signal handlers to inspect and manipilate extended state in the interrupted context. - The getcontext(2) never returns extended state, since there is no place in the fixed-sized mcontext_t to place variable-sized save area. And, since mcontext_t is embedded into ucontext_t, makes it impossible to fix in a reasonable way. Instead of extending getcontext(2) syscall, provide a sysarch(2) facility to query extended FPU state. - Add ptrace(2) support for getting and setting extended state; while there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries. - Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to consumers, making it opaque. Internally, struct fpu_kern_ctx now contains a space for the extended state. Convert in-kernel consumers of fpu_kern KPI both on i386 and amd64. First version of the support for AVX was submitted by Tim Bird on behalf of Sony. This version was written from scratch. Tested by: pho (previous version), Yamagi Burmeister MFC after: 1 month Added: head/sys/amd64/amd64/ptrace_machdep.c (contents, props changed) Modified: head/sys/amd64/acpica/acpi_switch.S head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/ia32/ia32_reg.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/include/fpu.h head/sys/amd64/include/frame.h head/sys/amd64/include/md_var.h head/sys/amd64/include/pcb.h head/sys/amd64/include/ptrace.h head/sys/amd64/include/sysarch.h head/sys/amd64/include/ucontext.h head/sys/compat/ia32/ia32_signal.h head/sys/conf/files.amd64 head/sys/crypto/aesni/aesni.c head/sys/crypto/aesni/aesni.h head/sys/crypto/aesni/aesni_wrap.c head/sys/crypto/via/padlock.c head/sys/crypto/via/padlock.h head/sys/crypto/via/padlock_cipher.c head/sys/crypto/via/padlock_hash.c head/sys/dev/random/nehemiah.c head/sys/i386/i386/machdep.c head/sys/i386/include/npx.h head/sys/i386/include/ptrace.h head/sys/i386/include/sysarch.h head/sys/i386/include/ucontext.h head/sys/i386/isa/npx.c head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/acpica/acpi_switch.S ============================================================================== --- head/sys/amd64/acpica/acpi_switch.S Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/acpica/acpi_switch.S Sat Jan 21 17:45:27 2012 (r230426) @@ -146,11 +146,22 @@ ENTRY(acpi_restorecpu) /* Restore FPU state. */ fninit - fxrstor PCB_USERFPU(%rdi) + movq WAKEUP_CTX(fpusave),%rdi + cmpl $0,use_xsave + jne 1f + fxrstor (%rdi) + jmp 2f +1: movl xsave_mask,%eax + movl xsave_mask+4,%edx +/* xrstor (%rdi) */ + .byte 0x0f,0xae,0x2f +2: /* Reload CR0. */ movq %rcx, %cr0 + movq WAKEUP_CTX(pcb),%rdi + /* Restore return address. */ movq PCB_RIP(%rdi), %rax movq %rax, (%rsp) Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/acpica/acpi_wakecode.S Sat Jan 21 17:45:27 2012 (r230426) @@ -270,6 +270,8 @@ wakeup_pcb: wakeup_gdt: .word 0 .quad 0 +wakeup_fpusave: + .quad 0 ALIGN_DATA wakeup_efer: Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/acpica/acpi_wakeup.c Sat Jan 21 17:45:27 2012 (r230426) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef SMP #include @@ -67,8 +68,10 @@ extern int acpi_reset_video; #ifdef SMP extern struct pcb **susppcbs; +extern void **suspfpusave; #else static struct pcb **susppcbs; +static void **suspfpusave; #endif int acpi_restorecpu(vm_offset_t, struct pcb *); @@ -105,6 +108,7 @@ acpi_wakeup_ap(struct acpi_softc *sc, in int ms; WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[cpu]); + WAKECODE_FIXUP(wakeup_fpusave, void *, suspfpusave[cpu]); WAKECODE_FIXUP(wakeup_gdt, uint16_t, susppcbs[cpu]->pcb_gdt.rd_limit); WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, susppcbs[cpu]->pcb_gdt.rd_base); @@ -244,6 +248,7 @@ acpi_sleep_machdep(struct acpi_softc *sc load_cr3(KPML4phys); if (savectx(susppcbs[0])) { + ctx_fpusave(suspfpusave[0]); #ifdef SMP if (!CPU_EMPTY(&wakeup_cpus) && suspend_cpus(wakeup_cpus) == 0) { @@ -256,6 +261,7 @@ acpi_sleep_machdep(struct acpi_softc *sc WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); + WAKECODE_FIXUP(wakeup_fpusave, void *, suspfpusave[0]); WAKECODE_FIXUP(wakeup_gdt, uint16_t, susppcbs[0]->pcb_gdt.rd_limit); WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, @@ -333,8 +339,11 @@ acpi_alloc_wakeup_handler(void) return (NULL); } susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK); - for (i = 0; i < mp_ncpus; i++) + suspfpusave = malloc(mp_ncpus * sizeof(void *), M_DEVBUF, M_WAITOK); + for (i = 0; i < mp_ncpus; i++) { susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); + suspfpusave[i] = alloc_fpusave(M_WAITOK); + } return (wakeaddr); } Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/amd64/cpu_switch.S Sat Jan 21 17:45:27 2012 (r230426) @@ -112,16 +112,25 @@ done_store_dr: /* have we used fp, and need a save? */ cmpq %rdi,PCPU(FPCURTHREAD) - jne 1f + jne 3f movq PCB_SAVEFPU(%r8),%r8 clts + cmpl $0,use_xsave + jne 1f fxsave (%r8) - smsw %ax + jmp 2f +1: movq %rdx,%rcx + movl xsave_mask,%eax + movl xsave_mask+4,%edx +/* xsave (%r8) */ + .byte 0x41,0x0f,0xae,0x20 + movq %rcx,%rdx +2: smsw %ax orb $CR0_TS,%al lmsw %ax xorl %eax,%eax movq %rax,PCPU(FPCURTHREAD) -1: +3: /* Save is done. Now fire up new thread. Leave old vmspace. */ movq TD_PCB(%rsi),%r8 @@ -354,10 +363,19 @@ ENTRY(savectx) sldt PCB_LDT(%rdi) str PCB_TR(%rdi) - clts - fxsave PCB_USERFPU(%rdi) - movq %rsi,%cr0 /* The previous %cr0 is saved in %rsi. */ +2: movq %rsi,%cr0 /* The previous %cr0 is saved in %rsi. */ movl $1,%eax ret END(savectx) + +/* + * Wrapper around fpusave to care about TS0_CR. + */ +ENTRY(ctx_fpusave) + movq %cr0,%rsi + clts + call fpusave + movq %rsi,%cr0 + ret +END(ctx_fpusave) Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/amd64/fpu.c Sat Jan 21 17:45:27 2012 (r230426) @@ -96,19 +96,97 @@ void stop_emulating(void); #define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_cw) #define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_sw) -typedef u_char bool_t; +CTASSERT(sizeof(struct savefpu) == 512); +CTASSERT(sizeof(struct xstate_hdr) == 64); +CTASSERT(sizeof(struct savefpu_ymm) == 832); + +/* + * This requirement is to make it easier for asm code to calculate + * offset of the fpu save area from the pcb address. FPU save area + * must by 64-bytes aligned. + */ +CTASSERT(sizeof(struct pcb) % XSAVE_AREA_ALIGN == 0); static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, NULL, 1, "Floating point instructions executed in hardware"); -static struct savefpu fpu_initialstate; +int use_xsave; /* non-static for cpu_switch.S */ +uint64_t xsave_mask; /* the same */ +static struct savefpu *fpu_initialstate; + +void +fpusave(void *addr) +{ + + if (use_xsave) + xsave((char *)addr, xsave_mask); + else + fxsave((char *)addr); +} + +static void +fpurestore(void *addr) +{ + + if (use_xsave) + xrstor((char *)addr, xsave_mask); + else + fxrstor((char *)addr); +} + +/* + * Enable XSAVE if supported and allowed by user. + * Calculate the xsave_mask. + */ +static void +fpuinit_bsp1(void) +{ + u_int cp[4]; + uint64_t xsave_mask_user; + + if ((cpu_feature2 & CPUID2_XSAVE) != 0) { + use_xsave = 1; + TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); + } + if (!use_xsave) + return; + + cpuid_count(0xd, 0x0, cp); + xsave_mask = XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; + if ((cp[0] & xsave_mask) != xsave_mask) + panic("CPU0 does not support X87 or SSE: %x", cp[0]); + xsave_mask = ((uint64_t)cp[3] << 32) | cp[0]; + xsave_mask_user = xsave_mask; + TUNABLE_ULONG_FETCH("hw.xsave_mask", &xsave_mask_user); + xsave_mask_user |= XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; + xsave_mask &= xsave_mask_user; +} /* - * Initialize the floating point unit. On the boot CPU we generate a - * clean state that is used to initialize the floating point unit when - * it is first used by a process. + * Calculate the fpu save area size. + */ +static void +fpuinit_bsp2(void) +{ + u_int cp[4]; + + if (use_xsave) { + cpuid_count(0xd, 0x0, cp); + cpu_max_ext_state_size = cp[1]; + + /* + * Reload the cpu_feature2, since we enabled OSXSAVE. + */ + do_cpuid(1, cp); + cpu_feature2 = cp[2]; + } else + cpu_max_ext_state_size = sizeof(struct savefpu); +} + +/* + * Initialize the floating point unit. */ void fpuinit(void) @@ -117,6 +195,20 @@ fpuinit(void) u_int mxcsr; u_short control; + if (IS_BSP()) + fpuinit_bsp1(); + + if (use_xsave) { + load_cr4(rcr4() | CR4_XSAVE); + xsetbv(XCR0, xsave_mask); + } + + /* + * XCR0 shall be set up before CPU can report the save area size. + */ + if (IS_BSP()) + fpuinit_bsp2(); + /* * It is too early for critical_enter() to work on AP. */ @@ -127,20 +219,46 @@ fpuinit(void) fldcw(control); mxcsr = __INITIAL_MXCSR__; ldmxcsr(mxcsr); - if (PCPU_GET(cpuid) == 0) { - fxsave(&fpu_initialstate); - if (fpu_initialstate.sv_env.en_mxcsr_mask) - cpu_mxcsr_mask = fpu_initialstate.sv_env.en_mxcsr_mask; - else - cpu_mxcsr_mask = 0xFFBF; - bzero(fpu_initialstate.sv_fp, sizeof(fpu_initialstate.sv_fp)); - bzero(fpu_initialstate.sv_xmm, sizeof(fpu_initialstate.sv_xmm)); - } start_emulating(); intr_restore(saveintr); } /* + * On the boot CPU we generate a clean state that is used to + * initialize the floating point unit when it is first used by a + * process. + */ +static void +fpuinitstate(void *arg __unused) +{ + register_t saveintr; + + fpu_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF, + M_WAITOK | M_ZERO); + saveintr = intr_disable(); + stop_emulating(); + + fpusave(fpu_initialstate); + if (fpu_initialstate->sv_env.en_mxcsr_mask) + cpu_mxcsr_mask = fpu_initialstate->sv_env.en_mxcsr_mask; + else + cpu_mxcsr_mask = 0xFFBF; + + /* + * The fninit instruction does not modify XMM registers. The + * fpusave call dumped the garbage contained in the registers + * after reset to the initial state saved. Clear XMM + * registers file image to make the startup program state and + * signal handler XMM register content predictable. + */ + bzero(&fpu_initialstate->sv_xmm[0], sizeof(struct xmmacc)); + + start_emulating(); + intr_restore(saveintr); +} +SYSINIT(fpuinitstate, SI_SUB_DRIVERS, SI_ORDER_ANY, fpuinitstate, NULL); + +/* * Free coprocessor (if we have it). */ void @@ -150,7 +268,7 @@ fpuexit(struct thread *td) critical_enter(); if (curthread == PCPU_GET(fpcurthread)) { stop_emulating(); - fxsave(PCPU_GET(curpcb)->pcb_save); + fpusave(PCPU_GET(curpcb)->pcb_save); start_emulating(); PCPU_SET(fpcurthread, 0); } @@ -423,7 +541,7 @@ fpudna(void) * the PCB doesn't contain a clean FPU state. Explicitly * load an initial state. */ - fxrstor(&fpu_initialstate); + fpurestore(fpu_initialstate); if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) fldcw(pcb->pcb_initial_fpucw); if (PCB_USER_FPU(pcb)) @@ -432,7 +550,7 @@ fpudna(void) else set_pcb_flags(pcb, PCB_FPUINITDONE); } else - fxrstor(pcb->pcb_save); + fpurestore(pcb->pcb_save); critical_exit(); } @@ -461,15 +579,16 @@ fpugetregs(struct thread *td) pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { - bcopy(&fpu_initialstate, &pcb->pcb_user_save, - sizeof(fpu_initialstate)); - pcb->pcb_user_save.sv_env.en_cw = pcb->pcb_initial_fpucw; + bcopy(fpu_initialstate, get_pcb_user_save_pcb(pcb), + cpu_max_ext_state_size); + get_pcb_user_save_pcb(pcb)->sv_env.en_cw = + pcb->pcb_initial_fpucw; fpuuserinited(td); return (_MC_FPOWNED_PCB); } critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { - fxsave(&pcb->pcb_user_save); + fpusave(get_pcb_user_save_pcb(pcb)); critical_exit(); return (_MC_FPOWNED_FPU); } else { @@ -491,25 +610,78 @@ fpuuserinited(struct thread *td) set_pcb_flags(pcb, PCB_FPUINITDONE); } +int +fpusetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size) +{ + struct xstate_hdr *hdr, *ehdr; + size_t len, max_len; + uint64_t bv; + + /* XXXKIB should we clear all extended state in xstate_bv instead ? */ + if (xfpustate == NULL) + return (0); + if (!use_xsave) + return (EOPNOTSUPP); + + len = xfpustate_size; + if (len < sizeof(struct xstate_hdr)) + return (EINVAL); + max_len = cpu_max_ext_state_size - sizeof(struct savefpu); + if (len > max_len) + return (EINVAL); + + ehdr = (struct xstate_hdr *)xfpustate; + bv = ehdr->xstate_bv; + + /* + * Avoid #gp. + */ + if (bv & ~xsave_mask) + return (EINVAL); + if ((bv & (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) != + (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) + return (EINVAL); + + hdr = (struct xstate_hdr *)(get_pcb_user_save_td(td) + 1); + + hdr->xstate_bv = bv; + bcopy(xfpustate + sizeof(struct xstate_hdr), + (char *)(hdr + 1), len - sizeof(struct xstate_hdr)); + + return (0); +} + /* * Set the state of the FPU. */ -void -fpusetregs(struct thread *td, struct savefpu *addr) +int +fpusetregs(struct thread *td, struct savefpu *addr, char *xfpustate, + size_t xfpustate_size) { struct pcb *pcb; + int error; pcb = td->td_pcb; critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { - fxrstor(addr); + error = fpusetxstate(td, xfpustate, xfpustate_size); + if (error != 0) { + critical_exit(); + return (error); + } + bcopy(addr, get_pcb_user_save_td(td), sizeof(*addr)); + fpurestore(get_pcb_user_save_td(td)); critical_exit(); set_pcb_flags(pcb, PCB_FPUINITDONE | PCB_USERFPUINITDONE); } else { critical_exit(); - bcopy(addr, &td->td_pcb->pcb_user_save, sizeof(*addr)); + error = fpusetxstate(td, xfpustate, xfpustate_size); + if (error != 0) + return (error); + bcopy(addr, get_pcb_user_save_td(td), sizeof(*addr)); fpuuserinited(td); } + return (0); } /* @@ -599,20 +771,62 @@ static devclass_t fpupnp_devclass; DRIVER_MODULE(fpupnp, acpi, fpupnp_driver, fpupnp_devclass, 0, 0); #endif /* DEV_ISA */ +static MALLOC_DEFINE(M_FPUKERN_CTX, "fpukern_ctx", + "Kernel contexts for FPU state"); + +#define FPU_KERN_CTX_FPUINITDONE 0x01 + +struct fpu_kern_ctx { + struct savefpu *prev; + uint32_t flags; + char hwstate1[]; +}; + +struct fpu_kern_ctx * +fpu_kern_alloc_ctx(u_int flags) +{ + struct fpu_kern_ctx *res; + size_t sz; + + sz = sizeof(struct fpu_kern_ctx) + XSAVE_AREA_ALIGN + + cpu_max_ext_state_size; + res = malloc(sz, M_FPUKERN_CTX, ((flags & FPU_KERN_NOWAIT) ? + M_NOWAIT : M_WAITOK) | M_ZERO); + return (res); +} + +void +fpu_kern_free_ctx(struct fpu_kern_ctx *ctx) +{ + + /* XXXKIB clear the memory ? */ + free(ctx, M_FPUKERN_CTX); +} + +static struct savefpu * +fpu_kern_ctx_savefpu(struct fpu_kern_ctx *ctx) +{ + vm_offset_t p; + + p = (vm_offset_t)&ctx->hwstate1; + p = roundup2(p, XSAVE_AREA_ALIGN); + return ((struct savefpu *)p); +} + int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, u_int flags) { struct pcb *pcb; pcb = td->td_pcb; - KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save == &pcb->pcb_user_save, - ("mangled pcb_save")); + KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save == + get_pcb_user_save_pcb(pcb), ("mangled pcb_save")); ctx->flags = 0; if ((pcb->pcb_flags & PCB_FPUINITDONE) != 0) ctx->flags |= FPU_KERN_CTX_FPUINITDONE; fpuexit(td); ctx->prev = pcb->pcb_save; - pcb->pcb_save = &ctx->hwstate; + pcb->pcb_save = fpu_kern_ctx_savefpu(ctx); set_pcb_flags(pcb, PCB_KERNFPU); clear_pcb_flags(pcb, PCB_FPUINITDONE); return (0); @@ -629,7 +843,7 @@ fpu_kern_leave(struct thread *td, struct fpudrop(); critical_exit(); pcb->pcb_save = ctx->prev; - if (pcb->pcb_save == &pcb->pcb_user_save) { + if (pcb->pcb_save == get_pcb_user_save_pcb(pcb)) { if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) { set_pcb_flags(pcb, PCB_FPUINITDONE); clear_pcb_flags(pcb, PCB_KERNFPU); @@ -653,7 +867,8 @@ fpu_kern_thread(u_int flags) pcb = PCPU_GET(curpcb); KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); - KASSERT(pcb->pcb_save == &pcb->pcb_user_save, ("mangled pcb_save")); + KASSERT(pcb->pcb_save == get_pcb_user_save_pcb(pcb), + ("mangled pcb_save")); KASSERT(PCB_USER_FPU(pcb), ("recursive call")); set_pcb_flags(pcb, PCB_KERNFPU); Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/amd64/genassym.c Sat Jan 21 17:45:27 2012 (r230426) @@ -156,7 +156,7 @@ ASSYM(PCB_GS32SD, offsetof(struct pcb, p ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp)); ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save)); ASSYM(PCB_SAVEFPU_SIZE, sizeof(struct savefpu)); -ASSYM(PCB_USERFPU, offsetof(struct pcb, pcb_user_save)); +ASSYM(PCB_USERFPU, sizeof(struct pcb)); ASSYM(PCB_SIZE, sizeof(struct pcb)); ASSYM(PCB_FULL_IRET, PCB_FULL_IRET); ASSYM(PCB_DBREGS, PCB_DBREGS); Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/amd64/initcpu.c Sat Jan 21 17:45:27 2012 (r230426) @@ -72,6 +72,7 @@ u_int cpu_vendor_id; /* CPU vendor ID * u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ u_int cpu_clflush_line_size = 32; +u_int cpu_max_ext_state_size; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA RNG feature available in CPU"); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/amd64/machdep.c Sat Jan 21 17:45:27 2012 (r230426) @@ -154,8 +154,10 @@ extern void panicifcpuunsupported(void); #define EFL_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) static void cpu_startup(void *); -static void get_fpcontext(struct thread *td, mcontext_t *mcp); -static int set_fpcontext(struct thread *td, const mcontext_t *mcp); +static void get_fpcontext(struct thread *td, mcontext_t *mcp, + char *xfpusave, size_t xfpusave_len); +static int set_fpcontext(struct thread *td, const mcontext_t *mcp, + char *xfpustate, size_t xfpustate_len); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); /* @@ -315,6 +317,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, struct sigacts *psp; char *sp; struct trapframe *regs; + char *xfpusave; + size_t xfpusave_len; int sig; int oonstack; @@ -328,6 +332,14 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, regs = td->td_frame; oonstack = sigonstack(regs->tf_rsp); + if (cpu_max_ext_state_size > sizeof(struct savefpu) && use_xsave) { + xfpusave_len = cpu_max_ext_state_size - sizeof(struct savefpu); + xfpusave = __builtin_alloca(xfpusave_len); + } else { + xfpusave_len = 0; + xfpusave = NULL; + } + /* Save user context. */ bzero(&sf, sizeof(sf)); sf.sf_uc.uc_sigmask = *mask; @@ -337,7 +349,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0; bcopy(regs, &sf.sf_uc.uc_mcontext.mc_rdi, sizeof(*regs)); sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ - get_fpcontext(td, &sf.sf_uc.uc_mcontext); + get_fpcontext(td, &sf.sf_uc.uc_mcontext, xfpusave, xfpusave_len); fpstate_drop(td); sf.sf_uc.uc_mcontext.mc_fsbase = pcb->pcb_fsbase; sf.sf_uc.uc_mcontext.mc_gsbase = pcb->pcb_gsbase; @@ -348,13 +360,18 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = td->td_sigstk.ss_sp + - td->td_sigstk.ss_size - sizeof(struct sigframe); + sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size; #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; #endif } else - sp = (char *)regs->tf_rsp - sizeof(struct sigframe) - 128; + sp = (char *)regs->tf_rsp - 128; + if (xfpusave != NULL) { + sp -= xfpusave_len; + sp = (char *)((unsigned long)sp & ~0x3Ful); + sf.sf_uc.uc_mcontext.mc_xfpustate = (register_t)sp; + } + sp -= sizeof(struct sigframe); /* Align to 16 bytes. */ sfp = (struct sigframe *)((unsigned long)sp & ~0xFul); @@ -387,7 +404,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* * Copy the sigframe out to the user's stack. */ - if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { + if (copyout(&sf, sfp, sizeof(*sfp)) != 0 || + (xfpusave != NULL && copyout(xfpusave, + (void *)sf.sf_uc.uc_mcontext.mc_xfpustate, xfpusave_len) + != 0)) { #ifdef DEBUG printf("process %ld has trashed its stack\n", (long)p->p_pid); #endif @@ -432,6 +452,8 @@ sys_sigreturn(td, uap) struct proc *p; struct trapframe *regs; ucontext_t *ucp; + char *xfpustate; + size_t xfpustate_len; long rflags; int cs, error, ret; ksiginfo_t ksi; @@ -490,7 +512,28 @@ sys_sigreturn(td, uap) return (EINVAL); } - ret = set_fpcontext(td, &ucp->uc_mcontext); + if ((uc.uc_mcontext.mc_flags & _MC_HASFPXSTATE) != 0) { + xfpustate_len = uc.uc_mcontext.mc_xfpustate_len; + if (xfpustate_len > cpu_max_ext_state_size - + sizeof(struct savefpu)) { + uprintf("pid %d (%s): sigreturn xfpusave_len = 0x%zx\n", + p->p_pid, td->td_name, xfpustate_len); + return (EINVAL); + } + xfpustate = __builtin_alloca(xfpustate_len); + error = copyin((const void *)uc.uc_mcontext.mc_xfpustate, + xfpustate, xfpustate_len); + if (error != 0) { + uprintf( + "pid %d (%s): sigreturn copying xfpustate failed\n", + p->p_pid, td->td_name); + return (error); + } + } else { + xfpustate = NULL; + xfpustate_len = 0; + } + ret = set_fpcontext(td, &ucp->uc_mcontext, xfpustate, xfpustate_len); if (ret != 0) { uprintf("pid %d (%s): sigreturn set_fpcontext err %d\n", p->p_pid, td->td_name, ret); @@ -1592,6 +1635,7 @@ hammer_time(u_int64_t modulep, u_int64_t int gsel_tss, x; struct pcpu *pc; struct nmi_pcpu *np; + struct xstate_hdr *xhdr; u_int64_t msr; char *env; size_t kstack0_sz; @@ -1601,7 +1645,6 @@ hammer_time(u_int64_t modulep, u_int64_t kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; bzero((void *)thread0.td_kstack, kstack0_sz); physfree += kstack0_sz; - thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -1650,7 +1693,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree += DPCPU_SIZE; PCPU_SET(prvspace, pc); PCPU_SET(curthread, &thread0); - PCPU_SET(curpcb, thread0.td_pcb); PCPU_SET(tssp, &common_tss[0]); PCPU_SET(commontssp, &common_tss[0]); PCPU_SET(tss, (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); @@ -1742,13 +1784,6 @@ hammer_time(u_int64_t modulep, u_int64_t initializecpu(); /* Initialize CPU registers */ initializecpucache(); - /* make an initial tss so cpu can get interrupt stack on syscall! */ - common_tss[0].tss_rsp0 = thread0.td_kstack + - kstack0_sz - sizeof(struct pcb); - /* Ensure the stack is aligned to 16 bytes */ - common_tss[0].tss_rsp0 &= ~0xFul; - PCPU_SET(rsp0, common_tss[0].tss_rsp0); - /* doublefault stack space, runs on ist1 */ common_tss[0].tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)]; @@ -1785,6 +1820,25 @@ hammer_time(u_int64_t modulep, u_int64_t msgbufinit(msgbufp, msgbufsize); fpuinit(); + /* + * Set up thread0 pcb after fpuinit calculated pcb + fpu save + * area size. Zero out the extended state header in fpu save + * area. + */ + thread0.td_pcb = get_pcb_td(&thread0); + bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); + if (use_xsave) { + xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + + 1); + xhdr->xstate_bv = xsave_mask; + } + /* make an initial tss so cpu can get interrupt stack on syscall! */ + common_tss[0].tss_rsp0 = (vm_offset_t)thread0.td_pcb; + /* Ensure the stack is aligned to 16 bytes */ + common_tss[0].tss_rsp0 &= ~0xFul; + PCPU_SET(rsp0, common_tss[0].tss_rsp0); + PCPU_SET(curpcb, thread0.td_pcb); + /* transfer to user mode */ _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); @@ -2054,7 +2108,7 @@ fill_fpregs(struct thread *td, struct fp P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); fpugetregs(td); - fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs); + fill_fpregs_xmm(get_pcb_user_save_td(td), fpregs); return (0); } @@ -2063,7 +2117,7 @@ int set_fpregs(struct thread *td, struct fpreg *fpregs) { - set_fpregs_xmm(fpregs, &td->td_pcb->pcb_user_save); + set_fpregs_xmm(fpregs, get_pcb_user_save_td(td)); fpuuserinited(td); return (0); } @@ -2114,9 +2168,11 @@ get_mcontext(struct thread *td, mcontext mcp->mc_gs = tp->tf_gs; mcp->mc_flags = tp->tf_flags; mcp->mc_len = sizeof(*mcp); - get_fpcontext(td, mcp); + get_fpcontext(td, mcp, NULL, 0); mcp->mc_fsbase = pcb->pcb_fsbase; mcp->mc_gsbase = pcb->pcb_gsbase; + mcp->mc_xfpustate = 0; + mcp->mc_xfpustate_len = 0; bzero(mcp->mc_spare, sizeof(mcp->mc_spare)); return (0); } @@ -2132,6 +2188,7 @@ set_mcontext(struct thread *td, const mc { struct pcb *pcb; struct trapframe *tp; + char *xfpustate; long rflags; int ret; @@ -2142,7 +2199,18 @@ set_mcontext(struct thread *td, const mc return (EINVAL); rflags = (mcp->mc_rflags & PSL_USERCHANGE) | (tp->tf_rflags & ~PSL_USERCHANGE); - ret = set_fpcontext(td, mcp); + if (mcp->mc_flags & _MC_HASFPXSTATE) { + if (mcp->mc_xfpustate_len > cpu_max_ext_state_size - + sizeof(struct savefpu)) + return (EINVAL); + xfpustate = __builtin_alloca(mcp->mc_xfpustate_len); + ret = copyin((void *)mcp->mc_xfpustate, xfpustate, + mcp->mc_xfpustate_len); + if (ret != 0) + return (ret); + } else + xfpustate = NULL; + ret = set_fpcontext(td, mcp, xfpustate, mcp->mc_xfpustate_len); if (ret != 0) return (ret); tp->tf_r15 = mcp->mc_r15; @@ -2180,35 +2248,51 @@ set_mcontext(struct thread *td, const mc } static void -get_fpcontext(struct thread *td, mcontext_t *mcp) +get_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpusave, + size_t xfpusave_len) { + size_t max_len, len; mcp->mc_ownedfp = fpugetregs(td); - bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate, + bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = fpuformat(); + if (!use_xsave || xfpusave_len == 0) + return; + max_len = cpu_max_ext_state_size - sizeof(struct savefpu); + len = xfpusave_len; + if (len > max_len) { + len = max_len; + bzero(xfpusave + max_len, len - max_len); + } + mcp->mc_flags |= _MC_HASFPXSTATE; + mcp->mc_xfpustate_len = len; + bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len); } static int -set_fpcontext(struct thread *td, const mcontext_t *mcp) +set_fpcontext(struct thread *td, const mcontext_t *mcp, char *xfpustate, + size_t xfpustate_len) { struct savefpu *fpstate; + int error; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) return (0); else if (mcp->mc_fpformat != _MC_FPFMT_XMM) return (EINVAL); - else if (mcp->mc_ownedfp == _MC_FPOWNED_NONE) + else if (mcp->mc_ownedfp == _MC_FPOWNED_NONE) { /* We don't care what state is left in the FPU or PCB. */ fpstate_drop(td); - else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || + error = 0; + } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { fpstate = (struct savefpu *)&mcp->mc_fpstate; fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; - fpusetregs(td, fpstate); + error = fpusetregs(td, fpstate, xfpustate, xfpustate_len); } else return (EINVAL); - return (0); + return (error); } void Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sat Jan 21 17:22:50 2012 (r230425) +++ head/sys/amd64/amd64/mp_machdep.c Sat Jan 21 17:45:27 2012 (r230426) @@ -99,7 +99,8 @@ char *nmi_stack; void *dpcpu; struct pcb stoppcbs[MAXCPU]; -struct pcb **susppcbs = NULL; +struct pcb **susppcbs; +void **suspfpusave; /* Variables needed for SMP tlb shootdown. */ vm_offset_t smp_tlb_addr1; @@ -1422,6 +1423,7 @@ cpususpend_handler(void) cr3 = rcr3(); if (savectx(susppcbs[cpu])) { + ctx_fpusave(suspfpusave[cpu]); wbinvd(); CPU_SET_ATOMIC(cpu, &stopped_cpus); } else { Added: head/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/amd64/ptrace_machdep.c Sat Jan 21 17:45:27 2012 (r230426) @@ -0,0 +1,141 @@ +/*- + * Copyright (c) 2011 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. 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 "opt_compat.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static int +cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) +{ + char *savefpu; + int error; + + if (!use_xsave) + return (EOPNOTSUPP); + + switch (req) { + case PT_GETXSTATE: + savefpu = (char *)(get_pcb_user_save_td(td) + 1); + error = copyout(savefpu, addr, + cpu_max_ext_state_size - sizeof(struct savefpu)); + break; + + case PT_SETXSTATE: + if (data > cpu_max_ext_state_size - sizeof(struct savefpu)) { + error = EINVAL; + break; + } + savefpu = malloc(data, M_TEMP, M_WAITOK); + error = copyin(addr, savefpu, data); + if (error == 0) + error = fpusetxstate(td, savefpu, data); + free(savefpu, M_TEMP); + break; + + default: + error = EINVAL; + break; + } + + return (error); +} + +#ifdef COMPAT_FREEBSD32 +#define PT_I386_GETXMMREGS (PT_FIRSTMACH + 0) +#define PT_I386_SETXMMREGS (PT_FIRSTMACH + 1) +#define PT_I386_GETXSTATE (PT_FIRSTMACH + 2) +#define PT_I386_SETXSTATE (PT_FIRSTMACH + 3) + +static int +cpu32_ptrace(struct thread *td, int req, void *addr, int data) +{ + struct savefpu *fpstate; + int error; + + switch (req) { + case PT_I386_GETXMMREGS: + error = copyout(get_pcb_user_save_td(td), addr, + sizeof(*fpstate)); + break; + + case PT_I386_SETXMMREGS: + fpstate = get_pcb_user_save_td(td); + error = copyin(addr, fpstate, sizeof(*fpstate)); + fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; + break; + + case PT_I386_GETXSTATE: + error = cpu_ptrace_xstate(td, PT_GETXSTATE, addr, data); + break; + + case PT_I386_SETXSTATE: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 17:50:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F54A106564A; Sat, 21 Jan 2012 17:50:15 +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 09D8E8FC0A; Sat, 21 Jan 2012 17:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LHoEL3002633; Sat, 21 Jan 2012 17:50:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LHoEY6002631; Sat, 21 Jan 2012 17:50:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201211750.q0LHoEY6002631@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jan 2012 17: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: r230427 - head/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 17:50:15 -0000 Author: kib Date: Sat Jan 21 17:50:14 2012 New Revision: 230427 URL: http://svn.freebsd.org/changeset/base/230427 Log: Adopt to new layout of struct pcb. MFC after: 1 month Modified: head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Sat Jan 21 17:45:27 2012 (r230426) +++ head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Sat Jan 21 17:50:14 2012 (r230427) @@ -66,7 +66,7 @@ kgdb_trgt_fetch_registers(int regno __un supply_register(AMD64_R8_REGNUM + 6, (char *)&pcb.pcb_r14); supply_register(AMD64_R15_REGNUM, (char *)&pcb.pcb_r15); supply_register(AMD64_RIP_REGNUM, (char *)&pcb.pcb_rip); - amd64_supply_fxsave(current_regcache, -1, &pcb.pcb_user_save); + amd64_supply_fxsave(current_regcache, -1, (struct fpusave *)(&pcb + 1)); } void From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 18:00:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7F5F106568D; Sat, 21 Jan 2012 18:00:28 +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 8E1718FC08; Sat, 21 Jan 2012 18:00:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LI0S8h003104; Sat, 21 Jan 2012 18:00:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LI0Sjt003083; Sat, 21 Jan 2012 18:00:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201211800.q0LI0Sjt003083@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jan 2012 18:00: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: r230429 - in head: lib/libc/amd64/gen lib/libc/arm/gen lib/libc/gen lib/libc/i386/gen lib/libc/ia64/gen lib/libc/mips/gen lib/libc/powerpc/gen lib/libc/powerpc64/gen lib/libc/sparc64/ge... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 18:00:28 -0000 Author: kib Date: Sat Jan 21 18:00:28 2012 New Revision: 230429 URL: http://svn.freebsd.org/changeset/base/230429 Log: Add API for obtaining extended machine context states that cannot be fit into existing mcontext_t. On i386 and amd64 do return the extended FPU states using getcontextx(3). For other architectures, getcontextx(3) returns the same information as getcontext(2). Tested by: pho MFC after: 1 month Added: head/lib/libc/amd64/gen/getcontextx.c (contents, props changed) head/lib/libc/arm/gen/getcontextx.c (contents, props changed) head/lib/libc/i386/gen/getcontextx.c (contents, props changed) head/lib/libc/ia64/gen/getcontextx.c (contents, props changed) head/lib/libc/mips/gen/getcontextx.c (contents, props changed) head/lib/libc/powerpc/gen/getcontextx.c (contents, props changed) head/lib/libc/powerpc64/gen/getcontextx.c (contents, props changed) head/lib/libc/sparc64/gen/getcontextx.c (contents, props changed) Modified: head/lib/libc/amd64/gen/Makefile.inc head/lib/libc/arm/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/getcontext.3 head/lib/libc/gen/ucontext.3 head/lib/libc/i386/gen/Makefile.inc head/lib/libc/ia64/gen/Makefile.inc head/lib/libc/mips/gen/Makefile.inc head/lib/libc/powerpc/gen/Makefile.inc head/lib/libc/powerpc64/gen/Makefile.inc head/lib/libc/sparc64/gen/Makefile.inc head/sys/sys/ucontext.h Modified: head/lib/libc/amd64/gen/Makefile.inc ============================================================================== --- head/lib/libc/amd64/gen/Makefile.inc Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/amd64/gen/Makefile.inc Sat Jan 21 18:00:28 2012 (r230429) @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= _setjmp.S _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \ - fabs.S \ + fabs.S getcontextx.c \ infinity.c ldexp.c makecontext.c signalcontext.c \ flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \ fpgetround.c fpsetround.c fpgetsticky.c Added: head/lib/libc/amd64/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/amd64/gen/getcontextx.c Sat Jan 21 18:00:28 2012 (r230429) @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2011 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. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int xstate_sz = -1; + +size_t +__getcontextx_size(void) +{ + u_int p[4]; + + if (xstate_sz == -1) { + do_cpuid(1, p); + if ((p[2] & CPUID2_OSXSAVE) != 0) { + cpuid_count(0xd, 0x0, p); + xstate_sz = p[1] - sizeof(struct savefpu); + } else + xstate_sz = 0; + } + + return (sizeof(ucontext_t) + xstate_sz); +} + +int +__fillcontextx(char *ctx) +{ + struct amd64_get_xfpustate xfpu; + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (getcontext(ucp) == -1) + return (-1); + if (xstate_sz != 0) { + xfpu.addr = (char *)(ucp + 1); + xfpu.len = xstate_sz; + if (sysarch(AMD64_GET_XFPUSTATE, &xfpu) == -1) + return (-1); + ucp->uc_mcontext.mc_xfpustate = (__register_t)xfpu.addr; + ucp->uc_mcontext.mc_xfpustate_len = xstate_sz; + ucp->uc_mcontext.mc_flags |= _MC_HASFPXSTATE; + } else { + ucp->uc_mcontext.mc_xfpustate = 0; + ucp->uc_mcontext.mc_xfpustate_len = 0; + } + return (0); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/arm/gen/Makefile.inc Sat Jan 21 18:00:28 2012 (r230429) @@ -2,5 +2,5 @@ # $FreeBSD$ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ - infinity.c ldexp.c makecontext.c \ + getcontextx.c infinity.c ldexp.c makecontext.c \ setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c Added: head/lib/libc/arm/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/getcontextx.c Sat Jan 21 18:00:28 2012 (r230429) @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011 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. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +size_t +__getcontextx_size(void) +{ + + return (sizeof(ucontext_t)); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + return (getcontext(ucp)); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/gen/Symbol.map Sat Jan 21 18:00:28 2012 (r230429) @@ -384,6 +384,7 @@ FBSD_1.2 { FBSD_1.3 { fdlopen; __FreeBSD_libc_enter_restricted_mode; + getcontextx; }; FBSDprivate_1.0 { @@ -507,4 +508,6 @@ FBSDprivate_1.0 { __elf_aux_vector; __pthread_map_stacks_exec; + __fillcontextx; + __getcontextx_size; }; Modified: head/lib/libc/gen/getcontext.3 ============================================================================== --- head/lib/libc/gen/getcontext.3 Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/gen/getcontext.3 Sat Jan 21 18:00:28 2012 (r230429) @@ -35,11 +35,11 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2002 +.Dd December 26, 2011 .Dt GETCONTEXT 3 .Os .Sh NAME -.Nm getcontext , setcontext +.Nm getcontext , getcontextx , setcontext .Nd get and set user thread context .Sh LIBRARY .Lb libc @@ -59,6 +59,20 @@ This saved context may then later be res .Fn setcontext . .Pp The +.Fn getcontextx +function saves the current execution context in the newly allocated structure +.Vt ucontext_t , +which is returned on success. +If architecture defines additional CPU states that can be stored in extended +blocks referenced from the +.Vt ucontext_t , +the memory for them may be allocated and their context also stored. +Memory returned by +.Fn getcontextx +function shall be freed using +.Fn free 3 . +.Pp +The .Fn setcontext function makes a previously saved thread context the current thread context, i.e., @@ -109,11 +123,24 @@ If successful, returns zero and .Fn setcontext does not return; otherwise \-1 is returned. +The +.Fn getcontextx +returns pointer to the allocated and initialized context on success, and +.Va NULL +on failure. .Sh ERRORS No errors are defined for .Fn getcontext or .Fn setcontext . +The +.Fn getcontextx +may return the following errors in +.Va errno : +.Bl -tag -width Er +.It Bq Er ENOMEM +No memory was available to allocate for the context or some extended state. +.El .Sh SEE ALSO .Xr sigaction 2 , .Xr sigaltstack 2 , Modified: head/lib/libc/gen/ucontext.3 ============================================================================== --- head/lib/libc/gen/ucontext.3 Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/gen/ucontext.3 Sat Jan 21 18:00:28 2012 (r230429) @@ -92,6 +92,9 @@ structures: .Ft int .Fn getcontext "ucontext_t *" ; .It +.Ft "ucontext_t *" +.Fn getcontextx "void" ; +.It .Ft int .Fn setcontext "const ucontext_t *" ; .It @@ -104,4 +107,5 @@ structures: .Sh SEE ALSO .Xr sigaltstack 2 , .Xr getcontext 3 , +.Xr getcontextx 3 , .Xr makecontext 3 Modified: head/lib/libc/i386/gen/Makefile.inc ============================================================================== --- head/lib/libc/i386/gen/Makefile.inc Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/i386/gen/Makefile.inc Sat Jan 21 18:00:28 2012 (r230429) @@ -2,5 +2,5 @@ # $FreeBSD$ SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \ - flt_rounds.c infinity.c ldexp.c makecontext.c \ + flt_rounds.c getcontextx.c infinity.c ldexp.c makecontext.c \ rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S Added: head/lib/libc/i386/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/i386/gen/getcontextx.c Sat Jan 21 18:00:28 2012 (r230429) @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2011 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. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +static int xstate_sz = -1; + +size_t +__getcontextx_size(void) +{ + u_int p[4]; + int cpuid_supported; + + if (xstate_sz == -1) { + __asm __volatile( + " pushfl\n" + " popl %%eax\n" + " movl %%eax,%%ecx\n" + " xorl $0x200000,%%eax\n" + " pushl %%eax\n" + " popfl\n" + " pushfl\n" + " popl %%eax\n" + " xorl %%eax,%%ecx\n" + " je 1f\n" + " movl $1,%0\n" + " jmp 2f\n" + "1: movl $0,%0\n" + "2:\n" + : "=r" (cpuid_supported) : : "eax", "ecx"); + if (cpuid_supported) { + __asm __volatile( + " pushl %%ebx\n" + " cpuid\n" + " movl %%ebx,%1\n" + " popl %%ebx\n" + : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (0x0)); + if ((p[2] & CPUID2_OSXSAVE) != 0) { + __asm __volatile( + " pushl %%ebx\n" + " cpuid\n" + " movl %%ebx,%1\n" + " popl %%ebx\n" + : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), + "=d" (p[3]) + : "0" (0xd), "2" (0x0)); + xstate_sz = p[1] - sizeof(struct savexmm); + } else + xstate_sz = 0; + } else + xstate_sz = 0; + } + + return (sizeof(ucontext_t) + xstate_sz); +} + +int +__fillcontextx(char *ctx) +{ + struct i386_get_xfpustate xfpu; + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + if (getcontext(ucp) == -1) + return (-1); + if (xstate_sz != 0) { + xfpu.addr = (char *)(ucp + 1); + xfpu.len = xstate_sz; + if (sysarch(I386_GET_XFPUSTATE, &xfpu) == -1) + return (-1); + ucp->uc_mcontext.mc_xfpustate = (__register_t)xfpu.addr; + ucp->uc_mcontext.mc_xfpustate_len = xstate_sz; + ucp->uc_mcontext.mc_flags |= _MC_HASFPXSTATE; + } else { + ucp->uc_mcontext.mc_xfpustate = 0; + ucp->uc_mcontext.mc_xfpustate_len = 0; + } + return (0); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/lib/libc/ia64/gen/Makefile.inc ============================================================================== --- head/lib/libc/ia64/gen/Makefile.inc Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/ia64/gen/Makefile.inc Sat Jan 21 18:00:28 2012 (r230429) @@ -3,7 +3,7 @@ SRCS+= __divdf3.S __divdi3.S __divsf3.S __divsi3.S __moddi3.S __modsi3.S \ __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S _mcount.S _set_tp.c \ _setjmp.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c fpsetmask.c \ - fpsetround.c infinity.c ldexp.c makecontext.c setjmp.S \ + fpsetround.c getcontextx.c infinity.c ldexp.c makecontext.c setjmp.S \ signalcontext.c sigsetjmp.S # The following may go away if function _Unwind_FindTableEntry() Added: head/lib/libc/ia64/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/ia64/gen/getcontextx.c Sat Jan 21 18:00:28 2012 (r230429) @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011 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. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +size_t +__getcontextx_size(void) +{ + + return (sizeof(ucontext_t)); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + return (getcontext(ucp)); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/lib/libc/mips/gen/Makefile.inc ============================================================================== --- head/lib/libc/mips/gen/Makefile.inc Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/mips/gen/Makefile.inc Sat Jan 21 18:00:28 2012 (r230429) @@ -6,4 +6,5 @@ SRCS+= infinity.c fabs.c ldexp.c # SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ # fpsetround.c fpsetsticky.c -SRCS+= _ctx_start.S _set_tp.c _setjmp.S makecontext.c setjmp.S signalcontext.c sigsetjmp.S +SRCS+= _ctx_start.S _set_tp.c _setjmp.S getcontextx.c makecontext.c \ + setjmp.S signalcontext.c sigsetjmp.S Added: head/lib/libc/mips/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/gen/getcontextx.c Sat Jan 21 18:00:28 2012 (r230429) @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011 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. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +size_t +__getcontextx_size(void) +{ + + return (sizeof(ucontext_t)); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + return (getcontext(ucp)); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/lib/libc/powerpc/gen/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/gen/Makefile.inc Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/powerpc/gen/Makefile.inc Sat Jan 21 18:00:28 2012 (r230429) @@ -1,7 +1,7 @@ # $FreeBSD$ SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ - fpgetsticky.c fpsetmask.c fpsetround.c \ + fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \ infinity.c ldexp.c makecontext.c _setjmp.S \ setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ _set_tp.c Added: head/lib/libc/powerpc/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc/gen/getcontextx.c Sat Jan 21 18:00:28 2012 (r230429) @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011 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. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +size_t +__getcontextx_size(void) +{ + + return (sizeof(ucontext_t)); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + return (getcontext(ucp)); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/lib/libc/powerpc64/gen/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/gen/Makefile.inc Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/powerpc64/gen/Makefile.inc Sat Jan 21 18:00:28 2012 (r230429) @@ -1,7 +1,7 @@ # $FreeBSD$ SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ - fpgetsticky.c fpsetmask.c fpsetround.c \ + fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \ infinity.c ldexp.c makecontext.c _setjmp.S \ setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ _set_tp.c Added: head/lib/libc/powerpc64/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/getcontextx.c Sat Jan 21 18:00:28 2012 (r230429) @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011 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. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +size_t +__getcontextx_size(void) +{ + + return (sizeof(ucontext_t)); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + return (getcontext(ucp)); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/lib/libc/sparc64/gen/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/gen/Makefile.inc Sat Jan 21 17:59:50 2012 (r230428) +++ head/lib/libc/sparc64/gen/Makefile.inc Sat Jan 21 18:00:28 2012 (r230429) @@ -2,5 +2,5 @@ SRCS+= _ctx_start.S _setjmp.S fabs.S fixunsdfsi.S flt_rounds.c fpgetmask.c \ fpgetround.c fpgetsticky.c fpsetmask.c fpsetround.c \ - infinity.c ldexp.c makecontext.c \ + getcontextx.c infinity.c ldexp.c makecontext.c \ signalcontext.c setjmp.S sigsetjmp.S _set_tp.c Added: head/lib/libc/sparc64/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sparc64/gen/getcontextx.c Sat Jan 21 18:00:28 2012 (r230429) @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011 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. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +size_t +__getcontextx_size(void) +{ + + return (sizeof(ucontext_t)); +} + +int +__fillcontextx(char *ctx) +{ + ucontext_t *ucp; + + ucp = (ucontext_t *)ctx; + return (getcontext(ucp)); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/sys/sys/ucontext.h ============================================================================== --- head/sys/sys/ucontext.h Sat Jan 21 17:59:50 2012 (r230428) +++ head/sys/sys/ucontext.h Sat Jan 21 18:00:28 2012 (r230429) @@ -72,11 +72,17 @@ struct ucontext4 { __BEGIN_DECLS int getcontext(ucontext_t *); +ucontext_t *getcontextx(void); int setcontext(const ucontext_t *); void makecontext(ucontext_t *, void (*)(void), int, ...); int signalcontext(ucontext_t *, int, __sighandler_t *); int swapcontext(ucontext_t *, const ucontext_t *); +#if __BSD_VISIBLE +size_t __getcontextx_size(void); +int __fillcontextx(char *ctx); +#endif + __END_DECLS #else /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 18:06:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52CE61065686; Sat, 21 Jan 2012 18:06:19 +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 235388FC16; Sat, 21 Jan 2012 18:06:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LI6JW5003337; Sat, 21 Jan 2012 18:06:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LI6J3o003335; Sat, 21 Jan 2012 18:06:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201211806.q0LI6J3o003335@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 21 Jan 2012 18:06: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: r230430 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 18:06:19 -0000 Author: kib Date: Sat Jan 21 18:06:18 2012 New Revision: 230430 URL: http://svn.freebsd.org/changeset/base/230430 Log: Use getcontextx(3) internal API instead of getcontext(2) to provide the signal handlers with the context information in the deferrred case. Only enable the use of getcontextx(3) in the deferred signal delivery code on amd64 and i386. Sparc64 seems to have some undetermined issues with interaction of alloca(3) and signal delivery. Tested by: flo (who also provided sparc64 harware access for me), pho Discussed with: marius MFC after: 1 month Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Sat Jan 21 18:00:28 2012 (r230429) +++ head/lib/libthr/thread/thr_sig.c Sat Jan 21 18:06:18 2012 (r230430) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include "un-namespace.h" @@ -314,16 +315,24 @@ check_cancel(struct pthread *curthread, static void check_deferred_signal(struct pthread *curthread) { - ucontext_t uc; + ucontext_t *uc; struct sigaction act; siginfo_t info; if (__predict_true(curthread->deferred_siginfo.si_signo == 0)) return; - getcontext(&uc); + +#if defined(__amd64__) || defined(__i386__) + uc = alloca(__getcontextx_size()); + __fillcontextx((char *)uc); +#else + ucontext_t ucv; + uc = &ucv; + getcontext(uc); +#endif if (curthread->deferred_siginfo.si_signo != 0) { act = curthread->deferred_sigact; - uc.uc_sigmask = curthread->deferred_sigmask; + uc->uc_sigmask = curthread->deferred_sigmask; memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t)); /* remove signal */ curthread->deferred_siginfo.si_signo = 0; @@ -334,7 +343,7 @@ check_deferred_signal(struct pthread *cu tact.sa_handler = SIG_DFL; _sigaction(info.si_signo, &tact, NULL); } - handle_signal(&act, info.si_signo, &info, &uc); + handle_signal(&act, info.si_signo, &info, uc); } } From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 20:06:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F0861065672; Sat, 21 Jan 2012 20:06:48 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 49F7F8FC0A; Sat, 21 Jan 2012 20:06:47 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 3D232C43; Sat, 21 Jan 2012 21:06:46 +0100 (CET) Date: Sat, 21 Jan 2012 21:05:33 +0100 From: Pawel Jakub Dawidek To: Adrian Chadd Message-ID: <20120121200533.GD1723@garage.freebsd.pl> References: <201201080055.q080tMlJ063808@svn.freebsd.org> <20120108104330.GC1674@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LKTjZJSUETSlgu2t" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229800 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 20:06:48 -0000 --LKTjZJSUETSlgu2t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 08, 2012 at 02:58:56PM -0800, Adrian Chadd wrote: > On 8 January 2012 02:43, Pawel Jakub Dawidek wrote: > > If someone is actually using GENERIC kernel. This change will break all > > my system next time I upgrade. Adding UFS_ACL option to the kernel > > config to make ZFS kernel module to work doesn't sound very intuitive. > > > > I understand what you are trying to accomplish, but we really need to > > find better way to do this. Until then, could you back it out? >=20 > I'd rather find a cleaner solution - it's pulling in code which just > isn't being used if you aren't using UFS_ACL or ZFS. >=20 > How about wrapping those two up in a module which zfs can register a > dependency on? Adrian, I see no progress was made on this and I just was beaten by this change. I upgrade a box, but forget about this and I couldn't load zfs module. Until better idea is found and implemented, once again, please back this one out. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --LKTjZJSUETSlgu2t Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8bGo0ACgkQForvXbEpPzT0YgCgqhJfmLhnLvnQh34PhKTBHpL1 ESoAoIKLC1oPOXPbjC3y67dFJCmznaHW =4Nox -----END PGP SIGNATURE----- --LKTjZJSUETSlgu2t-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 20:13:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4904A1065687; Sat, 21 Jan 2012 20:13: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 33BC88FC27; Sat, 21 Jan 2012 20:13:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LKDcoG007909; Sat, 21 Jan 2012 20:13:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LKDc9R007907; Sat, 21 Jan 2012 20:13:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201212013.q0LKDc9R007907@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 21 Jan 2012 20: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: r230436 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 20:13:38 -0000 Author: pjd Date: Sat Jan 21 20:13:37 2012 New Revision: 230436 URL: http://svn.freebsd.org/changeset/base/230436 Log: Fix minor memory leak. MFC after: 3 days Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sat Jan 21 19:21:42 2012 (r230435) +++ head/sbin/hastd/parse.y Sat Jan 21 20:13:37 2012 (r230436) @@ -812,6 +812,7 @@ resource_start: STR sizeof(curres->hr_name)) >= sizeof(curres->hr_name)) { pjdlog_error("Resource name is too long."); + free(curres); free($1); return (1); } From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 20:39:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84B51106566B; Sat, 21 Jan 2012 20:39:17 +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 5522C8FC0C; Sat, 21 Jan 2012 20:39:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LKdH1L008775; Sat, 21 Jan 2012 20:39:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LKdHfp008774; Sat, 21 Jan 2012 20:39:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201212039.q0LKdHfp008774@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 21 Jan 2012 20:39: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: r230437 - head/bin/sh/funcs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 20:39:17 -0000 Author: jilles Date: Sat Jan 21 20:39:17 2012 New Revision: 230437 URL: http://svn.freebsd.org/changeset/base/230437 Log: sh: Remove "kill" example function, which is superseded by the kill builtin MFC after: 1 week Deleted: head/bin/sh/funcs/kill From owner-svn-src-head@FreeBSD.ORG Sat Jan 21 21:12:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81065106564A; Sat, 21 Jan 2012 21: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 66ACC8FC13; Sat, 21 Jan 2012 21:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0LLCrae009851; Sat, 21 Jan 2012 21:12:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LLCrQn009840; Sat, 21 Jan 2012 21:12:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201212112.q0LLCrQn009840@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 21 Jan 2012 21: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: r230438 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 21:12:53 -0000 Author: pjd Date: Sat Jan 21 21:12:53 2012 New Revision: 230438 URL: http://svn.freebsd.org/changeset/base/230438 Log: Dramatically optimize listing snapshots when user requests only snapshot names and wants to sort them by name, ie. when executes: # zfs list -t snapshot -o name -s name Because only name is needed we don't have to read all snapshot properties. Below you can find how long does it take to list 34509 snapshots from a single disk pool before and after this change with cold and warm cache: before: # time zfs list -t snapshot -o name -s name > /dev/null cold cache: 525s warm cache: 218s after: # time zfs list -t snapshot -o name -s name > /dev/null cold cache: 1.7s warm cache: 1.1s MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Sat Jan 21 20:39:17 2012 (r230437) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Sat Jan 21 21:12:53 2012 (r230438) @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 Pawel Jakub Dawidek . + * All rights reserved. */ #include @@ -129,8 +131,11 @@ zfs_callback(zfs_handle_t *zhp, void *da cb->cb_depth++; if (zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) (void) zfs_iter_filesystems(zhp, zfs_callback, data); - if ((zfs_get_type(zhp) != ZFS_TYPE_SNAPSHOT) && include_snaps) - (void) zfs_iter_snapshots(zhp, zfs_callback, data); + if ((zfs_get_type(zhp) != ZFS_TYPE_SNAPSHOT) && include_snaps) { + (void) zfs_iter_snapshots(zhp, + (cb->cb_flags & ZFS_ITER_SIMPLE) != 0, zfs_callback, + data); + } cb->cb_depth--; } @@ -184,6 +189,14 @@ zfs_free_sort_columns(zfs_sort_column_t } } +boolean_t +zfs_sort_only_by_name(const zfs_sort_column_t *sc) +{ + + return (sc != NULL && sc->sc_next == NULL && + sc->sc_prop == ZFS_PROP_NAME); +} + /* ARGSUSED */ static int zfs_compare(const void *larg, const void *rarg, void *unused) @@ -224,7 +237,13 @@ zfs_compare(const void *larg, const void lcreate = zfs_prop_get_int(l, ZFS_PROP_CREATETXG); rcreate = zfs_prop_get_int(r, ZFS_PROP_CREATETXG); - if (lcreate < rcreate) + /* + * Both lcreate and rcreate being 0 means we don't have + * properties and we should compare full name. + */ + if (lcreate == 0 && rcreate == 0) + ret = strcmp(lat + 1, rat + 1); + else if (lcreate < rcreate) ret = -1; else if (lcreate > rcreate) ret = 1; @@ -290,7 +309,14 @@ zfs_sort(const void *larg, const void *r if (rvalid) verify(nvlist_lookup_string(rval, ZPROP_VALUE, &rstr) == 0); + } else if (psc->sc_prop == ZFS_PROP_NAME) { + lvalid = rvalid = B_TRUE; + + (void) strlcpy(lbuf, zfs_get_name(l), sizeof(lbuf)); + (void) strlcpy(rbuf, zfs_get_name(r), sizeof(rbuf)); + lstr = lbuf; + rstr = rbuf; } else if (zfs_prop_is_string(psc->sc_prop)) { lvalid = (zfs_prop_get(l, psc->sc_prop, lbuf, sizeof (lbuf), NULL, NULL, 0, B_TRUE) == 0); Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h Sat Jan 21 20:39:17 2012 (r230437) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h Sat Jan 21 21:12:53 2012 (r230438) @@ -43,11 +43,13 @@ typedef struct zfs_sort_column { #define ZFS_ITER_PROP_LISTSNAPS (1 << 2) #define ZFS_ITER_DEPTH_LIMIT (1 << 3) #define ZFS_ITER_RECVD_PROPS (1 << 4) +#define ZFS_ITER_SIMPLE (1 << 5) int zfs_for_each(int, char **, int options, zfs_type_t, zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *); int zfs_add_sort_column(zfs_sort_column_t **, const char *, boolean_t); void zfs_free_sort_columns(zfs_sort_column_t *); +boolean_t zfs_sort_only_by_name(const zfs_sort_column_t *); #ifdef __cplusplus } Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sat Jan 21 20:39:17 2012 (r230437) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sat Jan 21 21:12:53 2012 (r230438) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. - * Copyright (c) 2011 Pawel Jakub Dawidek . + * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2011 Martin Matuska . All rights reserved. */ @@ -2838,7 +2838,12 @@ print_dataset(zfs_handle_t *zhp, zprop_l first = B_FALSE; } - if (pl->pl_prop != ZPROP_INVAL) { + if (pl->pl_prop == ZFS_PROP_NAME) { + (void) strlcpy(property, zfs_get_name(zhp), + sizeof(property)); + propstr = property; + right_justify = zfs_prop_align_right(pl->pl_prop); + } else if (pl->pl_prop != ZPROP_INVAL) { if (zfs_prop_get(zhp, pl->pl_prop, property, sizeof (property), NULL, NULL, 0, B_FALSE) != 0) propstr = "-"; @@ -3005,6 +3010,13 @@ zfs_do_list(int argc, char **argv) fields = default_fields; /* + * If we are only going to list snapshot names and sort by name, + * then we can use faster version. + */ + if (strcmp(fields, "name") == 0 && zfs_sort_only_by_name(sortcol)) + flags |= ZFS_ITER_SIMPLE; + + /* * If "-o space" and no types were specified, don't display snapshots. */ if (strcmp(fields, "space") == 0 && types_specified == B_FALSE) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sat Jan 21 20:39:17 2012 (r230437) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sat Jan 21 21:12:53 2012 (r230438) @@ -507,7 +507,7 @@ extern int zfs_iter_root(libzfs_handle_t extern int zfs_iter_children(zfs_handle_t *, zfs_iter_f, void *); extern int zfs_iter_dependents(zfs_handle_t *, boolean_t, zfs_iter_f, void *); extern int zfs_iter_filesystems(zfs_handle_t *, zfs_iter_f, void *); -extern int zfs_iter_snapshots(zfs_handle_t *, zfs_iter_f, void *); +extern int zfs_iter_snapshots(zfs_handle_t *, boolean_t, zfs_iter_f, void *); extern int zfs_iter_snapshots_sorted(zfs_handle_t *, zfs_iter_f, void *); extern int zfs_iter_snapspec(zfs_handle_t *, const char *, zfs_iter_f, void *); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sat Jan 21 20:39:17 2012 (r230437) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sat Jan 21 21:12:53 2012 (r230438) @@ -23,7 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. - * Copyright (c) 2011 Pawel Jakub Dawidek . + * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. */ @@ -514,6 +514,22 @@ make_dataset_handle_zc(libzfs_handle_t * } zfs_handle_t * +make_dataset_simple_handle_zc(zfs_handle_t *pzhp, zfs_cmd_t *zc) +{ + zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1); + + if (zhp == NULL) + return (NULL); + + zhp->zfs_hdl = pzhp->zfs_hdl; + (void) strlcpy(zhp->zfs_name, zc->zc_name, sizeof (zhp->zfs_name)); + zhp->zfs_head_type = pzhp->zfs_type; + zhp->zfs_type = ZFS_TYPE_SNAPSHOT; + zhp->zpool_hdl = zpool_handle(zhp); + return (zhp); +} + +zfs_handle_t * zfs_handle_dup(zfs_handle_t *zhp_orig) { zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Sat Jan 21 20:39:17 2012 (r230437) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h Sat Jan 21 21:12:53 2012 (r230438) @@ -150,7 +150,7 @@ int zpool_standard_error_fmt(libzfs_hand int get_dependents(libzfs_handle_t *, boolean_t, const char *, char ***, size_t *); zfs_handle_t *make_dataset_handle_zc(libzfs_handle_t *, zfs_cmd_t *); - +zfs_handle_t *make_dataset_simple_handle_zc(zfs_handle_t *, zfs_cmd_t *); int zprop_parse_value(libzfs_handle_t *, nvpair_t *, int, zfs_type_t, nvlist_t *, char **, uint64_t *, const char *); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Sat Jan 21 20:39:17 2012 (r230437) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Sat Jan 21 21:12:53 2012 (r230438) @@ -23,6 +23,8 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 Pawel Jakub Dawidek . + * All rights reserved. */ #include @@ -137,7 +139,8 @@ zfs_iter_filesystems(zfs_handle_t *zhp, * Iterate over all snapshots */ int -zfs_iter_snapshots(zfs_handle_t *zhp, zfs_iter_f func, void *data) +zfs_iter_snapshots(zfs_handle_t *zhp, boolean_t simple, zfs_iter_f func, + void *data) { zfs_cmd_t zc = { 0 }; zfs_handle_t *nzhp; @@ -146,15 +149,19 @@ zfs_iter_snapshots(zfs_handle_t *zhp, zf if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) return (0); + zc.zc_simple = simple; + if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0) return (-1); while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_SNAPSHOT_LIST_NEXT, &zc)) == 0) { - if ((nzhp = make_dataset_handle_zc(zhp->zfs_hdl, - &zc)) == NULL) { + if (simple) + nzhp = make_dataset_simple_handle_zc(zhp, &zc); + else + nzhp = make_dataset_handle_zc(zhp->zfs_hdl, &zc); + if (nzhp == NULL) continue; - } if ((ret = func(nzhp, data)) != 0) { zcmd_free_nvlists(&zc); @@ -234,7 +241,7 @@ zfs_iter_snapshots_sorted(zfs_handle_t * avl_create(&avl, zfs_snapshot_compare, sizeof (zfs_node_t), offsetof(zfs_node_t, zn_avlnode)); - ret = zfs_iter_snapshots(zhp, zfs_sort_snaps, &avl); + ret = zfs_iter_snapshots(zhp, B_FALSE, zfs_sort_snaps, &avl); for (node = avl_first(&avl); node != NULL; node = AVL_NEXT(&avl, node)) ret |= callback(node->zn_handle, data); @@ -378,7 +385,7 @@ zfs_iter_children(zfs_handle_t *zhp, zfs if ((ret = zfs_iter_filesystems(zhp, func, data)) != 0) return (ret); - return (zfs_iter_snapshots(zhp, func, data)); + return (zfs_iter_snapshots(zhp, B_FALSE, func, data)); } @@ -439,8 +446,10 @@ iter_dependents_cb(zfs_handle_t *zhp, vo isf.next = ida->stack; ida->stack = &isf; err = zfs_iter_filesystems(zhp, iter_dependents_cb, ida); - if (err == 0) - err = zfs_iter_snapshots(zhp, iter_dependents_cb, ida); + if (err == 0) { + err = zfs_iter_snapshots(zhp, B_FALSE, + iter_dependents_cb, ida); + } ida->stack = isf.next; } if (!first && err == 0) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sat Jan 21 20:39:17 2012 (r230437) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sat Jan 21 21:12:53 2012 (r230438) @@ -22,6 +22,8 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 Pawel Jakub Dawidek . + * All rights reserved. */ #include @@ -717,7 +719,7 @@ send_iterate_fs(zfs_handle_t *zhp, void sd->parent_fromsnap_guid = 0; VERIFY(0 == nvlist_alloc(&sd->parent_snaps, NV_UNIQUE_NAME, 0)); VERIFY(0 == nvlist_alloc(&sd->snapprops, NV_UNIQUE_NAME, 0)); - (void) zfs_iter_snapshots(zhp, send_iterate_snap, sd); + (void) zfs_iter_snapshots(zhp, B_FALSE, send_iterate_snap, sd); VERIFY(0 == nvlist_add_nvlist(nvfs, "snaps", sd->parent_snaps)); VERIFY(0 == nvlist_add_nvlist(nvfs, "snapprops", sd->snapprops)); nvlist_free(sd->parent_snaps); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Sat Jan 21 20:39:17 2012 (r230437) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Sat Jan 21 21:12:53 2012 (r230438) @@ -300,7 +300,8 @@ typedef struct zfs_cmd { boolean_t zc_temphold; uint64_t zc_action_handle; int zc_cleanup_fd; - uint8_t zc_pad[4]; /* alignment */ + uint8_t zc_simple; + uint8_t zc_pad[3]; /* alignment */ uint64_t zc_sendobj; uint64_t zc_fromobj; uint64_t zc_createtxg; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Jan 21 20:39:17 2012 (r230437) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Jan 21 21:12:53 2012 (r230438) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 Pawel Jakub Dawidek . + * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Portions Copyright 2011 Martin Matuska * Copyright 2011 Nexenta Systems, Inc. All rights reserved. @@ -2036,6 +2036,7 @@ top: * zc_name name of filesystem * zc_cookie zap cursor * zc_nvlist_dst_size size of buffer for property nvlist + * zc_simple when set, only name is requested * * outputs: * zc_name name of next snapshot @@ -2050,7 +2051,7 @@ zfs_ioc_snapshot_list_next(zfs_cmd_t *zc int error; top: - if (snapshot_list_prefetch && zc->zc_cookie == 0) + if (snapshot_list_prefetch && zc->zc_cookie == 0 && !zc->zc_simple) (void) dmu_objset_find(zc->zc_name, dmu_objset_prefetch, NULL, DS_FIND_SNAPSHOTS); @@ -2072,7 +2073,7 @@ top: zc->zc_name + strlen(zc->zc_name), &zc->zc_obj, &zc->zc_cookie, NULL); - if (error == 0) { + if (error == 0 && !zc->zc_simple) { dsl_dataset_t *ds; dsl_pool_t *dp = os->os_dsl_dataset->ds_dir->dd_pool;