From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 01:19:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 006951065693; Sun, 7 Nov 2010 01:19:41 +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 E1E738FC08; Sun, 7 Nov 2010 01:19:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA71JeoO005370; Sun, 7 Nov 2010 01:19:40 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA71JeVl005368; Sun, 7 Nov 2010 01:19:40 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011070119.oA71JeVl005368@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 7 Nov 2010 01:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214900 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 01:19:41 -0000 Author: lstewart Date: Sun Nov 7 01:19:40 2010 New Revision: 214900 URL: http://svn.freebsd.org/changeset/base/214900 Log: Remove siis.4 from the man4/Makefile. It was incorrectly included in r214875 as part of the SIFTR MFC and breaks buildworld as siis.4 doesn't exist in stable/7. This is an intentional direct commit to the 7-STABLE branch. Pointy hat to: lstewart Noticed by: Michael Butler Modified: stable/7/share/man/man4/Makefile Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Sat Nov 6 22:07:22 2010 (r214899) +++ stable/7/share/man/man4/Makefile Sun Nov 7 01:19:40 2010 (r214900) @@ -315,7 +315,6 @@ MAN= aac.4 \ sge.4 \ si.4 \ siftr.4 \ - siis.4 \ sio.4 \ sis.4 \ sk.4 \ From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 03:09:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04FC9106566B; Sun, 7 Nov 2010 03:09:03 +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 E595E8FC18; Sun, 7 Nov 2010 03:09:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7392Ok011432; Sun, 7 Nov 2010 03:09:02 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7392v4011422; Sun, 7 Nov 2010 03:09:02 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011070309.oA7392v4011422@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 03:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214903 - in head/sys: conf mips/include mips/mips sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 03:09:03 -0000 Author: gonzo Date: Sun Nov 7 03:09:02 2010 New Revision: 214903 URL: http://svn.freebsd.org/changeset/base/214903 Log: - Add minidump support for FreeBSD/mips Added: head/sys/mips/mips/minidump_machdep.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/mips/include/cpuregs.h head/sys/mips/include/md_var.h head/sys/mips/include/pmap.h head/sys/mips/mips/dump_machdep.c head/sys/mips/mips/machdep.c head/sys/sys/kerneldump.h head/sys/vm/vm_page.c Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/conf/files.mips Sun Nov 7 03:09:02 2010 (r214903) @@ -55,6 +55,7 @@ mips/mips/db_trace.c optional ddb mips/mips/dump_machdep.c standard mips/mips/in_cksum.c optional inet mips/mips/locore.S standard no-obj +mips/mips/minidump_machdep.c standard mips/mips/mem.c optional mem mips/mips/nexus.c standard mips/mips/stack_machdep.c optional ddb | stack Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/include/cpuregs.h Sun Nov 7 03:09:02 2010 (r214903) @@ -181,6 +181,9 @@ #define MIPS_XUSEG_END 0x0000010000000000 #define MIPS_XKSEG_START 0xc000000000000000 #define MIPS_XKSEG_END 0xc00000ff80000000 +#define MIPS_XKSEG_COMPAT32_START 0xffffffff80000000 +#define MIPS_XKSEG_COMPAT32_END 0xffffffffffffffff +#define MIPS_XKSEG_TO_COMPAT32(va) ((va) & 0xffffffff) #ifdef __mips_n64 #define MIPS_DIRECT_MAPPABLE(pa) 1 Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/include/md_var.h Sun Nov 7 03:09:02 2010 (r214903) @@ -42,6 +42,8 @@ extern long Maxmem; extern char sigcode[]; extern int szsigcode, szosigcode; +extern uint32_t *vm_page_dump; +extern int vm_page_dump_size; extern vm_offset_t kstack0; extern vm_offset_t kernel_kseg0_end; @@ -74,4 +76,7 @@ void platform_identify(void); extern int busdma_swi_pending; void busdma_swi(void); + +struct dumperinfo; +void minidumpsys(struct dumperinfo *); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/include/pmap.h Sun Nov 7 03:09:02 2010 (r214903) @@ -144,6 +144,8 @@ extern vm_offset_t physmem_desc[PHYS_AVA extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; +extern vm_paddr_t dump_avail[PHYS_AVAIL_ENTRIES + 2]; + #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) #define pmap_page_set_memattr(m, ma) (void)0 Modified: head/sys/mips/mips/dump_machdep.c ============================================================================== --- head/sys/mips/mips/dump_machdep.c Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/mips/dump_machdep.c Sun Nov 7 03:09:02 2010 (r214903) @@ -1,35 +1,362 @@ /*- - * Copyright (c) 2006 Oleksandr Tymoshenko + * Copyright (c) 2002 Marcel Moolenaar * 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, immediately at the beginning of the file. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * 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$"); -/* Note to writer, when using pmap_kenter_temporary() you must, - * after using the va to write out the page, call - * pmap_kenter_temporary_free(). You should probably also - * pin the dump thread to the CPU with sched_pin(). +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +CTASSERT(sizeof(struct kerneldumpheader) == 512); + +int do_minidump = 1; +TUNABLE_INT("debug.minidump", &do_minidump); +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0, + "Enable mini crash dumps"); + +/* + * Don't touch the first SIZEOF_METADATA bytes on the dump device. This + * is to protect us from metadata and to protect metadata from us. */ +#define SIZEOF_METADATA (64*1024) + +#define MD_ALIGN(x) (((off_t)(x) + PAGE_MASK) & ~PAGE_MASK) +#define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) +extern struct pcb dumppcb; + +struct md_pa { + vm_paddr_t md_start; + vm_paddr_t md_size; +}; + +typedef int callback_t(struct md_pa *, int, void *); + +static struct kerneldumpheader kdh; +static off_t dumplo, fileofs; + +/* Handle buffered writes. */ +static char buffer[DEV_BSIZE]; +static size_t fragsz; + +/* XXX: I suppose 20 should be enough. */ +static struct md_pa dump_map[20]; + +static void +md_pa_init(void) +{ + int n, idx; + + bzero(dump_map, sizeof(dump_map)); + for (n = 0; n < sizeof(dump_map) / sizeof(dump_map[0]); n++) { + idx = n * 2; + if (dump_avail[idx] == 0 && dump_avail[idx + 1] == 0) + break; + dump_map[n].md_start = dump_avail[idx]; + dump_map[n].md_size = dump_avail[idx + 1] - dump_avail[idx]; + } +} + +static struct md_pa * +md_pa_first(void) +{ + + return (&dump_map[0]); +} + +static struct md_pa * +md_pa_next(struct md_pa *mdp) +{ + + mdp++; + if (mdp->md_size == 0) + mdp = NULL; + return (mdp); +} + +static int +buf_write(struct dumperinfo *di, char *ptr, size_t sz) +{ + size_t len; + int error; + + while (sz) { + len = DEV_BSIZE - fragsz; + if (len > sz) + len = sz; + bcopy(ptr, buffer + fragsz, len); + fragsz += len; + ptr += len; + sz -= len; + if (fragsz == DEV_BSIZE) { + error = dump_write(di, buffer, 0, dumplo, + DEV_BSIZE); + if (error) + return error; + dumplo += DEV_BSIZE; + fragsz = 0; + } + } + + return (0); +} + +static int +buf_flush(struct dumperinfo *di) +{ + int error; + + if (fragsz == 0) + return (0); + + error = dump_write(di, buffer, 0, dumplo, DEV_BSIZE); + dumplo += DEV_BSIZE; + fragsz = 0; + return (error); +} + +extern vm_offset_t kernel_l1kva; +extern char *pouet2; + +static int +cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo*)arg; + vm_paddr_t pa; + uint32_t pgs; + size_t counter, sz, chunk; + int c, error; + + error = 0; /* catch case in which chunk size is 0 */ + counter = 0; + pgs = mdp->md_size / PAGE_SIZE; + pa = mdp->md_start; + + printf(" chunk %d: %dMB (%d pages)", seqnr, pgs * PAGE_SIZE / ( + 1024*1024), pgs); + + /* Make sure we write coherent datas. */ + mips_dcache_wbinv_all(); + while (pgs) { + chunk = pgs; + if (chunk > MAXDUMPPGS) + chunk = MAXDUMPPGS; + sz = chunk << PAGE_SHIFT; + counter += sz; + if (counter >> 24) { + printf(" %d", pgs * PAGE_SIZE); + counter &= (1<<24) - 1; + } + + error = dump_write(di, (void *)(pa),0, dumplo, sz); + if (error) + break; + dumplo += sz; + pgs -= chunk; + pa += sz; + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf(" (CTRL-C to abort) "); + } + printf(" ... %s\n", (error) ? "fail" : "ok"); + return (error); +} + +static int +cb_dumphdr(struct md_pa *mdp, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo*)arg; + Elf_Phdr phdr; + uint64_t size; + int error; + + size = mdp->md_size; + bzero(&phdr, sizeof(phdr)); + phdr.p_type = PT_LOAD; + phdr.p_flags = PF_R; /* XXX */ + phdr.p_offset = fileofs; + phdr.p_vaddr = mdp->md_start; + phdr.p_paddr = mdp->md_start; + phdr.p_filesz = size; + phdr.p_memsz = size; + phdr.p_align = PAGE_SIZE; + + error = buf_write(di, (char*)&phdr, sizeof(phdr)); + fileofs += phdr.p_filesz; + return (error); +} + +static int +cb_size(struct md_pa *mdp, int seqnr, void *arg) +{ + uint32_t *sz = (uint32_t*)arg; + + *sz += (uint32_t)mdp->md_size; + return (0); +} + +static int +foreach_chunk(callback_t cb, void *arg) +{ + struct md_pa *mdp; + int error, seqnr; + + seqnr = 0; + mdp = md_pa_first(); + while (mdp != NULL) { + error = (*cb)(mdp, seqnr++, arg); + if (error) + return (-error); + mdp = md_pa_next(mdp); + } + return (seqnr); +} + +void +dumpsys(struct dumperinfo *di) +{ + Elf_Ehdr ehdr; + uint32_t dumpsize; + off_t hdrgap; + size_t hdrsz; + int error; + + if (do_minidump) { + minidumpsys(di); + return; + } + + bzero(&ehdr, sizeof(ehdr)); + ehdr.e_ident[EI_MAG0] = ELFMAG0; + ehdr.e_ident[EI_MAG1] = ELFMAG1; + ehdr.e_ident[EI_MAG2] = ELFMAG2; + ehdr.e_ident[EI_MAG3] = ELFMAG3; + ehdr.e_ident[EI_CLASS] = ELF_CLASS; +#if BYTE_ORDER == LITTLE_ENDIAN + ehdr.e_ident[EI_DATA] = ELFDATA2LSB; +#else + ehdr.e_ident[EI_DATA] = ELFDATA2MSB; +#endif + ehdr.e_ident[EI_VERSION] = EV_CURRENT; + ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ + ehdr.e_type = ET_CORE; + ehdr.e_machine = EM_MIPS; + ehdr.e_phoff = sizeof(ehdr); + ehdr.e_flags = 0; + ehdr.e_ehsize = sizeof(ehdr); + ehdr.e_phentsize = sizeof(Elf_Phdr); + ehdr.e_shentsize = sizeof(Elf_Shdr); + + md_pa_init(); + + /* Calculate dump size. */ + dumpsize = 0L; + ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); + hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; + fileofs = MD_ALIGN(hdrsz); + dumpsize += fileofs; + hdrgap = fileofs - DEV_ALIGN(hdrsz); + + /* Determine dump offset on device. */ + if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; + + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_MIPS_VERSION, dumpsize, di->blocksize); + + printf("Dumping %llu MB (%d chunks)\n", (long long)dumpsize >> 20, + ehdr.e_phnum); + + /* Dump leader */ + error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Dump ELF header */ + error = buf_write(di, (char*)&ehdr, sizeof(ehdr)); + if (error) + goto fail; + + /* Dump program headers */ + error = foreach_chunk(cb_dumphdr, di); + if (error < 0) + goto fail; + buf_flush(di); + + /* + * All headers are written using blocked I/O, so we know the + * current offset is (still) block aligned. Skip the alignement + * in the file to have the segment contents aligned at page + * boundary. We cannot use MD_ALIGN on dumplo, because we don't + * care and may very well be unaligned within the dump device. + */ + dumplo += hdrgap; + + /* Dump memory chunks (updates dumplo) */ + error = foreach_chunk(cb_dumpdata, di); + if (error < 0) + goto fail; + + /* Dump trailer */ + error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + + /* Signal completion, signoff and exit stage left. */ + dump_write(di, NULL, 0, 0, 0); + printf("\nDump complete\n"); + return; + + fail: + if (error < 0) + error = -error; + + if (error == ECANCELED) + printf("\nDump aborted\n"); + else if (error == ENOSPC) + printf("\nDump failed. Partition too small.\n"); + else + printf("\n** DUMP FAILED (ERROR %d) **\n", error); +} Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/mips/machdep.c Sun Nov 7 03:09:02 2010 (r214903) @@ -138,6 +138,7 @@ struct pcpu *pcpup = (struct pcpu *)pcpu vm_offset_t phys_avail[PHYS_AVAIL_ENTRIES + 2]; vm_offset_t physmem_desc[PHYS_AVAIL_ENTRIES + 2]; +vm_paddr_t dump_avail[PHYS_AVAIL_ENTRIES + 2]; #ifdef UNIMPLEMENTED struct platform platform; @@ -488,13 +489,6 @@ cpu_idle(int busy) panic("ints disabled in idleproc!"); } -void -dumpsys(struct dumperinfo *di __unused) -{ - - printf("Kernel dumps not implemented on this architecture\n"); -} - int cpu_idle_wakeup(int cpu) { Added: head/sys/mips/mips/minidump_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/minidump_machdep.c Sun Nov 7 03:09:02 2010 (r214903) @@ -0,0 +1,340 @@ +/*- + * Copyright (c) 2010 Oleksandr Tymoshenko + * Copyright (c) 2008 Semihalf, Grzegorz Bernacki + * 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. + * + * from: FreeBSD: src/sys/arm/arm/minidump_machdep.c v214223 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +CTASSERT(sizeof(struct kerneldumpheader) == 512); + +/* + * Don't touch the first SIZEOF_METADATA bytes on the dump device. This + * is to protect us from metadata and to protect metadata from us. + */ +#define SIZEOF_METADATA (64*1024) + +uint32_t *vm_page_dump; +int vm_page_dump_size; + +static struct kerneldumpheader kdh; +static off_t dumplo; +static off_t origdumplo; + +/* Handle chunked writes. */ +static uint64_t counter, progress; +/* Just auxiliary bufffer */ +static char tmpbuffer[PAGE_SIZE]; + +extern pd_entry_t *kernel_segmap; + +CTASSERT(sizeof(*vm_page_dump) == 4); + +static int +is_dumpable(vm_paddr_t pa) +{ + int i; + + for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { + if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) + return (1); + } + return (0); +} + +static void +dump_add_page(vm_paddr_t pa) +{ + int idx, bit; + + pa >>= PAGE_SHIFT; + idx = pa >> 5; /* 2^5 = 32 */ + bit = pa & 31; + atomic_set_int(&vm_page_dump[idx], 1ul << bit); +} + +static void +dump_drop_page(vm_paddr_t pa) +{ + int idx, bit; + + pa >>= PAGE_SHIFT; + idx = pa >> 5; /* 2^5 = 32 */ + bit = pa & 31; + atomic_clear_int(&vm_page_dump[idx], 1ul << bit); +} + +#define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) + +static int +write_buffer(struct dumperinfo *di, char *ptr, size_t sz) +{ + size_t len; + int error, c; + u_int maxdumpsz; + + maxdumpsz = di->maxiosize; + + if (maxdumpsz == 0) /* seatbelt */ + maxdumpsz = PAGE_SIZE; + + error = 0; + + while (sz) { + len = min(maxdumpsz, sz); + counter += len; + progress -= len; + + if (counter >> 22) { + printf(" %jd", PG2MB(progress >> PAGE_SHIFT)); + counter &= (1<<22) - 1; + } + + if (ptr) { + error = dump_write(di, ptr, 0, dumplo, len); + if (error) + return (error); + dumplo += len; + ptr += len; + sz -= len; + } else { + panic("pa is not supported"); + } + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf(" (CTRL-C to abort) "); + } + + return (0); +} + +void +minidumpsys(struct dumperinfo *di) +{ + struct minidumphdr mdhdr; + uint64_t dumpsize; + uint32_t ptesize; + uint32_t bits; + vm_paddr_t pa; + vm_offset_t prev_pte = 0; + uint32_t count = 0; + vm_offset_t va; + pt_entry_t *pte; + int i, bit, error; + void *dump_va; + + /* Flush cache */ + mips_dcache_wbinv_all(); + + counter = 0; + /* Walk page table pages, set bits in vm_page_dump */ + ptesize = 0; + + for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) { + ptesize += PAGE_SIZE; + pte = pmap_pte(kernel_pmap, va); + KASSERT(pte != NULL, ("pte for %jx is NULL", (uintmax_t)va)); + for (i = 0; i < NPTEPG; i++) { + if (pte_test(&pte[i], PTE_V)) { + pa = TLBLO_PTE_TO_PA(pte[i]); + if (is_dumpable(pa)) + dump_add_page(pa); + } + } + } + + /* + * Now mark pages from 0 to phys_avail[0], that's where kernel + * and pages allocated by pmap_steal reside + */ + for (pa = 0; pa < phys_avail[0]; pa += PAGE_SIZE) { + if (is_dumpable(pa)) + dump_add_page(pa); + } + + /* Calculate dump size. */ + dumpsize = ptesize; + dumpsize += round_page(msgbufp->msg_size); + dumpsize += round_page(vm_page_dump_size); + + for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { + bits = vm_page_dump[i]; + while (bits) { + bit = ffs(bits) - 1; + pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + + bit) * PAGE_SIZE; + /* Clear out undumpable pages now if needed */ + if (is_dumpable(pa)) + dumpsize += PAGE_SIZE; + else + dump_drop_page(pa); + bits &= ~(1ul << bit); + } + } + + dumpsize += PAGE_SIZE; + + /* Determine dump offset on device. */ + if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + + origdumplo = dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; + progress = dumpsize; + + /* Initialize mdhdr */ + bzero(&mdhdr, sizeof(mdhdr)); + strcpy(mdhdr.magic, MINIDUMP_MAGIC); + mdhdr.version = MINIDUMP_VERSION; + mdhdr.msgbufsize = msgbufp->msg_size; + mdhdr.bitmapsize = vm_page_dump_size; + mdhdr.ptesize = ptesize; + mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS; + + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_MIPS_VERSION, dumpsize, + di->blocksize); + + printf("Physical memory: %ju MB\n", + (uintmax_t)ptoa((uintmax_t)physmem) / 1048576); + printf("Dumping %llu MB:", (long long)dumpsize >> 20); + + /* Dump leader */ + error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Dump my header */ + bzero(tmpbuffer, sizeof(tmpbuffer)); + bcopy(&mdhdr, tmpbuffer, sizeof(mdhdr)); + error = write_buffer(di, tmpbuffer, PAGE_SIZE); + if (error) + goto fail; + + /* Dump msgbuf up front */ + error = write_buffer(di, (char *)msgbufp->msg_ptr, + round_page(msgbufp->msg_size)); + if (error) + goto fail; + + /* Dump bitmap */ + error = write_buffer(di, (char *)vm_page_dump, + round_page(vm_page_dump_size)); + if (error) + goto fail; + + /* Dump kernel page table pages */ + for (va = VM_MIN_KERNEL_ADDRESS; va < kernel_vm_end; va += NBPDR) { + pte = pmap_pte(kernel_pmap, va); + KASSERT(pte != NULL, ("pte for %jx is NULL", (uintmax_t)va)); + if (!count) { + prev_pte = (vm_offset_t)pte; + count++; + } + else { + if ((vm_offset_t)pte == (prev_pte + count * PAGE_SIZE)) + count++; + else { + error = write_buffer(di, (char*)prev_pte, + count * PAGE_SIZE); + if (error) + goto fail; + count = 1; + prev_pte = (vm_offset_t)pte; + } + } + } + + if (count) { + error = write_buffer(di, (char*)prev_pte, count * PAGE_SIZE); + if (error) + goto fail; + count = 0; + prev_pte = 0; + } + + /* Dump memory chunks page by page*/ + for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { + bits = vm_page_dump[i]; + while (bits) { + bit = ffs(bits) - 1; + pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + + bit) * PAGE_SIZE; + dump_va = pmap_kenter_temporary(pa, 0); + error = write_buffer(di, dump_va, PAGE_SIZE); + if (error) + goto fail; + pmap_kenter_temporary_free(pa); + bits &= ~(1ul << bit); + } + } + + /* Dump trailer */ + error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Signal completion, signoff and exit stage left. */ + dump_write(di, NULL, 0, 0, 0); + printf("\nDump complete\n"); + return; + +fail: + if (error < 0) + error = -error; + + if (error == ECANCELED) + printf("\nDump aborted\n"); + else if (error == ENOSPC) + printf("\nDump failed. Partition too small.\n"); + else + printf("\n** DUMP FAILED (ERROR %d) **\n", error); +} Modified: head/sys/sys/kerneldump.h ============================================================================== --- head/sys/sys/kerneldump.h Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/sys/kerneldump.h Sun Nov 7 03:09:02 2010 (r214903) @@ -71,6 +71,7 @@ struct kerneldumpheader { #define KERNELDUMP_ARM_VERSION 1 #define KERNELDUMP_I386_VERSION 2 #define KERNELDUMP_IA64_VERSION 1 +#define KERNELDUMP_MIPS_VERSION 1 #define KERNELDUMP_POWERPC_VERSION 1 #define KERNELDUMP_SPARC64_VERSION 1 #define KERNELDUMP_TEXT_VERSION 1 Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/vm/vm_page.c Sun Nov 7 03:09:02 2010 (r214903) @@ -359,7 +359,8 @@ vm_page_startup(vm_offset_t vaddr) bzero((void *)mapped, end - new_end); uma_startup((void *)mapped, boot_pages); -#if defined(__amd64__) || defined(__i386__) || defined(__arm__) +#if defined(__amd64__) || defined(__i386__) || defined(__arm__) || \ + defined(__mips__) /* * Allocate a bitmap to indicate that a random physical page * needs to be included in a minidump. From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 03:26:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 476DD106566C; Sun, 7 Nov 2010 03:26:23 +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 348418FC14; Sun, 7 Nov 2010 03:26:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA73QNPL012381; Sun, 7 Nov 2010 03:26:23 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA73QNcK012376; Sun, 7 Nov 2010 03:26:23 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011070326.oA73QNcK012376@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 03:26: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: r214904 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 03:26:23 -0000 Author: gonzo Date: Sun Nov 7 03:26:22 2010 New Revision: 214904 URL: http://svn.freebsd.org/changeset/base/214904 Log: Add minidump support for MIPS Added: head/lib/libkvm/kvm_minidump_mips.c (contents, props changed) Modified: head/lib/libkvm/Makefile head/lib/libkvm/kvm_mips.c head/lib/libkvm/kvm_private.h Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Sun Nov 7 03:09:02 2010 (r214903) +++ head/lib/libkvm/Makefile Sun Nov 7 03:26:22 2010 (r214904) @@ -20,7 +20,7 @@ WARNS?= 0 SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "arm" + ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" SRCS+= kvm_minidump_${KVM_ARCH}.c .endif INCS= kvm.h Added: head/lib/libkvm/kvm_minidump_mips.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_minidump_mips.c Sun Nov 7 03:26:22 2010 (r214904) @@ -0,0 +1,275 @@ +/*- + * Copyright (c) 2010 Oleksandr Tymoshenko + * Copyright (c) 2008 Semihalf, Grzegorz Bernacki + * Copyright (c) 2006 Peter Wemm + * + * 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. + * + * From: FreeBSD: src/lib/libkvm/kvm_minidump_arm.c r214223 + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * MIPS machine dependent routines for kvm and minidumps. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include "kvm_private.h" + +struct hpte { + struct hpte *next; + uint64_t pa; + int64_t off; +}; + +#define HPT_SIZE 1024 + +/* minidump must be the first field */ +struct vmstate { + int minidump; /* 1 = minidump mode */ + struct minidumphdr hdr; + void *hpt_head[HPT_SIZE]; + uint32_t *bitmap; + void *ptemap; +}; + +static void +hpt_insert(kvm_t *kd, uint64_t pa, int64_t off) +{ + struct hpte *hpte; + uint32_t fnv = FNV1_32_INIT; + + fnv = fnv_32_buf(&pa, sizeof(pa), fnv); + fnv &= (HPT_SIZE - 1); + hpte = malloc(sizeof(*hpte)); + hpte->pa = pa; + hpte->off = off; + hpte->next = kd->vmst->hpt_head[fnv]; + kd->vmst->hpt_head[fnv] = hpte; +} + +static int64_t +hpt_find(kvm_t *kd, uint64_t pa) +{ + struct hpte *hpte; + uint32_t fnv = FNV1_32_INIT; + + fnv = fnv_32_buf(&pa, sizeof(pa), fnv); + fnv &= (HPT_SIZE - 1); + for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) + if (pa == hpte->pa) + return (hpte->off); + + return (-1); +} + +static int +inithash(kvm_t *kd, uint32_t *base, int len, off_t off) +{ + uint64_t idx, pa; + uint32_t bit, bits; + + for (idx = 0; idx < len / sizeof(*base); idx++) { + bits = base[idx]; + while (bits) { + bit = ffs(bits) - 1; + bits &= ~(1ul << bit); + pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE; + hpt_insert(kd, pa, off); + off += PAGE_SIZE; + } + } + + return (off); +} + +void +_kvm_minidump_freevtop(kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + if (vm->bitmap) + free(vm->bitmap); + if (vm->ptemap) + free(vm->ptemap); + free(vm); + kd->vmst = NULL; +} + +int +_kvm_minidump_initvtop(kvm_t *kd) +{ + u_long pa; + struct vmstate *vmst; + off_t off; + + vmst = _kvm_malloc(kd, sizeof(*vmst)); + if (vmst == 0) { + _kvm_err(kd, kd->program, "cannot allocate vm"); + return (-1); + } + + kd->vmst = vmst; + vmst->minidump = 1; + + off = lseek(kd->pmfd, 0, SEEK_CUR); + if (pread(kd->pmfd, &vmst->hdr, + sizeof(vmst->hdr), 0) != sizeof(vmst->hdr)) { + _kvm_err(kd, kd->program, "cannot read dump header"); + return (-1); + } + + if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, + sizeof(vmst->hdr.magic)) != 0) { + _kvm_err(kd, kd->program, "not a minidump for this platform"); + return (-1); + } + if (vmst->hdr.version != MINIDUMP_VERSION) { + _kvm_err(kd, kd->program, "wrong minidump version. " + "Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); + return (-1); + } + + /* Skip header and msgbuf */ + off = PAGE_SIZE + round_page(vmst->hdr.msgbufsize); + + vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize); + if (vmst->bitmap == NULL) { + _kvm_err(kd, kd->program, "cannot allocate %d bytes for " + "bitmap", vmst->hdr.bitmapsize); + return (-1); + } + + if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != + vmst->hdr.bitmapsize) { + _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", + vmst->hdr.bitmapsize); + return (-1); + } + off += round_page(vmst->hdr.bitmapsize); + + vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); + if (vmst->ptemap == NULL) { + _kvm_err(kd, kd->program, "cannot allocate %d bytes for " + "ptemap", vmst->hdr.ptesize); + return (-1); + } + + if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != + vmst->hdr.ptesize) { + _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", + vmst->hdr.ptesize); + return (-1); + } + + off += vmst->hdr.ptesize; + + /* Build physical address hash table for sparse pages */ + inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off); + + return (0); +} + +int +_kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa) +{ + struct vmstate *vm; + pt_entry_t pte; + u_long offset, pteindex, a; + off_t ofs; + pt_entry_t *ptemap; + int i; + + if (ISALIVE(kd)) { + _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); + return (0); + } + + offset = va & PAGE_MASK; + /* Operate with page-aligned address */ + va &= ~PAGE_MASK; + + vm = kd->vmst; + ptemap = vm->ptemap; + +#if defined(__mips_n64) + if (va >= MIPS_XKPHYS_START && va < MIPS_XKPHYS_END) + a = (MIPS_XKPHYS_TO_PHYS(va)); + else +#endif + if (va >= MIPS_KSEG0_START && va < MIPS_KSEG0_END) + a = (MIPS_KSEG0_TO_PHYS(va)); + else if (va >= MIPS_KSEG1_START && va < MIPS_KSEG1_END) + a = (MIPS_KSEG1_TO_PHYS(va)); + else if (va >= vm->hdr.kernbase) { + pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT; + pte = ptemap[pteindex]; + if (!pte) { + _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid"); + goto invalid; + } + + a = TLBLO_PTE_TO_PA(pte); + + } else { + _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx " + "not minidumped", va); + return (0); + } + + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: physical " + "address 0x%lx not in minidump", a); + goto invalid; + } + + *pa = ofs + offset; + return (PAGE_SIZE - offset); + + +invalid: + _kvm_err(kd, 0, "invalid address (0x%lx)", va); + return (0); +} Modified: head/lib/libkvm/kvm_mips.c ============================================================================== --- head/lib/libkvm/kvm_mips.c Sun Nov 7 03:09:02 2010 (r214903) +++ head/lib/libkvm/kvm_mips.c Sun Nov 7 03:26:22 2010 (r214904) @@ -49,29 +49,62 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "kvm_private.h" +/* minidump must be the first item! */ +struct vmstate { + int minidump; /* 1 = minidump mode */ + void *mmapbase; + size_t mmapsize; +}; + void _kvm_freevtop(kvm_t *kd) { - - _kvm_err(kd, 0, "Unimplemented function"); + if (kd->vmst != 0) { + if (kd->vmst->minidump) + return (_kvm_minidump_freevtop(kd)); + if (kd->vmst->mmapbase != NULL) + munmap(kd->vmst->mmapbase, kd->vmst->mmapsize); + free(kd->vmst); + kd->vmst = NULL; + } } int _kvm_initvtop(kvm_t *kd) { + char minihdr[8]; - _kvm_err(kd, 0, "Unimplemented function"); - return (0); + if (!kd->rawdump) { + if (pread(kd->pmfd, &minihdr, 8, 0) == 8) { + if (memcmp(&minihdr, "minidump", 8) == 0) + return (_kvm_minidump_initvtop(kd)); + } else { + _kvm_err(kd, kd->program, "cannot read header"); + return (-1); + } + } + + _kvm_err(kd, 0, "_kvm_initvtop: Unsupported image type"); + return (-1); } int -_kvm_kvatop(kvm_t *kd, u_long va __unused, off_t *pa __unused) +_kvm_kvatop(kvm_t *kd, u_long va , off_t *pa) { - _kvm_err(kd, 0, "Unimplemented function"); + u_long offset = va & (PAGE_SIZE - 1); + struct vmstate *vm = kd->vmst; + + if (kd->vmst->minidump) + return _kvm_minidump_kvatop(kd, va, pa); + + + _kvm_err(kd, 0, "_kvm_kvatop: Unsupported image type"); return (0); } @@ -81,10 +114,8 @@ _kvm_kvatop(kvm_t *kd, u_long va __unuse * have to deal with these NOT being constants! (i.e. m68k) */ int -_kvm_mdopen(kd) - kvm_t *kd; +_kvm_mdopen(kvm_t *kd __unused) { - _kvm_err(kd, 0, "Unimplemented function"); return (0); } Modified: head/lib/libkvm/kvm_private.h ============================================================================== --- head/lib/libkvm/kvm_private.h Sun Nov 7 03:09:02 2010 (r214903) +++ head/lib/libkvm/kvm_private.h Sun Nov 7 03:26:22 2010 (r214904) @@ -104,7 +104,8 @@ uintptr_t _kvm_vnet_validaddr(kvm_t *, u int _kvm_dpcpu_initialized(kvm_t *, int); uintptr_t _kvm_dpcpu_validaddr(kvm_t *, uintptr_t); -#if defined(__amd64__) || defined(__i386__) || defined(__arm__) +#if defined(__amd64__) || defined(__i386__) || defined(__arm__) || \ + defined(__mips__) void _kvm_minidump_freevtop(kvm_t *); int _kvm_minidump_initvtop(kvm_t *); int _kvm_minidump_kvatop(kvm_t *, u_long, off_t *); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 03:40:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A3051065672; Sun, 7 Nov 2010 03:40:37 +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 77FA38FC12; Sun, 7 Nov 2010 03:40:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA73ebMx013350; Sun, 7 Nov 2010 03:40:37 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA73ebRw013346; Sun, 7 Nov 2010 03:40:37 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201011070340.oA73ebRw013346@svn.freebsd.org> From: Tim Kientzle Date: Sun, 7 Nov 2010 03:40: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: r214905 - in head/lib/libarchive: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 03:40:37 -0000 Author: kientzle Date: Sun Nov 7 03:40:37 2010 New Revision: 214905 URL: http://svn.freebsd.org/changeset/base/214905 Log: If the Zip reader doesn't see a PK signature block because there's inter-entry garbage, just scan forward to find the next one. This allows us to handle a lot of Zip archives that have been modified in-place. Thanks to: Gleb Kurtsou for sending me a sample archive Added: head/lib/libarchive/test/test_compat_zip_2.zip.uu (contents, props changed) Modified: head/lib/libarchive/archive_read_support_format_zip.c head/lib/libarchive/test/test_compat_zip.c Modified: head/lib/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_zip.c Sun Nov 7 03:26:22 2010 (r214904) +++ head/lib/libarchive/archive_read_support_format_zip.c Sun Nov 7 03:40:37 2010 (r214905) @@ -128,6 +128,7 @@ static int archive_read_format_zip_read_ static int archive_read_format_zip_read_data_skip(struct archive_read *a); static int archive_read_format_zip_read_header(struct archive_read *, struct archive_entry *); +static int search_next_signature(struct archive_read *); static int zip_read_data_deflate(struct archive_read *a, const void **buff, size_t *size, off_t *offset); static int zip_read_data_none(struct archive_read *a, const void **buff, @@ -317,10 +318,17 @@ archive_read_format_zip_read_header(stru signature = (const char *)h; } + /* If we don't see a PK signature here, scan forward. */ if (signature[0] != 'P' || signature[1] != 'K') { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "Bad ZIP file"); - return (ARCHIVE_FATAL); + r = search_next_signature(a); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Bad ZIP file"); + return (ARCHIVE_FATAL); + } + if ((h = __archive_read_ahead(a, 4, NULL)) == NULL) + return (ARCHIVE_FATAL); + signature = (const char *)h; } /* @@ -375,6 +383,42 @@ archive_read_format_zip_read_header(stru } static int +search_next_signature(struct archive_read *a) +{ + const void *h; + const char *p, *q; + size_t skip; + ssize_t bytes; + int64_t skipped = 0; + + for (;;) { + h = __archive_read_ahead(a, 4, &bytes); + if (h == NULL) + return (ARCHIVE_FATAL); + p = h; + q = p + bytes; + + while (p + 4 <= q) { + if (p[0] == 'P' && p[1] == 'K') { + if ((p[2] == '\001' && p[3] == '\002') + || (p[2] == '\003' && p[3] == '\004') + || (p[2] == '\005' && p[3] == '\006') + || (p[2] == '\007' && p[3] == '\010') + || (p[2] == '0' && p[3] == '0')) { + skip = p - (const char *)h; + __archive_read_consume(a, skip); + return (ARCHIVE_OK); + } + } + ++p; + } + skip = p - (const char *)h; + __archive_read_consume(a, skip); + skipped += skip; + } +} + +static int zip_read_file_header(struct archive_read *a, struct archive_entry *entry, struct zip *zip) { @@ -888,6 +932,9 @@ process_extra(const void* extra, struct if (datasize >= 4) zip->gid = archive_le16dec(p + offset + 2); break; + case 0x7875: + /* Info-Zip Unix Extra Field (type 3) "ux". */ + break; default: break; } Modified: head/lib/libarchive/test/test_compat_zip.c ============================================================================== --- head/lib/libarchive/test/test_compat_zip.c Sun Nov 7 03:26:22 2010 (r214904) +++ head/lib/libarchive/test/test_compat_zip.c Sun Nov 7 03:40:37 2010 (r214905) @@ -71,10 +71,43 @@ finish: #endif } +/* + * Verify that we skip junk between entries. The compat_zip_2.zip file + * has several bytes of junk between 'file1' and 'file2'. Such + * junk is routinely introduced by some Zip writers when they manipulate + * existing zip archives. + */ +static void +test_compat_zip_2(void) +{ + char name[] = "test_compat_zip_2.zip"; + struct archive_entry *ae; + struct archive *a; + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); + extract_reference_file(name); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240)); + + /* Read first entry. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file1", archive_entry_pathname(ae)); + + /* Read first entry. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file2", archive_entry_pathname(ae)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + DEFINE_TEST(test_compat_zip) { test_compat_zip_1(); + test_compat_zip_2(); } Added: head/lib/libarchive/test/test_compat_zip_2.zip.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/test/test_compat_zip_2.zip.uu Sun Nov 7 03:40:37 2010 (r214905) @@ -0,0 +1,10 @@ +$FreeBSD$ + +begin 644 test_compat_zip_2.zip +M4$L#!`H``````'V59CT````````````````%````9FEL93$M2E5.2RU02P,$ +M"@``````@95F/<>D!,D&````!@````4```!F:6QE,F9I;&4R"E!+`0(>`PH` +M`````'V59CT````````````````%``````````````"D@0````!F:6QE,5!+ +M`0(>`PH``````(&59CW'I`3)!@````8````%``````````````"D@2D```!F +::6QE,E!+!08``````@`"`&8```!2```````` +` +end From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 04:09:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C17C106567A; Sun, 7 Nov 2010 04:09:46 +0000 (UTC) (envelope-from swell.k@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 E0B778FC12; Sun, 7 Nov 2010 04:09:45 +0000 (UTC) Received: by ywh2 with SMTP id 2so2998508ywh.13 for ; Sat, 06 Nov 2010 21:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=ydTEUQzrK+zOVsvg0sI3hnN7CRiwANdHzVw1kynBnxA=; b=B3/eAjwVyvZM94Ctmv6y/gM+lPwJCnNROc0P71on5kIfUQCOaCAcyG2CIbGKLAr4yJ P78ZUG20aQ/dmCvk/PWfiSt5eS0+7q7mKB9dvK2NGay5unPnI1f8m4S6NvtJKIuuOOts /vmPJovtlzLOCIgMMR34hxDg7nomYzEx3lCX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=df4REDT+LmkyMTe4KeCf35QJ61IYDxote99C7QxUc9F4wTHj386T9qCVX259McaYP5 bJEnVcUKn6AQrBJYd5sQmb2HAhTNZ6pNNYy60thnnLGGTIf1H8269WwciPeQkio1ACN8 CJNqC8Mx/KmT47ZlD8VkbkHiex/dTruTKc99A= Received: by 10.91.11.15 with SMTP id o15mr3418488agi.206.1289102984160; Sat, 06 Nov 2010 21:09:44 -0700 (PDT) Received: from localhost ([200.58.118.143]) by mx.google.com with ESMTPS id r18sm3960344ann.29.2010.11.06.21.09.35 (version=SSLv3 cipher=RC4-MD5); Sat, 06 Nov 2010 21:09:43 -0700 (PDT) From: Anonymous To: Tim Kientzle References: <201011070340.oA73ebRw013346@svn.freebsd.org> Date: Sun, 07 Nov 2010 07:09:24 +0300 In-Reply-To: <201011070340.oA73ebRw013346@svn.freebsd.org> (Tim Kientzle's message of "Sun, 7 Nov 2010 03:40:37 +0000 (UTC)") Message-ID: <86wroppyff.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214905 - in head/lib/libarchive: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 04:09:46 -0000 Tim Kientzle writes: > Author: kientzle > Date: Sun Nov 7 03:40:37 2010 > New Revision: 214905 > URL: http://svn.freebsd.org/changeset/base/214905 > > Log: > If the Zip reader doesn't see a PK signature block > because there's inter-entry garbage, just scan forward > to find the next one. This allows us to handle a lot > of Zip archives that have been modified in-place. It's unrelated but can you also look at archives produces by Mojo Setup? http://icculus.org/mojosetup/examples/ $ /usr/bin/unzip duke3d-mojosetup-linux-x86.bin Archive: duke3d-mojosetup-linux-x86.bin unzip: Unrecognized archive format zsh: exit 1 $ LOCALBASE/bin/unzip duke3d-mojosetup-linux-x86.bin Archive: duke3d-mojosetup-linux-x86.bin warning [duke3d-mojosetup-linux-x86.bin]: 157716 extra bytes at beginning or within zipfile (attempting to process anyway) creating: data/ inflating: data/duke3d_readme.txt inflating: data/duke3d.png inflating: data/mojosetup_readme.txt inflating: data/gpl.txt creating: guis/ inflating: guis/libmojosetupgui_ncurses.so inflating: guis/libmojosetupgui_gtkplus2.so creating: meta/ inflating: meta/splash.bmp creating: meta/xdg-utils/ inflating: meta/xdg-utils/xdg-desktop-menu inflating: meta/xdg-utils/xdg-open creating: scripts/ inflating: scripts/config.luac inflating: scripts/localization.luac inflating: scripts/mojosetup_init.luac inflating: scripts/app_localization.luac inflating: scripts/mojosetup_mainline.luac zsh: exit 1 From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 07:16:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92501106566C; Sun, 7 Nov 2010 07:16:35 +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 8130F8FC08; Sun, 7 Nov 2010 07:16:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA77GZDv024795; Sun, 7 Nov 2010 07:16:35 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA77GZhG024793; Sun, 7 Nov 2010 07:16:35 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201011070716.oA77GZhG024793@svn.freebsd.org> From: Joel Dahl Date: Sun, 7 Nov 2010 07:16: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: r214907 - head/usr.sbin/apmd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 07:16:35 -0000 Author: joel (doc committer) Date: Sun Nov 7 07:16:35 2010 New Revision: 214907 URL: http://svn.freebsd.org/changeset/base/214907 Log: Remove extraneous Aq. Modified: head/usr.sbin/apmd/apmd.8 Modified: head/usr.sbin/apmd/apmd.8 ============================================================================== --- head/usr.sbin/apmd/apmd.8 Sun Nov 7 06:46:52 2010 (r214906) +++ head/usr.sbin/apmd/apmd.8 Sun Nov 7 07:16:35 2010 (r214907) @@ -1,6 +1,6 @@ .\" Copyright (c) 1999 Mitsuru IWASAKI .\" Copyright (c) 1999 KOIE Hidetaka -.\" Copyright (c) 1999 Yoshihiko SARUMARU Aq +.\" Copyright (c) 1999 Yoshihiko SARUMARU .\" Copyright (c) 1999 Norihiro Kumagai .\" All rights reserved. .\" From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 10:49:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 906991065673; Sun, 7 Nov 2010 10:49:40 +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 64A168FC0A; Sun, 7 Nov 2010 10:49:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Ane22038729; Sun, 7 Nov 2010 10:49:40 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Ane6b038728; Sun, 7 Nov 2010 10:49:40 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201011071049.oA7Ane6b038728@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 7 Nov 2010 10:49: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: r214908 - head/usr.bin/objformat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 10:49:40 -0000 Author: uqs Date: Sun Nov 7 10:49:40 2010 New Revision: 214908 URL: http://svn.freebsd.org/changeset/base/214908 Log: Retire objformat(1), take two. It's been almost four years, and this placeholder has not been needed. Deleted: head/usr.bin/objformat/ From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 11:12:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F44A106566B; Sun, 7 Nov 2010 11:12:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 785618FC14; Sun, 7 Nov 2010 11:12:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7BCU06040098; Sun, 7 Nov 2010 11:12:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7BCTLa040057; Sun, 7 Nov 2010 11:12:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071112.oA7BCTLa040057@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 11:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214909 - in stable/8/sys: arm/xscale/ixp425 dev/ae dev/age dev/alc dev/ale dev/bfe dev/bge dev/bm dev/cas dev/dc dev/fxp dev/gem dev/hme dev/jme dev/mge dev/mii dev/msk dev/pcn dev/re ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 11:12:30 -0000 Author: marius Date: Sun Nov 7 11:12:29 2010 New Revision: 214909 URL: http://svn.freebsd.org/changeset/base/214909 Log: MFC: r213893, r213908, r214566, r214605, r214846 Convert the PHY drivers to honor the mii_flags passed down and convert the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214684) to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari Modified: stable/8/sys/arm/xscale/ixp425/if_npe.c stable/8/sys/dev/ae/if_ae.c stable/8/sys/dev/ae/if_aevar.h stable/8/sys/dev/age/if_age.c stable/8/sys/dev/alc/if_alc.c stable/8/sys/dev/ale/if_ale.c stable/8/sys/dev/bfe/if_bfe.c stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h stable/8/sys/dev/bm/if_bm.c stable/8/sys/dev/cas/if_cas.c stable/8/sys/dev/cas/if_casvar.h stable/8/sys/dev/dc/dcphy.c stable/8/sys/dev/dc/if_dc.c stable/8/sys/dev/dc/pnphy.c stable/8/sys/dev/fxp/if_fxp.c stable/8/sys/dev/gem/if_gem.c stable/8/sys/dev/gem/if_gemvar.h stable/8/sys/dev/hme/if_hme.c stable/8/sys/dev/jme/if_jme.c stable/8/sys/dev/mge/if_mge.c stable/8/sys/dev/mii/acphy.c stable/8/sys/dev/mii/amphy.c stable/8/sys/dev/mii/atphy.c stable/8/sys/dev/mii/axphy.c stable/8/sys/dev/mii/bmtphy.c stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/ciphy.c stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/exphy.c stable/8/sys/dev/mii/gentbi.c stable/8/sys/dev/mii/icsphy.c stable/8/sys/dev/mii/inphy.c stable/8/sys/dev/mii/ip1000phy.c stable/8/sys/dev/mii/jmphy.c stable/8/sys/dev/mii/lxtphy.c stable/8/sys/dev/mii/miivar.h stable/8/sys/dev/mii/mlphy.c stable/8/sys/dev/mii/nsgphy.c stable/8/sys/dev/mii/nsphy.c stable/8/sys/dev/mii/nsphyter.c stable/8/sys/dev/mii/pnaphy.c stable/8/sys/dev/mii/qsphy.c stable/8/sys/dev/mii/rgephy.c stable/8/sys/dev/mii/rlphy.c stable/8/sys/dev/mii/rlswitch.c stable/8/sys/dev/mii/ruephy.c stable/8/sys/dev/mii/smcphy.c stable/8/sys/dev/mii/tdkphy.c stable/8/sys/dev/mii/tlphy.c stable/8/sys/dev/mii/truephy.c stable/8/sys/dev/mii/ukphy.c stable/8/sys/dev/mii/xmphy.c stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/pcn/if_pcn.c stable/8/sys/dev/re/if_re.c stable/8/sys/dev/sk/if_sk.c stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/stge/if_stge.c stable/8/sys/dev/tsec/if_tsec.c stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vr/if_vr.c stable/8/sys/dev/vr/if_vrreg.h stable/8/sys/dev/xl/if_xl.c stable/8/sys/pci/if_rl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- stable/8/sys/arm/xscale/ixp425/if_npe.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/arm/xscale/ixp425/if_npe.c Sun Nov 7 11:12:29 2010 (r214909) @@ -137,7 +137,6 @@ struct npe_softc { int rx_freeqid; /* rx free buffers qid */ int tx_qid; /* tx qid */ int tx_doneqid; /* tx completed qid */ - int sc_phy; /* PHY id */ struct ifmib_iso_8802_3 mibdata; bus_dma_tag_t sc_stats_tag; /* bus dma tag for stats block */ struct npestats *sc_stats; @@ -668,7 +667,7 @@ static int npe_activate(device_t dev) { struct npe_softc *sc = device_get_softc(dev); - int error, i, macbase, miibase; + int error, i, macbase, miibase, phy; /* * Setup NEP ID, MAC, and MII bindings. We allow override @@ -693,8 +692,8 @@ npe_activate(device_t dev) } /* PHY */ - if (!override_unit(dev, "phy", &sc->sc_phy, 0, MII_NPHY-1)) - sc->sc_phy = npeconfig[sc->sc_npeid].phy; + if (!override_unit(dev, "phy", &phy, 0, MII_NPHY - 1)) + phy = npeconfig[sc->sc_npeid].phy; if (!override_addr(dev, "mii", &miibase)) miibase = npeconfig[sc->sc_npeid].miibase; device_printf(sc->sc_dev, "MII at 0x%x\n", miibase); @@ -721,10 +720,12 @@ npe_activate(device_t dev) return error; } - /* probe for PHY */ - if (mii_phy_probe(dev, &sc->sc_mii, npe_ifmedia_update, npe_ifmedia_status)) { - device_printf(dev, "cannot find PHY %d.\n", sc->sc_phy); - return ENXIO; + /* attach PHY */ + error = mii_attach(dev, &sc->sc_mii, sc->sc_ifp, npe_ifmedia_update, + npe_ifmedia_status, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); + return error; } error = npe_dma_setup(sc, &sc->txdma, "tx", npe_txbuf, NPE_MAXSEG); @@ -1700,8 +1701,6 @@ npe_miibus_readreg(device_t dev, int phy struct npe_softc *sc = device_get_softc(dev); uint32_t v; - if (phy != sc->sc_phy) /* XXX no auto-detect */ - return 0xffff; v = (phy << NPE_MII_ADDR_SHL) | (reg << NPE_MII_REG_SHL) | NPE_MII_GO; npe_mii_mdio_write(sc, NPE_MAC_MDIO_CMD, v); if (npe_mii_mdio_wait(sc)) @@ -1717,8 +1716,6 @@ npe_miibus_writereg(device_t dev, int ph struct npe_softc *sc = device_get_softc(dev); uint32_t v; - if (phy != sc->sc_phy) /* XXX */ - return (0); v = (phy << NPE_MII_ADDR_SHL) | (reg << NPE_MII_REG_SHL) | data | NPE_MII_WRITE | NPE_MII_GO; Modified: stable/8/sys/dev/ae/if_ae.c ============================================================================== --- stable/8/sys/dev/ae/if_ae.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/ae/if_ae.c Sun Nov 7 11:12:29 2010 (r214909) @@ -360,9 +360,6 @@ ae_attach(device_t dev) if (error != 0) goto fail; - /* Set default PHY address. */ - sc->phyaddr = AE_PHYADDR_DEFAULT; - ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "could not allocate ifnet structure.\n"); @@ -390,10 +387,11 @@ ae_attach(device_t dev) /* * Configure and attach MII bus. */ - error = mii_phy_probe(dev, &sc->miibus, ae_mediachange, - ae_mediastatus); + error = mii_attach(dev, &sc->miibus, ifp, ae_mediachange, + ae_mediastatus, BMSR_DEFCAPMASK, AE_PHYADDR_DEFAULT, + MII_OFFSET_ANY, 0); if (error != 0) { - device_printf(dev, "no PHY found.\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -813,9 +811,6 @@ ae_miibus_readreg(device_t dev, int phy, * Locking is done in upper layers. */ - if (phy != sc->phyaddr) - return (0); - val = ((reg << AE_MDIO_REGADDR_SHIFT) & AE_MDIO_REGADDR_MASK) | AE_MDIO_START | AE_MDIO_READ | AE_MDIO_SUP_PREAMBLE | ((AE_MDIO_CLK_25_4 << AE_MDIO_CLK_SHIFT) & AE_MDIO_CLK_MASK); @@ -851,9 +846,6 @@ ae_miibus_writereg(device_t dev, int phy * Locking is done in upper layers. */ - if (phy != sc->phyaddr) - return (0); - aereg = ((reg << AE_MDIO_REGADDR_SHIFT) & AE_MDIO_REGADDR_MASK) | AE_MDIO_START | AE_MDIO_SUP_PREAMBLE | ((AE_MDIO_CLK_25_4 << AE_MDIO_CLK_SHIFT) & AE_MDIO_CLK_MASK) | Modified: stable/8/sys/dev/ae/if_aevar.h ============================================================================== --- stable/8/sys/dev/ae/if_aevar.h Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/ae/if_aevar.h Sun Nov 7 11:12:29 2010 (r214909) @@ -111,7 +111,6 @@ typedef struct ae_softc { struct mtx mtx; - int phyaddr; uint8_t eaddr[ETHER_ADDR_LEN]; uint8_t flags; int if_flags; Modified: stable/8/sys/dev/age/if_age.c ============================================================================== --- stable/8/sys/dev/age/if_age.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/age/if_age.c Sun Nov 7 11:12:29 2010 (r214909) @@ -210,8 +210,6 @@ age_miibus_readreg(device_t dev, int phy int i; sc = device_get_softc(dev); - if (phy != sc->age_phyaddr) - return (0); CSR_WRITE_4(sc, AGE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -241,8 +239,6 @@ age_miibus_writereg(device_t dev, int ph int i; sc = device_get_softc(dev); - if (phy != sc->age_phyaddr) - return (0); CSR_WRITE_4(sc, AGE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | @@ -621,9 +617,11 @@ age_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->age_miibus, age_mediachange, - age_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->age_miibus, ifp, age_mediachange, + age_mediastatus, BMSR_DEFCAPMASK, sc->age_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/alc/if_alc.c Sun Nov 7 11:12:29 2010 (r214909) @@ -235,9 +235,6 @@ alc_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != sc->alc_phyaddr) - return (0); - /* * For AR8132 fast ethernet controller, do not report 1000baseT * capability to mii(4). Even though AR8132 uses the same @@ -274,9 +271,6 @@ alc_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != sc->alc_phyaddr) - return (0); - CSR_WRITE_4(sc, ALC_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -978,9 +972,11 @@ alc_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->alc_miibus, alc_mediachange, - alc_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->alc_miibus, ifp, alc_mediachange, + alc_mediastatus, BMSR_DEFCAPMASK, sc->alc_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/ale/if_ale.c ============================================================================== --- stable/8/sys/dev/ale/if_ale.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/ale/if_ale.c Sun Nov 7 11:12:29 2010 (r214909) @@ -208,9 +208,6 @@ ale_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != sc->ale_phyaddr) - return (0); - CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); for (i = ALE_PHY_TIMEOUT; i > 0; i--) { @@ -237,9 +234,6 @@ ale_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != sc->ale_phyaddr) - return (0); - CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -605,9 +599,11 @@ ale_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->ale_miibus, ale_mediachange, - ale_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->ale_miibus, ifp, ale_mediachange, + ale_mediastatus, BMSR_DEFCAPMASK, sc->ale_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/bfe/if_bfe.c ============================================================================== --- stable/8/sys/dev/bfe/if_bfe.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/bfe/if_bfe.c Sun Nov 7 11:12:29 2010 (r214909) @@ -505,10 +505,11 @@ bfe_attach(device_t dev) bfe_chip_reset(sc); BFE_UNLOCK(sc); - if (mii_phy_probe(dev, &sc->bfe_miibus, - bfe_ifmedia_upd, bfe_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->bfe_miibus, ifp, bfe_ifmedia_upd, + bfe_ifmedia_sts, BMSR_DEFCAPMASK, sc->bfe_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -631,8 +632,6 @@ bfe_miibus_readreg(device_t dev, int phy u_int32_t ret; sc = device_get_softc(dev); - if (phy != sc->bfe_phyaddr) - return (0); bfe_readphy(sc, reg, &ret); return (ret); @@ -644,8 +643,6 @@ bfe_miibus_writereg(device_t dev, int ph struct bfe_softc *sc; sc = device_get_softc(dev); - if (phy != sc->bfe_phyaddr) - return (0); bfe_writephy(sc, reg, val); return (0); Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/bge/if_bge.c Sun Nov 7 11:12:29 2010 (r214909) @@ -782,10 +782,6 @@ bge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - /* Prevent the probe from finding incorrect devices. */ - if (phy != sc->bge_phy_addr) - return (0); - /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -2572,7 +2568,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, msicount, reg, rid, trys; + int error, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2605,7 +2601,7 @@ bge_attach(device_t dev) sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); /* Set default PHY address. */ - sc->bge_phy_addr = 1; + phy_addr = 1; /* * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the @@ -2972,17 +2968,17 @@ bge_attach(device_t dev) again: bge_asf_driver_up(sc); - if (mii_phy_probe(dev, &sc->bge_miibus, - bge_ifmedia_upd, bge_ifmedia_sts)) { + error = (mii_attach(dev, &sc->bge_miibus, ifp, + bge_ifmedia_upd, bge_ifmedia_sts, BMSR_DEFCAPMASK, + phy_addr, MII_OFFSET_ANY, 0)); + if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, BMCR_RESET); goto again; } - - device_printf(sc->bge_dev, "MII without any PHY!\n"); - error = ENXIO; + device_printf(sc->bge_dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/bge/if_bgereg.h Sun Nov 7 11:12:29 2010 (r214909) @@ -2762,7 +2762,6 @@ struct bge_softc { uint32_t bge_tx_buf_ratio; uint32_t bge_mi_mode; int bge_if_flags; - int bge_phy_addr; int bge_txcnt; int bge_link; /* link state */ int bge_link_evt; /* pending link event */ Modified: stable/8/sys/dev/bm/if_bm.c ============================================================================== --- stable/8/sys/dev/bm/if_bm.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/bm/if_bm.c Sun Nov 7 11:12:29 2010 (r214909) @@ -594,11 +594,19 @@ bm_attach(device_t dev) /* reset the adapter */ bm_chip_setup(sc); - /* setup MII */ - error = mii_phy_probe(dev, &sc->sc_miibus, bm_ifmedia_upd, - bm_ifmedia_sts); - if (error != 0) - device_printf(dev,"PHY probe failed: %d\n", error); + /* + * Setup MII + * On Apple BMAC controllers, we end up in a weird state of + * partially-completed autonegotiation on boot. So we force + * autonegotation to try again. + */ + error = mii_attach(dev, &sc->sc_miibus, ifp, bm_ifmedia_upd, + bm_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, + MIIF_FORCEANEG); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); + return (error); + } sc->sc_mii = device_get_softc(sc->sc_miibus); Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/cas/if_cas.c Sun Nov 7 11:12:29 2010 (r214909) @@ -344,13 +344,9 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } - switch (sc->sc_variant) { - default: - sc->sc_phyad = -1; - break; - } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); } /* * Fall back on an internal PHY if no external PHY was found. @@ -368,13 +364,9 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } - switch (sc->sc_variant) { - default: - sc->sc_phyad = -1; - break; - } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); } } else { /* @@ -394,12 +386,12 @@ cas_attach(struct cas_softc *sc) CAS_WRITE_4(sc, CAS_PCS_CONF, CAS_PCS_CONF_EN); CAS_BARRIER(sc, CAS_PCS_CONF, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - sc->sc_phyad = CAS_PHYAD_EXTERNAL; - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + CAS_PHYAD_EXTERNAL, MII_OFFSET_ANY, 0); } if (error != 0) { - device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxmap; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -2172,9 +2164,6 @@ cas_mii_readreg(device_t dev, int phy, i #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & CAS_SERDES) != 0) { switch (reg) { case MII_BMCR: @@ -2233,9 +2222,6 @@ cas_mii_writereg(device_t dev, int phy, #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & CAS_SERDES) != 0) { switch (reg) { case MII_BMSR: @@ -2318,8 +2304,7 @@ cas_mii_statchg(device_t dev) #ifdef CAS_DEBUG if ((ifp->if_flags & IFF_DEBUG) != 0) - device_printf(sc->sc_dev, "%s: status change: PHY = %d\n", - __func__, sc->sc_phyad); + device_printf(sc->sc_dev, "%s: status changen", __func__); #endif if ((sc->sc_mii->mii_media_status & IFM_ACTIVE) != 0 && Modified: stable/8/sys/dev/cas/if_casvar.h ============================================================================== --- stable/8/sys/dev/cas/if_casvar.h Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/cas/if_casvar.h Sun Nov 7 11:12:29 2010 (r214909) @@ -154,8 +154,6 @@ struct cas_softc { bus_dma_tag_t sc_cdmatag; /* control data bus DMA tag */ bus_dmamap_t sc_dmamap; /* bus DMA handle */ - u_int sc_phyad; /* PHY to use or -1 for any */ - u_int sc_variant; #define CAS_UNKNOWN 0 /* don't know */ #define CAS_CAS 1 /* Sun Cassini */ Modified: stable/8/sys/dev/dc/dcphy.c ============================================================================== --- stable/8/sys/dev/dc/dcphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/dc/dcphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -149,6 +149,7 @@ dcphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = dcphy_service; @@ -211,7 +212,6 @@ dcphy_service(struct mii_softc *sc, stru if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; - sc->mii_flags = 0; mii->mii_media_active = IFM_NONE; mode = CSR_READ_4(dc_sc, DC_NETCFG); mode &= ~(DC_NETCFG_FULLDUPLEX | DC_NETCFG_PORTSEL | Modified: stable/8/sys/dev/dc/if_dc.c ============================================================================== --- stable/8/sys/dev/dc/if_dc.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/dc/if_dc.c Sun Nov 7 11:12:29 2010 (r214909) @@ -778,26 +778,6 @@ dc_miibus_readreg(device_t dev, int phy, sc = device_get_softc(dev); bzero(&frame, sizeof(frame)); - /* - * Note: both the AL981 and AN983 have internal PHYs, - * however the AL981 provides direct access to the PHY - * registers while the AN983 uses a serial MII interface. - * The AN983's MII interface is also buggy in that you - * can read from any MII address (0 to 31), but only address 1 - * behaves normally. To deal with both cases, we pretend - * that the PHY is at MII address 1. - */ - if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) - return (0); - - /* - * Note: the ukphy probes of the RS7112 report a PHY at - * MII address 0 (possibly HomePNA?) and 1 (ethernet) - * so we only respond to correct one. - */ - if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR) - return (0); - if (sc->dc_pmode != DC_PMODE_MII) { if (phy == (MII_NPHY - 1)) { switch (reg) { @@ -900,12 +880,6 @@ dc_miibus_writereg(device_t dev, int phy sc = device_get_softc(dev); bzero(&frame, sizeof(frame)); - if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) - return (0); - - if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR) - return (0); - if (DC_IS_PNIC(sc)) { CSR_WRITE_4(sc, DC_PN_MII, DC_PN_MIIOPCODE_WRITE | (phy << 23) | (reg << 10) | data); @@ -1814,14 +1788,12 @@ dc_dma_map_addr(void *arg, bus_dma_segme static int dc_attach(device_t dev) { - int tmp = 0; uint32_t eaddr[(ETHER_ADDR_LEN+3)/4]; u_int32_t command; struct dc_softc *sc; struct ifnet *ifp; u_int32_t reg, revision; - int error = 0, rid, mac_offset; - int i; + int error, i, mac_offset, phy, rid, tmp; u_int8_t *mac; sc = device_get_softc(dev); @@ -2202,6 +2174,7 @@ dc_attach(device_t dev) * old selection (SIA only or SIA/SYM) and attach the dcphy * driver instead. */ + tmp = 0; if (DC_IS_INTEL(sc)) { dc_apply_fixup(sc, IFM_AUTO); tmp = sc->dc_pmode; @@ -2210,7 +2183,7 @@ dc_attach(device_t dev) /* * Setup General Purpose port mode and data so the tulip can talk - * to the MII. This needs to be done before mii_phy_probe so that + * to the MII. This needs to be done before mii_attach so that * we can actually see them. */ if (DC_IS_XIRCOM(sc)) { @@ -2222,16 +2195,37 @@ dc_attach(device_t dev) DELAY(10); } - error = mii_phy_probe(dev, &sc->dc_miibus, - dc_ifmedia_upd, dc_ifmedia_sts); + phy = MII_PHY_ANY; + /* + * Note: both the AL981 and AN983 have internal PHYs, however the + * AL981 provides direct access to the PHY registers while the AN983 + * uses a serial MII interface. The AN983's MII interface is also + * buggy in that you can read from any MII address (0 to 31), but + * only address 1 behaves normally. To deal with both cases, we + * pretend that the PHY is at MII address 1. + */ + if (DC_IS_ADMTEK(sc)) + phy = DC_ADMTEK_PHYADDR; + + /* + * Note: the ukphy probes of the RS7112 report a PHY at MII address + * 0 (possibly HomePNA?) and 1 (ethernet) so we only respond to the + * correct one. + */ + if (DC_IS_CONEXANT(sc)) + phy = DC_CONEXANT_PHYADDR; + + error = mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); if (error && DC_IS_INTEL(sc)) { sc->dc_pmode = tmp; if (sc->dc_pmode != DC_PMODE_SIA) sc->dc_pmode = DC_PMODE_SYM; sc->dc_flags |= DC_21143_NWAY; - mii_phy_probe(dev, &sc->dc_miibus, - dc_ifmedia_upd, dc_ifmedia_sts); + mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); /* * For non-MII cards, we need to have the 21143 * drive the LEDs. Except there are some systems @@ -2246,7 +2240,7 @@ dc_attach(device_t dev) } if (error) { - device_printf(dev, "MII without any PHY!\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/dc/pnphy.c ============================================================================== --- stable/8/sys/dev/dc/pnphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/dc/pnphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -132,6 +132,7 @@ pnphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = pnphy_service; @@ -169,8 +170,6 @@ pnphy_service(struct mii_softc *sc, stru if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; - sc->mii_flags = 0; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: /* NWAY is busted on this chip */ Modified: stable/8/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/8/sys/dev/fxp/if_fxp.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/fxp/if_fxp.c Sun Nov 7 11:12:29 2010 (r214909) @@ -804,10 +804,14 @@ fxp_attach(device_t dev) ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_MANUAL, 0, NULL); ifmedia_set(&sc->sc_media, IFM_ETHER|IFM_MANUAL); } else { - if (mii_phy_probe(dev, &sc->miibus, fxp_ifmedia_upd, - fxp_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + /* + * i82557 wedge when isolating all of their PHYs. + */ + error = mii_attach(dev, &sc->miibus, ifp, fxp_ifmedia_upd, + fxp_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, MIIF_NOISOLATE); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } } Modified: stable/8/sys/dev/gem/if_gem.c ============================================================================== --- stable/8/sys/dev/gem/if_gem.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/gem/if_gem.c Sun Nov 7 11:12:29 2010 (r214909) @@ -149,7 +149,7 @@ gem_attach(struct gem_softc *sc) { struct gem_txsoft *txs; struct ifnet *ifp; - int error, i; + int error, i, phy; uint32_t v; if (bootverbose) @@ -294,14 +294,15 @@ gem_attach(struct gem_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); switch (sc->sc_variant) { case GEM_SUN_ERI: - sc->sc_phyad = GEM_PHYAD_EXTERNAL; + phy = GEM_PHYAD_EXTERNAL; break; default: - sc->sc_phyad = -1; + phy = MII_PHY_ANY; break; } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, phy, + MII_OFFSET_ANY, 0); } /* @@ -318,17 +319,18 @@ gem_attach(struct gem_softc *sc) switch (sc->sc_variant) { case GEM_SUN_ERI: case GEM_APPLE_K2_GMAC: - sc->sc_phyad = GEM_PHYAD_INTERNAL; + phy = GEM_PHYAD_INTERNAL; break; case GEM_APPLE_GMAC: - sc->sc_phyad = GEM_PHYAD_EXTERNAL; + phy = GEM_PHYAD_EXTERNAL; break; default: - sc->sc_phyad = -1; + phy = MII_PHY_ANY; break; } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, phy, + MII_OFFSET_ANY, 0); } /* @@ -348,12 +350,12 @@ gem_attach(struct gem_softc *sc) GEM_BANK1_BARRIER(sc, GEM_MII_CONFIG, 4, BUS_SPACE_BARRIER_WRITE); sc->sc_flags |= GEM_SERDES; - sc->sc_phyad = GEM_PHYAD_EXTERNAL; - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, + GEM_PHYAD_EXTERNAL, MII_OFFSET_ANY, 0); } if (error != 0) { - device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxd; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -1848,9 +1850,6 @@ gem_mii_readreg(device_t dev, int phy, i #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & GEM_SERDES) != 0) { switch (reg) { case MII_BMCR: @@ -1909,9 +1908,6 @@ gem_mii_writereg(device_t dev, int phy, #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & GEM_SERDES) != 0) { switch (reg) { case MII_BMSR: @@ -1992,8 +1988,7 @@ gem_mii_statchg(device_t dev) #ifdef GEM_DEBUG if ((sc->sc_ifp->if_flags & IFF_DEBUG) != 0) - device_printf(sc->sc_dev, "%s: status change: PHY = %d\n", - __func__, sc->sc_phyad); + device_printf(sc->sc_dev, "%s: status change\n", __func__); #endif if ((sc->sc_mii->mii_media_status & IFM_ACTIVE) != 0 && Modified: stable/8/sys/dev/gem/if_gemvar.h ============================================================================== --- stable/8/sys/dev/gem/if_gemvar.h Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/gem/if_gemvar.h Sun Nov 7 11:12:29 2010 (r214909) @@ -126,8 +126,6 @@ struct gem_softc { bus_dma_tag_t sc_cdmatag; /* control data bus DMA tag */ bus_dmamap_t sc_dmamap; /* bus DMA handle */ - int sc_phyad; /* PHY to use or -1 for any */ - u_int sc_variant; #define GEM_UNKNOWN 0 /* don't know */ #define GEM_SUN_GEM 1 /* Sun GEM */ Modified: stable/8/sys/dev/hme/if_hme.c ============================================================================== --- stable/8/sys/dev/hme/if_hme.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/hme/if_hme.c Sun Nov 7 11:12:29 2010 (r214909) @@ -315,9 +315,20 @@ hme_config(struct hme_softc *sc) hme_mifinit(sc); - if ((error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, hme_mediachange, - hme_mediastatus)) != 0) { - device_printf(sc->sc_dev, "phy probe failed: %d\n", error); + /* + * DP83840A used with HME chips don't advertise their media + * capabilities themselves properly so force writing the ANAR + * according to the BMSR in mii_phy_setmedia(). + */ + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, hme_mediachange, + hme_mediastatus, BMSR_DEFCAPMASK, HME_PHYAD_EXTERNAL, + MII_OFFSET_ANY, MIIF_FORCEANEG); + i = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, hme_mediachange, + hme_mediastatus, BMSR_DEFCAPMASK, HME_PHYAD_INTERNAL, + MII_OFFSET_ANY, MIIF_FORCEANEG); + if (error != 0 && i != 0) { + error = ENXIO; + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxdesc; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -1404,10 +1415,6 @@ hme_mii_readreg(device_t dev, int phy, i int n; u_int32_t v; - /* We can at most have two PHYs. */ - if (phy != HME_PHYAD_EXTERNAL && phy != HME_PHYAD_INTERNAL) - return (0); - sc = device_get_softc(dev); /* Select the desired PHY in the MIF configuration register */ v = HME_MIF_READ_4(sc, HME_MIFI_CFG); @@ -1445,10 +1452,6 @@ hme_mii_writereg(device_t dev, int phy, int n; u_int32_t v; - /* We can at most have two PHYs. */ - if (phy != HME_PHYAD_EXTERNAL && phy != HME_PHYAD_INTERNAL) - return (0); - sc = device_get_softc(dev); /* Select the desired PHY in the MIF configuration register */ v = HME_MIF_READ_4(sc, HME_MIFI_CFG); Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/jme/if_jme.c Sun Nov 7 11:12:29 2010 (r214909) @@ -224,13 +224,8 @@ jme_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); /* For FPGA version, PHY address 0 should be ignored. */ - if ((sc->jme_flags & JME_FLAG_FPGA) != 0) { - if (phy == 0) - return (0); - } else { - if (sc->jme_phyaddr != phy) - return (0); - } + if ((sc->jme_flags & JME_FLAG_FPGA) != 0 && phy == 0) + return (0); CSR_WRITE_4(sc, JME_SMI, SMI_OP_READ | SMI_OP_EXECUTE | SMI_PHY_ADDR(phy) | SMI_REG_ADDR(reg)); @@ -260,13 +255,8 @@ jme_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); /* For FPGA version, PHY address 0 should be ignored. */ - if ((sc->jme_flags & JME_FLAG_FPGA) != 0) { - if (phy == 0) - return (0); - } else { - if (sc->jme_phyaddr != phy) - return (0); - } + if ((sc->jme_flags & JME_FLAG_FPGA) != 0 && phy == 0) + return (0); CSR_WRITE_4(sc, JME_SMI, SMI_OP_WRITE | SMI_OP_EXECUTE | ((val << SMI_DATA_SHIFT) & SMI_DATA_MASK) | @@ -751,9 +741,11 @@ jme_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->jme_miibus, jme_mediachange, - jme_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, + jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/mge/if_mge.c ============================================================================== --- stable/8/sys/dev/mge/if_mge.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mge/if_mge.c Sun Nov 7 11:12:29 2010 (r214909) @@ -608,7 +608,7 @@ mge_attach(device_t dev) struct mge_softc *sc; struct ifnet *ifp; uint8_t hwaddr[ETHER_ADDR_LEN]; - int i, error ; + int i, error, phy; sc = device_get_softc(dev); sc->dev = dev; @@ -619,6 +619,13 @@ mge_attach(device_t dev) /* Set chip version-dependent parameters */ mge_ver_params(sc); + /* + * We assume static PHY address <=> device unit mapping: + * PHY Address = MII_ADDR_BASE + devce unit. + * This is true for most Marvell boards. + */ + phy = MII_ADDR_BASE + device_get_unit(dev); + /* Initialize mutexes */ mtx_init(&sc->transmit_lock, device_get_nameunit(dev), "mge TX lock", MTX_DEF); mtx_init(&sc->receive_lock, device_get_nameunit(dev), "mge RX lock", MTX_DEF); @@ -680,10 +687,11 @@ mge_attach(device_t dev) ether_ifattach(ifp, hwaddr); callout_init(&sc->wd_callout, 0); - /* Probe PHY(s) */ - error = mii_phy_probe(dev, &sc->miibus, mge_ifmedia_upd, mge_ifmedia_sts); + /* Attach PHY(s) */ + error = mii_attach(dev, &sc->miibus, ifp, mge_ifmedia_upd, + mge_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); if (error) { - device_printf(dev, "MII failed to find PHY\n"); + device_printf(dev, "attaching PHYs failed\n"); if_free(ifp); sc->ifp = NULL; mge_detach(dev); @@ -1259,19 +1267,6 @@ mge_miibus_readreg(device_t dev, int phy { uint32_t retries; - /* - * We assume static PHY address <=> device unit mapping: - * PHY Address = MII_ADDR_BASE + devce unit. - * This is true for most Marvell boards. - * - * Code below grants proper PHY detection on each device - * unit. - */ - - - if ((MII_ADDR_BASE + device_get_unit(dev)) != phy) - return (0); - MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_READ | (reg << 21) | (phy << 16))); @@ -1290,9 +1285,6 @@ mge_miibus_writereg(device_t dev, int ph { uint32_t retries; - if ((MII_ADDR_BASE + device_get_unit(dev)) != phy) - return (0); - MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_WRITE | (reg << 21) | (phy << 16) | (value & 0xffff))); Modified: stable/8/sys/dev/mii/acphy.c ============================================================================== --- stable/8/sys/dev/mii/acphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mii/acphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -132,6 +132,7 @@ acphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = acphy_service; Modified: stable/8/sys/dev/mii/amphy.c ============================================================================== --- stable/8/sys/dev/mii/amphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mii/amphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -109,6 +109,7 @@ amphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = amphy_service; Modified: stable/8/sys/dev/mii/atphy.c ============================================================================== --- stable/8/sys/dev/mii/atphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mii/atphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -113,6 +113,7 @@ atphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = atphy_service; Modified: stable/8/sys/dev/mii/axphy.c ============================================================================== --- stable/8/sys/dev/mii/axphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mii/axphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -97,6 +97,7 @@ axphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = axphy_service; Modified: stable/8/sys/dev/mii/bmtphy.c ============================================================================== --- stable/8/sys/dev/mii/bmtphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mii/bmtphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -147,6 +147,7 @@ bmtphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = bmtphy_service; Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mii/brgphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -191,6 +191,7 @@ brgphy_attach(device_t dev) LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); /* Initialize mii_softc structure */ + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = brgphy_service; Modified: stable/8/sys/dev/mii/ciphy.c ============================================================================== --- stable/8/sys/dev/mii/ciphy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mii/ciphy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -57,9 +57,7 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" #include -/* -#include -*/ + static int ciphy_probe(device_t); static int ciphy_attach(device_t); @@ -118,6 +116,7 @@ ciphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = ciphy_service; Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Sun Nov 7 10:49:40 2010 (r214908) +++ stable/8/sys/dev/mii/e1000phy.c Sun Nov 7 11:12:29 2010 (r214909) @@ -59,9 +59,6 @@ __FBSDID("$FreeBSD$"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 11:12:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24CBA106566C; Sun, 7 Nov 2010 11:12:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E0038FC15; Sun, 7 Nov 2010 11:12:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7BCVnA040135; Sun, 7 Nov 2010 11:12:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7BCUYl040102; Sun, 7 Nov 2010 11:12:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071112.oA7BCUYl040102@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 11:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214910 - in stable/7/sys: arm/xscale/ixp425 dev/ae dev/age dev/alc dev/ale dev/bfe dev/bge dev/bm dev/cas dev/dc dev/fxp dev/gem dev/hme dev/jme dev/mii dev/msk dev/pcn dev/re dev/sk d... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 11:12:31 -0000 Author: marius Date: Sun Nov 7 11:12:30 2010 New Revision: 214910 URL: http://svn.freebsd.org/changeset/base/214910 Log: MFC: r213893, r213908, r214566, r214605, r214846 Convert the PHY drivers to honor the mii_flags passed down and convert the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214685) to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari Modified: stable/7/sys/arm/xscale/ixp425/if_npe.c stable/7/sys/dev/ae/if_ae.c stable/7/sys/dev/ae/if_aevar.h stable/7/sys/dev/age/if_age.c stable/7/sys/dev/alc/if_alc.c stable/7/sys/dev/ale/if_ale.c stable/7/sys/dev/bfe/if_bfe.c stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h stable/7/sys/dev/bm/if_bm.c stable/7/sys/dev/cas/if_cas.c stable/7/sys/dev/cas/if_casvar.h stable/7/sys/dev/dc/if_dc.c stable/7/sys/dev/dc/pnphy.c stable/7/sys/dev/fxp/if_fxp.c stable/7/sys/dev/gem/if_gem.c stable/7/sys/dev/gem/if_gemvar.h stable/7/sys/dev/hme/if_hme.c stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/mii/acphy.c stable/7/sys/dev/mii/amphy.c stable/7/sys/dev/mii/atphy.c stable/7/sys/dev/mii/bmtphy.c stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/ciphy.c stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/exphy.c stable/7/sys/dev/mii/gentbi.c stable/7/sys/dev/mii/icsphy.c stable/7/sys/dev/mii/inphy.c stable/7/sys/dev/mii/ip1000phy.c stable/7/sys/dev/mii/jmphy.c stable/7/sys/dev/mii/lxtphy.c stable/7/sys/dev/mii/mlphy.c stable/7/sys/dev/mii/nsgphy.c stable/7/sys/dev/mii/nsphy.c stable/7/sys/dev/mii/nsphyter.c stable/7/sys/dev/mii/pnaphy.c stable/7/sys/dev/mii/qsphy.c stable/7/sys/dev/mii/rgephy.c stable/7/sys/dev/mii/rlphy.c stable/7/sys/dev/mii/rlswitch.c stable/7/sys/dev/mii/ruephy.c stable/7/sys/dev/mii/tdkphy.c stable/7/sys/dev/mii/tlphy.c stable/7/sys/dev/mii/truephy.c stable/7/sys/dev/mii/ukphy.c stable/7/sys/dev/mii/xmphy.c stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/pcn/if_pcn.c stable/7/sys/dev/re/if_re.c stable/7/sys/dev/sk/if_sk.c stable/7/sys/dev/ste/if_ste.c stable/7/sys/dev/stge/if_stge.c stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vr/if_vr.c stable/7/sys/dev/vr/if_vrreg.h stable/7/sys/pci/if_rl.c stable/7/sys/pci/if_xl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- stable/7/sys/arm/xscale/ixp425/if_npe.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/arm/xscale/ixp425/if_npe.c Sun Nov 7 11:12:30 2010 (r214910) @@ -318,11 +318,13 @@ npe_attach(device_t dev) npe_getmac(sc, eaddr); - /* NB: must be setup prior to invoking mii code */ sc->sc_ifp = ifp = if_alloc(IFT_ETHER); - if (mii_phy_probe(dev, &sc->sc_mii, npe_ifmedia_update, npe_ifmedia_status)) { - device_printf(dev, "Cannot find my PHY.\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sc_mii, ifp, npe_ifmedia_update, + npe_ifmedia_status, BMSR_DEFCAPMASK, sc->sc_phy, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); + return error; goto out; } @@ -1596,8 +1598,6 @@ npe_miibus_readreg(device_t dev, int phy struct npe_softc *sc = device_get_softc(dev); uint32_t v; - if (phy != sc->sc_phy) /* XXX no auto-detect */ - return 0xffff; v = (phy << NPE_MII_ADDR_SHL) | (reg << NPE_MII_REG_SHL) | NPE_MII_GO; npe_mii_mdio_write(sc, NPE_MAC_MDIO_CMD, v); @@ -1615,8 +1615,6 @@ npe_miibus_writereg(device_t dev, int ph struct npe_softc *sc = device_get_softc(dev); uint32_t v; - if (phy != sc->sc_phy) /* XXX */ - return; v = (phy << NPE_MII_ADDR_SHL) | (reg << NPE_MII_REG_SHL) | data | NPE_MII_WRITE | NPE_MII_GO; Modified: stable/7/sys/dev/ae/if_ae.c ============================================================================== --- stable/7/sys/dev/ae/if_ae.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/ae/if_ae.c Sun Nov 7 11:12:30 2010 (r214910) @@ -360,9 +360,6 @@ ae_attach(device_t dev) if (error != 0) goto fail; - /* Set default PHY address. */ - sc->phyaddr = AE_PHYADDR_DEFAULT; - ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "could not allocate ifnet structure.\n"); @@ -390,10 +387,11 @@ ae_attach(device_t dev) /* * Configure and attach MII bus. */ - error = mii_phy_probe(dev, &sc->miibus, ae_mediachange, - ae_mediastatus); + error = mii_attach(dev, &sc->miibus, ifp, ae_mediachange, + ae_mediastatus, BMSR_DEFCAPMASK, AE_PHYADDR_DEFAULT, + MII_OFFSET_ANY, 0); if (error != 0) { - device_printf(dev, "no PHY found.\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -813,9 +811,6 @@ ae_miibus_readreg(device_t dev, int phy, * Locking is done in upper layers. */ - if (phy != sc->phyaddr) - return (0); - val = ((reg << AE_MDIO_REGADDR_SHIFT) & AE_MDIO_REGADDR_MASK) | AE_MDIO_START | AE_MDIO_READ | AE_MDIO_SUP_PREAMBLE | ((AE_MDIO_CLK_25_4 << AE_MDIO_CLK_SHIFT) & AE_MDIO_CLK_MASK); @@ -851,9 +846,6 @@ ae_miibus_writereg(device_t dev, int phy * Locking is done in upper layers. */ - if (phy != sc->phyaddr) - return (0); - aereg = ((reg << AE_MDIO_REGADDR_SHIFT) & AE_MDIO_REGADDR_MASK) | AE_MDIO_START | AE_MDIO_SUP_PREAMBLE | ((AE_MDIO_CLK_25_4 << AE_MDIO_CLK_SHIFT) & AE_MDIO_CLK_MASK) | Modified: stable/7/sys/dev/ae/if_aevar.h ============================================================================== --- stable/7/sys/dev/ae/if_aevar.h Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/ae/if_aevar.h Sun Nov 7 11:12:30 2010 (r214910) @@ -111,7 +111,6 @@ typedef struct ae_softc { struct mtx mtx; - int phyaddr; uint8_t eaddr[ETHER_ADDR_LEN]; uint8_t flags; int if_flags; Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/age/if_age.c Sun Nov 7 11:12:30 2010 (r214910) @@ -210,8 +210,6 @@ age_miibus_readreg(device_t dev, int phy int i; sc = device_get_softc(dev); - if (phy != sc->age_phyaddr) - return (0); CSR_WRITE_4(sc, AGE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -241,8 +239,6 @@ age_miibus_writereg(device_t dev, int ph int i; sc = device_get_softc(dev); - if (phy != sc->age_phyaddr) - return (0); CSR_WRITE_4(sc, AGE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | @@ -621,9 +617,11 @@ age_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->age_miibus, age_mediachange, - age_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->age_miibus, ifp, age_mediachange, + age_mediastatus, BMSR_DEFCAPMASK, sc->age_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/alc/if_alc.c Sun Nov 7 11:12:30 2010 (r214910) @@ -235,9 +235,6 @@ alc_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != sc->alc_phyaddr) - return (0); - /* * For AR8132 fast ethernet controller, do not report 1000baseT * capability to mii(4). Even though AR8132 uses the same @@ -274,9 +271,6 @@ alc_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != sc->alc_phyaddr) - return (0); - CSR_WRITE_4(sc, ALC_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -978,9 +972,11 @@ alc_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->alc_miibus, alc_mediachange, - alc_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->alc_miibus, ifp, alc_mediachange, + alc_mediastatus, BMSR_DEFCAPMASK, sc->alc_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/ale/if_ale.c Sun Nov 7 11:12:30 2010 (r214910) @@ -208,9 +208,6 @@ ale_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != sc->ale_phyaddr) - return (0); - CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); for (i = ALE_PHY_TIMEOUT; i > 0; i--) { @@ -237,9 +234,6 @@ ale_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != sc->ale_phyaddr) - return (0); - CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -605,9 +599,11 @@ ale_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->ale_miibus, ale_mediachange, - ale_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->ale_miibus, ifp, ale_mediachange, + ale_mediastatus, BMSR_DEFCAPMASK, sc->ale_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/bfe/if_bfe.c ============================================================================== --- stable/7/sys/dev/bfe/if_bfe.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/bfe/if_bfe.c Sun Nov 7 11:12:30 2010 (r214910) @@ -498,10 +498,11 @@ bfe_attach(device_t dev) bfe_chip_reset(sc); BFE_UNLOCK(sc); - if (mii_phy_probe(dev, &sc->bfe_miibus, - bfe_ifmedia_upd, bfe_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->bfe_miibus, ifp, bfe_ifmedia_upd, + bfe_ifmedia_sts, BMSR_DEFCAPMASK, sc->bfe_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -624,8 +625,6 @@ bfe_miibus_readreg(device_t dev, int phy u_int32_t ret; sc = device_get_softc(dev); - if (phy != sc->bfe_phyaddr) - return (0); bfe_readphy(sc, reg, &ret); return (ret); @@ -637,8 +636,6 @@ bfe_miibus_writereg(device_t dev, int ph struct bfe_softc *sc; sc = device_get_softc(dev); - if (phy != sc->bfe_phyaddr) - return (0); bfe_writephy(sc, reg, val); return (0); Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/bge/if_bge.c Sun Nov 7 11:12:30 2010 (r214910) @@ -782,10 +782,6 @@ bge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - /* Prevent the probe from finding incorrect devices. */ - if (phy != sc->bge_phy_addr) - return (0); - /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -2572,7 +2568,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, msicount, reg, rid, trys; + int error, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2605,7 +2601,7 @@ bge_attach(device_t dev) sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); /* Set default PHY address. */ - sc->bge_phy_addr = 1; + phy_addr = 1; /* * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the @@ -2972,17 +2968,17 @@ bge_attach(device_t dev) again: bge_asf_driver_up(sc); - if (mii_phy_probe(dev, &sc->bge_miibus, - bge_ifmedia_upd, bge_ifmedia_sts)) { + error = (mii_attach(dev, &sc->bge_miibus, ifp, + bge_ifmedia_upd, bge_ifmedia_sts, BMSR_DEFCAPMASK, + phy_addr, MII_OFFSET_ANY, 0)); + if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, BMCR_RESET); goto again; } - - device_printf(sc->bge_dev, "MII without any PHY!\n"); - error = ENXIO; + device_printf(sc->bge_dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/bge/if_bgereg.h Sun Nov 7 11:12:30 2010 (r214910) @@ -2762,7 +2762,6 @@ struct bge_softc { uint32_t bge_tx_buf_ratio; uint32_t bge_mi_mode; int bge_if_flags; - int bge_phy_addr; int bge_txcnt; int bge_link; /* link state */ int bge_link_evt; /* pending link event */ Modified: stable/7/sys/dev/bm/if_bm.c ============================================================================== --- stable/7/sys/dev/bm/if_bm.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/bm/if_bm.c Sun Nov 7 11:12:30 2010 (r214910) @@ -594,11 +594,19 @@ bm_attach(device_t dev) /* reset the adapter */ bm_chip_setup(sc); - /* setup MII */ - error = mii_phy_probe(dev, &sc->sc_miibus, bm_ifmedia_upd, - bm_ifmedia_sts); - if (error != 0) - device_printf(dev,"PHY probe failed: %d\n", error); + /* + * Setup MII + * On Apple BMAC controllers, we end up in a weird state of + * partially-completed autonegotiation on boot. So we force + * autonegotation to try again. + */ + error = mii_attach(dev, &sc->sc_miibus, ifp, bm_ifmedia_upd, + bm_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, + MIIF_FORCEANEG); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); + return (error); + } sc->sc_mii = device_get_softc(sc->sc_miibus); Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/cas/if_cas.c Sun Nov 7 11:12:30 2010 (r214910) @@ -344,13 +344,9 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } - switch (sc->sc_variant) { - default: - sc->sc_phyad = -1; - break; - } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); } /* * Fall back on an internal PHY if no external PHY was found. @@ -368,13 +364,9 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } - switch (sc->sc_variant) { - default: - sc->sc_phyad = -1; - break; - } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); } } else { /* @@ -394,12 +386,12 @@ cas_attach(struct cas_softc *sc) CAS_WRITE_4(sc, CAS_PCS_CONF, CAS_PCS_CONF_EN); CAS_BARRIER(sc, CAS_PCS_CONF, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - sc->sc_phyad = CAS_PHYAD_EXTERNAL; - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + CAS_PHYAD_EXTERNAL, MII_OFFSET_ANY, 0); } if (error != 0) { - device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxmap; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -2172,9 +2164,6 @@ cas_mii_readreg(device_t dev, int phy, i #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & CAS_SERDES) != 0) { switch (reg) { case MII_BMCR: @@ -2233,9 +2222,6 @@ cas_mii_writereg(device_t dev, int phy, #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & CAS_SERDES) != 0) { switch (reg) { case MII_BMSR: @@ -2318,8 +2304,7 @@ cas_mii_statchg(device_t dev) #ifdef CAS_DEBUG if ((ifp->if_flags & IFF_DEBUG) != 0) - device_printf(sc->sc_dev, "%s: status change: PHY = %d\n", - __func__, sc->sc_phyad); + device_printf(sc->sc_dev, "%s: status changen", __func__); #endif if ((sc->sc_mii->mii_media_status & IFM_ACTIVE) != 0 && Modified: stable/7/sys/dev/cas/if_casvar.h ============================================================================== --- stable/7/sys/dev/cas/if_casvar.h Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/cas/if_casvar.h Sun Nov 7 11:12:30 2010 (r214910) @@ -154,8 +154,6 @@ struct cas_softc { bus_dma_tag_t sc_cdmatag; /* control data bus DMA tag */ bus_dmamap_t sc_dmamap; /* bus DMA handle */ - u_int sc_phyad; /* PHY to use or -1 for any */ - u_int sc_variant; #define CAS_UNKNOWN 0 /* don't know */ #define CAS_CAS 1 /* Sun Cassini */ Modified: stable/7/sys/dev/dc/if_dc.c ============================================================================== --- stable/7/sys/dev/dc/if_dc.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/dc/if_dc.c Sun Nov 7 11:12:30 2010 (r214910) @@ -779,26 +779,6 @@ dc_miibus_readreg(device_t dev, int phy, sc = device_get_softc(dev); bzero(&frame, sizeof(frame)); - /* - * Note: both the AL981 and AN983 have internal PHYs, - * however the AL981 provides direct access to the PHY - * registers while the AN983 uses a serial MII interface. - * The AN983's MII interface is also buggy in that you - * can read from any MII address (0 to 31), but only address 1 - * behaves normally. To deal with both cases, we pretend - * that the PHY is at MII address 1. - */ - if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) - return (0); - - /* - * Note: the ukphy probes of the RS7112 report a PHY at - * MII address 0 (possibly HomePNA?) and 1 (ethernet) - * so we only respond to correct one. - */ - if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR) - return (0); - if (sc->dc_pmode != DC_PMODE_MII) { if (phy == (MII_NPHY - 1)) { switch (reg) { @@ -901,12 +881,6 @@ dc_miibus_writereg(device_t dev, int phy sc = device_get_softc(dev); bzero(&frame, sizeof(frame)); - if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) - return (0); - - if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR) - return (0); - if (DC_IS_PNIC(sc)) { CSR_WRITE_4(sc, DC_PN_MII, DC_PN_MIIOPCODE_WRITE | (phy << 23) | (reg << 10) | data); @@ -1815,14 +1789,12 @@ dc_dma_map_addr(void *arg, bus_dma_segme static int dc_attach(device_t dev) { - int tmp = 0; uint32_t eaddr[(ETHER_ADDR_LEN+3)/4]; u_int32_t command; struct dc_softc *sc; struct ifnet *ifp; u_int32_t reg, revision; - int error = 0, rid, mac_offset; - int i; + int error, i, mac_offset, phy, rid, tmp; u_int8_t *mac; sc = device_get_softc(dev); @@ -2203,6 +2175,7 @@ dc_attach(device_t dev) * old selection (SIA only or SIA/SYM) and attach the dcphy * driver instead. */ + tmp = 0; if (DC_IS_INTEL(sc)) { dc_apply_fixup(sc, IFM_AUTO); tmp = sc->dc_pmode; @@ -2211,7 +2184,7 @@ dc_attach(device_t dev) /* * Setup General Purpose port mode and data so the tulip can talk - * to the MII. This needs to be done before mii_phy_probe so that + * to the MII. This needs to be done before mii_attach so that * we can actually see them. */ if (DC_IS_XIRCOM(sc)) { @@ -2223,16 +2196,37 @@ dc_attach(device_t dev) DELAY(10); } - error = mii_phy_probe(dev, &sc->dc_miibus, - dc_ifmedia_upd, dc_ifmedia_sts); + phy = MII_PHY_ANY; + /* + * Note: both the AL981 and AN983 have internal PHYs, however the + * AL981 provides direct access to the PHY registers while the AN983 + * uses a serial MII interface. The AN983's MII interface is also + * buggy in that you can read from any MII address (0 to 31), but + * only address 1 behaves normally. To deal with both cases, we + * pretend that the PHY is at MII address 1. + */ + if (DC_IS_ADMTEK(sc)) + phy = DC_ADMTEK_PHYADDR; + + /* + * Note: the ukphy probes of the RS7112 report a PHY at MII address + * 0 (possibly HomePNA?) and 1 (ethernet) so we only respond to the + * correct one. + */ + if (DC_IS_CONEXANT(sc)) + phy = DC_CONEXANT_PHYADDR; + + error = mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); if (error && DC_IS_INTEL(sc)) { sc->dc_pmode = tmp; if (sc->dc_pmode != DC_PMODE_SIA) sc->dc_pmode = DC_PMODE_SYM; sc->dc_flags |= DC_21143_NWAY; - mii_phy_probe(dev, &sc->dc_miibus, - dc_ifmedia_upd, dc_ifmedia_sts); + mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); /* * For non-MII cards, we need to have the 21143 * drive the LEDs. Except there are some systems @@ -2247,7 +2241,7 @@ dc_attach(device_t dev) } if (error) { - device_printf(dev, "MII without any PHY!\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/dc/pnphy.c ============================================================================== --- stable/7/sys/dev/dc/pnphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/dc/pnphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -132,6 +132,7 @@ pnphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = pnphy_service; @@ -169,8 +170,6 @@ pnphy_service(struct mii_softc *sc, stru if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; - sc->mii_flags = 0; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: /* NWAY is busted on this chip */ Modified: stable/7/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/7/sys/dev/fxp/if_fxp.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/fxp/if_fxp.c Sun Nov 7 11:12:30 2010 (r214910) @@ -805,10 +805,14 @@ fxp_attach(device_t dev) ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_MANUAL, 0, NULL); ifmedia_set(&sc->sc_media, IFM_ETHER|IFM_MANUAL); } else { - if (mii_phy_probe(dev, &sc->miibus, fxp_ifmedia_upd, - fxp_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + /* + * i82557 wedge when isolating all of their PHYs. + */ + error = mii_attach(dev, &sc->miibus, ifp, fxp_ifmedia_upd, + fxp_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, MIIF_NOISOLATE); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } } Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/gem/if_gem.c Sun Nov 7 11:12:30 2010 (r214910) @@ -149,7 +149,7 @@ gem_attach(struct gem_softc *sc) { struct gem_txsoft *txs; struct ifnet *ifp; - int error, i; + int error, i, phy; uint32_t v; if (bootverbose) @@ -294,14 +294,15 @@ gem_attach(struct gem_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); switch (sc->sc_variant) { case GEM_SUN_ERI: - sc->sc_phyad = GEM_PHYAD_EXTERNAL; + phy = GEM_PHYAD_EXTERNAL; break; default: - sc->sc_phyad = -1; + phy = MII_PHY_ANY; break; } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, phy, + MII_OFFSET_ANY, 0); } /* @@ -318,17 +319,18 @@ gem_attach(struct gem_softc *sc) switch (sc->sc_variant) { case GEM_SUN_ERI: case GEM_APPLE_K2_GMAC: - sc->sc_phyad = GEM_PHYAD_INTERNAL; + phy = GEM_PHYAD_INTERNAL; break; case GEM_APPLE_GMAC: - sc->sc_phyad = GEM_PHYAD_EXTERNAL; + phy = GEM_PHYAD_EXTERNAL; break; default: - sc->sc_phyad = -1; + phy = MII_PHY_ANY; break; } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, phy, + MII_OFFSET_ANY, 0); } /* @@ -348,12 +350,12 @@ gem_attach(struct gem_softc *sc) GEM_BANK1_BARRIER(sc, GEM_MII_CONFIG, 4, BUS_SPACE_BARRIER_WRITE); sc->sc_flags |= GEM_SERDES; - sc->sc_phyad = GEM_PHYAD_EXTERNAL; - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, + GEM_PHYAD_EXTERNAL, MII_OFFSET_ANY, 0); } if (error != 0) { - device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxd; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -1848,9 +1850,6 @@ gem_mii_readreg(device_t dev, int phy, i #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & GEM_SERDES) != 0) { switch (reg) { case MII_BMCR: @@ -1909,9 +1908,6 @@ gem_mii_writereg(device_t dev, int phy, #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & GEM_SERDES) != 0) { switch (reg) { case MII_BMSR: @@ -1992,8 +1988,7 @@ gem_mii_statchg(device_t dev) #ifdef GEM_DEBUG if ((sc->sc_ifp->if_flags & IFF_DEBUG) != 0) - device_printf(sc->sc_dev, "%s: status change: PHY = %d\n", - __func__, sc->sc_phyad); + device_printf(sc->sc_dev, "%s: status change\n", __func__); #endif if ((sc->sc_mii->mii_media_status & IFM_ACTIVE) != 0 && Modified: stable/7/sys/dev/gem/if_gemvar.h ============================================================================== --- stable/7/sys/dev/gem/if_gemvar.h Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/gem/if_gemvar.h Sun Nov 7 11:12:30 2010 (r214910) @@ -126,8 +126,6 @@ struct gem_softc { bus_dma_tag_t sc_cdmatag; /* control data bus DMA tag */ bus_dmamap_t sc_dmamap; /* bus DMA handle */ - int sc_phyad; /* PHY to use or -1 for any */ - u_int sc_variant; #define GEM_UNKNOWN 0 /* don't know */ #define GEM_SUN_GEM 1 /* Sun GEM */ Modified: stable/7/sys/dev/hme/if_hme.c ============================================================================== --- stable/7/sys/dev/hme/if_hme.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/hme/if_hme.c Sun Nov 7 11:12:30 2010 (r214910) @@ -315,9 +315,20 @@ hme_config(struct hme_softc *sc) hme_mifinit(sc); - if ((error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, hme_mediachange, - hme_mediastatus)) != 0) { - device_printf(sc->sc_dev, "phy probe failed: %d\n", error); + /* + * DP83840A used with HME chips don't advertise their media + * capabilities themselves properly so force writing the ANAR + * according to the BMSR in mii_phy_setmedia(). + */ + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, hme_mediachange, + hme_mediastatus, BMSR_DEFCAPMASK, HME_PHYAD_EXTERNAL, + MII_OFFSET_ANY, MIIF_FORCEANEG); + i = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, hme_mediachange, + hme_mediastatus, BMSR_DEFCAPMASK, HME_PHYAD_INTERNAL, + MII_OFFSET_ANY, MIIF_FORCEANEG); + if (error != 0 && i != 0) { + error = ENXIO; + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxdesc; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -1404,10 +1415,6 @@ hme_mii_readreg(device_t dev, int phy, i int n; u_int32_t v; - /* We can at most have two PHYs. */ - if (phy != HME_PHYAD_EXTERNAL && phy != HME_PHYAD_INTERNAL) - return (0); - sc = device_get_softc(dev); /* Select the desired PHY in the MIF configuration register */ v = HME_MIF_READ_4(sc, HME_MIFI_CFG); @@ -1445,10 +1452,6 @@ hme_mii_writereg(device_t dev, int phy, int n; u_int32_t v; - /* We can at most have two PHYs. */ - if (phy != HME_PHYAD_EXTERNAL && phy != HME_PHYAD_INTERNAL) - return (0); - sc = device_get_softc(dev); /* Select the desired PHY in the MIF configuration register */ v = HME_MIF_READ_4(sc, HME_MIFI_CFG); Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/jme/if_jme.c Sun Nov 7 11:12:30 2010 (r214910) @@ -224,13 +224,8 @@ jme_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); /* For FPGA version, PHY address 0 should be ignored. */ - if ((sc->jme_flags & JME_FLAG_FPGA) != 0) { - if (phy == 0) - return (0); - } else { - if (sc->jme_phyaddr != phy) - return (0); - } + if ((sc->jme_flags & JME_FLAG_FPGA) != 0 && phy == 0) + return (0); CSR_WRITE_4(sc, JME_SMI, SMI_OP_READ | SMI_OP_EXECUTE | SMI_PHY_ADDR(phy) | SMI_REG_ADDR(reg)); @@ -260,13 +255,8 @@ jme_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); /* For FPGA version, PHY address 0 should be ignored. */ - if ((sc->jme_flags & JME_FLAG_FPGA) != 0) { - if (phy == 0) - return (0); - } else { - if (sc->jme_phyaddr != phy) - return (0); - } + if ((sc->jme_flags & JME_FLAG_FPGA) != 0 && phy == 0) + return (0); CSR_WRITE_4(sc, JME_SMI, SMI_OP_WRITE | SMI_OP_EXECUTE | ((val << SMI_DATA_SHIFT) & SMI_DATA_MASK) | @@ -751,9 +741,11 @@ jme_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->jme_miibus, jme_mediachange, - jme_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, + jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/mii/acphy.c ============================================================================== --- stable/7/sys/dev/mii/acphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/acphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -132,6 +132,7 @@ acphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = acphy_service; Modified: stable/7/sys/dev/mii/amphy.c ============================================================================== --- stable/7/sys/dev/mii/amphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/amphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -109,6 +109,7 @@ amphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = amphy_service; Modified: stable/7/sys/dev/mii/atphy.c ============================================================================== --- stable/7/sys/dev/mii/atphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/atphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -113,6 +113,7 @@ atphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = atphy_service; Modified: stable/7/sys/dev/mii/bmtphy.c ============================================================================== --- stable/7/sys/dev/mii/bmtphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/bmtphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -147,6 +147,7 @@ bmtphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = bmtphy_service; Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/brgphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -191,6 +191,7 @@ brgphy_attach(device_t dev) LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); /* Initialize mii_softc structure */ + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = brgphy_service; Modified: stable/7/sys/dev/mii/ciphy.c ============================================================================== --- stable/7/sys/dev/mii/ciphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/ciphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -57,9 +57,7 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" #include -/* -#include -*/ + static int ciphy_probe(device_t); static int ciphy_attach(device_t); @@ -118,6 +116,7 @@ ciphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = ciphy_service; Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/e1000phy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -59,9 +59,6 @@ __FBSDID("$FreeBSD$"); #include "miidevs.h" #include -/* XXX */ -#include -#include #include "miibus_if.h" @@ -71,7 +68,6 @@ static int e1000phy_attach(device_t); struct e1000phy_softc { struct mii_softc mii_sc; int mii_model; - struct msk_mii_data *mmd; }; static device_method_t e1000phy_methods[] = { @@ -144,6 +140,7 @@ e1000phy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = e1000phy_service; @@ -151,14 +148,9 @@ e1000phy_attach(device_t dev) esc->mii_model = MII_MODEL(ma->mii_id2); ifp = sc->mii_pdata->mii_ifp; - if (strcmp(ifp->if_dname, "msk") == 0) { - /* XXX */ - esc->mmd = device_get_ivars( - device_get_parent(device_get_parent(dev))); - if (esc->mmd != NULL && - (esc->mmd->mii_flags & MIIF_HAVEFIBER) != 0) - sc->mii_flags |= MIIF_HAVEFIBER; - } + if (strcmp(ifp->if_dname, "msk") == 0 && + (sc->mii_flags & MIIF_MACPRIV0) != 0) + sc->mii_flags |= MIIF_PHYPRIV0; switch (esc->mii_model) { case MII_MODEL_MARVELL_E1011: @@ -214,7 +206,7 @@ e1000phy_reset(struct mii_softc *sc) reg &= ~E1000_SCR_MODE_MASK; reg |= E1000_SCR_MODE_1000BX; PHY_WRITE(sc, E1000_SCR, reg); - if (esc->mmd != NULL && esc->mmd->pmd == 'P') { + if ((sc->mii_flags & MIIF_MACPRIV0) != 0) { /* Set SIGDET polarity low for SFP module. */ PHY_WRITE(sc, E1000_EADR, 1); reg = PHY_READ(sc, E1000_SCR); Modified: stable/7/sys/dev/mii/exphy.c ============================================================================== --- stable/7/sys/dev/mii/exphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/exphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -138,6 +138,7 @@ exphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = exphy_service; Modified: stable/7/sys/dev/mii/gentbi.c ============================================================================== --- stable/7/sys/dev/mii/gentbi.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/gentbi.c Sun Nov 7 11:12:30 2010 (r214910) @@ -166,6 +166,7 @@ gentbi_attach(device_t dev) MII_OUI(ma->mii_id1, ma->mii_id2), MII_MODEL(ma->mii_id2), MII_REV(ma->mii_id2)); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = gentbi_service; Modified: stable/7/sys/dev/mii/icsphy.c ============================================================================== --- stable/7/sys/dev/mii/icsphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/icsphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -141,6 +141,7 @@ icsphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = icsphy_service; Modified: stable/7/sys/dev/mii/inphy.c ============================================================================== --- stable/7/sys/dev/mii/inphy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/inphy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -107,6 +107,7 @@ inphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = inphy_service; Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Sun Nov 7 11:12:29 2010 (r214909) +++ stable/7/sys/dev/mii/ip1000phy.c Sun Nov 7 11:12:30 2010 (r214910) @@ -114,6 +114,7 @@ ip1000phy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = ip1000phy_service; @@ -123,6 +124,10 @@ ip1000phy_attach(device_t dev) isc->model = MII_MODEL(ma->mii_id2); isc->revision = MII_REV(ma->mii_id2); + if (isc->model == MII_MODEL_ICPLUS_IP1000A && + strcmp(mii->mii_ifp->if_dname, "stge") == 0 && + (sc->mii_flags & MIIF_MACPRIV0) != 0) + sc->mii_flags |= MIIF_PHYPRIV0; sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) @@ -412,12 +417,8 @@ ip1000phy_load_dspcode(struct mii_softc static void ip1000phy_reset(struct mii_softc *sc) { - struct ip1000phy_softc *isc; - struct stge_softc *stge_sc; - struct mii_data *mii; uint32_t reg; - isc = (struct ip1000phy_softc *)sc; mii_phy_reset(sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 11:39:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65D591065670; Sun, 7 Nov 2010 11:39:48 +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 53BD58FC20; Sun, 7 Nov 2010 11:39:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7BdmXN041513; Sun, 7 Nov 2010 11:39:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Bdm3I041511; Sun, 7 Nov 2010 11:39:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011071139.oA7Bdm3I041511@svn.freebsd.org> From: Xin LI Date: Sun, 7 Nov 2010 11:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214911 - stable/8/etc/periodic/security X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 11:39:48 -0000 Author: delphij Date: Sun Nov 7 11:39:48 2010 New Revision: 214911 URL: http://svn.freebsd.org/changeset/base/214911 Log: Revert r214897 in order to finish the merge properly without stopping svn2cvs. Pointy hat to: delphij Deleted: stable/8/etc/periodic/security/460.chkportsum Modified: stable/8/etc/periodic/security/Makefile Modified: stable/8/etc/periodic/security/Makefile ============================================================================== --- stable/8/etc/periodic/security/Makefile Sun Nov 7 11:12:30 2010 (r214910) +++ stable/8/etc/periodic/security/Makefile Sun Nov 7 11:39:48 2010 (r214911) @@ -6,7 +6,6 @@ FILES= 100.chksetuid \ 200.chkmounts \ 300.chkuid0 \ 400.passwdless \ - 460.chkportsum \ 410.logincheck \ 700.kernelmsg \ 800.loginfail \ From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 11:51:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B2A106566B; Sun, 7 Nov 2010 11:51:58 +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 C81A88FC1C; Sun, 7 Nov 2010 11:51:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7BpvWl042200; Sun, 7 Nov 2010 11:51:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7BpvdX042196; Sun, 7 Nov 2010 11:51:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011071151.oA7BpvdX042196@svn.freebsd.org> From: Xin LI Date: Sun, 7 Nov 2010 11:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214912 - in stable/8/etc: defaults periodic/security X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 11:51:58 -0000 Author: delphij Date: Sun Nov 7 11:51:57 2010 New Revision: 214912 URL: http://svn.freebsd.org/changeset/base/214912 Log: Redo r214897: MFC r211141 (gabor) - Fixes to the chkportsum script to handle better some special cases, like spaces in filename Submitted by: Alex Kozlov MFC r210254 (gabor) - Add a periodic script, which can be used to find installed ports' files with mismatched checksum PR: conf/124641 Submitted by: Alex Kozlov Added: stable/8/etc/periodic/security/460.chkportsum - copied, changed from r210254, head/etc/periodic/security/460.chkportsum Modified: stable/8/etc/defaults/periodic.conf stable/8/etc/periodic/security/Makefile Directory Properties: stable/8/etc/periodic/security/ (props changed) Modified: stable/8/etc/defaults/periodic.conf ============================================================================== --- stable/8/etc/defaults/periodic.conf Sun Nov 7 11:39:48 2010 (r214911) +++ stable/8/etc/defaults/periodic.conf Sun Nov 7 11:51:57 2010 (r214912) @@ -171,6 +171,9 @@ daily_status_security_passwdless_enable= # 410.logincheck daily_status_security_logincheck_enable="YES" +# 460.chkportsum +daily_status_security_chkportsum_enable="NO" # Check ports w/ wrong checksum + # 500.ipfwdenied daily_status_security_ipfwdenied_enable="YES" Copied and modified: stable/8/etc/periodic/security/460.chkportsum (from r210254, head/etc/periodic/security/460.chkportsum) ============================================================================== --- head/etc/periodic/security/460.chkportsum Mon Jul 19 20:19:14 2010 (r210254, copy source) +++ stable/8/etc/periodic/security/460.chkportsum Sun Nov 7 11:51:57 2010 (r214912) @@ -42,20 +42,20 @@ echo 'Checking for ports with mismatched case "${daily_status_security_chkportsum_enable}" in [Yy][Ee][Ss]) + set -f pkg_info -ga 2>/dev/null | \ - while read one two three; do - case ${one} in + while IFS= read -r line; do + set -- $line + case $1 in Information) - case ${two} in - for) name=${three%%:} ;; - *) name='??' ;; + case $2 in + for) name="${3%%:}" ;; + *) name='??' ;; esac ;; Mismatched|'') ;; - *) - if [ -n ${name} ]; then - echo ${name}: ${one} - fi + *) [ -n "${name}" ] && + echo "${name}: ${line%% fails the original MD5 checksum}" ;; esac done Modified: stable/8/etc/periodic/security/Makefile ============================================================================== --- stable/8/etc/periodic/security/Makefile Sun Nov 7 11:39:48 2010 (r214911) +++ stable/8/etc/periodic/security/Makefile Sun Nov 7 11:51:57 2010 (r214912) @@ -7,6 +7,7 @@ FILES= 100.chksetuid \ 300.chkuid0 \ 400.passwdless \ 410.logincheck \ + 460.chkportsum \ 700.kernelmsg \ 800.loginfail \ 900.tcpwrap \ From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 12:29:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2150C1065672; Sun, 7 Nov 2010 12:29:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FCCD8FC1B; Sun, 7 Nov 2010 12:29:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7CTQCt044233; Sun, 7 Nov 2010 12:29:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7CTQa6044231; Sun, 7 Nov 2010 12:29:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071229.oA7CTQa6044231@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 12:29: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: r214913 - head/sys/dev/wb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 12:29:27 -0000 Author: marius Date: Sun Nov 7 12:29:26 2010 New Revision: 214913 URL: http://svn.freebsd.org/changeset/base/214913 Log: Fix indentation in r213894. Modified: head/sys/dev/wb/if_wb.c Modified: head/sys/dev/wb/if_wb.c ============================================================================== --- head/sys/dev/wb/if_wb.c Sun Nov 7 11:51:57 2010 (r214912) +++ head/sys/dev/wb/if_wb.c Sun Nov 7 12:29:26 2010 (r214913) @@ -857,7 +857,7 @@ wb_attach(dev) */ error = mii_attach(dev, &sc->wb_miibus, ifp, wb_ifmedia_upd, wb_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); - if (error != 0) { + if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 14:28:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7829E1065670; Sun, 7 Nov 2010 14:28:01 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 676ED8FC15; Sun, 7 Nov 2010 14:28:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7ES15Z051087; Sun, 7 Nov 2010 14:28:01 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7ES1Sd051085; Sun, 7 Nov 2010 14:28:01 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201011071428.oA7ES1Sd051085@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 7 Nov 2010 14:28: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: r214917 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 14:28:01 -0000 Author: jh Date: Sun Nov 7 14:28:01 2010 New Revision: 214917 URL: http://svn.freebsd.org/changeset/base/214917 Log: Add missing curly brackets. By chance, the missing brackets didn't alter the code behavior. Submitted by: Lucius Windschuh Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sun Nov 7 13:50:42 2010 (r214916) +++ head/sys/kern/kern_conf.c Sun Nov 7 14:28:01 2010 (r214917) @@ -752,7 +752,7 @@ make_dev_credv(int flags, struct cdev ** return (res); } dev = newdev(devsw, unit, dev_new); - if ((dev->si_flags & SI_NAMED) == 0) + if ((dev->si_flags & SI_NAMED) == 0) { res = prep_devname(dev, fmt, ap); if (res != 0) { if ((flags & MAKEDEV_CHECKNAME) == 0) { @@ -766,6 +766,7 @@ make_dev_credv(int flags, struct cdev ** devfs_free(dev); } return (res); + } } if (flags & MAKEDEV_REF) dev_refl(dev); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 14:39:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1284B106564A; Sun, 7 Nov 2010 14:39:41 +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 013C28FC13; Sun, 7 Nov 2010 14:39:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Edeit051987; Sun, 7 Nov 2010 14:39:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7EdekE051983; Sun, 7 Nov 2010 14:39:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011071439.oA7EdekE051983@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Nov 2010 14:39: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: r214918 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 14:39:41 -0000 Author: tuexen Date: Sun Nov 7 14:39:40 2010 New Revision: 214918 URL: http://svn.freebsd.org/changeset/base/214918 Log: Not only stop all timers when entering the SHUTDOWN_SENT state, but also when entering the SHUTDOWN_ACK_SEND state. MFC after: 3 days. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Nov 7 14:28:01 2010 (r214917) +++ head/sys/netinet/sctp_indata.c Sun Nov 7 14:39:40 2010 (r214918) @@ -4369,7 +4369,7 @@ again: SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); - + sctp_stop_timers_for_shutdown(stcb); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, asoc->primary_destination); } @@ -5081,7 +5081,7 @@ done_with_it: SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); - + sctp_stop_timers_for_shutdown(stcb); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, asoc->primary_destination); return; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Nov 7 14:28:01 2010 (r214917) +++ head/sys/netinet/sctp_input.c Sun Nov 7 14:39:40 2010 (r214918) @@ -908,9 +908,7 @@ sctp_handle_shutdown(struct sctp_shutdow } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INPUT + SCTP_LOC_7); - /* start SHUTDOWN timer */ + sctp_stop_timers_for_shutdown(stcb); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net); } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Nov 7 14:28:01 2010 (r214917) +++ head/sys/netinet/sctputil.c Sun Nov 7 14:39:40 2010 (r214918) @@ -725,6 +725,31 @@ sctp_audit_log(uint8_t ev, uint8_t fd) #endif /* + * sctp_stop_timers_for_shutdown() should be called + * when entering the SHUTDOWN_SENT or SHUTDOWN_ACK_SENT + * state to make sure that all timers are stopped. + */ +void +sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb) +{ + struct sctp_association *asoc; + struct sctp_nets *net; + + asoc = &stcb->asoc; + + (void)SCTP_OS_TIMER_STOP(&asoc->hb_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->dack_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + (void)SCTP_OS_TIMER_STOP(&net->fr_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); + } +} + +/* * a list of sizes based on typical mtu's, used only if next hop size not * returned. */ @@ -749,26 +774,6 @@ static int sctp_mtu_sizes[] = { 65535 }; -void -sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb) -{ - struct sctp_association *asoc; - struct sctp_nets *net; - - asoc = &stcb->asoc; - - (void)SCTP_OS_TIMER_STOP(&asoc->hb_timer.timer); - (void)SCTP_OS_TIMER_STOP(&asoc->dack_timer.timer); - (void)SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); - (void)SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); - (void)SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); - (void)SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); - TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - (void)SCTP_OS_TIMER_STOP(&net->fr_timer.timer); - (void)SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); - } -} - int find_next_best_mtu(int totsz) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 15:36:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B01271065670; Sun, 7 Nov 2010 15:36:07 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7958FC0A; Sun, 7 Nov 2010 15:36:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Fa7nl055279; Sun, 7 Nov 2010 15:36:07 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Fa7Av055277; Sun, 7 Nov 2010 15:36:07 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201011071536.oA7Fa7Av055277@svn.freebsd.org> From: Nick Hibma Date: Sun, 7 Nov 2010 15:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214919 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 15:36:07 -0000 Author: n_hibma Date: Sun Nov 7 15:36:07 2010 New Revision: 214919 URL: http://svn.freebsd.org/changeset/base/214919 Log: Bugfix: Set the bit that marks a device number in use. This would cause a panic when disconnecting the second serial device. Submitted by: Lucius Windschuh Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Sun Nov 7 14:39:40 2010 (r214918) +++ head/sys/dev/usb/serial/usb_serial.c Sun Nov 7 15:36:07 2010 (r214919) @@ -200,9 +200,12 @@ ucom_unit_alloc(void) mtx_lock(&ucom_bitmap_mtx); - for (unit = 0; unit < UCOM_UNIT_MAX; unit++) - if ((ucom_bitmap[unit / 8] & (1 << (unit % 8))) == 0) + for (unit = 0; unit < UCOM_UNIT_MAX; unit++) { + if ((ucom_bitmap[unit / 8] & (1 << (unit % 8))) == 0) { + ucom_bitmap[unit / 8] |= (1 << (unit % 8)); break; + } + } mtx_unlock(&ucom_bitmap_mtx); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 16:05:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 466661065672; Sun, 7 Nov 2010 16:05:05 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E2668FC16; Sun, 7 Nov 2010 16:05:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7G55Al057432; Sun, 7 Nov 2010 16:05:05 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7G55Yh057429; Sun, 7 Nov 2010 16:05:05 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201011071605.oA7G55Yh057429@svn.freebsd.org> From: Olivier Houchard Date: Sun, 7 Nov 2010 16:05: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: r214921 - in head/usr.sbin/makefs: . cd9660 compat ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 16:05:05 -0000 Author: cognet Date: Sun Nov 7 16:05:04 2010 New Revision: 214921 URL: http://svn.freebsd.org/changeset/base/214921 Log: Sync with the latest version from NetBSD. It notably addds ISO9660 support. Submitted by: bapt Added: head/usr.sbin/makefs/cd9660/ head/usr.sbin/makefs/cd9660.c (contents, props changed) head/usr.sbin/makefs/cd9660.h (contents, props changed) head/usr.sbin/makefs/cd9660/Makefile.inc (contents, props changed) head/usr.sbin/makefs/cd9660/cd9660_archimedes.c (contents, props changed) head/usr.sbin/makefs/cd9660/cd9660_archimedes.h (contents, props changed) head/usr.sbin/makefs/cd9660/cd9660_conversion.c (contents, props changed) head/usr.sbin/makefs/cd9660/cd9660_debug.c (contents, props changed) head/usr.sbin/makefs/cd9660/cd9660_eltorito.c (contents, props changed) head/usr.sbin/makefs/cd9660/cd9660_eltorito.h (contents, props changed) head/usr.sbin/makefs/cd9660/cd9660_strings.c (contents, props changed) head/usr.sbin/makefs/cd9660/cd9660_write.c (contents, props changed) head/usr.sbin/makefs/cd9660/iso9660_rrip.c (contents, props changed) head/usr.sbin/makefs/cd9660/iso9660_rrip.h (contents, props changed) head/usr.sbin/makefs/compat/Makefile.inc (contents, props changed) head/usr.sbin/makefs/ffs.h (contents, props changed) head/usr.sbin/makefs/ffs/Makefile.inc (contents, props changed) Modified: head/usr.sbin/makefs/Makefile head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/ffs/buf.c head/usr.sbin/makefs/ffs/ffs_alloc.c head/usr.sbin/makefs/ffs/mkfs.c head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h head/usr.sbin/makefs/walk.c Modified: head/usr.sbin/makefs/Makefile ============================================================================== --- head/usr.sbin/makefs/Makefile Sun Nov 7 15:41:41 2010 (r214920) +++ head/usr.sbin/makefs/Makefile Sun Nov 7 16:05:04 2010 (r214921) @@ -1,22 +1,23 @@ # $FreeBSD$ PROG= makefs + +CFLAGS+=-I${.CURDIR} + +SRCS= cd9660.c ffs.c \ + getid.c \ + makefs.c \ + walk.c MAN= makefs.8 WARNS?= 2 -CFLAGS+=-I${.CURDIR} -SRCS= ffs.c getid.c makefs.c walk.c +.include "${.CURDIR}/cd9660/Makefile.inc" +.include "${.CURDIR}/ffs/Makefile.inc" +.include "${.CURDIR}/compat/Makefile.inc" -.PATH: ${.CURDIR}/ffs -CFLAGS+=-I${.CURDIR}/ffs CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1 -SRCS+= buf.c ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c mkfs.c ufs_bmap.c - -.PATH: ${.CURDIR}/compat -CFLAGS+=-I${.CURDIR}/compat -SRCS+= pwcache.c strsuftoll.c .PATH: ${.CURDIR}/../mtree CFLAGS+=-I${.CURDIR}/../mtree Added: head/usr.sbin/makefs/cd9660.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/makefs/cd9660.c Sun Nov 7 16:05:04 2010 (r214921) @@ -0,0 +1,2154 @@ +/* $NetBSD: cd9660.c,v 1.27 2010/10/27 18:51:34 christos Exp $ */ + +/* + * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan + * Perez-Rathke and Ram Vedam. All rights reserved. + * + * This code was written by Daniel Watt, Walter Deignan, Ryan Gabrys, + * Alan Perez-Rathke and Ram Vedam. + * + * 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 DANIEL WATT, WALTER DEIGNAN, RYAN + * GABRYS, ALAN PEREZ-RATHKE AND RAM VEDAM ``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 DANIEL WATT, WALTER DEIGNAN, RYAN + * GABRYS, ALAN PEREZ-RATHKE AND RAM VEDAM 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. + */ +/* + * Copyright (c) 2001 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Luke Mewburn for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC + * 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. + */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "makefs.h" +#include "cd9660.h" +#include "cd9660/iso9660_rrip.h" +#include "cd9660/cd9660_archimedes.h" + +/* + * Global variables + */ +iso9660_disk diskStructure; + +static void cd9660_finalize_PVD(void); +static cd9660node *cd9660_allocate_cd9660node(void); +static void cd9660_set_defaults(void); +static int cd9660_arguments_set_string(const char *, const char *, int, + char, char *); +static void cd9660_populate_iso_dir_record( + struct _iso_directory_record_cd9660 *, u_char, u_char, u_char, + const char *); +static void cd9660_setup_root_node(void); +static int cd9660_setup_volume_descriptors(void); +#if 0 +static int cd9660_fill_extended_attribute_record(cd9660node *); +#endif +static void cd9660_sort_nodes(cd9660node *); +static int cd9960_translate_node_common(cd9660node *); +static int cd9660_translate_node(fsnode *, cd9660node *); +static int cd9660_compare_filename(const char *, const char *); +static void cd9660_sorted_child_insert(cd9660node *, cd9660node *); +static int cd9660_handle_collisions(cd9660node *, int); +static cd9660node *cd9660_rename_filename(cd9660node *, int, int); +static void cd9660_copy_filenames(cd9660node *); +static void cd9660_sorting_nodes(cd9660node *); +static int cd9660_count_collisions(cd9660node *); +static cd9660node *cd9660_rrip_move_directory(cd9660node *); +static int cd9660_add_dot_records(cd9660node *); + +static void cd9660_convert_structure(fsnode *, cd9660node *, int, + int *, int *); +static void cd9660_free_structure(cd9660node *); +static int cd9660_generate_path_table(void); +static int cd9660_level1_convert_filename(const char *, char *, int); +static int cd9660_level2_convert_filename(const char *, char *, int); +#if 0 +static int cd9660_joliet_convert_filename(const char *, char *, int); +#endif +static int cd9660_convert_filename(const char *, char *, int); +static void cd9660_populate_dot_records(cd9660node *); +static int64_t cd9660_compute_offsets(cd9660node *, int64_t); +#if 0 +static int cd9660_copy_stat_info(cd9660node *, cd9660node *, int); +#endif +static cd9660node *cd9660_create_virtual_entry(const char *, cd9660node *, int, + int); +static cd9660node *cd9660_create_file(const char *, cd9660node *, cd9660node *); +static cd9660node *cd9660_create_directory(const char *, cd9660node *, + cd9660node *); +static cd9660node *cd9660_create_special_directory(u_char, cd9660node *); + + +/* + * Allocate and initalize a cd9660node + * @returns struct cd9660node * Pointer to new node, or NULL on error + */ +static cd9660node * +cd9660_allocate_cd9660node(void) +{ + cd9660node *temp; + + if ((temp = calloc(1, sizeof(cd9660node))) == NULL) + err(EXIT_FAILURE, "%s: calloc", __func__); + TAILQ_INIT(&temp->cn_children); + temp->parent = temp->dot_record = temp->dot_dot_record = NULL; + temp->ptnext = temp->ptprev = temp->ptlast = NULL; + temp->node = NULL; + temp->isoDirRecord = NULL; + temp->isoExtAttributes = NULL; + temp->rr_real_parent = temp->rr_relocated = NULL; + temp->su_tail_data = NULL; + return temp; +} + +int cd9660_defaults_set = 0; + +/** +* Set default values for cd9660 extension to makefs +*/ +static void +cd9660_set_defaults(void) +{ + /*Fix the sector size for now, though the spec allows for other sizes*/ + diskStructure.sectorSize = 2048; + + /* Set up defaults in our own structure */ + diskStructure.verbose_level = 0; + diskStructure.keep_bad_images = 0; + diskStructure.follow_sym_links = 0; + diskStructure.isoLevel = 2; + + diskStructure.rock_ridge_enabled = 0; + diskStructure.rock_ridge_renamed_dir_name = 0; + diskStructure.rock_ridge_move_count = 0; + diskStructure.rr_moved_dir = 0; + + diskStructure.archimedes_enabled = 0; + + diskStructure.include_padding_areas = 1; + + /* Spec breaking functionality */ + diskStructure.allow_deep_trees = + diskStructure.allow_start_dot = + diskStructure.allow_max_name = + diskStructure.allow_illegal_chars = + diskStructure.allow_lowercase = + diskStructure.allow_multidot = + diskStructure.omit_trailing_period = 0; + + /* Make sure the PVD is clear */ + memset(&diskStructure.primaryDescriptor, 0, 2048); + + memset(diskStructure.primaryDescriptor.volume_set_id, 0x20,32); + memset(diskStructure.primaryDescriptor.publisher_id, 0x20,128); + memset(diskStructure.primaryDescriptor.preparer_id, 0x20,128); + memset(diskStructure.primaryDescriptor.application_id, 0x20,128); + memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,128); + memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,128); + memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,128); + + strcpy(diskStructure.primaryDescriptor.system_id,"NetBSD"); + + cd9660_defaults_set = 1; + + /* Boot support: Initially disabled */ + diskStructure.has_generic_bootimage = 0; + diskStructure.generic_bootimage = NULL; + + diskStructure.boot_image_directory = 0; + /*memset(diskStructure.boot_descriptor, 0, 2048);*/ + + diskStructure.is_bootable = 0; + TAILQ_INIT(&diskStructure.boot_images); + LIST_INIT(&diskStructure.boot_entries); +} + +void +cd9660_prep_opts(fsinfo_t *fsopts __unused) +{ + cd9660_set_defaults(); +} + +void +cd9660_cleanup_opts(fsinfo_t *fsopts __unused) +{ + +} + +static int +cd9660_arguments_set_string(const char *val, const char *fieldtitle, int length, + char testmode, char * dest) +{ + int len, test; + + if (val == NULL) + warnx("error: The %s requires a string argument", fieldtitle); + else if ((len = strlen(val)) <= length) { + if (testmode == 'd') + test = cd9660_valid_d_chars(val); + else + test = cd9660_valid_a_chars(val); + if (test) { + memcpy(dest, val, len); + if (test == 2) + cd9660_uppercase_characters(dest, len); + return 1; + } else + warnx("error: The %s must be composed of " + "%c-characters", fieldtitle, testmode); + } else + warnx("error: The %s must be at most 32 characters long", + fieldtitle); + return 0; +} + +/* + * Command-line parsing function + */ + +int +cd9660_parse_opts(const char *option, fsinfo_t *fsopts) +{ + char *var, *val; + int rv; + /* Set up allowed options - integer options ONLY */ + option_t cd9660_options[] = { + { "l", &diskStructure.isoLevel, 1, 3, "ISO Level" }, + { "isolevel", &diskStructure.isoLevel, 1, 3, "ISO Level" }, + { "verbose", &diskStructure.verbose_level, 0, 2, + "Turns on verbose output" }, + { "v", &diskStructure.verbose_level, 0 , 2, + "Turns on verbose output"}, + { .name = NULL } + }; + + if (cd9660_defaults_set == 0) + cd9660_set_defaults(); + + /* + * Todo : finish implementing this, and make a function that + * parses them + */ + /* + string_option_t cd9660_string_options[] = { + { "L", "Label", &diskStructure.primaryDescriptor.volume_id, 1, 32, "Disk Label", ISO_STRING_FILTER_DCHARS }, + { NULL } + } + */ + + assert(option != NULL); + + if (debug & DEBUG_FS_PARSE_OPTS) + printf("cd9660_parse_opts: got `%s'\n", option); + + if ((var = strdup(option)) == NULL) + err(1, "allocating memory for copy of option string"); + rv = 1; + + val = strchr(var, '='); + if (val != NULL) + *val++ = '\0'; + + /* First handle options with no parameters */ + if (strcmp(var, "h") == 0) { + diskStructure.displayHelp = 1; + rv = 1; + } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "S", "follow-symlinks")) { + /* this is not handled yet */ + diskStructure.follow_sym_links = 1; + rv = 1; + } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "L", "label")) { + rv = cd9660_arguments_set_string(val, "Disk Label", 32, 'd', + diskStructure.primaryDescriptor.volume_id); + } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "applicationid")) { + rv = cd9660_arguments_set_string(val, "Application Identifier", 128, 'a', + diskStructure.primaryDescriptor.application_id); + } else if(CD9660_IS_COMMAND_ARG_DUAL(var, "P", "publisher")) { + rv = cd9660_arguments_set_string(val, "Publisher Identifier", + 128, 'a', diskStructure.primaryDescriptor.publisher_id); + } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "p", "preparer")) { + rv = cd9660_arguments_set_string(val, "Preparer Identifier", + 128, 'a', diskStructure.primaryDescriptor.preparer_id); + } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "V", "volumeid")) { + rv = cd9660_arguments_set_string(val, "Volume Set Identifier", + 128, 'a', diskStructure.primaryDescriptor.volume_set_id); + /* Boot options */ + } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "B", "bootimage")) { + if (val == NULL) + warnx("error: The Boot Image parameter requires a valid boot information string"); + else + rv = cd9660_add_boot_disk(val); + } else if (CD9660_IS_COMMAND_ARG(var, "bootimagedir")) { + /* + * XXXfvdl this is unused. + */ + if (val == NULL) + errx(1, "error: The Boot Image Directory parameter" + " requires a directory name\n"); + else { + if ((diskStructure.boot_image_directory = + malloc(strlen(val) + 1)) == NULL) { + CD9660_MEM_ALLOC_ERROR("cd9660_parse_opts"); + exit(1); + } + + /* BIG TODO: Add the max length function here */ + cd9660_arguments_set_string(val, "Boot Image Directory", + 12 , 'd', diskStructure.boot_image_directory); + } + } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "G", "generic-bootimage")) { + if (val == NULL) + warnx("error: The Boot Image parameter requires a valid boot information string"); + else + rv = cd9660_add_generic_bootimage(val); + } else if (CD9660_IS_COMMAND_ARG(var, "no-trailing-padding")) + diskStructure.include_padding_areas = 0; + /* RRIP */ + else if (CD9660_IS_COMMAND_ARG_DUAL(var, "R", "rockridge")) + diskStructure.rock_ridge_enabled = 1; + else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "archimedes")) + diskStructure.archimedes_enabled = 1; + else if (CD9660_IS_COMMAND_ARG_DUAL(var, "K", "keep-bad-images")) + diskStructure.keep_bad_images = 1; + else if (CD9660_IS_COMMAND_ARG(var, "allow-deep-trees")) + diskStructure.allow_deep_trees = 1; + else if (CD9660_IS_COMMAND_ARG(var, "allow-max-name")) + diskStructure.allow_max_name = 1; + else if (CD9660_IS_COMMAND_ARG(var, "allow-illegal-chars")) + diskStructure.allow_illegal_chars = 1; + else if (CD9660_IS_COMMAND_ARG(var, "allow-lowercase")) + diskStructure.allow_lowercase = 1; + else if (CD9660_IS_COMMAND_ARG(var,"allow-multidot")) + diskStructure.allow_multidot = 1; + else if (CD9660_IS_COMMAND_ARG(var, "omit-trailing-period")) + diskStructure.omit_trailing_period = 1; + else if (CD9660_IS_COMMAND_ARG(var, "no-emul-boot") || + CD9660_IS_COMMAND_ARG(var, "no-boot") || + CD9660_IS_COMMAND_ARG(var, "hard-disk-boot")) { + cd9660_eltorito_add_boot_option(var, 0); + + /* End of flag variables */ + } else if (CD9660_IS_COMMAND_ARG(var, "boot-load-segment")) { + if (val == NULL) { + warnx("Option `%s' doesn't contain a value", var); + rv = 0; + } else { + cd9660_eltorito_add_boot_option(var, val); + } + } else { + if (val == NULL) { + warnx("Option `%s' doesn't contain a value", var); + rv = 0; + } else + rv = set_option(cd9660_options, var, val); + } + + if (var) + free(var); + return (rv); +} + +/* + * Main function for cd9660_makefs + * Builds the ISO image file + * @param const char *image The image filename to create + * @param const char *dir The directory that is being read + * @param struct fsnode *root The root node of the filesystem tree + * @param struct fsinfo_t *fsopts Any options + */ +void +cd9660_makefs(const char *image, const char *dir, fsnode *root, + fsinfo_t *fsopts) +{ + int64_t startoffset; + int numDirectories; + uint64_t pathTableSectors; + int64_t firstAvailableSector; + int64_t totalSpace; + int error; + cd9660node *real_root; + + if (diskStructure.verbose_level > 0) + printf("cd9660_makefs: ISO level is %i\n", + diskStructure.isoLevel); + if (diskStructure.isoLevel < 2 && + diskStructure.allow_multidot) + errx(1, "allow-multidot requires iso level of 2\n"); + + assert(image != NULL); + assert(dir != NULL); + assert(root != NULL); + + if (diskStructure.displayHelp) { + /* + * Display help here - probably want to put it in + * a separate function + */ + return; + } + + diskStructure.rootFilesystemPath = dir; + + if (diskStructure.verbose_level > 0) + printf("cd9660_makefs: image %s directory %s root %p\n", + image, dir, root); + + /* Set up some constants. Later, these will be defined with options */ + + /* Counter needed for path tables */ + numDirectories = 0; + + /* Convert tree to our own format */ + /* Actually, we now need to add the REAL root node, at level 0 */ + + real_root = cd9660_allocate_cd9660node(); + if ((real_root->isoDirRecord = + malloc( sizeof(iso_directory_record_cd9660) )) == NULL) { + CD9660_MEM_ALLOC_ERROR("cd9660_makefs"); + exit(1); + } + + /* Leave filename blank for root */ + memset(real_root->isoDirRecord->name, 0, + ISO_FILENAME_MAXLENGTH_WITH_PADDING); + + real_root->level = 0; + diskStructure.rootNode = real_root; + real_root->type = CD9660_TYPE_DIR; + error = 0; + real_root->node = root; + cd9660_convert_structure(root, real_root, 1, &numDirectories, &error); + + if (TAILQ_EMPTY(&real_root->cn_children)) { + errx(1, "cd9660_makefs: converted directory is empty. " + "Tree conversion failed\n"); + } else if (error != 0) { + errx(1, "cd9660_makefs: tree conversion failed\n"); + } else { + if (diskStructure.verbose_level > 0) + printf("cd9660_makefs: tree converted\n"); + } + + /* Add the dot and dot dot records */ + cd9660_add_dot_records(real_root); + + cd9660_setup_root_node(); + + if (diskStructure.verbose_level > 0) + printf("cd9660_makefs: done converting tree\n"); + + /* non-SUSP extensions */ + if (diskStructure.archimedes_enabled) + archimedes_convert_tree(diskStructure.rootNode); + + /* Rock ridge / SUSP init pass */ + if (diskStructure.rock_ridge_enabled) { + cd9660_susp_initialize(diskStructure.rootNode, + diskStructure.rootNode, NULL); + } + + /* Build path table structure */ + diskStructure.pathTableLength = cd9660_generate_path_table(); + + pathTableSectors = CD9660_BLOCKS(diskStructure.sectorSize, + diskStructure.pathTableLength); + + firstAvailableSector = cd9660_setup_volume_descriptors(); + if (diskStructure.is_bootable) { + firstAvailableSector = cd9660_setup_boot(firstAvailableSector); + if (firstAvailableSector < 0) + errx(1, "setup_boot failed"); + } + /* LE first, then BE */ + diskStructure.primaryLittleEndianTableSector = firstAvailableSector; + diskStructure.primaryBigEndianTableSector = + diskStructure.primaryLittleEndianTableSector + pathTableSectors; + + /* Set the secondary ones to -1, not going to use them for now */ + diskStructure.secondaryBigEndianTableSector = -1; + diskStructure.secondaryLittleEndianTableSector = -1; + + diskStructure.dataFirstSector = + diskStructure.primaryBigEndianTableSector + pathTableSectors; + if (diskStructure.verbose_level > 0) + printf("cd9660_makefs: Path table conversion complete. " + "Each table is %i bytes, or %" PRIu64 " sectors.\n", + diskStructure.pathTableLength, pathTableSectors); + + startoffset = diskStructure.sectorSize*diskStructure.dataFirstSector; + + totalSpace = cd9660_compute_offsets(real_root, startoffset); + + diskStructure.totalSectors = diskStructure.dataFirstSector + + CD9660_BLOCKS(diskStructure.sectorSize, totalSpace); + + /* Disabled until pass 1 is done */ + if (diskStructure.rock_ridge_enabled) { + diskStructure.susp_continuation_area_start_sector = + diskStructure.totalSectors; + diskStructure.totalSectors += + CD9660_BLOCKS(diskStructure.sectorSize, + diskStructure.susp_continuation_area_size); + cd9660_susp_finalize(diskStructure.rootNode); + } + + + cd9660_finalize_PVD(); + + /* Add padding sectors, just for testing purposes right now */ + /* diskStructure.totalSectors+=150; */ + + /* Debugging output */ + if (diskStructure.verbose_level > 0) { + printf("cd9660_makefs: Sectors 0-15 reserved\n"); + printf("cd9660_makefs: Primary path tables starts in sector %" + PRId64 "\n", diskStructure.primaryLittleEndianTableSector); + printf("cd9660_makefs: File data starts in sector %" + PRId64 "\n", diskStructure.dataFirstSector); + printf("cd9660_makefs: Total sectors: %" + PRId64 "\n", diskStructure.totalSectors); + } + + /* + * Add padding sectors at the end + * TODO: Clean this up and separate padding + */ + if (diskStructure.include_padding_areas) + diskStructure.totalSectors += 150; + + cd9660_write_image(image); + + if (diskStructure.verbose_level > 1) { + debug_print_volume_descriptor_information(); + debug_print_tree(real_root,0); + debug_print_path_tree(real_root); + } + + /* Clean up data structures */ + cd9660_free_structure(real_root); + + if (diskStructure.verbose_level > 0) + printf("cd9660_makefs: done\n"); +} + +/* Generic function pointer - implement later */ +typedef int (*cd9660node_func)(cd9660node *); + +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, + diskStructure.rootNode->dot_record->isoDirRecord, 34); + + /* In RRIP, this might be longer than 34 */ + diskStructure.primaryDescriptor.root_directory_record[0] = 34; + + /* Set up all the important numbers in the PVD */ + cd9660_bothendian_dword(diskStructure.totalSectors, + (unsigned char *)diskStructure.primaryDescriptor.volume_space_size); + cd9660_bothendian_word(1, + (unsigned char *)diskStructure.primaryDescriptor.volume_set_size); + cd9660_bothendian_word(1, + (unsigned char *) + diskStructure.primaryDescriptor.volume_sequence_number); + cd9660_bothendian_word(diskStructure.sectorSize, + (unsigned char *) + diskStructure.primaryDescriptor.logical_block_size); + cd9660_bothendian_dword(diskStructure.pathTableLength, + (unsigned char *)diskStructure.primaryDescriptor.path_table_size); + + cd9660_731(diskStructure.primaryLittleEndianTableSector, + (u_char *)diskStructure.primaryDescriptor.type_l_path_table); + cd9660_732(diskStructure.primaryBigEndianTableSector, + (u_char *)diskStructure.primaryDescriptor.type_m_path_table); + + diskStructure.primaryDescriptor.file_structure_version[0] = 1; + + /* Pad all strings with spaces instead of nulls */ + cd9660_pad_string_spaces(diskStructure.primaryDescriptor.volume_id, 32); + cd9660_pad_string_spaces(diskStructure.primaryDescriptor.system_id, 32); + cd9660_pad_string_spaces(diskStructure.primaryDescriptor.volume_set_id, + 128); + cd9660_pad_string_spaces(diskStructure.primaryDescriptor.publisher_id, + 128); + cd9660_pad_string_spaces(diskStructure.primaryDescriptor.preparer_id, + 128); + cd9660_pad_string_spaces(diskStructure.primaryDescriptor.application_id, + 128); + cd9660_pad_string_spaces( + diskStructure.primaryDescriptor.copyright_file_id, 128); + cd9660_pad_string_spaces( + diskStructure.primaryDescriptor.abstract_file_id, 128); + cd9660_pad_string_spaces( + diskStructure.primaryDescriptor.bibliographic_file_id, 128); + + /* Setup dates */ + time(&tim); + cd9660_time_8426( + (unsigned char *)diskStructure.primaryDescriptor.creation_date, + tim); + cd9660_time_8426( + (unsigned char *)diskStructure.primaryDescriptor.modification_date, + tim); + + /* + cd9660_set_date(diskStructure.primaryDescriptor.expiration_date, now); + */ + + memset(diskStructure.primaryDescriptor.expiration_date, '0' ,17); + cd9660_time_8426( + (unsigned char *)diskStructure.primaryDescriptor.effective_date, + tim); +} + +static void +cd9660_populate_iso_dir_record(struct _iso_directory_record_cd9660 *record, + u_char ext_attr_length, u_char flags, + u_char name_len, const char * name) +{ + record->ext_attr_length[0] = ext_attr_length; + record->flags[0] = ISO_FLAG_CLEAR | flags; + record->file_unit_size[0] = 0; + record->interleave[0] = 0; + cd9660_bothendian_word(1, record->volume_sequence_number); + record->name_len[0] = name_len; + memset(record->name, '\0', sizeof (record->name)); + memcpy(record->name, name, name_len); + record->length[0] = 33 + name_len; + + /* Todo : better rounding */ + record->length[0] += (record->length[0] & 1) ? 1 : 0; +} + +static void +cd9660_setup_root_node(void) +{ + cd9660_populate_iso_dir_record(diskStructure.rootNode->isoDirRecord, + 0, ISO_FLAG_DIRECTORY, 1, "\0"); + +} + +/*********** SUPPORT FUNCTIONS ***********/ +static int +cd9660_setup_volume_descriptors(void) +{ + /* Boot volume descriptor should come second */ + int sector = 16; + /* For now, a fixed 2 : PVD and terminator */ + volume_descriptor *temp, *t; + + /* Set up the PVD */ + if ((temp = malloc(sizeof(volume_descriptor))) == NULL) { + CD9660_MEM_ALLOC_ERROR("cd9660_setup_volume_descriptors"); + exit(1); + } + + temp->volumeDescriptorData = + (unsigned char *)&diskStructure.primaryDescriptor; + temp->volumeDescriptorData[0] = ISO_VOLUME_DESCRIPTOR_PVD; + temp->volumeDescriptorData[6] = 1; + temp->sector = sector; + memcpy(temp->volumeDescriptorData + 1, + ISO_VOLUME_DESCRIPTOR_STANDARD_ID, 5); + diskStructure.firstVolumeDescriptor = temp; + + sector++; + /* Set up boot support if enabled. BVD must reside in sector 17 */ + if (diskStructure.is_bootable) { + if ((t = malloc(sizeof(volume_descriptor))) == NULL) { + CD9660_MEM_ALLOC_ERROR( + "cd9660_setup_volume_descriptors"); + exit(1); + } + if ((t->volumeDescriptorData = malloc(2048)) == NULL) { + CD9660_MEM_ALLOC_ERROR( + "cd9660_setup_volume_descriptors"); + exit(1); + } + temp->next = t; + temp = t; + memset(t->volumeDescriptorData, 0, 2048); + t->sector = 17; + if (diskStructure.verbose_level > 0) + printf("Setting up boot volume descriptor\n"); + cd9660_setup_boot_volume_descriptor(t); + sector++; + } + + /* Set up the terminator */ + if ((t = malloc(sizeof(volume_descriptor))) == NULL) { + CD9660_MEM_ALLOC_ERROR("cd9660_setup_volume_descriptors"); + exit(1); + } + if ((t->volumeDescriptorData = malloc(2048)) == NULL) { + CD9660_MEM_ALLOC_ERROR("cd9660_setup_volume_descriptors"); + exit(1); + } + + temp->next = t; + memset(t->volumeDescriptorData, 0, 2048); + t->volumeDescriptorData[0] = ISO_VOLUME_DESCRIPTOR_TERMINATOR; + t->next = 0; + t->volumeDescriptorData[6] = 1; + t->sector = sector; + memcpy(t->volumeDescriptorData + 1, + ISO_VOLUME_DESCRIPTOR_STANDARD_ID, 5); + + sector++; + return sector; +} + +#if 0 +/* + * Populate EAR at some point. Not required, but is used by NetBSD's + * cd9660 support + */ +static int +cd9660_fill_extended_attribute_record(cd9660node *node) +{ + if ((node->isoExtAttributes = + malloc(sizeof(struct iso_extended_attributes))) == NULL) { + CD9660_MEM_ALLOC_ERROR("cd9660_fill_extended_attribute_record"); + exit(1); + }; + + return 1; +} +#endif + +static int +cd9960_translate_node_common(cd9660node *newnode) +{ + time_t tim; + int test; + u_char flag; + char temp[ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + + /* Now populate the isoDirRecord structure */ + memset(temp, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); + + test = cd9660_convert_filename(newnode->node->name, + temp, !(S_ISDIR(newnode->node->type))); + + flag = ISO_FLAG_CLEAR; + if (S_ISDIR(newnode->node->type)) + flag |= ISO_FLAG_DIRECTORY; + + cd9660_populate_iso_dir_record(newnode->isoDirRecord, 0, + flag, strlen(temp), temp); + + /* Set the various dates */ + + /* If we want to use the current date and time */ + time(&tim); + + cd9660_time_915(newnode->isoDirRecord->date, tim); + + cd9660_bothendian_dword(newnode->fileDataLength, + newnode->isoDirRecord->size); + /* If the file is a link, we want to set the size to 0 */ + if (S_ISLNK(newnode->node->type)) + newnode->fileDataLength = 0; + + return 1; +} + +/* + * Translate fsnode to cd9960node + * Translate filenames and other metadata, including dates, sizes, + * permissions, etc + * @param struct fsnode * The node generated by makefs + * @param struct cd9660node * The intermediate node to be written to + * @returns int 0 on failure, 1 on success + */ +static int +cd9660_translate_node(fsnode *node, cd9660node *newnode) +{ + if (node == NULL) { + if (diskStructure.verbose_level > 0) + printf("cd9660_translate_node: NULL node passed, " + "returning\n"); + return 0; + } + if ((newnode->isoDirRecord = + malloc(sizeof(iso_directory_record_cd9660))) == NULL) { + CD9660_MEM_ALLOC_ERROR("cd9660_translate_node"); + return 0; + } + + /* Set the node pointer */ + newnode->node = node; + + /* Set the size */ + if (!(S_ISDIR(node->type))) + newnode->fileDataLength = node->inode->st.st_size; + + if (cd9960_translate_node_common(newnode) == 0) + return 0; + + /* Finally, overwrite some of the values that are set by default */ + cd9660_time_915(newnode->isoDirRecord->date, node->inode->st.st_mtime); + + return 1; +} + +/* + * Compares two ISO filenames + * @param const char * The first file name + * @param const char * The second file name + * @returns : -1 if first is less than second, 0 if they are the same, 1 if + * the second is greater than the first + */ +static int +cd9660_compare_filename(const char *first, const char *second) +{ + /* + * This can be made more optimal once it has been tested + * (the extra character, for example, is for testing) + */ + + int p1 = 0; + int p2 = 0; + char c1, c2; + /* First, on the filename */ + + while (p1 < ISO_FILENAME_MAXLENGTH_BEFORE_VERSION-1 + && p2 < ISO_FILENAME_MAXLENGTH_BEFORE_VERSION-1) { + c1 = first[p1]; + c2 = second[p2]; + if (c1 == '.' && c2 =='.') + break; + else if (c1 == '.') { + p2++; + c1 = ' '; + } else if (c2 == '.') { + p1++; + c2 = ' '; + } else { + p1++; + p2++; + } + + if (c1 < c2) + return -1; + else if (c1 > c2) { + return 1; + } + } + + if (first[p1] == '.' && second[p2] == '.') { + p1++; + p2++; + while (p1 < ISO_FILENAME_MAXLENGTH_BEFORE_VERSION - 1 + && p2 < ISO_FILENAME_MAXLENGTH_BEFORE_VERSION - 1) { + c1 = first[p1]; + c2 = second[p2]; + if (c1 == ';' && c2 == ';') + break; + else if (c1 == ';') { + p2++; + c1 = ' '; + } else if (c2 == ';') { + p1++; + c2 = ' '; + } else { + p1++; + p2++; + } + + if (c1 < c2) + return -1; + else if (c1 > c2) + return 1; + } + } + return 0; +} + +/* + * Insert a node into list with ISO sorting rules + * @param cd9660node * The head node of the list + * @param cd9660node * The node to be inserted + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 16:24:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C03D106564A; Sun, 7 Nov 2010 16:24:52 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id F3B9C8FC12; Sun, 7 Nov 2010 16:24:51 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 051D02A28CEB; Sun, 7 Nov 2010 17:24:51 +0100 (CET) Date: Sun, 7 Nov 2010 17:24:51 +0100 From: Ed Schouten To: Olivier Houchard Message-ID: <20101107162451.GD2054@hoeg.nl> References: <201011071605.oA7G55Yh057429@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="A1Iwnsx6rNfRhs6P" Content-Disposition: inline In-Reply-To: <201011071605.oA7G55Yh057429@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: r214921 - in head/usr.sbin/makefs: . cd9660 compat ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 16:24:52 -0000 --A1Iwnsx6rNfRhs6P Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Olivier Houchard , 20101107 17:05: > Sync with the latest version from NetBSD. It notably addds ISO9660 suppor= t. Thank you! --=20 Ed Schouten WWW: http://80386.nl/ --A1Iwnsx6rNfRhs6P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkzW0tMACgkQ52SDGA2eCwWWdwCfRrRCG0pQZIJQvLjrKugoncxz u5EAn2WqIKPULZd1R4AvIfLwZvB75np3 =gXyU -----END PGP SIGNATURE----- --A1Iwnsx6rNfRhs6P-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 16:56:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98CB5106564A; Sun, 7 Nov 2010 16:56:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832B38FC15; Sun, 7 Nov 2010 16:56:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7GuTOw062065; Sun, 7 Nov 2010 16:56:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7GuTdt062047; Sun, 7 Nov 2010 16:56:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071656.oA7GuTdt062047@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 16:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214922 - in stable/8/sys: arm/at91 dev/bce dev/ed dev/et dev/lge dev/nfe dev/nge dev/nve dev/sf dev/sge dev/sis dev/smc dev/tl dev/tx dev/usb/net dev/wb mips/idt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 16:56:29 -0000 Author: marius Date: Sun Nov 7 16:56:29 2010 New Revision: 214922 URL: http://svn.freebsd.org/changeset/base/214922 Log: MFC: r213894, r213896, r214913 Converted the remainder of the NIC drivers to use the mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214685) instead of mii_phy_probe(). Unlike r213893 (MFC'ed to stable/8 in r214909) these are only straight forward conversions though. Reviewed by: yongari Modified: stable/8/sys/arm/at91/if_ate.c stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/ed/if_ed_pccard.c stable/8/sys/dev/et/if_et.c stable/8/sys/dev/lge/if_lge.c stable/8/sys/dev/nfe/if_nfe.c stable/8/sys/dev/nge/if_nge.c stable/8/sys/dev/nve/if_nve.c stable/8/sys/dev/sf/if_sf.c stable/8/sys/dev/sge/if_sge.c stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/smc/if_smc.c stable/8/sys/dev/tl/if_tl.c stable/8/sys/dev/tx/if_tx.c stable/8/sys/dev/usb/net/usb_ethernet.c stable/8/sys/dev/wb/if_wb.c stable/8/sys/mips/idt/if_kr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/arm/at91/if_ate.c ============================================================================== --- stable/8/sys/arm/at91/if_ate.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/arm/at91/if_ate.c Sun Nov 7 16:56:29 2010 (r214922) @@ -258,9 +258,10 @@ ate_attach(device_t dev) } sc->ifp = ifp = if_alloc(IFT_ETHER); - if (mii_phy_probe(dev, &sc->miibus, ate_ifmedia_upd, ate_ifmedia_sts)) { - device_printf(dev, "Cannot find my PHY.\n"); - err = ENXIO; + err = mii_attach(dev, &sc->miibus, ifp, ate_ifmedia_upd, + ate_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (err != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto out; } Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/bce/if_bce.c Sun Nov 7 16:56:29 2010 (r214922) @@ -1134,12 +1134,13 @@ bce_attach(device_t dev) /* Handle any special PHY initialization for SerDes PHYs. */ bce_init_media(sc); - /* MII child bus by probing the PHY. */ - if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, - bce_ifmedia_sts)) { - BCE_PRINTF("%s(%d): No PHY found on child MII bus!\n", - __FILE__, __LINE__); - rc = ENXIO; + /* MII child bus by attaching the PHY. */ + rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, + bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, + MII_OFFSET_ANY, 0); + if (rc != 0) { + BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, + __LINE__); goto bce_attach_fail; } Modified: stable/8/sys/dev/ed/if_ed_pccard.c ============================================================================== --- stable/8/sys/dev/ed/if_ed_pccard.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/ed/if_ed_pccard.c Sun Nov 7 16:56:29 2010 (r214922) @@ -578,25 +578,21 @@ ed_pccard_attach(device_t dev) goto bad; if (sc->chip_type == ED_CHIP_TYPE_DL10019 || sc->chip_type == ED_CHIP_TYPE_DL10022) { - /* Probe for an MII bus, but ignore errors. */ + /* Try to attach an MII bus, but ignore errors. */ ed_pccard_dl100xx_mii_reset(sc); - (void)mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts); + (void)mii_attach(dev, &sc->miibus, sc->ifp, ed_ifmedia_upd, + ed_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); } else if (sc->chip_type == ED_CHIP_TYPE_AX88190 || - sc->chip_type == ED_CHIP_TYPE_AX88790) { - if ((error = mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts)) != 0) { - device_printf(dev, "Missing mii %d!\n", error); + sc->chip_type == ED_CHIP_TYPE_AX88790 || + sc->chip_type == ED_CHIP_TYPE_TC5299J) { + error = mii_attach(dev, &sc->miibus, sc->ifp, ed_ifmedia_upd, + ed_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto bad; } - - } else if (sc->chip_type == ED_CHIP_TYPE_TC5299J) { - if ((error = mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts)) != 0) { - device_printf(dev, "Missing mii!\n"); - goto bad; - } - } if (sc->miibus != NULL) { sc->sc_tick = ed_pccard_tick; Modified: stable/8/sys/dev/et/if_et.c ============================================================================== --- stable/8/sys/dev/et/if_et.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/et/if_et.c Sun Nov 7 16:56:29 2010 (r214922) @@ -63,8 +63,8 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include #include @@ -343,10 +343,10 @@ et_attach(device_t dev) et_chip_attach(sc); - error = mii_phy_probe(dev, &sc->sc_miibus, - et_ifmedia_upd, et_ifmedia_sts); + error = mii_attach(dev, &sc->sc_miibus, ifp, et_ifmedia_upd, + et_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); if (error) { - device_printf(dev, "can't probe any PHY\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/lge/if_lge.c ============================================================================== --- stable/8/sys/dev/lge/if_lge.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/lge/if_lge.c Sun Nov 7 16:56:29 2010 (r214922) @@ -558,10 +558,10 @@ lge_attach(dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->lge_miibus, - lge_ifmedia_upd, lge_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->lge_miibus, ifp, lge_ifmedia_upd, + lge_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/8/sys/dev/nfe/if_nfe.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/nfe/if_nfe.c Sun Nov 7 16:56:29 2010 (r214922) @@ -600,10 +600,10 @@ nfe_attach(device_t dev) #endif /* Do MII setup */ - if (mii_phy_probe(dev, &sc->nfe_miibus, nfe_ifmedia_upd, - nfe_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->nfe_miibus, ifp, nfe_ifmedia_upd, + nfe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } ether_ifattach(ifp, sc->eaddr); Modified: stable/8/sys/dev/nge/if_nge.c ============================================================================== --- stable/8/sys/dev/nge/if_nge.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/nge/if_nge.c Sun Nov 7 16:56:29 2010 (r214922) @@ -1079,10 +1079,10 @@ nge_attach(device_t dev) /* * Do MII setup. */ - error = mii_phy_probe(dev, &sc->nge_miibus, nge_mediachange, - nge_mediastatus); + error = mii_attach(dev, &sc->nge_miibus, ifp, nge_mediachange, + nge_mediastatus, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); if (error != 0) { - device_printf(dev, "no PHY found!\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/nve/if_nve.c ============================================================================== --- stable/8/sys/dev/nve/if_nve.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/nve/if_nve.c Sun Nov 7 16:56:29 2010 (r214922) @@ -543,11 +543,12 @@ nve_attach(device_t dev) ifp->if_capabilities |= IFCAP_VLAN_MTU; ifp->if_capenable |= IFCAP_VLAN_MTU; - /* Probe device for MII interface to PHY */ - DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_phy_probe\n"); - if (mii_phy_probe(dev, &sc->miibus, nve_ifmedia_upd, nve_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + /* Attach device for MII interface to PHY */ + DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_attach\n"); + error = mii_attach(dev, &sc->miibus, ifp, nve_ifmedia_upd, + nve_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -555,10 +556,10 @@ nve_attach(device_t dev) ether_ifattach(ifp, eaddr); /* Activate our interrupt handler. - attach last to avoid lock */ - error = bus_setup_intr(sc->dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, + error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, nve_intr, sc, &sc->sc_ih); if (error) { - device_printf(sc->dev, "couldn't set up interrupt handler\n"); + device_printf(dev, "couldn't set up interrupt handler\n"); goto fail; } DEBUGOUT(NVE_DEBUG_INIT, "nve: nve_attach - exit\n"); Modified: stable/8/sys/dev/sf/if_sf.c ============================================================================== --- stable/8/sys/dev/sf/if_sf.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/sf/if_sf.c Sun Nov 7 16:56:29 2010 (r214922) @@ -866,10 +866,10 @@ sf_attach(device_t dev) } /* Do MII setup. */ - if (mii_phy_probe(dev, &sc->sf_miibus, sf_ifmedia_upd, - sf_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sf_miibus, ifp, sf_ifmedia_upd, + sf_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/sge/if_sge.c Sun Nov 7 16:56:29 2010 (r214922) @@ -627,10 +627,10 @@ sge_attach(device_t dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->sge_miibus, sge_ifmedia_upd, - sge_ifmedia_sts)) { - device_printf(dev, "no PHY found!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sge_miibus, ifp, sge_ifmedia_upd, + sge_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/sis/if_sis.c Sun Nov 7 16:56:29 2010 (r214922) @@ -1164,10 +1164,10 @@ sis_attach(device_t dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->sis_miibus, - sis_ifmedia_upd, sis_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sis_miibus, ifp, sis_ifmedia_upd, + sis_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/smc/if_smc.c ============================================================================== --- stable/8/sys/dev/smc/if_smc.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/smc/if_smc.c Sun Nov 7 16:56:29 2010 (r214922) @@ -324,8 +324,9 @@ smc_attach(device_t dev) callout_init_mtx(&sc->smc_mii_tick_ch, &sc->smc_mtx, CALLOUT_RETURNUNLOCKED); if (sc->smc_chip >= REV_CHIP_91110FD) { - mii_phy_probe(dev, &sc->smc_miibus, smc_mii_ifmedia_upd, - smc_mii_ifmedia_sts); + (void)mii_attach(dev, &sc->smc_miibus, ifp, + smc_mii_ifmedia_upd, smc_mii_ifmedia_sts, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); if (sc->smc_miibus != NULL) { sc->smc_mii_tick = smc_mii_tick; sc->smc_mii_mediachg = smc_mii_mediachg; Modified: stable/8/sys/dev/tl/if_tl.c ============================================================================== --- stable/8/sys/dev/tl/if_tl.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/tl/if_tl.c Sun Nov 7 16:56:29 2010 (r214922) @@ -1280,9 +1280,11 @@ tl_attach(dev) * Do MII setup. If no PHYs are found, then this is a * bitrate ThunderLAN chip that only supports 10baseT * and AUI/BNC. + * XXX mii_attach() can fail for reason different than + * no PHYs found! */ - if (mii_phy_probe(dev, &sc->tl_miibus, - tl_ifmedia_upd, tl_ifmedia_sts)) { + if (mii_attach(dev, &sc->tl_miibus, ifp, tl_ifmedia_upd, + tl_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0)) { struct ifmedia *ifm; sc->tl_bitrate = 1; ifmedia_init(&sc->ifmedia, 0, tl_ifmedia_upd, tl_ifmedia_sts); Modified: stable/8/sys/dev/tx/if_tx.c ============================================================================== --- stable/8/sys/dev/tx/if_tx.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/tx/if_tx.c Sun Nov 7 16:56:29 2010 (r214922) @@ -379,10 +379,10 @@ epic_attach(device_t dev) device_printf(dev, "unknown card vendor %04xh\n", sc->cardvend); /* Do ifmedia setup. */ - if (mii_phy_probe(dev, &sc->miibus, - epic_ifmedia_upd, epic_ifmedia_sts)) { - device_printf(dev, "ERROR! MII without any PHY!?\n"); - error = ENXIO; + error = mii_attach(dev, &sc->miibus, ifp, epic_ifmedia_upd, + epic_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- stable/8/sys/dev/usb/net/usb_ethernet.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/usb/net/usb_ethernet.c Sun Nov 7 16:56:29 2010 (r214922) @@ -222,11 +222,12 @@ ue_attach_post_task(struct usb_proc_msg if (ue->ue_methods->ue_mii_upd != NULL && ue->ue_methods->ue_mii_sts != NULL) { mtx_lock(&Giant); /* device_xxx() depends on this */ - error = mii_phy_probe(ue->ue_dev, &ue->ue_miibus, - ue_ifmedia_upd, ue->ue_methods->ue_mii_sts); + error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, + ue_ifmedia_upd, ue->ue_methods->ue_mii_sts, + BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); mtx_unlock(&Giant); if (error) { - device_printf(ue->ue_dev, "MII without any PHY\n"); + device_printf(ue->ue_dev, "attaching PHYs failed\n"); goto error; } } Modified: stable/8/sys/dev/wb/if_wb.c ============================================================================== --- stable/8/sys/dev/wb/if_wb.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/dev/wb/if_wb.c Sun Nov 7 16:56:29 2010 (r214922) @@ -859,9 +859,10 @@ wb_attach(dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->wb_miibus, - wb_ifmedia_upd, wb_ifmedia_sts)) { - error = ENXIO; + error = mii_attach(dev, &sc->wb_miibus, ifp, wb_ifmedia_upd, + wb_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/8/sys/mips/idt/if_kr.c ============================================================================== --- stable/8/sys/mips/idt/if_kr.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/8/sys/mips/idt/if_kr.c Sun Nov 7 16:56:29 2010 (r214922) @@ -265,10 +265,10 @@ kr_attach(device_t dev) CSR_WRITE_4(sc, KR_MIIMCFG, 0); /* Do MII setup. */ - if (mii_phy_probe(dev, &sc->kr_miibus, - kr_ifmedia_upd, kr_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->kr_miibus, ifp, kr_ifmedia_upd, + kr_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:33:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0384D106566B; Sun, 7 Nov 2010 17:33:05 +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 E631F8FC0A; Sun, 7 Nov 2010 17:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7HX49S064985; Sun, 7 Nov 2010 17:33:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7HX4FM064983; Sun, 7 Nov 2010 17:33:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201011071733.oA7HX4FM064983@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 7 Nov 2010 17:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214923 - head/tools/regression/acltools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:33:05 -0000 Author: trasz Date: Sun Nov 7 17:33:04 2010 New Revision: 214923 URL: http://svn.freebsd.org/changeset/base/214923 Log: Remove useless comment. Modified: head/tools/regression/acltools/tools-nfs4.test Modified: head/tools/regression/acltools/tools-nfs4.test ============================================================================== --- head/tools/regression/acltools/tools-nfs4.test Sun Nov 7 16:56:29 2010 (r214922) +++ head/tools/regression/acltools/tools-nfs4.test Sun Nov 7 17:33:04 2010 (r214923) @@ -527,7 +527,6 @@ $ setfacl -a0 owner@:r:allow,group@:w:de $ ls -ld ddd | cut -d' ' -f1 > dr----x---+ -# XXX: This one is fishy. Shouldn't it be "dr---wx---+"? $ rmdir ddd $ mkdir ddd $ chmod 0 ddd From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:35:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B88FA106564A; Sun, 7 Nov 2010 17:35:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C2398FC18; Sun, 7 Nov 2010 17:35:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7HZgf2065264; Sun, 7 Nov 2010 17:35:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7HZgfi065262; Sun, 7 Nov 2010 17:35:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071735.oA7HZgfi065262@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214924 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:35:42 -0000 Author: marius Date: Sun Nov 7 17:35:42 2010 New Revision: 214924 URL: http://svn.freebsd.org/changeset/base/214924 Log: MFC: r214262 - Take advantage of mii_phy_dev_probe(). - Use mii_phy_add_media() instead of mii_add_media(). I'm not sure how this driver actually managed to work before as mii_add_media() is intended to be used to gether with mii_anar() while mii_phy_add_media() is intended to be used with mii_phy_setmedia(), however this driver mii_add_media() along with mii_phy_setmedia(). Modified: stable/8/sys/dev/mii/smcphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/smcphy.c ============================================================================== --- stable/8/sys/dev/mii/smcphy.c Sun Nov 7 17:33:04 2010 (r214923) +++ stable/8/sys/dev/mii/smcphy.c Sun Nov 7 17:35:42 2010 (r214924) @@ -76,20 +76,16 @@ static driver_t smcphy_driver = { DRIVER_MODULE(smcphy, miibus, smcphy_driver, smcphy_devclass, 0, 0); +static const struct mii_phydesc smcphys[] = { + MII_PHY_DESC(SMSC, LAN83C183), + MII_PHY_END +}; + static int smcphy_probe(device_t dev) { - struct mii_attach_args *ma; - - ma = device_get_ivars(dev); - if (MII_OUI(ma->mii_id1, ma->mii_id2) != MII_OUI_SMSC || - MII_MODEL(ma->mii_id2) != MII_MODEL_SMSC_LAN83C183) - return (ENXIO); - - device_set_desc(dev, MII_STR_SMSC_LAN83C183); - - return (0); + return (mii_phy_dev_probe(dev, smcphys, BUS_PROBE_DEFAULT)); } static int @@ -111,7 +107,7 @@ smcphy_attach(device_t dev) sc->mii_service = smcphy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; if (smcphy_reset(sc) != 0) { device_printf(dev, "reset failed\n"); @@ -122,7 +118,7 @@ smcphy_attach(device_t dev) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); - mii_add_media(sc); + mii_phy_add_media(sc); printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:38:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C901065670; Sun, 7 Nov 2010 17:38:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A272E8FC17; Sun, 7 Nov 2010 17:38:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Hcsfr065600; Sun, 7 Nov 2010 17:38:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Hcsw3065580; Sun, 7 Nov 2010 17:38:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071738.oA7Hcsw3065580@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214925 - in stable/7/sys: arm/at91 dev/bce dev/ed dev/et dev/lge dev/nfe dev/nge dev/nve dev/sf dev/sge dev/sis dev/tx dev/usb pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:38:54 -0000 Author: marius Date: Sun Nov 7 17:38:54 2010 New Revision: 214925 URL: http://svn.freebsd.org/changeset/base/214925 Log: MFC: r213894, r213896, r214913 Converted the remainder of the NIC drivers to use the mii_attach() introduced in r213878 (MFC'ed to stable/7 in r214685) instead of mii_phy_probe(). Unlike r213893 (MFC'ed to stable/7 in r214910) these are mostly straight forward conversions though. Modified: stable/7/sys/arm/at91/if_ate.c stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/ed/if_ed_pccard.c stable/7/sys/dev/et/if_et.c stable/7/sys/dev/lge/if_lge.c stable/7/sys/dev/nfe/if_nfe.c stable/7/sys/dev/nge/if_nge.c stable/7/sys/dev/nve/if_nve.c stable/7/sys/dev/sf/if_sf.c stable/7/sys/dev/sge/if_sge.c stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/tx/if_tx.c stable/7/sys/dev/usb/if_aue.c stable/7/sys/dev/usb/if_axe.c stable/7/sys/dev/usb/if_rue.c stable/7/sys/dev/usb/if_udav.c stable/7/sys/pci/if_tl.c stable/7/sys/pci/if_wb.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/arm/at91/if_ate.c ============================================================================== --- stable/7/sys/arm/at91/if_ate.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/arm/at91/if_ate.c Sun Nov 7 17:38:54 2010 (r214925) @@ -215,9 +215,10 @@ ate_attach(device_t dev) ate_set_mac(sc, eaddr); sc->ifp = ifp = if_alloc(IFT_ETHER); - if (mii_phy_probe(dev, &sc->miibus, ate_ifmedia_upd, ate_ifmedia_sts)) { - device_printf(dev, "Cannot find my PHY.\n"); - err = ENXIO; + err = mii_attach(dev, &sc->miibus, ifp, ate_ifmedia_upd, + ate_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (err != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto out; } Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/bce/if_bce.c Sun Nov 7 17:38:54 2010 (r214925) @@ -1134,12 +1134,13 @@ bce_attach(device_t dev) /* Handle any special PHY initialization for SerDes PHYs. */ bce_init_media(sc); - /* MII child bus by probing the PHY. */ - if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, - bce_ifmedia_sts)) { - BCE_PRINTF("%s(%d): No PHY found on child MII bus!\n", - __FILE__, __LINE__); - rc = ENXIO; + /* MII child bus by attaching the PHY. */ + rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, + bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, + MII_OFFSET_ANY, 0); + if (rc != 0) { + BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, + __LINE__); goto bce_attach_fail; } Modified: stable/7/sys/dev/ed/if_ed_pccard.c ============================================================================== --- stable/7/sys/dev/ed/if_ed_pccard.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/ed/if_ed_pccard.c Sun Nov 7 17:38:54 2010 (r214925) @@ -540,23 +540,27 @@ ed_pccard_attach(device_t dev) goto bad; if (sc->chip_type == ED_CHIP_TYPE_DL10019 || sc->chip_type == ED_CHIP_TYPE_DL10022) { - /* Probe for an MII bus, but ignore errors. */ + /* Try to attach an MII bus, but ignore errors. */ ed_pccard_dl100xx_mii_reset(sc); - (void)mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts); + (void)mii_attach(dev, &sc->miibus, sc->ifp, ed_ifmedia_upd, + ed_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); } else if (sc->chip_type == ED_CHIP_TYPE_AX88190) { ed_pccard_ax88x90_mii_reset(sc); - if ((error = mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts)) != 0) { - device_printf(dev, "Missing mii!\n"); + error = mii_attach(dev, &sc->miibus, sc->ifp, ed_ifmedia_upd, + ed_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto bad; } - } else if (sc->chip_type == ED_CHIP_TYPE_TC5299J) { ed_pccard_tc5299j_mii_reset(sc); - if ((error = mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts)) != 0) { - device_printf(dev, "Missing mii!\n"); + error = mii_attach(dev, &sc->miibus, sc->ifp, ed_ifmedia_upd, + ed_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto bad; } Modified: stable/7/sys/dev/et/if_et.c ============================================================================== --- stable/7/sys/dev/et/if_et.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/et/if_et.c Sun Nov 7 17:38:54 2010 (r214925) @@ -63,8 +63,8 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include #include @@ -343,10 +343,10 @@ et_attach(device_t dev) et_chip_attach(sc); - error = mii_phy_probe(dev, &sc->sc_miibus, - et_ifmedia_upd, et_ifmedia_sts); + error = mii_attach(dev, &sc->sc_miibus, ifp, et_ifmedia_upd, + et_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); if (error) { - device_printf(dev, "can't probe any PHY\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/lge/if_lge.c ============================================================================== --- stable/7/sys/dev/lge/if_lge.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/lge/if_lge.c Sun Nov 7 17:38:54 2010 (r214925) @@ -558,10 +558,10 @@ lge_attach(dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->lge_miibus, - lge_ifmedia_upd, lge_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->lge_miibus, ifp, lge_ifmedia_upd, + lge_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/7/sys/dev/nfe/if_nfe.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/nfe/if_nfe.c Sun Nov 7 17:38:54 2010 (r214925) @@ -601,10 +601,10 @@ nfe_attach(device_t dev) #endif /* Do MII setup */ - if (mii_phy_probe(dev, &sc->nfe_miibus, nfe_ifmedia_upd, - nfe_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->nfe_miibus, ifp, nfe_ifmedia_upd, + nfe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } ether_ifattach(ifp, sc->eaddr); Modified: stable/7/sys/dev/nge/if_nge.c ============================================================================== --- stable/7/sys/dev/nge/if_nge.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/nge/if_nge.c Sun Nov 7 17:38:54 2010 (r214925) @@ -1079,10 +1079,10 @@ nge_attach(device_t dev) /* * Do MII setup. */ - error = mii_phy_probe(dev, &sc->nge_miibus, nge_mediachange, - nge_mediastatus); + error = mii_attach(dev, &sc->nge_miibus, ifp, nge_mediachange, + nge_mediastatus, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); if (error != 0) { - device_printf(dev, "no PHY found!\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/nve/if_nve.c ============================================================================== --- stable/7/sys/dev/nve/if_nve.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/nve/if_nve.c Sun Nov 7 17:38:54 2010 (r214925) @@ -544,11 +544,12 @@ nve_attach(device_t dev) ifp->if_capabilities |= IFCAP_VLAN_MTU; ifp->if_capenable |= IFCAP_VLAN_MTU; - /* Probe device for MII interface to PHY */ - DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_phy_probe\n"); - if (mii_phy_probe(dev, &sc->miibus, nve_ifmedia_upd, nve_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + /* Attach device for MII interface to PHY */ + DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_attach\n"); + error = mii_attach(dev, &sc->miibus, ifp, nve_ifmedia_upd, + nve_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -556,10 +557,10 @@ nve_attach(device_t dev) ether_ifattach(ifp, eaddr); /* Activate our interrupt handler. - attach last to avoid lock */ - error = bus_setup_intr(sc->dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, + error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, nve_intr, sc, &sc->sc_ih); if (error) { - device_printf(sc->dev, "couldn't set up interrupt handler\n"); + device_printf(dev, "couldn't set up interrupt handler\n"); goto fail; } DEBUGOUT(NVE_DEBUG_INIT, "nve: nve_attach - exit\n"); Modified: stable/7/sys/dev/sf/if_sf.c ============================================================================== --- stable/7/sys/dev/sf/if_sf.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/sf/if_sf.c Sun Nov 7 17:38:54 2010 (r214925) @@ -866,10 +866,10 @@ sf_attach(device_t dev) } /* Do MII setup. */ - if (mii_phy_probe(dev, &sc->sf_miibus, sf_ifmedia_upd, - sf_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sf_miibus, ifp, sf_ifmedia_upd, + sf_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/sge/if_sge.c Sun Nov 7 17:38:54 2010 (r214925) @@ -627,10 +627,10 @@ sge_attach(device_t dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->sge_miibus, sge_ifmedia_upd, - sge_ifmedia_sts)) { - device_printf(dev, "no PHY found!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sge_miibus, ifp, sge_ifmedia_upd, + sge_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/sis/if_sis.c Sun Nov 7 17:38:54 2010 (r214925) @@ -1164,10 +1164,10 @@ sis_attach(device_t dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->sis_miibus, - sis_ifmedia_upd, sis_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sis_miibus, ifp, sis_ifmedia_upd, + sis_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/tx/if_tx.c ============================================================================== --- stable/7/sys/dev/tx/if_tx.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/tx/if_tx.c Sun Nov 7 17:38:54 2010 (r214925) @@ -383,10 +383,10 @@ epic_attach(device_t dev) device_printf(dev, "unknown card vendor %04xh\n", sc->cardvend); /* Do ifmedia setup. */ - if (mii_phy_probe(dev, &sc->miibus, - epic_ifmedia_upd, epic_ifmedia_sts)) { - device_printf(dev, "ERROR! MII without any PHY!?\n"); - error = ENXIO; + error = mii_attach(dev, &sc->miibus, ifp, epic_ifmedia_upd, + epic_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: stable/7/sys/dev/usb/if_aue.c ============================================================================== --- stable/7/sys/dev/usb/if_aue.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/usb/if_aue.c Sun Nov 7 17:38:54 2010 (r214925) @@ -649,7 +649,7 @@ aue_attach(device_t self) usbd_status err; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; - int i; + int error, i; sc->aue_dev = self; sc->aue_udev = uaa->device; @@ -741,15 +741,16 @@ aue_attach(device_t self) * end up getting the children deleted twice, which will crash * the system. */ - if (mii_phy_probe(self, &sc->aue_miibus, - aue_ifmedia_upd, aue_ifmedia_sts)) { - device_printf(self, "MII without any PHY!\n"); + error = mii_attach(self, &sc->aue_miibus, ifp, aue_ifmedia_upd, + aue_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(self, "attaching PHYs failed\n"); if_free(ifp); AUE_SXUNLOCK(sc); mtx_destroy(&sc->aue_mtx); sx_destroy(&sc->aue_sx); usb_ether_task_destroy(&sc->aue_taskqueue); - return ENXIO; + return error; } sc->aue_qdat.ifp = ifp; Modified: stable/7/sys/dev/usb/if_axe.c ============================================================================== --- stable/7/sys/dev/usb/if_axe.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/usb/if_axe.c Sun Nov 7 17:38:54 2010 (r214925) @@ -544,7 +544,7 @@ axe_attach(device_t self) struct ifnet *ifp; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; - int i; + int error, i; sc->axe_udev = uaa->device; sc->axe_dev = self; @@ -657,15 +657,16 @@ device_printf(sc->axe_dev, "%s, bufsz %d ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - if (mii_phy_probe(self, &sc->axe_miibus, - axe_ifmedia_upd, axe_ifmedia_sts)) { - device_printf(sc->axe_dev, "MII without any PHY!\n"); + error = mii_attach(self, &sc->axe_miibus, ifp, axe_ifmedia_upd, + axe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(sc->axe_dev, "attaching PHYs failed\n"); if_free(ifp); AXE_UNLOCK(sc); AXE_SLEEPUNLOCK(sc); sx_destroy(&sc->axe_sleeplock); mtx_destroy(&sc->axe_mtx); - return ENXIO; + return error; } /* Modified: stable/7/sys/dev/usb/if_rue.c ============================================================================== --- stable/7/sys/dev/usb/if_rue.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/usb/if_rue.c Sun Nov 7 17:38:54 2010 (r214925) @@ -349,9 +349,6 @@ rue_miibus_readreg(device_t dev, int phy int rval; int ruereg; - if (phy != 0) /* RTL8150 supports PHY == 0, only */ - return (0); - switch (reg) { case MII_BMCR: ruereg = RUE_BMCR; @@ -392,9 +389,6 @@ rue_miibus_writereg(device_t dev, int ph struct rue_softc *sc = device_get_softc(dev); int ruereg; - if (phy != 0) /* RTL8150 supports PHY == 0, only */ - return (0); - switch (reg) { case MII_BMCR: ruereg = RUE_BMCR; @@ -584,13 +578,14 @@ rue_attach(device_t self) usbd_status err; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; - int i; + int error, i; struct rue_type *t; sc->rue_dev = self; sc->rue_udev = uaa->device; if (usbd_set_config_no(sc->rue_udev, RUE_CONFIG_NO, 0)) { + error = ENXIO; device_printf(sc->rue_dev, "getting interface handle failed\n"); goto error; } @@ -599,6 +594,7 @@ rue_attach(device_t self) err = usbd_device2interface_handle(uaa->device, RUE_IFACE_IDX, &iface); if (err) { + error = ENXIO; device_printf(sc->rue_dev, "getting interface handle failed\n"); goto error; } @@ -621,6 +617,7 @@ rue_attach(device_t self) for (i = 0; i < id->bNumEndpoints; i++) { ed = usbd_interface2endpoint_descriptor(iface, i); if (ed == NULL) { + error = ENXIO; device_printf(sc->rue_dev, "couldn't get ep %d\n", i); goto error; } @@ -647,12 +644,14 @@ rue_attach(device_t self) err = rue_read_mem(sc, RUE_EEPROM_IDR0, (caddr_t)&eaddr, ETHER_ADDR_LEN); if (err) { + error = ENXIO; device_printf(sc->rue_dev, "couldn't get station address\n"); goto error1; } ifp = sc->rue_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { + error = ENXIO; device_printf(sc->rue_dev, "can not if_alloc()\n"); goto error1; } @@ -667,10 +666,14 @@ rue_attach(device_t self) ifp->if_init = rue_init; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; - /* MII setup */ - if (mii_phy_probe(self, &sc->rue_miibus, - rue_ifmedia_upd, rue_ifmedia_sts)) { - device_printf(sc->rue_dev, "MII without any PHY!\n"); + /* + * MII setup + * RTL8150 supports PHY == 0 only + */ + error = mii_attach(self, &sc->rue_miibus, ifp, rue_ifmedia_upd, + rue_ifmedia_sts, BMSR_DEFCAPMASK, 0, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(sc->rue_dev, "attaching PHYs failed\n"); goto error2; } @@ -692,7 +695,7 @@ rue_attach(device_t self) RUE_UNLOCK(sc); mtx_destroy(&sc->rue_mtx); error: - return ENXIO; + return error; } static int Modified: stable/7/sys/dev/usb/if_udav.c ============================================================================== --- stable/7/sys/dev/usb/if_udav.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/dev/usb/if_udav.c Sun Nov 7 17:38:54 2010 (r214925) @@ -298,6 +298,9 @@ udav_attach(device_t self) struct mii_data *mii; #endif u_char eaddr[ETHER_ADDR_LEN]; +#if defined(__FreeBSD__) + int error; +#endif int i; #if defined(__NetBSD__) int s; @@ -444,13 +447,16 @@ udav_attach(device_t self) if_attach(ifp); Ether_ifattach(ifp, eaddr); #elif defined(__FreeBSD__) - if (mii_phy_probe(self, &sc->sc_miibus, - udav_ifmedia_change, udav_ifmedia_status)) { - printf("%s: MII without any PHY!\n", device_get_nameunit(sc->sc_dev)); + /* one internal PHY only */ + error = mii_attach(self, &sc->sc_miibus, ifp, udav_ifmedia_change, + udav_ifmedia_status, BMSR_DEFCAPMASK, 0, MII_OFFSET_ANY, 0); + if (error != 0) { + printf("%s: attaching PHYs failed\\n", + device_get_nameunit(sc->sc_dev)); if_free(ifp); UDAV_UNLOCK(sc); mtx_destroy(&sc->sc_mtx); - return ENXIO; + return error; } sc->sc_qdat.ifp = ifp; @@ -1822,13 +1828,6 @@ udav_miibus_readreg(device_t dev, int ph return (0); } - /* XXX: one PHY only for the internal PHY */ - if (phy != 0) { - DPRINTFN(0xff, ("%s: %s: phy=%d is not supported\n", - device_get_nameunit(sc->sc_dev), __func__, phy)); - return (0); - } - udav_lock_mii(sc); /* select internal PHY and set PHY register address */ @@ -1878,13 +1877,6 @@ udav_miibus_writereg(device_t dev, int p return (0); /* XXX real error? */ } - /* XXX: one PHY only for the internal PHY */ - if (phy != 0) { - DPRINTFN(0xff, ("%s: %s: phy=%d is not supported\n", - device_get_nameunit(sc->sc_dev), __func__, phy)); - return (0); /* XXX real error? */ - } - udav_lock_mii(sc); /* select internal PHY and set PHY register address */ Modified: stable/7/sys/pci/if_tl.c ============================================================================== --- stable/7/sys/pci/if_tl.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/pci/if_tl.c Sun Nov 7 17:38:54 2010 (r214925) @@ -1280,9 +1280,11 @@ tl_attach(dev) * Do MII setup. If no PHYs are found, then this is a * bitrate ThunderLAN chip that only supports 10baseT * and AUI/BNC. + * XXX mii_attach() can fail for reason different than + * no PHYs found! */ - if (mii_phy_probe(dev, &sc->tl_miibus, - tl_ifmedia_upd, tl_ifmedia_sts)) { + if (mii_attach(dev, &sc->tl_miibus, ifp, tl_ifmedia_upd, + tl_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0)) { struct ifmedia *ifm; sc->tl_bitrate = 1; ifmedia_init(&sc->ifmedia, 0, tl_ifmedia_upd, tl_ifmedia_sts); Modified: stable/7/sys/pci/if_wb.c ============================================================================== --- stable/7/sys/pci/if_wb.c Sun Nov 7 17:35:42 2010 (r214924) +++ stable/7/sys/pci/if_wb.c Sun Nov 7 17:38:54 2010 (r214925) @@ -859,9 +859,10 @@ wb_attach(dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->wb_miibus, - wb_ifmedia_upd, wb_ifmedia_sts)) { - error = ENXIO; + error = mii_attach(dev, &sc->wb_miibus, ifp, wb_ifmedia_upd, + wb_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:40:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 230BD1065679; Sun, 7 Nov 2010 17:40:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAF4C8FC0C; Sun, 7 Nov 2010 17:40:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Hew5U065827; Sun, 7 Nov 2010 17:40:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Hewv6065825; Sun, 7 Nov 2010 17:40:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071740.oA7Hewv6065825@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214926 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:40:59 -0000 Author: marius Date: Sun Nov 7 17:40:58 2010 New Revision: 214926 URL: http://svn.freebsd.org/changeset/base/214926 Log: MFC: r214263 Take advantage of mii_phy_add_media()/mii_phy_setmedia(). Modified: stable/8/sys/dev/mii/pnaphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/pnaphy.c ============================================================================== --- stable/8/sys/dev/mii/pnaphy.c Sun Nov 7 17:38:54 2010 (r214925) +++ stable/8/sys/dev/mii/pnaphy.c Sun Nov 7 17:40:58 2010 (r214926) @@ -102,7 +102,6 @@ pnaphy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; - const char *sep = ""; sc = device_get_softc(dev); ma = device_get_ivars(dev); @@ -116,29 +115,16 @@ pnaphy_attach(device_t dev) sc->mii_service = pnaphy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; - -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) -#define PRINT(s) printf("%s%s", sep, s); sep = ", " + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP | MIIF_IS_HPNA; mii_phy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_HPNA_1, 0, sc->mii_inst), 0); - PRINT("HomePNA"); - } - + mii_phy_add_media(sc); printf("\n"); -#undef ADD -#undef PRINT - MIIBUS_MEDIAINIT(sc->mii_dev); - return (0); } @@ -159,17 +145,11 @@ pnaphy_service(struct mii_softc *sc, str break; switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_AUTO: - case IFM_10_T: - case IFM_100_TX: - case IFM_100_T4: - return (EINVAL); + case IFM_HPNA_1: + mii_phy_setmedia(sc); + break; default: - /* - * BMCR data is stored in the ifmedia entry. - */ - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + return (EINVAL); } break; @@ -182,7 +162,7 @@ pnaphy_service(struct mii_softc *sc, str /* Update the media status. */ ukphy_status(sc); if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T) - mii->mii_media_active = IFM_ETHER|IFM_HPNA_1; + mii->mii_media_active = IFM_ETHER | IFM_HPNA_1; /* Callback if something changed. */ mii_phy_update(sc, cmd); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:41:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29139106566B; Sun, 7 Nov 2010 17:41:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0D8D8FC08; Sun, 7 Nov 2010 17:41:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Hf9Fc065874; Sun, 7 Nov 2010 17:41:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Hf93E065872; Sun, 7 Nov 2010 17:41:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071741.oA7Hf93E065872@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214927 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:41:10 -0000 Author: marius Date: Sun Nov 7 17:41:09 2010 New Revision: 214927 URL: http://svn.freebsd.org/changeset/base/214927 Log: MFC: r214263 Take advantage of mii_phy_add_media()/mii_phy_setmedia(). Modified: stable/7/sys/dev/mii/pnaphy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/pnaphy.c ============================================================================== --- stable/7/sys/dev/mii/pnaphy.c Sun Nov 7 17:40:58 2010 (r214926) +++ stable/7/sys/dev/mii/pnaphy.c Sun Nov 7 17:41:09 2010 (r214927) @@ -102,7 +102,6 @@ pnaphy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; - const char *sep = ""; sc = device_get_softc(dev); ma = device_get_ivars(dev); @@ -116,29 +115,16 @@ pnaphy_attach(device_t dev) sc->mii_service = pnaphy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; - -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) -#define PRINT(s) printf("%s%s", sep, s); sep = ", " + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP | MIIF_IS_HPNA; mii_phy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); - if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) - printf("no media present"); - else { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_HPNA_1, 0, sc->mii_inst), 0); - PRINT("HomePNA"); - } - + mii_phy_add_media(sc); printf("\n"); -#undef ADD -#undef PRINT - MIIBUS_MEDIAINIT(sc->mii_dev); - return (0); } @@ -159,17 +145,11 @@ pnaphy_service(struct mii_softc *sc, str break; switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_AUTO: - case IFM_10_T: - case IFM_100_TX: - case IFM_100_T4: - return (EINVAL); + case IFM_HPNA_1: + mii_phy_setmedia(sc); + break; default: - /* - * BMCR data is stored in the ifmedia entry. - */ - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + return (EINVAL); } break; @@ -182,7 +162,7 @@ pnaphy_service(struct mii_softc *sc, str /* Update the media status. */ ukphy_status(sc); if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T) - mii->mii_media_active = IFM_ETHER|IFM_HPNA_1; + mii->mii_media_active = IFM_ETHER | IFM_HPNA_1; /* Callback if something changed. */ mii_phy_update(sc, cmd); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:44:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B687910656AA; Sun, 7 Nov 2010 17:44:04 +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 A514B8FC12; Sun, 7 Nov 2010 17:44:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Hi4I9066179; Sun, 7 Nov 2010 17:44:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Hi4bT066177; Sun, 7 Nov 2010 17:44:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011071744.oA7Hi4bT066177@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Nov 2010 17:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214928 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:44:04 -0000 Author: tuexen Date: Sun Nov 7 17:44:04 2010 New Revision: 214928 URL: http://svn.freebsd.org/changeset/base/214928 Log: * Use exponential backoff for retransmission of SHUTDOWN and SHUTDOWN-ACK chunks. * While there, do some cleanups. MFC after: 3 days. Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun Nov 7 17:41:09 2010 (r214927) +++ head/sys/netinet/sctp_timer.c Sun Nov 7 17:44:04 2010 (r214928) @@ -291,6 +291,10 @@ sctp_threshold_management(struct sctp_in return (0); } +/* + * sctp_find_alternate_net() returns a non-NULL pointer as long + * the argument net is non-NULL. + */ struct sctp_nets * sctp_find_alternate_net(struct sctp_tcb *stcb, struct sctp_nets *net, @@ -440,8 +444,7 @@ sctp_find_alternate_net(struct sctp_tcb else if (mode == 1) { TAILQ_FOREACH(mnet, &stcb->asoc.nets, sctp_next) { if (((mnet->dest_state & SCTP_ADDR_REACHABLE) != SCTP_ADDR_REACHABLE) || - (mnet->dest_state & SCTP_ADDR_UNCONFIRMED) - ) { + (mnet->dest_state & SCTP_ADDR_UNCONFIRMED)) { /* * will skip ones that are not-reachable or * unconfirmed @@ -505,12 +508,10 @@ sctp_find_alternate_net(struct sctp_tcb } alt->src_addr_selected = 0; } - if ( - ((alt->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE) && - (alt->ro.ro_rt != NULL) && /* sa_ignore NO_NULL_CHK */ - (!(alt->dest_state & SCTP_ADDR_UNCONFIRMED)) - ) { + if (((alt->dest_state & SCTP_ADDR_REACHABLE) == SCTP_ADDR_REACHABLE) && + (alt->ro.ro_rt != NULL) && + (!(alt->dest_state & SCTP_ADDR_UNCONFIRMED))) { /* Found a reachable address */ break; } @@ -549,8 +550,6 @@ sctp_find_alternate_net(struct sctp_tcb return (alt); } - - static void sctp_backoff_on_timeout(struct sctp_tcb *stcb, struct sctp_nets *net, @@ -1021,8 +1020,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * used, then pick dest with largest ssthresh for any * retransmission. */ - alt = net; - alt = sctp_find_alternate_net(stcb, alt, 1); + alt = sctp_find_alternate_net(stcb, net, 1); /* * CUCv2: If a different dest is picked for the * retransmission, then new (rtx-)pseudo_cumack needs to be @@ -1213,7 +1211,7 @@ sctp_t1init_timer(struct sctp_inpcb *inp struct sctp_nets *alt; alt = sctp_find_alternate_net(stcb, stcb->asoc.primary_destination, 0); - if ((alt != NULL) && (alt != stcb->asoc.primary_destination)) { + if (alt != stcb->asoc.primary_destination) { sctp_move_chunks_from_net(stcb, stcb->asoc.primary_destination); stcb->asoc.primary_destination = alt; } @@ -1480,6 +1478,7 @@ sctp_delete_prim_timer(struct sctp_inpcb * For the shutdown and shutdown-ack, we do not keep one around on the * control queue. This means we must generate a new one and call the general * chunk output routine, AFTER having done threshold management. + * It is assumed that net is non-NULL. */ int sctp_shutdown_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, @@ -1492,18 +1491,13 @@ sctp_shutdown_timer(struct sctp_inpcb *i /* Assoc is over */ return (1); } + sctp_backoff_on_timeout(stcb, net, 1, 0, 0); /* second select an alternative */ alt = sctp_find_alternate_net(stcb, net, 0); /* third generate a shutdown into the queue for out net */ - if (alt) { - sctp_send_shutdown(stcb, alt); - } else { - /* - * if alt is NULL, there is no dest to send to?? - */ - return (0); - } + sctp_send_shutdown(stcb, alt); + /* fourth restart timer */ sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, inp, stcb, alt); return (0); @@ -1520,6 +1514,7 @@ sctp_shutdownack_timer(struct sctp_inpcb /* Assoc is over */ return (1); } + sctp_backoff_on_timeout(stcb, net, 1, 0, 0); /* second select an alternative */ alt = sctp_find_alternate_net(stcb, net, 0); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:48:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 948F61065670; Sun, 7 Nov 2010 17:48:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 812DC8FC1B; Sun, 7 Nov 2010 17:48:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Hm7qe066582; Sun, 7 Nov 2010 17:48:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Hm776066577; Sun, 7 Nov 2010 17:48:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071748.oA7Hm776066577@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214929 - in stable/8/sys/dev: mii tl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:48:07 -0000 Author: marius Date: Sun Nov 7 17:48:07 2010 New Revision: 214929 URL: http://svn.freebsd.org/changeset/base/214929 Log: MFC: r214264 - Add IFM_10_2 and IFM_10_5 media via tlphy(4) only in case the respective interface also has such connectors. - In tl_attach() unify three different ways of obtaining the device and vendor IDs and remove the now obsolete tl_dinfo from tl_softc. - Given that tlphy(4) only handles the integrated PHYs of NICs driven by tl(4) make it only probe on the latter. - Switch mlphy(4) and tlphy(4) to use mii_phy_add_media()/mii_phy_setmedia(). - Simplify looking for the respective companion PHY in mlphy(4) and tlphy(4) by ignoring the native one by just comparing the device_t's directly rather than the device name. Modified: stable/8/sys/dev/mii/mlphy.c stable/8/sys/dev/mii/tlphy.c stable/8/sys/dev/tl/if_tl.c stable/8/sys/dev/tl/if_tlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/mlphy.c ============================================================================== --- stable/8/sys/dev/mii/mlphy.c Sun Nov 7 17:44:04 2010 (r214928) +++ stable/8/sys/dev/mii/mlphy.c Sun Nov 7 17:48:07 2010 (r214929) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); struct mlphy_softc { struct mii_softc ml_mii; + device_t ml_dev; int ml_state; int ml_linked; }; @@ -96,6 +97,7 @@ static driver_t mlphy_driver = { DRIVER_MODULE(mlphy, miibus, mlphy_driver, mlphy_devclass, 0, 0); +static struct mii_softc *mlphy_find_other(struct mlphy_softc *); static int mlphy_service(struct mii_softc *, struct mii_data *, int); static void mlphy_reset(struct mii_softc *); static void mlphy_status(struct mii_softc *); @@ -105,10 +107,8 @@ mlphy_probe(dev) device_t dev; { struct mii_attach_args *ma; - device_t parent; ma = device_get_ivars(dev); - parent = device_get_parent(device_get_parent(dev)); /* * Micro Linear PHY reports oui == 0 model == 0 @@ -122,7 +122,8 @@ mlphy_probe(dev) * encountered the 6692 on an Olicom card with a ThunderLAN * controller chip. */ - if (strcmp(device_get_name(parent), "tl") != 0) + if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))), + "tl") != 0) return (ENXIO); device_set_desc(dev, "Micro Linear 6692 media interface"); @@ -141,6 +142,7 @@ mlphy_attach(dev) msc = device_get_softc(dev); sc = &msc->ml_mii; + msc->ml_dev = dev; ma = device_get_ivars(dev); sc->mii_dev = device_get_parent(dev); mii = ma->mii_data; @@ -155,14 +157,15 @@ mlphy_attach(dev) #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), - BMCR_LOOP|BMCR_S100); + MII_MEDIA_100_TX); mii_phy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + /* Let the companion PHY (if any) only handle the media we don't. */ ma->mii_capmask = ~sc->mii_capabilities; device_printf(dev, " "); - mii_add_media(sc); + mii_phy_add_media(sc); printf("\n"); #undef ADD MIIBUS_MEDIAINIT(sc->mii_dev); @@ -170,20 +173,21 @@ mlphy_attach(dev) } static struct mii_softc * -mlphy_find_other(device_t mii) +mlphy_find_other(struct mlphy_softc *msc) { device_t *devlist; struct mii_softc *retval; int i, devs; retval = NULL; - if (device_get_children(mii, &devlist, &devs)) + if (device_get_children(msc->ml_mii.mii_dev, &devlist, &devs) != 0) return (NULL); - for (i = 0; i < devs; i++) - if (strcmp(device_get_name(devlist[i]), "mlphy")) { + for (i = 0; i < devs; i++) { + if (devlist[i] != msc->ml_dev) { retval = device_get_softc(devlist[i]); break; } + } free(devlist, M_TEMP); return (retval); } @@ -204,7 +208,7 @@ mlphy_service(xsc, mii, cmd) * See if there's another PHY on this bus with us. * If so, we may need it for 10Mbps modes. */ - other = mlphy_find_other(msc->ml_mii.mii_dev); + other = mlphy_find_other(msc); switch (cmd) { case MII_POLLSTAT: @@ -229,7 +233,7 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, BMCR_ISO); } - (void) mii_phy_auto(sc); + (void)mii_phy_auto(sc); msc->ml_linked = 0; return (0); case IFM_10_T: @@ -246,8 +250,7 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, ife->ifm_data); } - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(sc); msc->ml_state = 0; break; case IFM_100_TX: @@ -262,17 +265,11 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, BMCR_ISO); } - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(sc); msc->ml_state = 0; break; - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); default: - break; + return (EINVAL); } break; @@ -381,7 +378,7 @@ mlphy_status(sc) struct mii_softc *other = NULL; /* See if there's another PHY on the bus with us. */ - other = mlphy_find_other(msc->ml_mii.mii_dev); + other = mlphy_find_other(msc); if (other == NULL) return; Modified: stable/8/sys/dev/mii/tlphy.c ============================================================================== --- stable/8/sys/dev/mii/tlphy.c Sun Nov 7 17:44:04 2010 (r214928) +++ stable/8/sys/dev/mii/tlphy.c Sun Nov 7 17:48:07 2010 (r214929) @@ -124,6 +124,9 @@ static int tlphy_probe(device_t dev) { + if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))), + "tl") != 0) + return (ENXIO); return (mii_phy_dev_probe(dev, tlphys, BUS_PROBE_DEFAULT)); } @@ -150,11 +153,17 @@ tlphy_attach(device_t dev) sc->sc_mii.mii_service = tlphy_service; sc->sc_mii.mii_pdata = mii; + /* + * Note that if we're on a device that also supports 100baseTX, + * we are not going to want to use the built-in 10baseT port, + * since there will be another PHY on the MII wired up to the + * UTP connector. + */ capmask = BMSR_DEFCAPMASK; if (mii->mii_instance && device_get_children(sc->sc_mii.mii_dev, &devlist, &devs) == 0) { for (i = 0; i < devs; i++) { - if (strcmp(device_get_name(devlist[i]), "tlphy")) { + if (devlist[i] != dev) { other = device_get_softc(devlist[i]); capmask &= ~other->mii_capabilities; break; @@ -167,38 +176,36 @@ tlphy_attach(device_t dev) mii_phy_reset(&sc->sc_mii); - /* - * Note that if we're on a device that also supports 100baseTX, - * we are not going to want to use the built-in 10baseT port, - * since there will be another PHY on the MII wired up to the - * UTP connector. The parent indicates this to us by specifying - * the TLPHY_MEDIA_NO_10_T bit. - */ sc->sc_mii.mii_capabilities = PHY_READ(&sc->sc_mii, MII_BMSR) & capmask; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->sc_mii.mii_inst), - BMCR_ISO); - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_LOOP, - sc->sc_mii.mii_inst), BMCR_LOOP); + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_LOOP, sc->sc_mii.mii_inst), + MII_MEDIA_100_TX); #define PRINT(s) printf("%s%s", sep, s); sep = ", " - device_printf(dev, " "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, sc->sc_mii.mii_inst), 0); - PRINT("10base2/BNC"); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc->sc_mii.mii_inst), 0); - PRINT("10base5/AUI"); - - if (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) { + if ((sc->sc_mii.mii_flags & (MIIF_MACPRIV0 | MIIF_MACPRIV1)) != 0 && + (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) + device_printf(dev, " "); + if ((sc->sc_mii.mii_flags & MIIF_MACPRIV0) != 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, sc->sc_mii.mii_inst), + 0); + PRINT("10base2/BNC"); + } + if ((sc->sc_mii.mii_flags & MIIF_MACPRIV1) != 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc->sc_mii.mii_inst), + 0); + PRINT("10base5/AUI"); + } + if ((sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) { printf("%s", sep); - mii_add_media(&sc->sc_mii); + mii_phy_add_media(&sc->sc_mii); } - - printf("\n"); + if ((sc->sc_mii.mii_flags & (MIIF_MACPRIV0 | MIIF_MACPRIV1)) != 0 && + (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) + printf("\n"); #undef ADD #undef PRINT MIIBUS_MEDIAINIT(sc->sc_mii.mii_dev); @@ -233,7 +240,7 @@ tlphy_service(struct mii_softc *self, st * an autonegotiation cycle, so there's no such * thing as "already in auto mode". */ - (void) tlphy_auto(sc); + (void)tlphy_auto(sc); break; case IFM_10_2: case IFM_10_5: @@ -244,9 +251,7 @@ tlphy_service(struct mii_softc *self, st default: PHY_WRITE(&sc->sc_mii, MII_TLPHY_CTRL, 0); DELAY(100000); - PHY_WRITE(&sc->sc_mii, MII_ANAR, - mii_anar(ife->ifm_media)); - PHY_WRITE(&sc->sc_mii, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(&sc->sc_mii); } break; @@ -283,7 +288,7 @@ tlphy_service(struct mii_softc *self, st sc->sc_mii.mii_ticks = 0; mii_phy_reset(&sc->sc_mii); - tlphy_auto(sc); + (void)tlphy_auto(sc); return (0); } Modified: stable/8/sys/dev/tl/if_tl.c ============================================================================== --- stable/8/sys/dev/tl/if_tl.c Sun Nov 7 17:44:04 2010 (r214928) +++ stable/8/sys/dev/tl/if_tl.c Sun Nov 7 17:48:07 2010 (r214929) @@ -1104,12 +1104,11 @@ static int tl_attach(dev) device_t dev; { - int i; u_int16_t did, vid; struct tl_type *t; struct ifnet *ifp; struct tl_softc *sc; - int unit, error = 0, rid; + int error, flags, i, rid, unit; u_char eaddr[6]; vid = pci_get_vendor(dev); @@ -1210,10 +1209,9 @@ tl_attach(dev) bzero(sc->tl_ldata, sizeof(struct tl_list_data)); - sc->tl_dinfo = t; - if (t->tl_vid == COMPAQ_VENDORID || t->tl_vid == TI_VENDORID) + if (vid == COMPAQ_VENDORID || vid == TI_VENDORID) sc->tl_eeaddr = TL_EEPROM_EADDR; - if (t->tl_vid == OLICOM_VENDORID) + if (vid == OLICOM_VENDORID) sc->tl_eeaddr = TL_EEPROM_EADDR_OC; /* Reset the adapter. */ @@ -1244,7 +1242,7 @@ tl_attach(dev) * word. To make things even more confusing, neither 00:00:28 * nor 00:00:24 appear in the IEEE OUI database. */ - if (sc->tl_dinfo->tl_vid == OLICOM_VENDORID) { + if (vid == OLICOM_VENDORID) { for (i = 0; i < ETHER_ADDR_LEN; i += 2) { u_int16_t *p; p = (u_int16_t *)&eaddr[i]; @@ -1283,6 +1281,20 @@ tl_attach(dev) * XXX mii_attach() can fail for reason different than * no PHYs found! */ + flags = 0; + if (vid == COMPAQ_VENDORID) { + if (did == COMPAQ_DEVICEID_NETEL_10_100_PROLIANT || + did == COMPAQ_DEVICEID_NETFLEX_3P_INTEGRATED || + did == COMPAQ_DEVICEID_NETFLEX_3P_BNC || + did == COMPAQ_DEVICEID_NETEL_10_T2_UTP_COAX) + flags |= MIIF_MACPRIV0; + if (did == COMPAQ_DEVICEID_NETEL_10 || + did == COMPAQ_DEVICEID_NETEL_10_100_DUAL || + did == COMPAQ_DEVICEID_NETFLEX_3P || + did == COMPAQ_DEVICEID_NETEL_10_100_EMBEDDED) + flags |= MIIF_MACPRIV1; + } else if (vid == OLICOM_VENDORID && did == OLICOM_DEVICEID_OC2183) + flags |= MIIF_MACPRIV0 | MIIF_MACPRIV1; if (mii_attach(dev, &sc->tl_miibus, ifp, tl_ifmedia_upd, tl_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0)) { struct ifmedia *ifm; Modified: stable/8/sys/dev/tl/if_tlreg.h ============================================================================== --- stable/8/sys/dev/tl/if_tlreg.h Sun Nov 7 17:44:04 2010 (r214928) +++ stable/8/sys/dev/tl/if_tlreg.h Sun Nov 7 17:48:07 2010 (r214929) @@ -118,7 +118,6 @@ struct tl_softc { struct resource *tl_irq; struct resource *tl_res; device_t tl_miibus; - struct tl_type *tl_dinfo; /* ThunderLAN adapter info */ u_int8_t tl_eeaddr; struct tl_list_data *tl_ldata; /* TX/RX lists and mbufs */ struct tl_chain_data tl_cdata; From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:48:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F9DB10656A4; Sun, 7 Nov 2010 17:48:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8BA8FC19; Sun, 7 Nov 2010 17:48:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7HmBWG066625; Sun, 7 Nov 2010 17:48:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7HmBBX066620; Sun, 7 Nov 2010 17:48:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071748.oA7HmBBX066620@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214930 - in stable/7/sys: dev/mii pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:48:13 -0000 Author: marius Date: Sun Nov 7 17:48:11 2010 New Revision: 214930 URL: http://svn.freebsd.org/changeset/base/214930 Log: MFC: r214264 - Add IFM_10_2 and IFM_10_5 media via tlphy(4) only in case the respective interface also has such connectors. - In tl_attach() unify three different ways of obtaining the device and vendor IDs and remove the now obsolete tl_dinfo from tl_softc. - Given that tlphy(4) only handles the integrated PHYs of NICs driven by tl(4) make it only probe on the latter. - Switch mlphy(4) and tlphy(4) to use mii_phy_add_media()/mii_phy_setmedia(). - Simplify looking for the respective companion PHY in mlphy(4) and tlphy(4) by ignoring the native one by just comparing the device_t's directly rather than the device name. Modified: stable/7/sys/dev/mii/mlphy.c stable/7/sys/dev/mii/tlphy.c stable/7/sys/pci/if_tl.c stable/7/sys/pci/if_tlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/mlphy.c ============================================================================== --- stable/7/sys/dev/mii/mlphy.c Sun Nov 7 17:48:07 2010 (r214929) +++ stable/7/sys/dev/mii/mlphy.c Sun Nov 7 17:48:11 2010 (r214930) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); struct mlphy_softc { struct mii_softc ml_mii; + device_t ml_dev; int ml_state; int ml_linked; }; @@ -96,6 +97,7 @@ static driver_t mlphy_driver = { DRIVER_MODULE(mlphy, miibus, mlphy_driver, mlphy_devclass, 0, 0); +static struct mii_softc *mlphy_find_other(struct mlphy_softc *); static int mlphy_service(struct mii_softc *, struct mii_data *, int); static void mlphy_reset(struct mii_softc *); static void mlphy_status(struct mii_softc *); @@ -105,10 +107,8 @@ mlphy_probe(dev) device_t dev; { struct mii_attach_args *ma; - device_t parent; ma = device_get_ivars(dev); - parent = device_get_parent(device_get_parent(dev)); /* * Micro Linear PHY reports oui == 0 model == 0 @@ -122,7 +122,8 @@ mlphy_probe(dev) * encountered the 6692 on an Olicom card with a ThunderLAN * controller chip. */ - if (strcmp(device_get_name(parent), "tl") != 0) + if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))), + "tl") != 0) return (ENXIO); device_set_desc(dev, "Micro Linear 6692 media interface"); @@ -141,6 +142,7 @@ mlphy_attach(dev) msc = device_get_softc(dev); sc = &msc->ml_mii; + msc->ml_dev = dev; ma = device_get_ivars(dev); sc->mii_dev = device_get_parent(dev); mii = ma->mii_data; @@ -155,14 +157,15 @@ mlphy_attach(dev) #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), - BMCR_LOOP|BMCR_S100); + MII_MEDIA_100_TX); mii_phy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + /* Let the companion PHY (if any) only handle the media we don't. */ ma->mii_capmask = ~sc->mii_capabilities; device_printf(dev, " "); - mii_add_media(sc); + mii_phy_add_media(sc); printf("\n"); #undef ADD MIIBUS_MEDIAINIT(sc->mii_dev); @@ -170,20 +173,21 @@ mlphy_attach(dev) } static struct mii_softc * -mlphy_find_other(device_t mii) +mlphy_find_other(struct mlphy_softc *msc) { device_t *devlist; struct mii_softc *retval; int i, devs; retval = NULL; - if (device_get_children(mii, &devlist, &devs)) + if (device_get_children(msc->ml_mii.mii_dev, &devlist, &devs) != 0) return (NULL); - for (i = 0; i < devs; i++) - if (strcmp(device_get_name(devlist[i]), "mlphy")) { + for (i = 0; i < devs; i++) { + if (devlist[i] != msc->ml_dev) { retval = device_get_softc(devlist[i]); break; } + } free(devlist, M_TEMP); return (retval); } @@ -204,7 +208,7 @@ mlphy_service(xsc, mii, cmd) * See if there's another PHY on this bus with us. * If so, we may need it for 10Mbps modes. */ - other = mlphy_find_other(msc->ml_mii.mii_dev); + other = mlphy_find_other(msc); switch (cmd) { case MII_POLLSTAT: @@ -229,7 +233,7 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, BMCR_ISO); } - (void) mii_phy_auto(sc); + (void)mii_phy_auto(sc); msc->ml_linked = 0; return (0); case IFM_10_T: @@ -246,8 +250,7 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, ife->ifm_data); } - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(sc); msc->ml_state = 0; break; case IFM_100_TX: @@ -262,17 +265,11 @@ mlphy_service(xsc, mii, cmd) mii_phy_reset(other); PHY_WRITE(other, MII_BMCR, BMCR_ISO); } - PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media)); - PHY_WRITE(sc, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(sc); msc->ml_state = 0; break; - case IFM_100_T4: - /* - * XXX Not supported as a manual setting right now. - */ - return (EINVAL); default: - break; + return (EINVAL); } break; @@ -381,7 +378,7 @@ mlphy_status(sc) struct mii_softc *other = NULL; /* See if there's another PHY on the bus with us. */ - other = mlphy_find_other(msc->ml_mii.mii_dev); + other = mlphy_find_other(msc); if (other == NULL) return; Modified: stable/7/sys/dev/mii/tlphy.c ============================================================================== --- stable/7/sys/dev/mii/tlphy.c Sun Nov 7 17:48:07 2010 (r214929) +++ stable/7/sys/dev/mii/tlphy.c Sun Nov 7 17:48:11 2010 (r214930) @@ -124,6 +124,9 @@ static int tlphy_probe(device_t dev) { + if (strcmp(device_get_name(device_get_parent(device_get_parent(dev))), + "tl") != 0) + return (ENXIO); return (mii_phy_dev_probe(dev, tlphys, BUS_PROBE_DEFAULT)); } @@ -150,11 +153,17 @@ tlphy_attach(device_t dev) sc->sc_mii.mii_service = tlphy_service; sc->sc_mii.mii_pdata = mii; + /* + * Note that if we're on a device that also supports 100baseTX, + * we are not going to want to use the built-in 10baseT port, + * since there will be another PHY on the MII wired up to the + * UTP connector. + */ capmask = BMSR_DEFCAPMASK; if (mii->mii_instance && device_get_children(sc->sc_mii.mii_dev, &devlist, &devs) == 0) { for (i = 0; i < devs; i++) { - if (strcmp(device_get_name(devlist[i]), "tlphy")) { + if (devlist[i] != dev) { other = device_get_softc(devlist[i]); capmask &= ~other->mii_capabilities; break; @@ -167,38 +176,36 @@ tlphy_attach(device_t dev) mii_phy_reset(&sc->sc_mii); - /* - * Note that if we're on a device that also supports 100baseTX, - * we are not going to want to use the built-in 10baseT port, - * since there will be another PHY on the MII wired up to the - * UTP connector. The parent indicates this to us by specifying - * the TLPHY_MEDIA_NO_10_T bit. - */ sc->sc_mii.mii_capabilities = PHY_READ(&sc->sc_mii, MII_BMSR) & capmask; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->sc_mii.mii_inst), - BMCR_ISO); - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_LOOP, - sc->sc_mii.mii_inst), BMCR_LOOP); + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_LOOP, sc->sc_mii.mii_inst), + MII_MEDIA_100_TX); #define PRINT(s) printf("%s%s", sep, s); sep = ", " - device_printf(dev, " "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, sc->sc_mii.mii_inst), 0); - PRINT("10base2/BNC"); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc->sc_mii.mii_inst), 0); - PRINT("10base5/AUI"); - - if (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) { + if ((sc->sc_mii.mii_flags & (MIIF_MACPRIV0 | MIIF_MACPRIV1)) != 0 && + (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) + device_printf(dev, " "); + if ((sc->sc_mii.mii_flags & MIIF_MACPRIV0) != 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, sc->sc_mii.mii_inst), + 0); + PRINT("10base2/BNC"); + } + if ((sc->sc_mii.mii_flags & MIIF_MACPRIV1) != 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, sc->sc_mii.mii_inst), + 0); + PRINT("10base5/AUI"); + } + if ((sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) { printf("%s", sep); - mii_add_media(&sc->sc_mii); + mii_phy_add_media(&sc->sc_mii); } - - printf("\n"); + if ((sc->sc_mii.mii_flags & (MIIF_MACPRIV0 | MIIF_MACPRIV1)) != 0 && + (sc->sc_mii.mii_capabilities & BMSR_MEDIAMASK) != 0) + printf("\n"); #undef ADD #undef PRINT MIIBUS_MEDIAINIT(sc->sc_mii.mii_dev); @@ -233,7 +240,7 @@ tlphy_service(struct mii_softc *self, st * an autonegotiation cycle, so there's no such * thing as "already in auto mode". */ - (void) tlphy_auto(sc); + (void)tlphy_auto(sc); break; case IFM_10_2: case IFM_10_5: @@ -244,9 +251,7 @@ tlphy_service(struct mii_softc *self, st default: PHY_WRITE(&sc->sc_mii, MII_TLPHY_CTRL, 0); DELAY(100000); - PHY_WRITE(&sc->sc_mii, MII_ANAR, - mii_anar(ife->ifm_media)); - PHY_WRITE(&sc->sc_mii, MII_BMCR, ife->ifm_data); + mii_phy_setmedia(&sc->sc_mii); } break; @@ -283,7 +288,7 @@ tlphy_service(struct mii_softc *self, st sc->sc_mii.mii_ticks = 0; mii_phy_reset(&sc->sc_mii); - tlphy_auto(sc); + (void)tlphy_auto(sc); return (0); } Modified: stable/7/sys/pci/if_tl.c ============================================================================== --- stable/7/sys/pci/if_tl.c Sun Nov 7 17:48:07 2010 (r214929) +++ stable/7/sys/pci/if_tl.c Sun Nov 7 17:48:11 2010 (r214930) @@ -1104,12 +1104,11 @@ static int tl_attach(dev) device_t dev; { - int i; u_int16_t did, vid; struct tl_type *t; struct ifnet *ifp; struct tl_softc *sc; - int unit, error = 0, rid; + int error, flags, i, rid, unit; u_char eaddr[6]; vid = pci_get_vendor(dev); @@ -1210,10 +1209,9 @@ tl_attach(dev) bzero(sc->tl_ldata, sizeof(struct tl_list_data)); - sc->tl_dinfo = t; - if (t->tl_vid == COMPAQ_VENDORID || t->tl_vid == TI_VENDORID) + if (vid == COMPAQ_VENDORID || vid == TI_VENDORID) sc->tl_eeaddr = TL_EEPROM_EADDR; - if (t->tl_vid == OLICOM_VENDORID) + if (vid == OLICOM_VENDORID) sc->tl_eeaddr = TL_EEPROM_EADDR_OC; /* Reset the adapter. */ @@ -1244,7 +1242,7 @@ tl_attach(dev) * word. To make things even more confusing, neither 00:00:28 * nor 00:00:24 appear in the IEEE OUI database. */ - if (sc->tl_dinfo->tl_vid == OLICOM_VENDORID) { + if (vid == OLICOM_VENDORID) { for (i = 0; i < ETHER_ADDR_LEN; i += 2) { u_int16_t *p; p = (u_int16_t *)&eaddr[i]; @@ -1283,6 +1281,20 @@ tl_attach(dev) * XXX mii_attach() can fail for reason different than * no PHYs found! */ + flags = 0; + if (vid == COMPAQ_VENDORID) { + if (did == COMPAQ_DEVICEID_NETEL_10_100_PROLIANT || + did == COMPAQ_DEVICEID_NETFLEX_3P_INTEGRATED || + did == COMPAQ_DEVICEID_NETFLEX_3P_BNC || + did == COMPAQ_DEVICEID_NETEL_10_T2_UTP_COAX) + flags |= MIIF_MACPRIV0; + if (did == COMPAQ_DEVICEID_NETEL_10 || + did == COMPAQ_DEVICEID_NETEL_10_100_DUAL || + did == COMPAQ_DEVICEID_NETFLEX_3P || + did == COMPAQ_DEVICEID_NETEL_10_100_EMBEDDED) + flags |= MIIF_MACPRIV1; + } else if (vid == OLICOM_VENDORID && did == OLICOM_DEVICEID_OC2183) + flags |= MIIF_MACPRIV0 | MIIF_MACPRIV1; if (mii_attach(dev, &sc->tl_miibus, ifp, tl_ifmedia_upd, tl_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0)) { struct ifmedia *ifm; Modified: stable/7/sys/pci/if_tlreg.h ============================================================================== --- stable/7/sys/pci/if_tlreg.h Sun Nov 7 17:48:07 2010 (r214929) +++ stable/7/sys/pci/if_tlreg.h Sun Nov 7 17:48:11 2010 (r214930) @@ -118,7 +118,6 @@ struct tl_softc { struct resource *tl_irq; struct resource *tl_res; device_t tl_miibus; - struct tl_type *tl_dinfo; /* ThunderLAN adapter info */ u_int8_t tl_eeaddr; struct tl_list_data *tl_ldata; /* TX/RX lists and mbufs */ struct tl_chain_data tl_cdata; From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:50:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4EC9106564A; Sun, 7 Nov 2010 17:50:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78CEB8FC1A; Sun, 7 Nov 2010 17:50:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Hos2N066921; Sun, 7 Nov 2010 17:50:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Hoss4066919; Sun, 7 Nov 2010 17:50:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071750.oA7Hoss4066919@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214931 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:50:54 -0000 Author: marius Date: Sun Nov 7 17:50:54 2010 New Revision: 214931 URL: http://svn.freebsd.org/changeset/base/214931 Log: MFC: r214528 - When resetting pm_active and pm_context of a pmap in pmap_pinit() we need locking as otherwise we may race against the other parts of the MD code which expects a consistent state of these. While at it move the resetting of the pmap before entering it in the TSB. - Spell a 0 as TLB_CTX_KERNEL. Modified: stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Sun Nov 7 17:48:11 2010 (r214930) +++ stable/8/sys/sparc64/sparc64/pmap.c Sun Nov 7 17:50:54 2010 (r214931) @@ -1061,7 +1061,7 @@ pmap_pinit0(pmap_t pm) PMAP_LOCK_INIT(pm); for (i = 0; i < MAXCPU; i++) - pm->pm_context[i] = 0; + pm->pm_context[i] = TLB_CTX_KERNEL; pm->pm_active = 0; pm->pm_tsb = NULL; pm->pm_tsb_obj = NULL; @@ -1099,6 +1099,12 @@ pmap_pinit(pmap_t pm) if (pm->pm_tsb_obj == NULL) pm->pm_tsb_obj = vm_object_allocate(OBJT_DEFAULT, TSB_PAGES); + mtx_lock_spin(&sched_lock); + for (i = 0; i < MAXCPU; i++) + pm->pm_context[i] = -1; + pm->pm_active = 0; + mtx_unlock_spin(&sched_lock); + VM_OBJECT_LOCK(pm->pm_tsb_obj); for (i = 0; i < TSB_PAGES; i++) { m = vm_page_grab(pm->pm_tsb_obj, i, VM_ALLOC_NOBUSY | @@ -1110,9 +1116,6 @@ pmap_pinit(pmap_t pm) VM_OBJECT_UNLOCK(pm->pm_tsb_obj); pmap_qenter((vm_offset_t)pm->pm_tsb, ma, TSB_PAGES); - for (i = 0; i < MAXCPU; i++) - pm->pm_context[i] = -1; - pm->pm_active = 0; bzero(&pm->pm_stats, sizeof(pm->pm_stats)); return (1); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:50:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47A49106577F; Sun, 7 Nov 2010 17:50:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340D98FC1C; Sun, 7 Nov 2010 17:50:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7HouSo066977; Sun, 7 Nov 2010 17:50:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Houk6066975; Sun, 7 Nov 2010 17:50:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071750.oA7Houk6066975@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214932 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:50:56 -0000 Author: marius Date: Sun Nov 7 17:50:55 2010 New Revision: 214932 URL: http://svn.freebsd.org/changeset/base/214932 Log: MFC: r214528 - When resetting pm_active and pm_context of a pmap in pmap_pinit() we need locking as otherwise we may race against the other parts of the MD code which expects a consistent state of these. While at it move the resetting of the pmap before entering it in the TSB. - Spell a 0 as TLB_CTX_KERNEL. Modified: stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Sun Nov 7 17:50:54 2010 (r214931) +++ stable/7/sys/sparc64/sparc64/pmap.c Sun Nov 7 17:50:55 2010 (r214932) @@ -1056,7 +1056,7 @@ pmap_pinit0(pmap_t pm) PMAP_LOCK_INIT(pm); for (i = 0; i < MAXCPU; i++) - pm->pm_context[i] = 0; + pm->pm_context[i] = TLB_CTX_KERNEL; pm->pm_active = 0; pm->pm_tsb = NULL; pm->pm_tsb_obj = NULL; @@ -1094,6 +1094,12 @@ pmap_pinit(pmap_t pm) if (pm->pm_tsb_obj == NULL) pm->pm_tsb_obj = vm_object_allocate(OBJT_DEFAULT, TSB_PAGES); + mtx_lock_spin(&sched_lock); + for (i = 0; i < MAXCPU; i++) + pm->pm_context[i] = -1; + pm->pm_active = 0; + mtx_unlock_spin(&sched_lock); + VM_OBJECT_LOCK(pm->pm_tsb_obj); for (i = 0; i < TSB_PAGES; i++) { m = vm_page_grab(pm->pm_tsb_obj, i, VM_ALLOC_NOBUSY | @@ -1105,9 +1111,6 @@ pmap_pinit(pmap_t pm) VM_OBJECT_UNLOCK(pm->pm_tsb_obj); pmap_qenter((vm_offset_t)pm->pm_tsb, ma, TSB_PAGES); - for (i = 0; i < MAXCPU; i++) - pm->pm_context[i] = -1; - pm->pm_active = 0; bzero(&pm->pm_stats, sizeof(pm->pm_stats)); return (1); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:50:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83F9C1065782; Sun, 7 Nov 2010 17:50:56 +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 71A258FC1D; Sun, 7 Nov 2010 17:50:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Houv2066993; Sun, 7 Nov 2010 17:50:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Houem066990; Sun, 7 Nov 2010 17:50:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011071750.oA7Houem066990@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Nov 2010 17:50: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: r214933 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:50:56 -0000 Author: tuexen Date: Sun Nov 7 17:50:56 2010 New Revision: 214933 URL: http://svn.freebsd.org/changeset/base/214933 Log: Remove two functions which are not used. MFC after: 3 days. Modified: head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_timer.h Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun Nov 7 17:50:55 2010 (r214932) +++ head/sys/netinet/sctp_timer.c Sun Nov 7 17:50:56 2010 (r214933) @@ -1670,30 +1670,6 @@ sctp_heartbeat_timer(struct sctp_inpcb * return (0); } -int -sctp_is_hb_timer_running(struct sctp_tcb *stcb) -{ - if (SCTP_OS_TIMER_PENDING(&stcb->asoc.hb_timer.timer)) { - /* its running */ - return (1); - } else { - /* nope */ - return (0); - } -} - -int -sctp_is_sack_timer_running(struct sctp_tcb *stcb) -{ - if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { - /* its running */ - return (1); - } else { - /* nope */ - return (0); - } -} - #define SCTP_NUMBER_OF_MTU_SIZES 18 static uint32_t mtu_sizes[] = { 68, Modified: head/sys/netinet/sctp_timer.h ============================================================================== --- head/sys/netinet/sctp_timer.h Sun Nov 7 17:50:55 2010 (r214932) +++ head/sys/netinet/sctp_timer.h Sun Nov 7 17:50:56 2010 (r214933) @@ -65,9 +65,6 @@ int sctp_heartbeat_timer(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, int); -int sctp_is_hb_timer_running(struct sctp_tcb *stcb); -int sctp_is_sack_timer_running(struct sctp_tcb *stcb); - int sctp_cookie_timer(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:54:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9465D1065672; Sun, 7 Nov 2010 17:54:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81C588FC12; Sun, 7 Nov 2010 17:54:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7HsfDa067396; Sun, 7 Nov 2010 17:54:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Hsfs5067394; Sun, 7 Nov 2010 17:54:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071754.oA7Hsfs5067394@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214934 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:54:41 -0000 Author: marius Date: Sun Nov 7 17:54:41 2010 New Revision: 214934 URL: http://svn.freebsd.org/changeset/base/214934 Log: MFC: r214606 Try to make the style consistent (including regarding NetBSD bits not yet merged) and adhere style(9). Modified: stable/8/sys/dev/mii/mii_physubr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/8/sys/dev/mii/mii_physubr.c Sun Nov 7 17:50:56 2010 (r214933) +++ stable/8/sys/dev/mii/mii_physubr.c Sun Nov 7 17:54:41 2010 (r214934) @@ -107,8 +107,8 @@ mii_phy_setmedia(struct mii_softc *sc) if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) { if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || - (sc->mii_flags & MIIF_FORCEANEG)) - (void) mii_phy_auto(sc); + (sc->mii_flags & MIIF_FORCEANEG) != 0) + (void)mii_phy_auto(sc); return; } @@ -124,10 +124,10 @@ mii_phy_setmedia(struct mii_softc *sc) bmcr = mii_media_table[ife->ifm_data].mm_bmcr; gtcr = mii_media_table[ife->ifm_data].mm_gtcr; - if (mii->mii_media.ifm_media & IFM_ETH_MASTER) { + if ((mii->mii_media.ifm_media & IFM_ETH_MASTER) != 0) { switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_1000_T: - gtcr |= GTCR_MAN_MS|GTCR_ADV_MS; + gtcr |= GTCR_MAN_MS | GTCR_ADV_MS; break; default: @@ -135,53 +135,48 @@ mii_phy_setmedia(struct mii_softc *sc) } } - if (ife->ifm_media & IFM_LOOP) + if ((ife->ifm_media & IFM_LOOP) != 0) bmcr |= BMCR_LOOP; PHY_WRITE(sc, MII_ANAR, anar); PHY_WRITE(sc, MII_BMCR, bmcr); - if (sc->mii_flags & MIIF_HAVE_GTCR) + if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) PHY_WRITE(sc, MII_100T2CR, gtcr); } int mii_phy_auto(struct mii_softc *sc) { + int anar, gtcr; /* * Check for 1000BASE-X. Autonegotiation is a bit * different on such devices. */ - if (sc->mii_flags & MIIF_IS_1000X) { - uint16_t anar = 0; - - if (sc->mii_extcapabilities & EXTSR_1000XFDX) + if ((sc->mii_flags & MIIF_IS_1000X) != 0) { + anar = 0; + if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0) anar |= ANAR_X_FD; - if (sc->mii_extcapabilities & EXTSR_1000XHDX) + if ((sc->mii_extcapabilities & EXTSR_1000XHDX) != 0) anar |= ANAR_X_HD; - if (sc->mii_flags & MIIF_DOPAUSE) { + if ((sc->mii_flags & MIIF_DOPAUSE) != 0) { /* XXX Asymmetric vs. symmetric? */ anar |= ANLPAR_X_PAUSE_TOWARDS; } - PHY_WRITE(sc, MII_ANAR, anar); } else { - uint16_t anar; - anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; - if (sc->mii_flags & MIIF_DOPAUSE) + if ((sc->mii_flags & MIIF_DOPAUSE) != 0) anar |= ANAR_FC; PHY_WRITE(sc, MII_ANAR, anar); - if (sc->mii_flags & MIIF_HAVE_GTCR) { - uint16_t gtcr = 0; - - if (sc->mii_extcapabilities & EXTSR_1000TFDX) + if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { + gtcr = 0; + if ((sc->mii_extcapabilities & EXTSR_1000TFDX) != 0) gtcr |= GTCR_ADV_1000TFDX; - if (sc->mii_extcapabilities & EXTSR_1000THDX) + if ((sc->mii_extcapabilities & EXTSR_1000THDX) != 0) gtcr |= GTCR_ADV_1000THDX; - PHY_WRITE(sc, MII_100T2CR, gtcr); } } @@ -213,7 +208,7 @@ mii_phy_tick(struct mii_softc *sc) /* Read the status register twice; BMSR_LINK is latch-low. */ reg = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); - if (reg & BMSR_LINK) { + if ((reg & BMSR_LINK) != 0) { sc->mii_ticks = 0; /* reset autonegotiation timer. */ /* See above. */ return (0); @@ -243,7 +238,7 @@ mii_phy_reset(struct mii_softc *sc) struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; int reg, i; - if (sc->mii_flags & MIIF_NOISOLATE) + if ((sc->mii_flags & MIIF_NOISOLATE) != 0) reg = BMCR_RESET; else reg = BMCR_RESET | BMCR_ISO; @@ -396,7 +391,10 @@ mii_phy_add_media(struct mii_softc *sc) return; } - /* Set aneg timer for 10/100 media. Gigabit media handled below. */ + /* + * Set the autonegotiation timer for 10/100 media. Gigabit media is + * handled below. + */ sc->mii_anegticks = MII_ANEGTICKS; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -411,55 +409,54 @@ mii_phy_add_media(struct mii_softc *sc) * HomePNA PHYs. And there is really only one media type * that is supported. */ - if (sc->mii_flags & MIIF_IS_HPNA) { - if (sc->mii_capabilities & BMSR_10THDX) { + if ((sc->mii_flags & MIIF_IS_HPNA) != 0) { + if ((sc->mii_capabilities & BMSR_10THDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_HPNA_1, 0, - sc->mii_inst), - MII_MEDIA_10_T); + sc->mii_inst), MII_MEDIA_10_T); PRINT("HomePNA1"); } return; } - if (sc->mii_capabilities & BMSR_10THDX) { + if ((sc->mii_capabilities & BMSR_10THDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), MII_MEDIA_10_T); PRINT("10baseT"); } - if (sc->mii_capabilities & BMSR_10TFDX) { + if ((sc->mii_capabilities & BMSR_10TFDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), MII_MEDIA_10_T_FDX); PRINT("10baseT-FDX"); } - if (sc->mii_capabilities & BMSR_100TXHDX) { + if ((sc->mii_capabilities & BMSR_100TXHDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), MII_MEDIA_100_TX); PRINT("100baseTX"); } - if (sc->mii_capabilities & BMSR_100TXFDX) { + if ((sc->mii_capabilities & BMSR_100TXFDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), MII_MEDIA_100_TX_FDX); PRINT("100baseTX-FDX"); } - if (sc->mii_capabilities & BMSR_100T4) { + if ((sc->mii_capabilities & BMSR_100T4) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_T4, 0, sc->mii_inst), MII_MEDIA_100_T4); PRINT("100baseT4"); } - if (sc->mii_extcapabilities & EXTSR_MEDIAMASK) { + if ((sc->mii_extcapabilities & EXTSR_MEDIAMASK) != 0) { /* * XXX Right now only handle 1000SX and 1000TX. Need - * XXX to handle 1000LX and 1000CX some how. + * XXX to handle 1000LX and 1000CX somehow. */ - if (sc->mii_extcapabilities & EXTSR_1000XHDX) { + if ((sc->mii_extcapabilities & EXTSR_1000XHDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_IS_1000X; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, 0, sc->mii_inst), MII_MEDIA_1000_X); PRINT("1000baseSX"); } - if (sc->mii_extcapabilities & EXTSR_1000XFDX) { + if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_IS_1000X; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, @@ -475,7 +472,7 @@ mii_phy_add_media(struct mii_softc *sc) * * All 1000baseT PHYs have a 1000baseT control register. */ - if (sc->mii_extcapabilities & EXTSR_1000THDX) { + if ((sc->mii_extcapabilities & EXTSR_1000THDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_HAVE_GTCR; mii->mii_media.ifm_mask |= IFM_ETH_MASTER; @@ -483,7 +480,7 @@ mii_phy_add_media(struct mii_softc *sc) sc->mii_inst), MII_MEDIA_1000_T); PRINT("1000baseT"); } - if (sc->mii_extcapabilities & EXTSR_1000TFDX) { + if ((sc->mii_extcapabilities & EXTSR_1000TFDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_HAVE_GTCR; mii->mii_media.ifm_mask |= IFM_ETH_MASTER; @@ -493,7 +490,7 @@ mii_phy_add_media(struct mii_softc *sc) } } - if (sc->mii_capabilities & BMSR_ANEG) { + if ((sc->mii_capabilities & BMSR_ANEG) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), MII_NMEDIA); /* intentionally invalid index */ PRINT("auto"); @@ -511,8 +508,7 @@ mii_phy_detach(device_t dev) mii_phy_down(sc); sc->mii_dev = NULL; LIST_REMOVE(sc, mii_list); - - return(0); + return (0); } const struct mii_phydesc * @@ -545,6 +541,5 @@ mii_phy_dev_probe(device_t dev, const st device_set_desc(dev, mpd->mpd_name); return (mrv); } - return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 17:54:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED714106574B; Sun, 7 Nov 2010 17:54:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B16D8FC14; Sun, 7 Nov 2010 17:54:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Hsipo067432; Sun, 7 Nov 2010 17:54:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7HsiJO067430; Sun, 7 Nov 2010 17:54:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071754.oA7HsiJO067430@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 17:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214935 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 17:54:46 -0000 Author: marius Date: Sun Nov 7 17:54:43 2010 New Revision: 214935 URL: http://svn.freebsd.org/changeset/base/214935 Log: MFC: r214606 Try to make the style consistent (including regarding NetBSD bits not yet merged) and adhere style(9). Modified: stable/7/sys/dev/mii/mii_physubr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/7/sys/dev/mii/mii_physubr.c Sun Nov 7 17:54:41 2010 (r214934) +++ stable/7/sys/dev/mii/mii_physubr.c Sun Nov 7 17:54:43 2010 (r214935) @@ -107,8 +107,8 @@ mii_phy_setmedia(struct mii_softc *sc) if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) { if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || - (sc->mii_flags & MIIF_FORCEANEG)) - (void) mii_phy_auto(sc); + (sc->mii_flags & MIIF_FORCEANEG) != 0) + (void)mii_phy_auto(sc); return; } @@ -124,10 +124,10 @@ mii_phy_setmedia(struct mii_softc *sc) bmcr = mii_media_table[ife->ifm_data].mm_bmcr; gtcr = mii_media_table[ife->ifm_data].mm_gtcr; - if (mii->mii_media.ifm_media & IFM_ETH_MASTER) { + if ((mii->mii_media.ifm_media & IFM_ETH_MASTER) != 0) { switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_1000_T: - gtcr |= GTCR_MAN_MS|GTCR_ADV_MS; + gtcr |= GTCR_MAN_MS | GTCR_ADV_MS; break; default: @@ -135,53 +135,48 @@ mii_phy_setmedia(struct mii_softc *sc) } } - if (ife->ifm_media & IFM_LOOP) + if ((ife->ifm_media & IFM_LOOP) != 0) bmcr |= BMCR_LOOP; PHY_WRITE(sc, MII_ANAR, anar); PHY_WRITE(sc, MII_BMCR, bmcr); - if (sc->mii_flags & MIIF_HAVE_GTCR) + if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) PHY_WRITE(sc, MII_100T2CR, gtcr); } int mii_phy_auto(struct mii_softc *sc) { + int anar, gtcr; /* * Check for 1000BASE-X. Autonegotiation is a bit * different on such devices. */ - if (sc->mii_flags & MIIF_IS_1000X) { - uint16_t anar = 0; - - if (sc->mii_extcapabilities & EXTSR_1000XFDX) + if ((sc->mii_flags & MIIF_IS_1000X) != 0) { + anar = 0; + if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0) anar |= ANAR_X_FD; - if (sc->mii_extcapabilities & EXTSR_1000XHDX) + if ((sc->mii_extcapabilities & EXTSR_1000XHDX) != 0) anar |= ANAR_X_HD; - if (sc->mii_flags & MIIF_DOPAUSE) { + if ((sc->mii_flags & MIIF_DOPAUSE) != 0) { /* XXX Asymmetric vs. symmetric? */ anar |= ANLPAR_X_PAUSE_TOWARDS; } - PHY_WRITE(sc, MII_ANAR, anar); } else { - uint16_t anar; - anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; - if (sc->mii_flags & MIIF_DOPAUSE) + if ((sc->mii_flags & MIIF_DOPAUSE) != 0) anar |= ANAR_FC; PHY_WRITE(sc, MII_ANAR, anar); - if (sc->mii_flags & MIIF_HAVE_GTCR) { - uint16_t gtcr = 0; - - if (sc->mii_extcapabilities & EXTSR_1000TFDX) + if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { + gtcr = 0; + if ((sc->mii_extcapabilities & EXTSR_1000TFDX) != 0) gtcr |= GTCR_ADV_1000TFDX; - if (sc->mii_extcapabilities & EXTSR_1000THDX) + if ((sc->mii_extcapabilities & EXTSR_1000THDX) != 0) gtcr |= GTCR_ADV_1000THDX; - PHY_WRITE(sc, MII_100T2CR, gtcr); } } @@ -213,7 +208,7 @@ mii_phy_tick(struct mii_softc *sc) /* Read the status register twice; BMSR_LINK is latch-low. */ reg = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); - if (reg & BMSR_LINK) { + if ((reg & BMSR_LINK) != 0) { sc->mii_ticks = 0; /* reset autonegotiation timer. */ /* See above. */ return (0); @@ -243,7 +238,7 @@ mii_phy_reset(struct mii_softc *sc) struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; int reg, i; - if (sc->mii_flags & MIIF_NOISOLATE) + if ((sc->mii_flags & MIIF_NOISOLATE) != 0) reg = BMCR_RESET; else reg = BMCR_RESET | BMCR_ISO; @@ -396,7 +391,10 @@ mii_phy_add_media(struct mii_softc *sc) return; } - /* Set aneg timer for 10/100 media. Gigabit media handled below. */ + /* + * Set the autonegotiation timer for 10/100 media. Gigabit media is + * handled below. + */ sc->mii_anegticks = MII_ANEGTICKS; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -411,55 +409,54 @@ mii_phy_add_media(struct mii_softc *sc) * HomePNA PHYs. And there is really only one media type * that is supported. */ - if (sc->mii_flags & MIIF_IS_HPNA) { - if (sc->mii_capabilities & BMSR_10THDX) { + if ((sc->mii_flags & MIIF_IS_HPNA) != 0) { + if ((sc->mii_capabilities & BMSR_10THDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_HPNA_1, 0, - sc->mii_inst), - MII_MEDIA_10_T); + sc->mii_inst), MII_MEDIA_10_T); PRINT("HomePNA1"); } return; } - if (sc->mii_capabilities & BMSR_10THDX) { + if ((sc->mii_capabilities & BMSR_10THDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), MII_MEDIA_10_T); PRINT("10baseT"); } - if (sc->mii_capabilities & BMSR_10TFDX) { + if ((sc->mii_capabilities & BMSR_10TFDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), MII_MEDIA_10_T_FDX); PRINT("10baseT-FDX"); } - if (sc->mii_capabilities & BMSR_100TXHDX) { + if ((sc->mii_capabilities & BMSR_100TXHDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), MII_MEDIA_100_TX); PRINT("100baseTX"); } - if (sc->mii_capabilities & BMSR_100TXFDX) { + if ((sc->mii_capabilities & BMSR_100TXFDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), MII_MEDIA_100_TX_FDX); PRINT("100baseTX-FDX"); } - if (sc->mii_capabilities & BMSR_100T4) { + if ((sc->mii_capabilities & BMSR_100T4) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_T4, 0, sc->mii_inst), MII_MEDIA_100_T4); PRINT("100baseT4"); } - if (sc->mii_extcapabilities & EXTSR_MEDIAMASK) { + if ((sc->mii_extcapabilities & EXTSR_MEDIAMASK) != 0) { /* * XXX Right now only handle 1000SX and 1000TX. Need - * XXX to handle 1000LX and 1000CX some how. + * XXX to handle 1000LX and 1000CX somehow. */ - if (sc->mii_extcapabilities & EXTSR_1000XHDX) { + if ((sc->mii_extcapabilities & EXTSR_1000XHDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_IS_1000X; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, 0, sc->mii_inst), MII_MEDIA_1000_X); PRINT("1000baseSX"); } - if (sc->mii_extcapabilities & EXTSR_1000XFDX) { + if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_IS_1000X; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, @@ -475,7 +472,7 @@ mii_phy_add_media(struct mii_softc *sc) * * All 1000baseT PHYs have a 1000baseT control register. */ - if (sc->mii_extcapabilities & EXTSR_1000THDX) { + if ((sc->mii_extcapabilities & EXTSR_1000THDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_HAVE_GTCR; mii->mii_media.ifm_mask |= IFM_ETH_MASTER; @@ -483,7 +480,7 @@ mii_phy_add_media(struct mii_softc *sc) sc->mii_inst), MII_MEDIA_1000_T); PRINT("1000baseT"); } - if (sc->mii_extcapabilities & EXTSR_1000TFDX) { + if ((sc->mii_extcapabilities & EXTSR_1000TFDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_HAVE_GTCR; mii->mii_media.ifm_mask |= IFM_ETH_MASTER; @@ -493,7 +490,7 @@ mii_phy_add_media(struct mii_softc *sc) } } - if (sc->mii_capabilities & BMSR_ANEG) { + if ((sc->mii_capabilities & BMSR_ANEG) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), MII_NMEDIA); /* intentionally invalid index */ PRINT("auto"); @@ -511,8 +508,7 @@ mii_phy_detach(device_t dev) mii_phy_down(sc); sc->mii_dev = NULL; LIST_REMOVE(sc, mii_list); - - return(0); + return (0); } const struct mii_phydesc * @@ -545,6 +541,5 @@ mii_phy_dev_probe(device_t dev, const st device_set_desc(dev, mpd->mpd_name); return (mrv); } - return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 18:21:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCC1F1065670; Sun, 7 Nov 2010 18:21:42 +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 CA2098FC14; Sun, 7 Nov 2010 18:21:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7ILgPa069475; Sun, 7 Nov 2010 18:21:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7ILgdo069473; Sun, 7 Nov 2010 18:21:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011071821.oA7ILgdo069473@svn.freebsd.org> From: Andriy Gapon Date: Sun, 7 Nov 2010 18:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214936 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 18:21:43 -0000 Author: avg Date: Sun Nov 7 18:21:42 2010 New Revision: 214936 URL: http://svn.freebsd.org/changeset/base/214936 Log: MFC r213937: zfs: add vop_getpages method implementation Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 7 17:54:43 2010 (r214935) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 7 18:21:42 2010 (r214936) @@ -4158,6 +4158,96 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t * } static int +zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) +{ + znode_t *zp = VTOZ(vp); + zfsvfs_t *zfsvfs = zp->z_zfsvfs; + objset_t *os = zp->z_zfsvfs->z_os; + vm_page_t mreq; + vm_object_t object; + caddr_t va; + struct sf_buf *sf; + int i, error; + int pcount, size; + + ZFS_ENTER(zfsvfs); + ZFS_VERIFY_ZP(zp); + + pcount = round_page(count) / PAGE_SIZE; + mreq = m[reqpage]; + object = mreq->object; + error = 0; + + KASSERT(vp->v_object == object, ("mismatching object")); + + VM_OBJECT_LOCK(object); + + for (i = 0; i < pcount; i++) { + if (i != reqpage) { + vm_page_lock(m[i]); + vm_page_free(m[i]); + vm_page_unlock(m[i]); + } + } + + if (mreq->valid) { + if (mreq->valid != VM_PAGE_BITS_ALL) + vm_page_zero_invalid(mreq, TRUE); + VM_OBJECT_UNLOCK(object); + ZFS_EXIT(zfsvfs); + return (VM_PAGER_OK); + } + + PCPU_INC(cnt.v_vnodein); + PCPU_INC(cnt.v_vnodepgsin); + + if (IDX_TO_OFF(mreq->pindex) >= object->un_pager.vnp.vnp_size) { + VM_OBJECT_UNLOCK(object); + ZFS_EXIT(zfsvfs); + return (VM_PAGER_BAD); + } + + size = PAGE_SIZE; + if (IDX_TO_OFF(mreq->pindex) + size > object->un_pager.vnp.vnp_size) + size = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mreq->pindex); + + VM_OBJECT_UNLOCK(object); + + va = zfs_map_page(mreq, &sf); + error = dmu_read(os, zp->z_id, IDX_TO_OFF(mreq->pindex), + size, va, DMU_READ_PREFETCH); + if (size != PAGE_SIZE) + bzero(va + size, PAGE_SIZE - size); + zfs_unmap_page(sf); + + VM_OBJECT_LOCK(object); + + if (!error) + mreq->valid = VM_PAGE_BITS_ALL; + KASSERT(mreq->dirty == 0, ("zfs_getpages: page %p is dirty", mreq)); + + VM_OBJECT_UNLOCK(object); + + ZFS_ACCESSTIME_STAMP(zfsvfs, zp); + ZFS_EXIT(zfsvfs); + return (error ? VM_PAGER_ERROR : VM_PAGER_OK); +} + +static int +zfs_freebsd_getpages(ap) + struct vop_getpages_args /* { + struct vnode *a_vp; + vm_page_t *a_m; + int a_count; + int a_reqpage; + vm_ooffset_t a_offset; + } */ *ap; +{ + + return (zfs_getpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_reqpage)); +} + +static int zfs_freebsd_open(ap) struct vop_open_args /* { struct vnode *a_vp; @@ -5261,6 +5351,7 @@ struct vop_vector zfs_vnodeops = { .vop_getacl = zfs_freebsd_getacl, .vop_setacl = zfs_freebsd_setacl, .vop_aclcheck = zfs_freebsd_aclcheck, + .vop_getpages = zfs_freebsd_getpages, }; struct vop_vector zfs_fifoops = { From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 18:25:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7801B106564A; Sun, 7 Nov 2010 18:25:43 +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 4B7B28FC16; Sun, 7 Nov 2010 18:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7IPhRY069739; Sun, 7 Nov 2010 18:25:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7IPhSs069736; Sun, 7 Nov 2010 18:25:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011071825.oA7IPhSs069736@svn.freebsd.org> From: Andriy Gapon Date: Sun, 7 Nov 2010 18:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214937 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 18:25:43 -0000 Author: avg Date: Sun Nov 7 18:25:42 2010 New Revision: 214937 URL: http://svn.freebsd.org/changeset/base/214937 Log: MFC r214774: x86 topo_probe: do not probe smp topology if only one cpu is visible Modified: stable/8/sys/amd64/amd64/mp_machdep.c stable/8/sys/i386/i386/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/mp_machdep.c Sun Nov 7 18:21:42 2010 (r214936) +++ stable/8/sys/amd64/amd64/mp_machdep.c Sun Nov 7 18:25:42 2010 (r214937) @@ -231,6 +231,9 @@ topo_probe_0x4(void) cpu_logical++; } + KASSERT(cpu_cores >= 1 && cpu_logical >= 1, + ("topo_probe_0x4 couldn't find BSP")); + cpu_cores /= cpu_logical; hyperthreading_cpus = cpu_logical; } @@ -302,7 +305,9 @@ topo_probe(void) return; logical_cpus_mask = 0; - if (cpu_vendor_id == CPU_VENDOR_AMD) + if (mp_ncpus <= 1) + cpu_cores = cpu_logical = 1; + else if (cpu_vendor_id == CPU_VENDOR_AMD) topo_probe_amd(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) { /* @@ -324,10 +329,8 @@ topo_probe(void) * Fallback: assume each logical CPU is in separate * physical package. That is, no multi-core, no SMT. */ - if (cpu_cores == 0) - cpu_cores = 1; - if (cpu_logical == 0) - cpu_logical = 1; + if (cpu_cores == 0 || cpu_logical == 0) + cpu_cores = cpu_logical = 1; cpu_topo_probed = 1; } Modified: stable/8/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/8/sys/i386/i386/mp_machdep.c Sun Nov 7 18:21:42 2010 (r214936) +++ stable/8/sys/i386/i386/mp_machdep.c Sun Nov 7 18:25:42 2010 (r214937) @@ -285,6 +285,9 @@ topo_probe_0x4(void) cpu_logical++; } + KASSERT(cpu_cores >= 1 && cpu_logical >= 1, + ("topo_probe_0x4 couldn't find BSP")); + cpu_cores /= cpu_logical; hyperthreading_cpus = cpu_logical; } @@ -356,7 +359,9 @@ topo_probe(void) return; logical_cpus_mask = 0; - if (cpu_vendor_id == CPU_VENDOR_AMD) + if (mp_ncpus <= 1) + cpu_cores = cpu_logical = 1; + else if (cpu_vendor_id == CPU_VENDOR_AMD) topo_probe_amd(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) { /* @@ -378,10 +383,8 @@ topo_probe(void) * Fallback: assume each logical CPU is in separate * physical package. That is, no multi-core, no SMT. */ - if (cpu_cores == 0) - cpu_cores = 1; - if (cpu_logical == 0) - cpu_logical = 1; + if (cpu_cores == 0 || cpu_logical == 0) + cpu_cores = cpu_logical = 1; cpu_topo_probed = 1; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 18:42:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62A151065672; Sun, 7 Nov 2010 18:42:38 +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 5140D8FC15; Sun, 7 Nov 2010 18:42:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7IgboR070624; Sun, 7 Nov 2010 18:42:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Igb8Y070622; Sun, 7 Nov 2010 18:42:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011071842.oA7Igb8Y070622@svn.freebsd.org> From: Alan Cox Date: Sun, 7 Nov 2010 18:42: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: r214938 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 18:42:38 -0000 Author: alc Date: Sun Nov 7 18:42:37 2010 New Revision: 214938 URL: http://svn.freebsd.org/changeset/base/214938 Log: Eliminate a possible race between pmap_pinit() and pmap_kenter_pde() on superpage promotion or demotion. Micro-optimize pmap_kenter_pde(). Reviewed by: kib, jhb (an earlier version) MFC after: 1 week Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Nov 7 18:25:42 2010 (r214937) +++ head/sys/i386/i386/pmap.c Sun Nov 7 18:42:37 2010 (r214938) @@ -1678,11 +1678,19 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v return (pmap_unwire_pte_hold(pmap, mpte, free)); } +/* + * Initialize the pmap for the swapper process. + */ void pmap_pinit0(pmap_t pmap) { PMAP_LOCK_INIT(pmap); + /* + * Since the page table directory is shared with the kernel pmap, + * which is already included in the list "allpmaps", this pmap does + * not need to be inserted into that list. + */ pmap->pm_pdir = (pd_entry_t *)(KERNBASE + (vm_offset_t)IdlePTD); #ifdef PAE pmap->pm_pdpt = (pdpt_entry_t *)(KERNBASE + (vm_offset_t)IdlePDPT); @@ -1692,9 +1700,6 @@ pmap_pinit0(pmap_t pmap) PCPU_SET(curpmap, pmap); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); - mtx_lock_spin(&allpmaps_lock); - LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); - mtx_unlock_spin(&allpmaps_lock); } /* @@ -1759,9 +1764,9 @@ pmap_pinit(pmap_t pmap) mtx_lock_spin(&allpmaps_lock); LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); - mtx_unlock_spin(&allpmaps_lock); - /* Wire in kernel global address entries. */ + /* Copy the kernel page table directory entries. */ bcopy(PTD + KPTDI, pmap->pm_pdir + KPTDI, nkpt * sizeof(pd_entry_t)); + mtx_unlock_spin(&allpmaps_lock); /* install self-referential address mapping entry(s) */ for (i = 0; i < NPGPTD; i++) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 18:50:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 202981065672; Sun, 7 Nov 2010 18:50:36 +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 F3FA88FC15; Sun, 7 Nov 2010 18:50:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7IoZDU070898; Sun, 7 Nov 2010 18:50:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7IoZDo070893; Sun, 7 Nov 2010 18:50:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011071850.oA7IoZDo070893@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Nov 2010 18:50: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: r214939 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 18:50:36 -0000 Author: tuexen Date: Sun Nov 7 18:50:35 2010 New Revision: 214939 URL: http://svn.freebsd.org/changeset/base/214939 Log: Do not have the MTU table twice in the code. Therefore move the function from the timer code to util, rename it appropriately and also fix a bug in sctp_get_prev_mtu(), where calling it with a value existing in the MTU table did not return a smaller one. MFC after: 3 days. Modified: head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun Nov 7 18:42:37 2010 (r214938) +++ head/sys/netinet/sctp_timer.c Sun Nov 7 18:50:35 2010 (r214939) @@ -1670,46 +1670,6 @@ sctp_heartbeat_timer(struct sctp_inpcb * return (0); } -#define SCTP_NUMBER_OF_MTU_SIZES 18 -static uint32_t mtu_sizes[] = { - 68, - 296, - 508, - 512, - 544, - 576, - 1006, - 1492, - 1500, - 1536, - 2002, - 2048, - 4352, - 4464, - 8166, - 17914, - 32000, - 65535 -}; - - -static uint32_t -sctp_getnext_mtu(struct sctp_inpcb *inp, uint32_t cur_mtu) -{ - /* select another MTU that is just bigger than this one */ - int i; - - for (i = 0; i < SCTP_NUMBER_OF_MTU_SIZES; i++) { - if (cur_mtu < mtu_sizes[i]) { - /* no max_mtu is bigger than this one */ - return (mtu_sizes[i]); - } - } - /* here return the highest allowable */ - return (cur_mtu); -} - - void sctp_pathmtu_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, @@ -1717,7 +1677,7 @@ sctp_pathmtu_timer(struct sctp_inpcb *in { uint32_t next_mtu, mtu; - next_mtu = sctp_getnext_mtu(inp, net->mtu); + next_mtu = sctp_get_next_mtu(inp, net->mtu); if ((next_mtu > net->mtu) && (net->port == 0)) { if ((net->src_addr_selected == 0) || Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Nov 7 18:42:37 2010 (r214938) +++ head/sys/netinet/sctp_usrreq.c Sun Nov 7 18:50:35 2010 (r214939) @@ -194,7 +194,7 @@ sctp_notify_mbuf(struct sctp_inpcb *inp, * mtu is. Rats we will have to guess (in a educated fashion * of course) */ - nxtsz = find_next_best_mtu(totsz); + nxtsz = sctp_get_prev_mtu(totsz); } /* Stop any PMTU timer */ if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Nov 7 18:42:37 2010 (r214938) +++ head/sys/netinet/sctputil.c Sun Nov 7 18:50:35 2010 (r214939) @@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define NUMBER_OF_MTU_SIZES 18 - #ifndef KTR_SCTP #define KTR_SCTP KTR_SUBSYS @@ -753,7 +751,7 @@ sctp_stop_timers_for_shutdown(struct sct * a list of sizes based on typical mtu's, used only if next hop size not * returned. */ -static int sctp_mtu_sizes[] = { +static uint32_t sctp_mtu_sizes[] = { 68, 296, 508, @@ -774,25 +772,42 @@ static int sctp_mtu_sizes[] = { 65535 }; -int -find_next_best_mtu(int totsz) +/* + * Return the largest MTU smaller than val. If there is no + * entry, just return val. + */ +uint32_t +sctp_get_prev_mtu(uint32_t val) { - int i, perfer; + uint32_t i; - /* - * if we are in here we must find the next best fit based on the - * size of the dg that failed to be sent. - */ - perfer = 0; - for (i = 0; i < NUMBER_OF_MTU_SIZES; i++) { - if (totsz < sctp_mtu_sizes[i]) { - perfer = i - 1; - if (perfer < 0) - perfer = 0; + if (val <= sctp_mtu_sizes[0]) { + return (val); + } + for (i = 1; i < (sizeof(sctp_mtu_sizes) / sizeof(uint32_t)); i++) { + if (val <= sctp_mtu_sizes[i]) { break; } } - return (sctp_mtu_sizes[perfer]); + return (sctp_mtu_sizes[i - 1]); +} + +/* + * Return the smallest MTU larger than val. If there is no + * entry, just return val. + */ +uint32_t +sctp_get_next_mtu(struct sctp_inpcb *inp, uint32_t val) +{ + /* select another MTU that is just bigger than this one */ + uint32_t i; + + for (i = 0; i < (sizeof(sctp_mtu_sizes) / sizeof(uint32_t)); i++) { + if (val < sctp_mtu_sizes[i]) { + return (sctp_mtu_sizes[i]); + } + } + return (val); } void Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun Nov 7 18:42:37 2010 (r214938) +++ head/sys/netinet/sctputil.h Sun Nov 7 18:50:35 2010 (r214939) @@ -124,7 +124,8 @@ sctp_append_to_readq(struct sctp_inpcb * void sctp_iterator_worker(void); -int find_next_best_mtu(int); +uint32_t sctp_get_prev_mtu(uint32_t); +uint32_t sctp_get_next_mtu(struct sctp_inpcb *, uint32_t); void sctp_timeout_handler(void *); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 19:19:14 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F75E1065672; Sun, 7 Nov 2010 19:19:14 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2608FC27; Sun, 7 Nov 2010 19:19:14 +0000 (UTC) Received: from [10.123.2.178] (DIR-655 [192.168.1.65]) by monday.kientzle.com (8.14.3/8.14.3) with ESMTP id oA7Iwe6n090209; Sun, 7 Nov 2010 18:58:40 GMT (envelope-from kientzle@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <86wroppyff.fsf@gmail.com> Date: Sun, 7 Nov 2010 10:58:40 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201011070340.oA73ebRw013346@svn.freebsd.org> <86wroppyff.fsf@gmail.com> To: Anonymous X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r214905 - in head/lib/libarchive: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 19:19:14 -0000 On Nov 6, 2010, at 9:09 PM, Anonymous wrote: > Tim Kientzle writes: >=20 >> Author: kientzle >> Date: Sun Nov 7 03:40:37 2010 >> New Revision: 214905 >> URL: http://svn.freebsd.org/changeset/base/214905 >>=20 >> Log: >> If the Zip reader doesn't see a PK signature block >> because there's inter-entry garbage, just scan forward >> to find the next one. This allows us to handle a lot >> of Zip archives that have been modified in-place. >=20 > It's unrelated but can you also look at archives produces by Mojo = Setup? >=20 > http://icculus.org/mojosetup/examples/ >=20 > $ /usr/bin/unzip duke3d-mojosetup-linux-x86.bin > Archive: duke3d-mojosetup-linux-x86.bin > unzip: Unrecognized archive format > zsh: exit 1 >=20 > $ LOCALBASE/bin/unzip duke3d-mojosetup-linux-x86.bin > Archive: duke3d-mojosetup-linux-x86.bin > warning [duke3d-mojosetup-linux-x86.bin]: 157716 extra bytes at = beginning or within zipfile > (attempting to process anyway) > creating: data/ > inflating: data/duke3d_readme.txt Libarchive currently doesn't support self-extracting Zip archives (the "157716 extra bytes" that Info-Zip mentions). There's a hack in libarchive's Zip reader that mostly supports one particular common type of self-extracting Zip archive, but it's not very easy to generalize. There are a couple of possible options for addressing this, but I won't have time to work on any of those any time soon. Tim From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 19:23:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DD8F106566C; Sun, 7 Nov 2010 19:23:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5738FC14; Sun, 7 Nov 2010 19:23:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7JNPRe071985; Sun, 7 Nov 2010 19:23:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7JNPPw071983; Sun, 7 Nov 2010 19:23:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011071923.oA7JNPPw071983@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Nov 2010 19:23: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: r214940 - head/release/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 19:23:25 -0000 Author: marius Date: Sun Nov 7 19:23:25 2010 New Revision: 214940 URL: http://svn.freebsd.org/changeset/base/214940 Log: Add gpart and glabel to the release CD mfsroot. Modified: head/release/sparc64/boot_crunch.conf Modified: head/release/sparc64/boot_crunch.conf ============================================================================== --- head/release/sparc64/boot_crunch.conf Sun Nov 7 18:50:35 2010 (r214939) +++ head/release/sparc64/boot_crunch.conf Sun Nov 7 19:23:25 2010 (r214940) @@ -15,6 +15,7 @@ srcdirs /usr/src/sbin progs camcontrol progs dhclient progs fsck_ffs +progs geom progs ifconfig progs mount_nfs progs newfs @@ -23,6 +24,8 @@ progs rtsol progs tunefs ln fsck_ffs fsck_4.2bsd ln fsck_ffs fsck_ufs +ln geom glabel +ln geom gpart srcdirs /usr/src/usr.bin progs cpio @@ -40,5 +43,5 @@ progs sysinstall progs usbconfig libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph -libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml +libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lgeom -lbsdxml libs -larchive -lcrypto -lbz2 -llzma -lusb -ljail From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 19:32:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1521A106566B; Sun, 7 Nov 2010 19:32:04 +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 C93C78FC3A; Sun, 7 Nov 2010 19:32:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7JW3PU072221; Sun, 7 Nov 2010 19:32:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7JW3BY072220; Sun, 7 Nov 2010 19:32:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011071932.oA7JW3BY072220@svn.freebsd.org> From: Andriy Gapon Date: Sun, 7 Nov 2010 19:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214941 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 19:32:04 -0000 Author: avg Date: Sun Nov 7 19:32:03 2010 New Revision: 214941 URL: http://svn.freebsd.org/changeset/base/214941 Log: Followup to r214936: zfs_getpages: account for differences from head in page locking Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 7 19:23:25 2010 (r214940) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 7 19:32:03 2010 (r214941) @@ -4181,14 +4181,13 @@ zfs_getpages(struct vnode *vp, vm_page_t KASSERT(vp->v_object == object, ("mismatching object")); VM_OBJECT_LOCK(object); - + vm_page_lock_queues(); for (i = 0; i < pcount; i++) { if (i != reqpage) { - vm_page_lock(m[i]); vm_page_free(m[i]); - vm_page_unlock(m[i]); } } + vm_page_unlock_queues(); if (mreq->valid) { if (mreq->valid != VM_PAGE_BITS_ALL) From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 19:51:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DED110656A3; Sun, 7 Nov 2010 19:51:52 +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 0C2638FC14; Sun, 7 Nov 2010 19:51:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Jppks072852; Sun, 7 Nov 2010 19:51:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Jppcd072851; Sun, 7 Nov 2010 19:51:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011071951.oA7Jppcd072851@svn.freebsd.org> From: Alan Cox Date: Sun, 7 Nov 2010 19:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214942 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 19:51:52 -0000 Author: alc Date: Sun Nov 7 19:51:51 2010 New Revision: 214942 URL: http://svn.freebsd.org/changeset/base/214942 Log: MFC r214564 Correct some format strings used by sysctls. Modified: stable/8/sys/vm/vm_phys.c stable/8/sys/vm/vm_reserv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/vm/vm_phys.c ============================================================================== --- stable/8/sys/vm/vm_phys.c Sun Nov 7 19:32:03 2010 (r214941) +++ stable/8/sys/vm/vm_phys.c Sun Nov 7 19:51:51 2010 (r214942) @@ -120,11 +120,11 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "-- -- "); sbuf_printf(&sbuf, "--\n"); for (oind = VM_NFREEORDER - 1; oind >= 0; oind--) { - sbuf_printf(&sbuf, " %2.2d (%6.6dK)", oind, + sbuf_printf(&sbuf, " %2d (%6dK)", oind, 1 << (PAGE_SHIFT - 10 + oind)); for (pind = 0; pind < VM_NFREEPOOL; pind++) { fl = vm_phys_free_queues[flind][pind]; - sbuf_printf(&sbuf, " | %6.6d", fl[oind].lcnt); + sbuf_printf(&sbuf, " | %6d", fl[oind].lcnt); } sbuf_printf(&sbuf, "\n"); } Modified: stable/8/sys/vm/vm_reserv.c ============================================================================== --- stable/8/sys/vm/vm_reserv.c Sun Nov 7 19:32:03 2010 (r214941) +++ stable/8/sys/vm/vm_reserv.c Sun Nov 7 19:51:51 2010 (r214942) @@ -196,7 +196,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER unused_pages += VM_LEVEL_0_NPAGES - rv->popcnt; } mtx_unlock(&vm_page_queue_free_mtx); - sbuf_printf(&sbuf, "%5.5d: %6.6dK, %6.6d\n", level, + sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, unused_pages * (PAGE_SIZE / 1024), counter); } sbuf_finish(&sbuf); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:20:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C003106577E; Sun, 7 Nov 2010 20:20:20 +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 49DE08FC12; Sun, 7 Nov 2010 20:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KKK0S075400; Sun, 7 Nov 2010 20:20:20 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7KKK1L075397; Sun, 7 Nov 2010 20:20:20 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011072020.oA7KKK1L075397@svn.freebsd.org> From: Alan Cox Date: Sun, 7 Nov 2010 20:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214943 - stable/7/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:20:20 -0000 Author: alc Date: Sun Nov 7 20:20:19 2010 New Revision: 214943 URL: http://svn.freebsd.org/changeset/base/214943 Log: MFC r214564 Correct some format strings used by sysctls. Modified: stable/7/sys/vm/vm_phys.c stable/7/sys/vm/vm_reserv.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/vm_phys.c ============================================================================== --- stable/7/sys/vm/vm_phys.c Sun Nov 7 19:51:51 2010 (r214942) +++ stable/7/sys/vm/vm_phys.c Sun Nov 7 20:20:19 2010 (r214943) @@ -120,11 +120,11 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) sbuf_printf(&sbuf, "-- -- "); sbuf_printf(&sbuf, "--\n"); for (oind = VM_NFREEORDER - 1; oind >= 0; oind--) { - sbuf_printf(&sbuf, " %2.2d (%6.6dK)", oind, + sbuf_printf(&sbuf, " %2d (%6dK)", oind, 1 << (PAGE_SHIFT - 10 + oind)); for (pind = 0; pind < VM_NFREEPOOL; pind++) { fl = vm_phys_free_queues[flind][pind]; - sbuf_printf(&sbuf, " | %6.6d", fl[oind].lcnt); + sbuf_printf(&sbuf, " | %6d", fl[oind].lcnt); } sbuf_printf(&sbuf, "\n"); } Modified: stable/7/sys/vm/vm_reserv.c ============================================================================== --- stable/7/sys/vm/vm_reserv.c Sun Nov 7 19:51:51 2010 (r214942) +++ stable/7/sys/vm/vm_reserv.c Sun Nov 7 20:20:19 2010 (r214943) @@ -196,7 +196,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER unused_pages += VM_LEVEL_0_NPAGES - rv->popcnt; } mtx_unlock(&vm_page_queue_free_mtx); - sbuf_printf(&sbuf, "%5.5d: %6.6dK, %6.6d\n", level, + sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, unused_pages * (PAGE_SIZE / 1024), counter); } sbuf_finish(&sbuf); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:29:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAD2C106564A; Sun, 7 Nov 2010 20:29:39 +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 C85958FC15; Sun, 7 Nov 2010 20:29:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KTdcP076583; Sun, 7 Nov 2010 20:29:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7KTdKZ076581; Sun, 7 Nov 2010 20:29:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011072029.oA7KTdKZ076581@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 7 Nov 2010 20:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214944 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:29:40 -0000 Author: jilles Date: Sun Nov 7 20:29:39 2010 New Revision: 214944 URL: http://svn.freebsd.org/changeset/base/214944 Log: MFC r214609: sh(1): Correct synopsis and make precise how $0 is set. In particular, the extra argument to set $0 with -c was not documented. Modified: stable/8/bin/sh/sh.1 Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/sh.1 ============================================================================== --- stable/8/bin/sh/sh.1 Sun Nov 7 20:20:19 2010 (r214943) +++ stable/8/bin/sh/sh.1 Sun Nov 7 20:29:39 2010 (r214944) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd October 16, 2010 +.Dd October 31, 2010 .Dt SH 1 .Os .Sh NAME @@ -40,9 +40,24 @@ .Nd command interpreter (shell) .Sh SYNOPSIS .Nm -.Op Fl /+abCEefIimnPpsTuVvx +.Op Fl /+abCEefIimnPpTuVvx .Op Fl /+o Ar longname -.Op Fl c Ar string +.Oo +.Ar script +.Op Ar arg ... +.Oc +.Nm +.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+o Ar longname +.Fl c Ar string +.Oo +.Ar name +.Op Ar arg ... +.Oc +.Nm +.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+o Ar longname +.Fl s .Op Ar arg ... .Sh DESCRIPTION The @@ -1105,7 +1120,12 @@ For a pipeline, the process ID is that of the last command in the pipeline. .It Li $0 -(zero) Expands to the name of the shell or shell script. +(zero) Expands to the name of the shell script if passed on the command line, +the +.Ar name +operand if given (with +.Fl c ) +or otherwise argument 0 passed to the shell. .El .Ss Word Expansions This clause describes the various expansions that are From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:33:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56EA51065696; Sun, 7 Nov 2010 20:33:37 +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 06B528FC0A; Sun, 7 Nov 2010 20:33:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KXalh077809; Sun, 7 Nov 2010 20:33:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7KXa5C077807; Sun, 7 Nov 2010 20:33:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011072033.oA7KXa5C077807@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 7 Nov 2010 20:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214945 - stable/7/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:33:37 -0000 Author: jilles Date: Sun Nov 7 20:33:36 2010 New Revision: 214945 URL: http://svn.freebsd.org/changeset/base/214945 Log: MFC r214609: sh(1): Correct synopsis and make precise how $0 is set. In particular, the extra argument to set $0 with -c was not documented. Modified: stable/7/bin/sh/sh.1 Directory Properties: stable/7/bin/sh/ (props changed) Modified: stable/7/bin/sh/sh.1 ============================================================================== --- stable/7/bin/sh/sh.1 Sun Nov 7 20:29:39 2010 (r214944) +++ stable/7/bin/sh/sh.1 Sun Nov 7 20:33:36 2010 (r214945) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd October 16, 2010 +.Dd October 31, 2010 .Dt SH 1 .Os .Sh NAME @@ -40,9 +40,24 @@ .Nd command interpreter (shell) .Sh SYNOPSIS .Nm -.Op Fl /+abCEefIimnPpsTuVvx +.Op Fl /+abCEefIimnPpTuVvx .Op Fl /+o Ar longname -.Op Fl c Ar string +.Oo +.Ar script +.Op Ar arg ... +.Oc +.Nm +.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+o Ar longname +.Fl c Ar string +.Oo +.Ar name +.Op Ar arg ... +.Oc +.Nm +.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+o Ar longname +.Fl s .Op Ar arg ... .Sh DESCRIPTION The @@ -1099,7 +1114,12 @@ For a pipeline, the process ID is that of the last command in the pipeline. .It Li $0 -(zero) Expands to the name of the shell or shell script. +(zero) Expands to the name of the shell script if passed on the command line, +the +.Ar name +operand if given (with +.Fl c ) +or otherwise argument 0 passed to the shell. .El .Ss Word Expansions This clause describes the various expansions that are From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:33:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06FDE106578B; Sun, 7 Nov 2010 20:33:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5FAA8FC25; Sun, 7 Nov 2010 20:33:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KXd8g077861; Sun, 7 Nov 2010 20:33:39 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7KXdrc077855; Sun, 7 Nov 2010 20:33:39 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011072033.oA7KXdrc077855@svn.freebsd.org> From: Andrew Thompson Date: Sun, 7 Nov 2010 20:33: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: r214946 - in head/sys/arm: conf xscale/ixp425 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:33:40 -0000 Author: thompsa Date: Sun Nov 7 20:33:39 2010 New Revision: 214946 URL: http://svn.freebsd.org/changeset/base/214946 Log: Hook up the five gpio pins on the Avila board to the gpio framework. There are actually 16 I/O lines but the other ones are used for system devices and interrupts. The IXP4XX platform can set interrupts on these pins for high/low/rising/falling/transitional but this is not implemented yet. The Cambria has the same interface but as all the pins are assigned to system functions the gpio header is toggled via a PLD on the i2c bus and is not supported by this commit. Added: head/sys/arm/xscale/ixp425/avila_gpio.c (contents, props changed) Modified: head/sys/arm/conf/AVILA head/sys/arm/conf/AVILA.hints head/sys/arm/xscale/ixp425/files.avila head/sys/arm/xscale/ixp425/ixp425reg.h Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Sun Nov 7 20:33:36 2010 (r214945) +++ head/sys/arm/conf/AVILA Sun Nov 7 20:33:39 2010 (r214946) @@ -87,6 +87,10 @@ device ad7418 # AD7418 on I2C bus device avila_led +device gpio +device gpioled +device avila_gpio # GPIO pins on J8 + device ata device atadisk # ATA disk drives device avila_ata # Gateworks CF/IDE support Modified: head/sys/arm/conf/AVILA.hints ============================================================================== --- head/sys/arm/conf/AVILA.hints Sun Nov 7 20:33:36 2010 (r214945) +++ head/sys/arm/conf/AVILA.hints Sun Nov 7 20:33:39 2010 (r214946) @@ -41,6 +41,9 @@ hint.ata_avila.0.at="ixp0" # Front Panel LED hint.led_avila.0.at="ixp0" +# GPIO pins +hint.gpio_avila.0.at="ixp0" + # Analog Devices AD7418 temperature sensor hint.ad7418.0.at="iicbus0" hint.ad7418.0.addr=0x50 Added: head/sys/arm/xscale/ixp425/avila_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xscale/ixp425/avila_gpio.c Sun Nov 7 20:33:39 2010 (r214946) @@ -0,0 +1,380 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * Copyright (c) 2009, Luiz Otavio O Souza. + * Copyright (c) 2010, Andrew Thompson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * GPIO driver for Gateworks Avilia + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "gpio_if.h" + +#define GPIO_SET_BITS(sc, reg, bits) \ + GPIO_CONF_WRITE_4(sc, reg, GPIO_CONF_READ_4(sc, (reg)) | (bits)) + +#define GPIO_CLEAR_BITS(sc, reg, bits) \ + GPIO_CONF_WRITE_4(sc, reg, GPIO_CONF_READ_4(sc, (reg)) & ~(bits)) + +#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) + +struct avila_gpio_softc { + device_t sc_dev; + struct mtx sc_mtx; + bus_space_tag_t sc_iot; + bus_space_handle_t sc_gpio_ioh; + uint32_t sc_valid; + struct gpio_pin sc_pins[IXP4XX_GPIO_PINS]; +}; + +struct avila_gpio_pin { + const char *name; + int pin; + int caps; +}; + +#define GPIO_PIN_IO (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT) +static struct avila_gpio_pin avila_gpio_pins[] = { + { "GPIO0", 0, GPIO_PIN_IO }, + { "GPIO1", 1, GPIO_PIN_IO }, + { "GPIO2", 2, GPIO_PIN_IO }, + { "GPIO3", 3, GPIO_PIN_IO }, + { "GPIO4", 4, GPIO_PIN_IO }, + /* + * The following pins are connected to system devices and should not + * really be frobbed. + */ +#if 0 + { "SER_ENA", 5, GPIO_PIN_IO }, + { "I2C_SCL", 6, GPIO_PIN_IO }, + { "I2C_SDA", 7, GPIO_PIN_IO }, + { "PCI_INTD", 8, GPIO_PIN_IO }, + { "PCI_INTC", 9, GPIO_PIN_IO }, + { "PCI_INTB", 10, GPIO_PIN_IO }, + { "PCI_INTA", 11, GPIO_PIN_IO }, + { "ATA_INT", 12, GPIO_PIN_IO }, + { "PCI_RST", 13, GPIO_PIN_IO }, + { "PCI_CLK", 14, GPIO_PIN_OUTPUT }, + { "EX_CLK", 15, GPIO_PIN_OUTPUT }, +#endif +}; +#undef GPIO_PIN_IO + +/* + * Helpers + */ +static void avila_gpio_pin_configure(struct avila_gpio_softc *sc, + struct gpio_pin *pin, uint32_t flags); +static int avila_gpio_pin_flags(struct avila_gpio_softc *sc, uint32_t pin); + +/* + * Driver stuff + */ +static int avila_gpio_probe(device_t dev); +static int avila_gpio_attach(device_t dev); +static int avila_gpio_detach(device_t dev); + +/* + * GPIO interface + */ +static int avila_gpio_pin_max(device_t dev, int *maxpin); +static int avila_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps); +static int avila_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t + *flags); +static int avila_gpio_pin_getname(device_t dev, uint32_t pin, char *name); +static int avila_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags); +static int avila_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value); +static int avila_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val); +static int avila_gpio_pin_toggle(device_t dev, uint32_t pin); + +static int +avila_gpio_pin_flags(struct avila_gpio_softc *sc, uint32_t pin) +{ + uint32_t v; + + v = GPIO_CONF_READ_4(sc, IXP425_GPIO_GPINR) & (1 << pin); + + return (v ? GPIO_PIN_INPUT : GPIO_PIN_OUTPUT); +} + +static void +avila_gpio_pin_configure(struct avila_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + uint32_t mask; + + mask = 1 << pin->gp_pin; + GPIO_LOCK(sc); + + /* + * Manage input/output + */ + if (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) { + pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT); + if (flags & GPIO_PIN_OUTPUT) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + GPIO_CLEAR_BITS(sc, IXP425_GPIO_GPOER, mask); + } + else { + pin->gp_flags |= GPIO_PIN_INPUT; + GPIO_SET_BITS(sc, IXP425_GPIO_GPOER, mask); + } + } + + GPIO_UNLOCK(sc); +} + +static int +avila_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = IXP4XX_GPIO_PINS - 1; + return (0); +} + +static int +avila_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct avila_gpio_softc *sc = device_get_softc(dev); + + if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & (1 << pin))) + return (EINVAL); + + GPIO_LOCK(sc); + *caps = sc->sc_pins[pin].gp_caps; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +avila_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct avila_gpio_softc *sc = device_get_softc(dev); + + if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & (1 << pin))) + return (EINVAL); + + GPIO_LOCK(sc); + /* refresh since we do not own all the pins */ + sc->sc_pins[pin].gp_flags = avila_gpio_pin_flags(sc, pin); + *flags = sc->sc_pins[pin].gp_flags; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +avila_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct avila_gpio_softc *sc = device_get_softc(dev); + + if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & (1 << pin))) + return (EINVAL); + + GPIO_LOCK(sc); + memcpy(name, sc->sc_pins[pin].gp_name, GPIOMAXNAME); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +avila_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct avila_gpio_softc *sc = device_get_softc(dev); + uint32_t mask = 1 << pin; + + if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & mask)) + return (EINVAL); + + /* Filter out unwanted flags */ + if ((flags &= sc->sc_pins[pin].gp_caps) != flags) + return (EINVAL); + + /* Can't mix input/output together */ + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) + return (EINVAL); + + avila_gpio_pin_configure(sc, &sc->sc_pins[pin], flags); + return (0); +} + +static int +avila_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct avila_gpio_softc *sc = device_get_softc(dev); + uint32_t mask = 1 << pin; + + if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & mask)) + return (EINVAL); + + GPIO_LOCK(sc); + if (value) + GPIO_SET_BITS(sc, IXP425_GPIO_GPOUTR, mask); + else + GPIO_CLEAR_BITS(sc, IXP425_GPIO_GPOUTR, mask); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +avila_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct avila_gpio_softc *sc = device_get_softc(dev); + + if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & (1 << pin))) + return (EINVAL); + + GPIO_LOCK(sc); + *val = (GPIO_CONF_READ_4(sc, IXP425_GPIO_GPINR) & (1 << pin)) ? 1 : 0; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +avila_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct avila_gpio_softc *sc = device_get_softc(dev); + uint32_t mask = 1 << pin; + int res; + + if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & mask)) + return (EINVAL); + + GPIO_LOCK(sc); + res = (GPIO_CONF_READ_4(sc, IXP425_GPIO_GPINR) & mask) ? 1 : 0; + if (res) + GPIO_CLEAR_BITS(sc, IXP425_GPIO_GPOUTR, mask); + else + GPIO_SET_BITS(sc, IXP425_GPIO_GPOUTR, mask); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +avila_gpio_probe(device_t dev) +{ + + device_set_desc(dev, "Gateworks Avila GPIO driver"); + return (0); +} + +static int +avila_gpio_attach(device_t dev) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + struct avila_gpio_softc *sc = device_get_softc(dev); + struct ixp425_softc *sa = device_get_softc(device_get_parent(dev)); + int i; + + sc->sc_dev = dev; + sc->sc_iot = sa->sc_iot; + sc->sc_gpio_ioh = sa->sc_gpio_ioh; + + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + + for (i = 0; i < N(avila_gpio_pins); i++) { + struct avila_gpio_pin *p = &avila_gpio_pins[i]; + + strncpy(sc->sc_pins[p->pin].gp_name, p->name, GPIOMAXNAME); + sc->sc_pins[p->pin].gp_pin = p->pin; + sc->sc_pins[p->pin].gp_caps = p->caps; + sc->sc_pins[p->pin].gp_flags = avila_gpio_pin_flags(sc, p->pin); + sc->sc_valid |= 1 << p->pin; + } + + device_add_child(dev, "gpioc", device_get_unit(dev)); + device_add_child(dev, "gpiobus", device_get_unit(dev)); + return (bus_generic_attach(dev)); +#undef N +} + +static int +avila_gpio_detach(device_t dev) +{ + struct avila_gpio_softc *sc = device_get_softc(dev); + + KASSERT(mtx_initialized(&sc->sc_mtx), ("gpio mutex not initialized")); + + bus_generic_detach(dev); + + mtx_destroy(&sc->sc_mtx); + + return(0); +} + +static device_method_t gpio_avila_methods[] = { + DEVMETHOD(device_probe, avila_gpio_probe), + DEVMETHOD(device_attach, avila_gpio_attach), + DEVMETHOD(device_detach, avila_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_pin_max, avila_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, avila_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, avila_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, avila_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, avila_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, avila_gpio_pin_get), + DEVMETHOD(gpio_pin_set, avila_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, avila_gpio_pin_toggle), + {0, 0}, +}; + +static driver_t gpio_avila_driver = { + "gpio_avila", + gpio_avila_methods, + sizeof(struct avila_gpio_softc), +}; +static devclass_t gpio_avila_devclass; + +DRIVER_MODULE(gpio_avila, ixp, gpio_avila_driver, gpio_avila_devclass, 0, 0); Modified: head/sys/arm/xscale/ixp425/files.avila ============================================================================== --- head/sys/arm/xscale/ixp425/files.avila Sun Nov 7 20:33:36 2010 (r214945) +++ head/sys/arm/xscale/ixp425/files.avila Sun Nov 7 20:33:39 2010 (r214946) @@ -2,7 +2,9 @@ arm/xscale/ixp425/avila_machdep.c standard arm/xscale/ixp425/avila_ata.c optional avila_ata arm/xscale/ixp425/avila_led.c optional avila_led +arm/xscale/ixp425/avila_gpio.c optional avila_gpio arm/xscale/ixp425/cambria_exp_space.c standard arm/xscale/ixp425/cambria_fled.c optional cambria_fled arm/xscale/ixp425/cambria_led.c optional cambria_led +arm/xscale/ixp425/cambria_gpio.c optional cambria_gpio arm/xscale/ixp425/ixdp425_pci.c optional pci Modified: head/sys/arm/xscale/ixp425/ixp425reg.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425reg.h Sun Nov 7 20:33:36 2010 (r214945) +++ head/sys/arm/xscale/ixp425/ixp425reg.h Sun Nov 7 20:33:39 2010 (r214946) @@ -323,6 +323,8 @@ #define GPIO_TYPE(b,v) ((v) << (((b) & 0x7) * 3)) #define GPIO_TYPE_REG(b) (((b)&8)?IXP425_GPIO_GPIT2R:IXP425_GPIO_GPIT1R) +#define IXP4XX_GPIO_PINS 16 + /* * Expansion Bus Configuration Space. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:37:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E518106566C; Sun, 7 Nov 2010 20:37:26 +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 1242F8FC13; Sun, 7 Nov 2010 20:37:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KbPxL078599; Sun, 7 Nov 2010 20:37:25 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7KbPmg078597; Sun, 7 Nov 2010 20:37:25 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011072037.oA7KbPmg078597@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 20:37: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: r214947 - head/contrib/gdb/gdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:37:26 -0000 Author: gonzo Date: Sun Nov 7 20:37:25 2010 New Revision: 214947 URL: http://svn.freebsd.org/changeset/base/214947 Log: Calculate offset from frame top for registers saved on a stack frame. Modified: head/contrib/gdb/gdb/mips-tdep.c Modified: head/contrib/gdb/gdb/mips-tdep.c ============================================================================== --- head/contrib/gdb/gdb/mips-tdep.c Sun Nov 7 20:33:39 2010 (r214946) +++ head/contrib/gdb/gdb/mips-tdep.c Sun Nov 7 20:37:25 2010 (r214947) @@ -1495,6 +1495,7 @@ mips_mdebug_frame_cache (struct frame_in int kernel_trap; /* What registers have been saved? Bitmasks. */ unsigned long gen_mask, float_mask; + long reg_offset; if ((*this_cache) != NULL) return (*this_cache); @@ -1513,6 +1514,8 @@ mips_mdebug_frame_cache (struct frame_in /* Extract the frame's base. */ cache->base = (frame_unwind_register_signed (next_frame, NUM_REGS + PROC_FRAME_REG (proc_desc)) + PROC_FRAME_OFFSET (proc_desc) - PROC_FRAME_ADJUST (proc_desc)); + /* Save registers offset from scratching by following find_proc_desc call */ + reg_offset = PROC_REG_OFFSET (proc_desc); kernel_trap = PROC_REG_MASK (proc_desc) & 1; gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK (proc_desc); @@ -1567,8 +1570,7 @@ mips_mdebug_frame_cache (struct frame_in /* Fill in the offsets for the registers which gen_mask says were saved. */ { - CORE_ADDR reg_position = (cache->base - + PROC_REG_OFFSET (proc_desc)); + CORE_ADDR reg_position = (cache->base + reg_offset); int ireg; for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1) if (gen_mask & 0x80000000) @@ -2162,15 +2164,18 @@ restart: { PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; set_reg_offset (temp_saved_regs, reg, sp + low_word); + /* Do we have registers offset yet? */ + if (!PROC_REG_OFFSET (&temp_proc_desc)) + PROC_REG_OFFSET (&temp_proc_desc) = low_word - PROC_FRAME_OFFSET (&temp_proc_desc); } else if ((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */ { - /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and $ra, - but the register size used is only 32 bits. Make the address - for the saved register point to the lower 32 bits. */ PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; set_reg_offset (temp_saved_regs, reg, - sp + low_word + 8 - mips_regsize (current_gdbarch)); + sp + low_word); + /* Do we have registers offset yet? */ + if (!PROC_REG_OFFSET (&temp_proc_desc)) + PROC_REG_OFFSET (&temp_proc_desc) = low_word - PROC_FRAME_OFFSET (&temp_proc_desc); } else if (high_word == 0x27be) /* addiu $30,$sp,size */ { From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:38:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E41741065670; Sun, 7 Nov 2010 20:38:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D26528FC16; Sun, 7 Nov 2010 20:38:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KcEdB078727; Sun, 7 Nov 2010 20:38:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7KcERr078725; Sun, 7 Nov 2010 20:38:14 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011072038.oA7KcERr078725@svn.freebsd.org> From: Andrew Thompson Date: Sun, 7 Nov 2010 20:38: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: r214948 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:38:15 -0000 Author: thompsa Date: Sun Nov 7 20:38:14 2010 New Revision: 214948 URL: http://svn.freebsd.org/changeset/base/214948 Log: Remove line for the uncommitted Cambria gpio drive that snuck in with r214946. Modified: head/sys/arm/xscale/ixp425/files.avila Modified: head/sys/arm/xscale/ixp425/files.avila ============================================================================== --- head/sys/arm/xscale/ixp425/files.avila Sun Nov 7 20:37:25 2010 (r214947) +++ head/sys/arm/xscale/ixp425/files.avila Sun Nov 7 20:38:14 2010 (r214948) @@ -6,5 +6,4 @@ arm/xscale/ixp425/avila_gpio.c optional arm/xscale/ixp425/cambria_exp_space.c standard arm/xscale/ixp425/cambria_fled.c optional cambria_fled arm/xscale/ixp425/cambria_led.c optional cambria_led -arm/xscale/ixp425/cambria_gpio.c optional cambria_gpio arm/xscale/ixp425/ixdp425_pci.c optional pci From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:40:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66E721065670; Sun, 7 Nov 2010 20:40:00 +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 54A468FC15; Sun, 7 Nov 2010 20:40:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Ke0rb078984; Sun, 7 Nov 2010 20:40:00 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Ke0aT078981; Sun, 7 Nov 2010 20:40:00 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011072040.oA7Ke0aT078981@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 20:40: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: r214949 - head/contrib/gdb/gdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:40:00 -0000 Author: gonzo Date: Sun Nov 7 20:40:00 2010 New Revision: 214949 URL: http://svn.freebsd.org/changeset/base/214949 Log: Change register numbers according to current struct reg and struct fpreg in src/sys/mips/include/reg.h Modified: head/contrib/gdb/gdb/mips-tdep.h head/contrib/gdb/gdb/mipsfbsd-tdep.h Modified: head/contrib/gdb/gdb/mips-tdep.h ============================================================================== --- head/contrib/gdb/gdb/mips-tdep.h Sun Nov 7 20:38:14 2010 (r214948) +++ head/contrib/gdb/gdb/mips-tdep.h Sun Nov 7 20:40:00 2010 (r214949) @@ -78,7 +78,7 @@ enum { MIPS_EMBED_BADVADDR_REGNUM = 35, MIPS_EMBED_CAUSE_REGNUM = 36, MIPS_EMBED_PC_REGNUM = 37, - MIPS_EMBED_FP0_REGNUM = 38 + MIPS_EMBED_FP0_REGNUM = 40 }; /* Defined in mips-tdep.c and used in remote-mips.c */ Modified: head/contrib/gdb/gdb/mipsfbsd-tdep.h ============================================================================== --- head/contrib/gdb/gdb/mipsfbsd-tdep.h Sun Nov 7 20:38:14 2010 (r214948) +++ head/contrib/gdb/gdb/mipsfbsd-tdep.h Sun Nov 7 20:40:00 2010 (r214949) @@ -34,7 +34,7 @@ void mipsfbsd_fill_reg (char *, int); void mipsfbsd_supply_fpreg (char *, int); void mipsfbsd_fill_fpreg (char *, int); -#define SIZEOF_STRUCT_REG (38 * mips_regsize (current_gdbarch)) -#define SIZEOF_STRUCT_FPREG (33 * mips_regsize (current_gdbarch)) +#define SIZEOF_STRUCT_REG (40 * mips_regsize (current_gdbarch)) +#define SIZEOF_STRUCT_FPREG (34 * mips_regsize (current_gdbarch)) #endif /* mipsfbsd_TDEP_H */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:44:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD750106566C; Sun, 7 Nov 2010 20:44:46 +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 AB95B8FC14; Sun, 7 Nov 2010 20:44:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KikZ1079635; Sun, 7 Nov 2010 20:44:46 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Kik8A079633; Sun, 7 Nov 2010 20:44:46 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011072044.oA7Kik8A079633@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 20:44: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: r214950 - head/contrib/binutils/bfd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:44:46 -0000 Author: gonzo Date: Sun Nov 7 20:44:46 2010 New Revision: 214950 URL: http://svn.freebsd.org/changeset/base/214950 Log: Prevent endless loop by detecting broken MIPS.options Modified: head/contrib/binutils/bfd/elfxx-mips.c Modified: head/contrib/binutils/bfd/elfxx-mips.c ============================================================================== --- head/contrib/binutils/bfd/elfxx-mips.c Sun Nov 7 20:40:00 2010 (r214949) +++ head/contrib/binutils/bfd/elfxx-mips.c Sun Nov 7 20:44:46 2010 (r214950) @@ -4330,6 +4330,15 @@ _bfd_mips_elf_section_processing (bfd *a bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l, &intopt); + if (intopt.size < sizeof (Elf_External_Options)) + { + (*_bfd_error_handler) + (_("Warning: bad `%s' option size %u smaller than its header"), + MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size); + break; + } + + if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO) { bfd_byte buf[8]; @@ -4542,6 +4551,14 @@ _bfd_mips_elf_section_from_shdr (bfd *ab bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l, &intopt); + if (intopt.size < sizeof (Elf_External_Options)) + { + (*_bfd_error_handler) + (_("Warning: bad `%s' option size %u smaller than its header"), + MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size); + break; + } + if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO) { Elf64_Internal_RegInfo intreg; From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:53:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7CCD106564A; Sun, 7 Nov 2010 20:53:19 +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 527B38FC1E; Sun, 7 Nov 2010 20:53:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KrJIf080866; Sun, 7 Nov 2010 20:53:19 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7KrJg6080863; Sun, 7 Nov 2010 20:53:19 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011072053.oA7KrJg6080863@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 20:53: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: r214951 - head/gnu/usr.bin/gdb/arch/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:53:19 -0000 Author: gonzo Date: Sun Nov 7 20:53:19 2010 New Revision: 214951 URL: http://svn.freebsd.org/changeset/base/214951 Log: Link threads support to the build Modified: head/gnu/usr.bin/gdb/arch/mips/Makefile head/gnu/usr.bin/gdb/arch/mips/init.c Modified: head/gnu/usr.bin/gdb/arch/mips/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/arch/mips/Makefile Sun Nov 7 20:44:46 2010 (r214950) +++ head/gnu/usr.bin/gdb/arch/mips/Makefile Sun Nov 7 20:53:19 2010 (r214951) @@ -1,7 +1,7 @@ # $FreeBSD$ .if !defined(GDB_CROSS_DEBUGGER) -LIBSRCS+= mipsfbsd-nat.c +LIBSRCS+= mipsfbsd-nat.c fbsd-threads.c .endif LIBSRCS+= solib.c solib-svr4.c LIBSRCS+= mips-tdep.c mipsfbsd-tdep.c fbsd-proc.c Modified: head/gnu/usr.bin/gdb/arch/mips/init.c ============================================================================== --- head/gnu/usr.bin/gdb/arch/mips/init.c Sun Nov 7 20:44:46 2010 (r214950) +++ head/gnu/usr.bin/gdb/arch/mips/init.c Sun Nov 7 20:53:19 2010 (r214951) @@ -131,6 +131,7 @@ initialize_all_files (void) _initialize_infptrace (); _initialize_inftarg (); _initialize_solib (); + _initialize_thread_db (); _initialize_svr4_solib (); #if 0 _initialize_svr4_lm (); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 20:56:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D53F106564A; Sun, 7 Nov 2010 20:56:41 +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 6AC6B8FC08; Sun, 7 Nov 2010 20:56:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7KufoG081201; Sun, 7 Nov 2010 20:56:41 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7KufOm081199; Sun, 7 Nov 2010 20:56:41 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011072056.oA7KufOm081199@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 20:56: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: r214952 - head/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 20:56:41 -0000 Author: gonzo Date: Sun Nov 7 20:56:41 2010 New Revision: 214952 URL: http://svn.freebsd.org/changeset/base/214952 Log: - Use proper constant for accessing PCB intead of hardcoded numbers - Minor clean-up Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Nov 7 20:53:19 2010 (r214951) +++ head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Nov 7 20:56:41 2010 (r214952) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "kgdb.h" void @@ -61,24 +63,26 @@ kgdb_trgt_fetch_registers(int regno __un warnx("kvm_read: %s", kvm_geterr(kvm)); memset(&pcb, 0, sizeof(pcb)); } - supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[0]); - supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[1]); - supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[2]); - supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[3]); - supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[4]); - supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[5]); - supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[6]); - supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[7]); - supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[8]); - supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[9]); - supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[10]); + + supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S0]); + supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S1]); + supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S2]); + supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S3]); + supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S4]); + supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S5]); + supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S6]); + supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S7]); + supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_SP]); + supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_GP]); + supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[PCB_REG_RA]); + supply_register(MIPS_EMBED_PC_REGNUM, (char *)&pcb.pcb_context[PCB_REG_PC]); } void kgdb_trgt_store_registers(int regno __unused) { - fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__); + fprintf_unfiltered(gdb_stderr, "Unimplemented function: %s\n", __func__); } void @@ -127,7 +131,7 @@ static int kgdb_trgt_frame_offset[] = { }; static struct kgdb_frame_cache * -kgdb_trgt_frame_cache(struct frame_info *next_frame __unused, void **this_cache __unused) +kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache) { char buf[MAX_REGISTER_SIZE]; struct kgdb_frame_cache *cache; @@ -192,7 +196,7 @@ static const struct frame_unwind kgdb_tr }; const struct frame_unwind * -kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame __unused) +kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame) { char *pname; CORE_ADDR pc; @@ -207,6 +211,5 @@ kgdb_trgt_trapframe_sniffer(struct frame (strcmp(pname, "MipsUserIntr") == 0) || (strcmp(pname, "MipsUserGenException") == 0)) return (&kgdb_trgt_trapframe_unwind); - /* printf("%s: %llx =%s\n", __func__, pc, pname); */ return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 21:40:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EFE0106566B; Sun, 7 Nov 2010 21:40:35 +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 0D81C8FC1C; Sun, 7 Nov 2010 21:40:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7LeYxx084698; Sun, 7 Nov 2010 21:40:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7LeY8j084696; Sun, 7 Nov 2010 21:40:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011072140.oA7LeY8j084696@svn.freebsd.org> From: Alan Cox Date: Sun, 7 Nov 2010 21:40: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: r214953 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 21:40:35 -0000 Author: alc Date: Sun Nov 7 21:40:34 2010 New Revision: 214953 URL: http://svn.freebsd.org/changeset/base/214953 Log: In case the stack size reaches its limit and its growth must be restricted, ensure that grow_amount is a multiple of the page size. Otherwise, the kernel may crash in swap_reserve_by_uid() on HEAD and FreeBSD 8.x, and produce a core file with a missing stack on FreeBSD 7.x. Diagnosed and reported by: jilles Reviewed by: kib MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Nov 7 20:56:41 2010 (r214952) +++ head/sys/vm/vm_map.c Sun Nov 7 21:40:34 2010 (r214953) @@ -3338,7 +3338,8 @@ Retry: if (grow_amount > stack_entry->avail_ssize) grow_amount = stack_entry->avail_ssize; if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) { - grow_amount = stacklim - ctob(vm->vm_ssize); + grow_amount = trunc_page((vm_size_t)stacklim) - + ctob(vm->vm_ssize); } /* If we would blow our VMEM resource limit, no go */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 21:48:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D73C9106566B; Sun, 7 Nov 2010 21:48: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 C57618FC0C; Sun, 7 Nov 2010 21:48:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7LmnE1085414; Sun, 7 Nov 2010 21:48:49 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7LmnvE085412; Sun, 7 Nov 2010 21:48:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011072148.oA7LmnvE085412@svn.freebsd.org> From: Alan Cox Date: Sun, 7 Nov 2010 21: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: r214954 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 21:48:49 -0000 Author: alc Date: Sun Nov 7 21:48:49 2010 New Revision: 214954 URL: http://svn.freebsd.org/changeset/base/214954 Log: Don't call pmap_demote_DMAP() on MTRR entries from the BIOS that are marked as "bogus". Reported by: Jia-Shiun Li Modified: head/sys/amd64/amd64/amd64_mem.c Modified: head/sys/amd64/amd64/amd64_mem.c ============================================================================== --- head/sys/amd64/amd64/amd64_mem.c Sun Nov 7 21:40:34 2010 (r214953) +++ head/sys/amd64/amd64/amd64_mem.c Sun Nov 7 21:48:49 2010 (r214954) @@ -583,7 +583,7 @@ amd64_mrset(struct mem_range_softc *sc, i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0; mrd = sc->mr_desc + i; for (; i < sc->mr_ndesc; i++, mrd++) { - if (mrd->mr_flags & MDF_ACTIVE) + if ((mrd->mr_flags & (MDF_ACTIVE | MDF_BOGUS)) == MDF_ACTIVE) pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, FALSE); } @@ -688,7 +688,7 @@ amd64_mrinit(struct mem_range_softc *sc) i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0; mrd = sc->mr_desc + i; for (; i < sc->mr_ndesc; i++, mrd++) { - if (mrd->mr_flags & MDF_ACTIVE) + if ((mrd->mr_flags & (MDF_ACTIVE | MDF_BOGUS)) == MDF_ACTIVE) pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, TRUE); } } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 21:57:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94A89106566C; Sun, 7 Nov 2010 21:57:57 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7713E8FC08; Sun, 7 Nov 2010 21:57:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7LvvVJ086192; Sun, 7 Nov 2010 21:57:57 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Lvvft086189; Sun, 7 Nov 2010 21:57:57 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201011072157.oA7Lvvft086189@svn.freebsd.org> From: Nick Hibma Date: Sun, 7 Nov 2010 21:57: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: r214955 - head/tools/tools/nanobsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 21:57:57 -0000 Author: n_hibma Date: Sun Nov 7 21:57:57 2010 New Revision: 214955 URL: http://svn.freebsd.org/changeset/base/214955 Log: - Set -x flag when executing customisation scripts to aid in debugging them. - Use KERNCONFDIR with KERNCONF instead of copying the kernel config into the source tree so included kernel configs work. - Put more stuff in the _.bk/_.ik log file, not just make statements. - Add the kernel config name to the pprint during kernel installation. - Add NANO_MODULES providing a list of modules to build and install. Reviewed by: imp MFC after: 2 weeks Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sun Nov 7 21:48:49 2010 (r214954) +++ head/tools/tools/nanobsd/nanobsd.sh Sun Nov 7 21:57:57 2010 (r214955) @@ -75,6 +75,9 @@ CONF_WORLD=' ' # Kernel config file to use NANO_KERNEL=GENERIC +# Kernel modules to build; default is none +NANO_MODULES= + # Customize commands. NANO_CUSTOMIZE="" @@ -189,19 +192,26 @@ build_kernel ( ) ( pprint 2 "build kernel ($NANO_KERNEL)" pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk" + ( if [ -f ${NANO_KERNEL} ] ; then - cp ${NANO_KERNEL} ${NANO_SRC}/sys/${NANO_ARCH}/conf + kernconfdir=$(realpath $(dirname ${NANO_KERNEL})) + kernconf=$(basename ${NANO_KERNEL}) + else + kernconf=${NANO_KERNEL} fi - (cd ${NANO_SRC}; + cd ${NANO_SRC}; # unset these just in case to avoid compiler complaints # when cross-building unset TARGET_CPUTYPE unset TARGET_BIG_ENDIAN + # Note: We intentionally build all modules, not only the ones in + # NANO_MODULES so the built world can be reused by multiple images. env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ - __MAKE_CONF=${NANO_MAKE_CONF_BUILD} KERNCONF=`basename ${NANO_KERNEL}` \ - > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 - ) + __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ + ${kernconfdir:+"KERNCONFDIR="}${kernconfdir} \ + KERNCONF=${kernconf} + ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 ) clean_world ( ) ( @@ -258,14 +268,25 @@ install_etc ( ) ( ) install_kernel ( ) ( - pprint 2 "install kernel" + pprint 2 "install kernel ($NANO_KERNEL)" pprint 3 "log: ${NANO_OBJ}/_.ik" + ( + if [ -f ${NANO_KERNEL} ] ; then + kernconfdir=$(realpath $(dirname ${NANO_KERNEL})) + kernconf=$(basename ${NANO_KERNEL}) + else + kernconf=${NANO_KERNEL} + fi + cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} installkernel \ DESTDIR=${NANO_WORLDDIR} \ - __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} KERNCONF=`basename ${NANO_KERNEL}` \ - > ${NANO_OBJ}/_.ik 2>&1 + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ + ${kernconfdir:+"KERNCONFDIR="}${kernconfdir} \ + KERNCONF=${kernconf} \ + MODULES_OVERRIDE="${NANO_MODULES}" + ) > ${NANO_OBJ}/_.ik 2>&1 ) run_customize() ( @@ -276,7 +297,7 @@ run_customize() ( pprint 2 "customize \"$c\"" pprint 3 "log: ${NANO_OBJ}/_.cust.$c" pprint 4 "`type $c`" - ( $c ) > ${NANO_OBJ}/_.cust.$c 2>&1 + ( set -x ; $c ) > ${NANO_OBJ}/_.cust.$c 2>&1 done ) @@ -288,7 +309,7 @@ run_late_customize() ( pprint 2 "late customize \"$c\"" pprint 3 "log: ${NANO_OBJ}/_.late_cust.$c" pprint 4 "`type $c`" - ( $c ) > ${NANO_OBJ}/_.late_cust.$c 2>&1 + ( set -x ; $c ) > ${NANO_OBJ}/_.late_cust.$c 2>&1 done ) From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 22:24:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1922F1065672; Sun, 7 Nov 2010 22:24:18 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0404E8FC31; Sun, 7 Nov 2010 22:24:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7MOHRi088343; Sun, 7 Nov 2010 22:24:17 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7MOH72088341; Sun, 7 Nov 2010 22:24:17 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201011072224.oA7MOH72088341@svn.freebsd.org> From: Brian Somers Date: Sun, 7 Nov 2010 22:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214956 - in stable/8: sbin/growfs tools/regression/lib/msun tools/regression/sbin tools/regression/usr.bin/pkill tools/tools/ath/common tools/tools/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 22:24:18 -0000 Author: brian Date: Sun Nov 7 22:24:17 2010 New Revision: 214956 URL: http://svn.freebsd.org/changeset/base/214956 Log: MFC r197763 and r212839: Handle extending a filesystem into unzeroed storage. Added: stable/8/tools/regression/sbin/ - copied from r212839, head/tools/regression/sbin/ Modified: stable/8/sbin/growfs/growfs.c Directory Properties: stable/8/sbin/growfs/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/sbin/growfs/growfs.c ============================================================================== --- stable/8/sbin/growfs/growfs.c Sun Nov 7 21:57:57 2010 (r214955) +++ stable/8/sbin/growfs/growfs.c Sun Nov 7 22:24:17 2010 (r214956) @@ -371,16 +371,16 @@ static void initcg(int cylno, time_t utime, int fso, unsigned int Nflag) { DBG_FUNC("initcg") - static void *iobuf; + static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; struct csum *cs; uint d, dupper, dlower; - if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize)) == NULL) { + if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize * 3)) == NULL) errx(37, "panic: cannot allocate I/O buffer"); - } + /* * Determine block bounds for cylinder group. * Allow space for super block summary information in first @@ -400,7 +400,8 @@ initcg(int cylno, time_t utime, int fso, acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg; + acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ? + sblock.fs_ipg : 2 * INOPB(&sblock); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -533,11 +534,14 @@ initcg(int cylno, time_t utime, int fso, sblock.fs_cstotal.cs_nbfree += acg.cg_cs.cs_nbfree; sblock.fs_cstotal.cs_nifree += acg.cg_cs.cs_nifree; *cs = acg.cg_cs; + + memcpy(iobuf, &acg, sblock.fs_cgsize); + memset(iobuf + sblock.fs_cgsize, '\0', + sblock.fs_bsize * 3 - sblock.fs_cgsize); + wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), - sblock.fs_bsize, (char *)&acg, fso, Nflag); - DBG_DUMP_CG(&sblock, - "new cg", - &acg); + sblock.fs_bsize * 3, iobuf, fso, Nflag); + DBG_DUMP_CG(&sblock, "new cg", &acg); DBG_LEAVE; return; @@ -2209,6 +2213,7 @@ main(int argc, char **argv) printf("Warning: %jd sector(s) cannot be allocated.\n", (intmax_t)fsbtodb(&sblock, sblock.fs_size % sblock.fs_fpg)); sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg; + maxino -= sblock.fs_ipg; } /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 22:28:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C79A6106564A; Sun, 7 Nov 2010 22:28:55 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4FB18FC08; Sun, 7 Nov 2010 22:28:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7MStJV088960; Sun, 7 Nov 2010 22:28:55 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7MSt1c088958; Sun, 7 Nov 2010 22:28:55 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201011072228.oA7MSt1c088958@svn.freebsd.org> From: Brian Somers Date: Sun, 7 Nov 2010 22:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214957 - stable/8/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 22:28:55 -0000 Author: brian Date: Sun Nov 7 22:28:55 2010 New Revision: 214957 URL: http://svn.freebsd.org/changeset/base/214957 Log: MFC r198236 for now. Modified: stable/8/sbin/growfs/Makefile Directory Properties: stable/8/sbin/growfs/ (props changed) Modified: stable/8/sbin/growfs/Makefile ============================================================================== --- stable/8/sbin/growfs/Makefile Sun Nov 7 22:24:17 2010 (r214956) +++ stable/8/sbin/growfs/Makefile Sun Nov 7 22:28:55 2010 (r214957) @@ -10,8 +10,6 @@ PROG= growfs SRCS= growfs.c MAN= growfs.8 -WARNS?= 6 - .if defined(GFSDBG) SRCS+= debug.c .endif From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 22:33:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CD10106566B; Sun, 7 Nov 2010 22:33:56 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A36E8FC0C; Sun, 7 Nov 2010 22:33:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7MXtWn089241; Sun, 7 Nov 2010 22:33:55 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7MXtJF089239; Sun, 7 Nov 2010 22:33:55 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201011072233.oA7MXtJF089239@svn.freebsd.org> From: Brian Somers Date: Sun, 7 Nov 2010 22:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214958 - stable/8/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 22:33:56 -0000 Author: brian Date: Sun Nov 7 22:33:55 2010 New Revision: 214958 URL: http://svn.freebsd.org/changeset/base/214958 Log: MFC r212886 (by marcel): Unbreak the build on strong-aligned architectures. Modified: stable/8/sbin/growfs/growfs.c Directory Properties: stable/8/sbin/growfs/ (props changed) Modified: stable/8/sbin/growfs/growfs.c ============================================================================== --- stable/8/sbin/growfs/growfs.c Sun Nov 7 22:28:55 2010 (r214957) +++ stable/8/sbin/growfs/growfs.c Sun Nov 7 22:33:55 2010 (r214958) @@ -452,7 +452,7 @@ initcg(int cylno, time_t utime, int fso, bzero(iobuf, sblock.fs_bsize); for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { - dp1 = (struct ufs1_dinode *)iobuf; + dp1 = (struct ufs1_dinode *)(void *)iobuf; #ifdef FSIRAND for (j = 0; j < INOPB(&sblock); j++) { dp1->di_gen = random(); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 22:51:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2A31106564A; Sun, 7 Nov 2010 22:51:54 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EDB88FC0A; Sun, 7 Nov 2010 22:51:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Mpsjr090315; Sun, 7 Nov 2010 22:51:54 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7MpsBq090305; Sun, 7 Nov 2010 22:51:54 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011072251.oA7MpsBq090305@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 7 Nov 2010 22:51: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: r214959 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 22:51:54 -0000 Author: obrien Date: Sun Nov 7 22:51:54 2010 New Revision: 214959 URL: http://svn.freebsd.org/changeset/base/214959 Log: Change to ANSI-C function definitions. Modified: head/usr.bin/yacc/Makefile head/usr.bin/yacc/closure.c head/usr.bin/yacc/error.c head/usr.bin/yacc/lalr.c head/usr.bin/yacc/lr0.c head/usr.bin/yacc/main.c head/usr.bin/yacc/mkpar.c head/usr.bin/yacc/output.c head/usr.bin/yacc/reader.c head/usr.bin/yacc/skeleton.c head/usr.bin/yacc/symtab.c head/usr.bin/yacc/verbose.c head/usr.bin/yacc/warshall.c Modified: head/usr.bin/yacc/Makefile ============================================================================== --- head/usr.bin/yacc/Makefile Sun Nov 7 22:33:55 2010 (r214958) +++ head/usr.bin/yacc/Makefile Sun Nov 7 22:51:54 2010 (r214959) @@ -9,6 +9,6 @@ MAN= yacc.1 yyfix.1 LINKS= ${BINDIR}/yacc ${BINDIR}/byacc MLINKS= yacc.1 byacc.1 -WARNS?= 2 +WARNS?= 6 .include Modified: head/usr.bin/yacc/closure.c ============================================================================== --- head/usr.bin/yacc/closure.c Sun Nov 7 22:33:55 2010 (r214958) +++ head/usr.bin/yacc/closure.c Sun Nov 7 22:51:54 2010 (r214959) @@ -62,7 +62,7 @@ static unsigned *EFF; static void -set_EFF() +set_EFF(void) { unsigned *row; int symbol; @@ -99,7 +99,7 @@ set_EFF() void -set_first_derives() +set_first_derives(void) { unsigned *rrow; unsigned *vrow; @@ -154,9 +154,7 @@ set_first_derives() void -closure(nucleus, n) -short *nucleus; -int n; +closure(short *nucleus, int n) { int ruleno; unsigned word; @@ -224,7 +222,7 @@ int n; void -finalize_closure() +finalize_closure(void) { FREE(itemset); FREE(ruleset); @@ -235,8 +233,7 @@ finalize_closure() #ifdef DEBUG static void -print_closure(n) -int n; +print_closure(int n) { short *isp; @@ -247,7 +244,7 @@ int n; static void -print_EFF() +print_EFF(void) { int i, j; unsigned *rowp; @@ -279,7 +276,7 @@ print_EFF() static void -print_first_derives() +print_first_derives(void) { int i; int j; Modified: head/usr.bin/yacc/error.c ============================================================================== --- head/usr.bin/yacc/error.c Sun Nov 7 22:33:55 2010 (r214958) +++ head/usr.bin/yacc/error.c Sun Nov 7 22:51:54 2010 (r214959) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); static void print_pos(char *, char *); void -fatal(msg) -const char *msg; +fatal(const char *msg) { warnx("f - %s", msg); done(2); @@ -58,7 +57,7 @@ const char *msg; void -no_space() +no_space(void) { warnx("f - out of space"); done(2); @@ -66,8 +65,7 @@ no_space() void -open_error(filename) -const char *filename; +open_error(const char *filename) { warnx("f - cannot open \"%s\"", filename); done(2); @@ -75,7 +73,7 @@ const char *filename; void -unexpected_EOF() +unexpected_EOF(void) { warnx("e - line %d of \"%s\", unexpected end-of-file", lineno, input_file_name); @@ -84,9 +82,7 @@ unexpected_EOF() static void -print_pos(st_line, st_cptr) -char *st_line; -char *st_cptr; +print_pos(char *st_line, char *st_cptr) { char *s; @@ -112,10 +108,7 @@ char *st_cptr; void -syntax_error(st_lineno, st_line, st_cptr) -int st_lineno; -char *st_line; -char *st_cptr; +syntax_error(int st_lineno, char *st_line, char *st_cptr) { warnx("e - line %d of \"%s\", syntax error", st_lineno, input_file_name); @@ -125,10 +118,7 @@ char *st_cptr; void -unterminated_comment(c_lineno, c_line, c_cptr) -int c_lineno; -char *c_line; -char *c_cptr; +unterminated_comment(int c_lineno, char *c_line, char *c_cptr) { warnx("e - line %d of \"%s\", unmatched /*", c_lineno, input_file_name); @@ -138,10 +128,7 @@ char *c_cptr; void -unterminated_string(s_lineno, s_line, s_cptr) -int s_lineno; -char *s_line; -char *s_cptr; +unterminated_string(int s_lineno, char *s_line, char *s_cptr) { warnx("e - line %d of \"%s\", unterminated string", s_lineno, input_file_name); @@ -151,10 +138,7 @@ char *s_cptr; void -unterminated_text(t_lineno, t_line, t_cptr) -int t_lineno; -char *t_line; -char *t_cptr; +unterminated_text(int t_lineno, char *t_line, char *t_cptr) { warnx("e - line %d of \"%s\", unmatched %%{", t_lineno, input_file_name); @@ -164,10 +148,7 @@ char *t_cptr; void -unterminated_union(u_lineno, u_line, u_cptr) -int u_lineno; -char *u_line; -char *u_cptr; +unterminated_union(int u_lineno, char *u_line, char *u_cptr) { warnx("e - line %d of \"%s\", unterminated %%union declaration", u_lineno, input_file_name); @@ -177,8 +158,7 @@ char *u_cptr; void -over_unionized(u_cptr) -char *u_cptr; +over_unionized(char *u_cptr) { warnx("e - line %d of \"%s\", too many %%union declarations", lineno, input_file_name); @@ -188,10 +168,7 @@ char *u_cptr; void -illegal_tag(t_lineno, t_line, t_cptr) -int t_lineno; -char *t_line; -char *t_cptr; +illegal_tag(int t_lineno, char *t_line, char *t_cptr) { warnx("e - line %d of \"%s\", illegal tag", t_lineno, input_file_name); print_pos(t_line, t_cptr); @@ -200,8 +177,7 @@ char *t_cptr; void -illegal_character(c_cptr) -char *c_cptr; +illegal_character(char *c_cptr) { warnx("e - line %d of \"%s\", illegal character", lineno, input_file_name); print_pos(line, c_cptr); @@ -210,8 +186,7 @@ char *c_cptr; void -used_reserved(s) -char *s; +used_reserved(char *s) { warnx("e - line %d of \"%s\", illegal use of reserved symbol %s", lineno, input_file_name, s); @@ -220,8 +195,7 @@ char *s; void -tokenized_start(s) -char *s; +tokenized_start(char *s) { warnx("e - line %d of \"%s\", the start symbol %s cannot be \ declared to be a token", lineno, input_file_name, s); @@ -230,8 +204,7 @@ declared to be a token", lineno, input_f void -retyped_warning(s) -char *s; +retyped_warning(char *s) { warnx("w - line %d of \"%s\", the type of %s has been redeclared", lineno, input_file_name, s); @@ -239,8 +212,7 @@ char *s; void -reprec_warning(s) -char *s; +reprec_warning(char *s) { warnx("w - line %d of \"%s\", the precedence of %s has been redeclared", lineno, input_file_name, s); @@ -248,8 +220,7 @@ char *s; void -revalued_warning(s) -char *s; +revalued_warning(char *s) { warnx("w - line %d of \"%s\", the value of %s has been redeclared", lineno, input_file_name, s); @@ -257,8 +228,7 @@ char *s; void -terminal_start(s) -char *s; +terminal_start(char *s) { warnx("e - line %d of \"%s\", the start symbol %s is a token", lineno, input_file_name, s); @@ -267,7 +237,7 @@ char *s; void -restarted_warning() +restarted_warning(void) { warnx("w - line %d of \"%s\", the start symbol has been redeclared", lineno, input_file_name); @@ -275,7 +245,7 @@ restarted_warning() void -no_grammar() +no_grammar(void) { warnx("e - line %d of \"%s\", no grammar has been specified", lineno, input_file_name); @@ -284,8 +254,7 @@ no_grammar() void -terminal_lhs(s_lineno) -int s_lineno; +terminal_lhs(int s_lineno) { warnx("e - line %d of \"%s\", a token appears on the lhs of a production", s_lineno, input_file_name); @@ -294,7 +263,7 @@ int s_lineno; void -prec_redeclared() +prec_redeclared(void) { warnx("w - line %d of \"%s\", conflicting %%prec specifiers", lineno, input_file_name); @@ -302,10 +271,7 @@ prec_redeclared() void -unterminated_action(a_lineno, a_line, a_cptr) -int a_lineno; -char *a_line; -char *a_cptr; +unterminated_action(int a_lineno, char *a_line, char *a_cptr) { warnx("e - line %d of \"%s\", unterminated action", a_lineno, input_file_name); @@ -315,9 +281,7 @@ char *a_cptr; void -dollar_warning(a_lineno, i) -int a_lineno; -int i; +dollar_warning(int a_lineno, int i) { warnx("w - line %d of \"%s\", $%d references beyond the \ end of the current rule", a_lineno, input_file_name, i); @@ -325,10 +289,7 @@ end of the current rule", a_lineno, inpu void -dollar_error(a_lineno, a_line, a_cptr) -int a_lineno; -char *a_line; -char *a_cptr; +dollar_error(int a_lineno, char *a_line, char *a_cptr) { warnx("e - line %d of \"%s\", illegal $-name", a_lineno, input_file_name); print_pos(a_line, a_cptr); @@ -337,7 +298,7 @@ char *a_cptr; void -untyped_lhs() +untyped_lhs(void) { warnx("e - line %d of \"%s\", $$ is untyped", lineno, input_file_name); done(1); @@ -345,9 +306,7 @@ untyped_lhs() void -untyped_rhs(i, s) -int i; -char *s; +untyped_rhs(int i, char *s) { warnx("e - line %d of \"%s\", $%d (%s) is untyped", lineno, input_file_name, i, s); @@ -356,8 +315,7 @@ char *s; void -unknown_rhs(i) -int i; +unknown_rhs(int i) { warnx("e - line %d of \"%s\", $%d is untyped", lineno, input_file_name, i); done(1); @@ -365,7 +323,7 @@ int i; void -default_action_warning() +default_action_warning(void) { warnx("w - line %d of \"%s\", the default action assigns an \ undefined value to $$", lineno, input_file_name); @@ -373,8 +331,7 @@ undefined value to $$", lineno, input_fi void -undefined_goal(s) -char *s; +undefined_goal(char *s) { warnx("e - the start symbol %s is undefined", s); done(1); @@ -382,8 +339,7 @@ char *s; void -undefined_symbol_warning(s) -char *s; +undefined_symbol_warning(char *s) { warnx("w - the symbol %s is undefined", s); } Modified: head/usr.bin/yacc/lalr.c ============================================================================== --- head/usr.bin/yacc/lalr.c Sun Nov 7 22:33:55 2010 (r214958) +++ head/usr.bin/yacc/lalr.c Sun Nov 7 22:51:54 2010 (r214959) @@ -96,7 +96,7 @@ static int top; void -lalr() +lalr(void) { tokensetsize = WORDSIZE(ntokens); @@ -116,7 +116,7 @@ lalr() static void -set_state_table() +set_state_table(void) { core *sp; @@ -128,7 +128,7 @@ set_state_table() static void -set_accessing_symbol() +set_accessing_symbol(void) { core *sp; @@ -140,7 +140,7 @@ set_accessing_symbol() static void -set_shift_table() +set_shift_table(void) { shifts *sp; @@ -152,7 +152,7 @@ set_shift_table() static void -set_reduction_table() +set_reduction_table(void) { reductions *rp; @@ -164,7 +164,7 @@ set_reduction_table() static void -set_maxrhs() +set_maxrhs(void) { short *itemp; short *item_end; @@ -193,7 +193,7 @@ set_maxrhs() static void -initialize_LA() +initialize_LA(void) { int i, j, k; reductions *rp; @@ -231,7 +231,7 @@ initialize_LA() static void -set_goto_map() +set_goto_map(void) { shifts *sp; int i; @@ -301,9 +301,7 @@ set_goto_map() /* Map_goto maps a state/symbol pair into its numeric representation. */ static int -map_goto(state, symbol) -int state; -int symbol; +map_goto(int state, int symbol) { int high; int low; @@ -330,7 +328,7 @@ int symbol; static void -initialize_F() +initialize_F(void) { int i; int j; @@ -408,7 +406,7 @@ initialize_F() static void -build_relations() +build_relations(void) { int i; int j; @@ -501,8 +499,7 @@ build_relations() static void -add_lookback_edge(stateno, ruleno, gotono) -int stateno, ruleno, gotono; +add_lookback_edge(int stateno, int ruleno, int gotono) { int i, k; int found; @@ -529,9 +526,7 @@ int stateno, ruleno, gotono; static short ** -transpose(R, n) -short **R; -int n; +transpose(short **R, int n) { short **new_R; short **temp_R; @@ -587,14 +582,14 @@ int n; static void -compute_FOLLOWS() +compute_FOLLOWS(void) { digraph(includes); } static void -compute_lookaheads() +compute_lookaheads(void) { int i, n; unsigned *fp1, *fp2, *fp3; @@ -629,8 +624,7 @@ compute_lookaheads() static void -digraph(relation) -short **relation; +digraph(short **relation) { int i; @@ -655,9 +649,7 @@ short **relation; static void -traverse(i, R) -int i; -short **R; +traverse(int i, short **R) { unsigned *fp1; unsigned *fp2; Modified: head/usr.bin/yacc/lr0.c ============================================================================== --- head/usr.bin/yacc/lr0.c Sun Nov 7 22:33:55 2010 (r214958) +++ head/usr.bin/yacc/lr0.c Sun Nov 7 22:51:54 2010 (r214959) @@ -91,7 +91,7 @@ static short *kernel_items; static void -allocate_itemsets() +allocate_itemsets(void) { short *itemp; short *item_end; @@ -134,7 +134,7 @@ allocate_itemsets() static void -allocate_storage() +allocate_storage(void) { allocate_itemsets(); shiftset = NEW2(nsyms, short); @@ -144,7 +144,7 @@ allocate_storage() static void -append_states() +append_states(void) { int i; int j; @@ -174,7 +174,7 @@ append_states() static void -free_storage() +free_storage(void) { FREE(shift_symbol); FREE(redset); @@ -188,7 +188,7 @@ free_storage() static void -generate_states() +generate_states(void) { allocate_storage(); itemset = NEW2(nitems, short); @@ -216,8 +216,7 @@ generate_states() static int -get_state(symbol) -int symbol; +get_state(int symbol) { int key; short *isp1; @@ -281,7 +280,7 @@ int symbol; static void -initialize_states() +initialize_states(void) { int i; short *start_derives; @@ -309,7 +308,7 @@ initialize_states() static void -new_itemsets() +new_itemsets(void) { int i; int shiftcount; @@ -346,8 +345,7 @@ new_itemsets() static core * -new_state(symbol) -int symbol; +new_state(int symbol) { int n; core *p; @@ -387,7 +385,7 @@ int symbol; #if 0 /* show_cores is used for debugging */ -show_cores() +show_cores(void) { core *p; int i, j, k, n; @@ -422,7 +420,7 @@ show_cores() /* show_ritems is used for debugging */ -show_ritems() +show_ritems(void) { int i; @@ -432,7 +430,7 @@ show_ritems() /* show_rrhs is used for debugging */ -show_rrhs() +show_rrhs(void) { int i; @@ -443,7 +441,7 @@ show_rrhs() /* show_shifts is used for debugging */ -show_shifts() +show_shifts(void) { shifts *p; int i, j, k; @@ -463,7 +461,7 @@ show_shifts() static void -save_shifts() +save_shifts(void) { shifts *p; short *sp1; @@ -498,7 +496,7 @@ save_shifts() static void -save_reductions() +save_reductions(void) { short *isp; short *rp1; @@ -548,7 +546,7 @@ save_reductions() static void -set_derives() +set_derives(void) { int i, k; int lhs; @@ -588,7 +586,7 @@ free_derives() #ifdef DEBUG static void -print_derives() +print_derives(void) { int i; short *sp; @@ -611,7 +609,7 @@ print_derives() static void -set_nullable() +set_nullable(void) { int i, j; int empty; @@ -661,7 +659,7 @@ set_nullable() #if 0 -free_nullable() +free_nullable(void) { FREE(nullable); } @@ -669,7 +667,7 @@ free_nullable() void -lr0() +lr0(void) { set_derives(); set_nullable(); Modified: head/usr.bin/yacc/main.c ============================================================================== --- head/usr.bin/yacc/main.c Sun Nov 7 22:33:55 2010 (r214958) +++ head/usr.bin/yacc/main.c Sun Nov 7 22:51:54 2010 (r214959) @@ -115,8 +115,7 @@ static void usage(void); volatile sig_atomic_t sigdie; __dead2 void -done(k) -int k; +done(int k) { if (action_file) { fclose(action_file); unlink(action_file_name); } if (text_file) { fclose(text_file); unlink(text_file_name); } @@ -127,8 +126,7 @@ int k; static void -onintr(signo) - int signo __unused; +onintr(int signo __unused) { sigdie = 1; done(1); @@ -136,7 +134,7 @@ onintr(signo) static void -set_signals() +set_signals(void) { #ifdef SIGINT if (signal(SIGINT, SIG_IGN) != SIG_IGN) @@ -154,7 +152,7 @@ set_signals() static void -usage() +usage(void) { fprintf(stderr, "%s\n%s\n", "usage: yacc [-dlrtv] [-b file_prefix] [-o output_filename]", @@ -164,9 +162,7 @@ usage() static void -getargs(argc, argv) -int argc; -char *argv[]; +getargs(int argc, char *argv[]) { int ch; @@ -221,8 +217,7 @@ char *argv[]; char * -allocate(n) -unsigned n; +allocate(unsigned n) { char *p; @@ -237,7 +232,7 @@ unsigned n; static void -create_file_names() +create_file_names(void) { int i, len; const char *tmpdir; @@ -357,7 +352,7 @@ create_file_names() static void -open_files() +open_files(void) { int fd; Modified: head/usr.bin/yacc/mkpar.c ============================================================================== --- head/usr.bin/yacc/mkpar.c Sun Nov 7 22:33:55 2010 (r214958) +++ head/usr.bin/yacc/mkpar.c Sun Nov 7 22:51:54 2010 (r214959) @@ -73,7 +73,7 @@ static void unused_rules(void); void -make_parser() +make_parser(void) { int i; @@ -90,8 +90,7 @@ make_parser() static action * -parse_actions(stateno) -int stateno; +parse_actions(int stateno) { action *actions; @@ -102,8 +101,7 @@ int stateno; static action * -get_shifts(stateno) -int stateno; +get_shifts(int stateno) { action *actions, *temp; shifts *sp; @@ -137,9 +135,7 @@ int stateno; } static action * -add_reductions(stateno, actions) -int stateno; -action *actions; +add_reductions(int stateno, action *actions) { int i, j, m, n; int ruleno, tokensetsize; @@ -163,9 +159,7 @@ action *actions; static action * -add_reduce(actions, ruleno, symbol) -action *actions; -int ruleno, symbol; +add_reduce(action *actions, int ruleno, int symbol) { action *temp, *prev, *next; @@ -204,7 +198,7 @@ int ruleno, symbol; static void -find_final_state() +find_final_state(void) { int goal, i; short *tostate; @@ -222,7 +216,7 @@ find_final_state() static void -unused_rules() +unused_rules(void) { int i; action *p; @@ -256,7 +250,7 @@ unused_rules() static void -remove_conflicts() +remove_conflicts(void) { int i; int symbol; @@ -333,7 +327,7 @@ remove_conflicts() static void -total_conflicts() +total_conflicts(void) { /* Warn if s/r != expect or if any r/r */ if ((SRtotal != SRexpect) || RRtotal) @@ -352,8 +346,7 @@ total_conflicts() static int -sole_reduction(stateno) -int stateno; +sole_reduction(int stateno) { int count, ruleno; action *p; @@ -381,7 +374,7 @@ int stateno; static void -defreds() +defreds(void) { int i; @@ -391,8 +384,7 @@ defreds() } static void -free_action_row(p) -action *p; +free_action_row(action *p) { action *q; @@ -405,7 +397,7 @@ action *p; } void -free_parser() +free_parser(void) { int i; Modified: head/usr.bin/yacc/output.c ============================================================================== --- head/usr.bin/yacc/output.c Sun Nov 7 22:33:55 2010 (r214958) +++ head/usr.bin/yacc/output.c Sun Nov 7 22:51:54 2010 (r214959) @@ -95,7 +95,7 @@ static const char line_format[] = "#line void -output() +output(void) { free_itemsets(); free_shifts(); @@ -119,7 +119,7 @@ output() static void -output_prefix() +output_prefix(void) { if (symbol_prefix == NULL) symbol_prefix = "yy"; @@ -184,7 +184,7 @@ output_prefix() static void -output_rule_data() +output_rule_data(void) { int i; int j; @@ -232,7 +232,7 @@ output_rule_data() static void -output_yydefred() +output_yydefred(void) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 23:22:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51994106566B; Sun, 7 Nov 2010 23:22:23 +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 3F40D8FC0A; Sun, 7 Nov 2010 23:22:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7NMNw3092307; Sun, 7 Nov 2010 23:22:23 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7NMNa4092305; Sun, 7 Nov 2010 23:22:23 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011072322.oA7NMNa4092305@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 23:22: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: r214960 - head/gnu/usr.bin/gdb/arch/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 23:22:23 -0000 Author: gonzo Date: Sun Nov 7 23:22:22 2010 New Revision: 214960 URL: http://svn.freebsd.org/changeset/base/214960 Log: Fix initialization order:_initialize_svr4_solib should be called before _initialize_thread_db Modified: head/gnu/usr.bin/gdb/arch/mips/init.c Modified: head/gnu/usr.bin/gdb/arch/mips/init.c ============================================================================== --- head/gnu/usr.bin/gdb/arch/mips/init.c Sun Nov 7 22:51:54 2010 (r214959) +++ head/gnu/usr.bin/gdb/arch/mips/init.c Sun Nov 7 23:22:22 2010 (r214960) @@ -119,6 +119,8 @@ initialize_all_files (void) _initialize_mips_tdep (); _initialize_mipsfbsd_tdep (); _initialize_corelow (); + _initialize_solib (); + _initialize_svr4_solib (); _initialize_ser_hardwire (); _initialize_ser_pipe (); _initialize_ser_tcp (); @@ -130,9 +132,7 @@ initialize_all_files (void) _initialize_kernel_u_addr (); _initialize_infptrace (); _initialize_inftarg (); - _initialize_solib (); _initialize_thread_db (); - _initialize_svr4_solib (); #if 0 _initialize_svr4_lm (); #endif From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 23:22:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D973106566B; Sun, 7 Nov 2010 23:22:43 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A8F38FC14; Sun, 7 Nov 2010 23:22:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7NMh55092377; Sun, 7 Nov 2010 23:22:43 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7NMhb0092364; Sun, 7 Nov 2010 23:22:43 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011072322.oA7NMhb0092364@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 7 Nov 2010 23:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214961 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 23:22:43 -0000 Author: obrien Date: Sun Nov 7 23:22:42 2010 New Revision: 214961 URL: http://svn.freebsd.org/changeset/base/214961 Log: Directly use memory allocation functions and remove needless casts in their usage. Also use associated modern types instead of k&r ones. Modified: head/usr.bin/yacc/closure.c head/usr.bin/yacc/defs.h head/usr.bin/yacc/lalr.c head/usr.bin/yacc/lr0.c head/usr.bin/yacc/main.c head/usr.bin/yacc/mkpar.c head/usr.bin/yacc/output.c head/usr.bin/yacc/reader.c head/usr.bin/yacc/skeleton.c head/usr.bin/yacc/symtab.c head/usr.bin/yacc/verbose.c Modified: head/usr.bin/yacc/closure.c ============================================================================== --- head/usr.bin/yacc/closure.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/closure.c Sun Nov 7 23:22:42 2010 (r214961) @@ -149,7 +149,7 @@ set_first_derives(void) print_first_derives(); #endif - FREE(EFF); + free(EFF); } @@ -224,9 +224,9 @@ closure(short *nucleus, int n) void finalize_closure(void) { - FREE(itemset); - FREE(ruleset); - FREE(first_derives + ntokens * WORDSIZE(nrules)); + free(itemset); + free(ruleset); + free(first_derives + ntokens * WORDSIZE(nrules)); } Modified: head/usr.bin/yacc/defs.h ============================================================================== --- head/usr.bin/yacc/defs.h Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/defs.h Sun Nov 7 23:22:42 2010 (r214961) @@ -133,12 +133,8 @@ /* storage allocation macros */ -#define CALLOC(k,n) (calloc((unsigned)(k),(unsigned)(n))) -#define FREE(x) (free((char*)(x))) -#define MALLOC(n) (malloc((unsigned)(n))) #define NEW(t) ((t*)allocate(sizeof(t))) -#define NEW2(n,t) ((t*)allocate((unsigned)((n)*sizeof(t)))) -#define REALLOC(p,n) (realloc((char*)(p),(unsigned)(n))) +#define NEW2(n,t) ((t*)allocate((n)*sizeof(t))) /* the structure of a symbol table entry */ @@ -304,7 +300,7 @@ extern short final_state; /* global functions */ -char *allocate(unsigned); +void *allocate(size_t); void closure(short *, int); void create_symbol_table(void); void default_action_warning(void); Modified: head/usr.bin/yacc/lalr.c ============================================================================== --- head/usr.bin/yacc/lalr.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/lalr.c Sun Nov 7 23:22:42 2010 (r214961) @@ -293,7 +293,7 @@ set_goto_map(void) } } - FREE(temp_map + ntokens); + free(temp_map + ntokens); } @@ -396,11 +396,11 @@ initialize_F(void) for (i = 0; i < ngotos; i++) { if (reads[i]) - FREE(reads[i]); + free(reads[i]); } - FREE(reads); - FREE(edge); + free(reads); + free(edge); } @@ -487,14 +487,14 @@ build_relations(void) for (i = 0; i < ngotos; i++) if (includes[i]) - FREE(includes[i]); + free(includes[i]); - FREE(includes); + free(includes); includes = new_includes; - FREE(edge); - FREE(states); + free(edge); + free(states); } @@ -562,7 +562,7 @@ transpose(short **R, int n) } } - FREE(nedges); + free(nedges); for (i = 0; i < n; i++) { @@ -574,7 +574,7 @@ transpose(short **R, int n) } } - FREE(temp_R); + free(temp_R); return (new_R); } @@ -615,11 +615,11 @@ compute_lookaheads(void) for (sp = lookback[i]; sp; sp = next) { next = sp->next; - FREE(sp); + free(sp); } - FREE(lookback); - FREE(F); + free(lookback); + free(F); } @@ -642,8 +642,8 @@ digraph(short **relation) traverse(i, relation); } - FREE(INDEX); - FREE(VERTICES); + free(INDEX); + free(VERTICES); } Modified: head/usr.bin/yacc/lr0.c ============================================================================== --- head/usr.bin/yacc/lr0.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/lr0.c Sun Nov 7 23:22:42 2010 (r214961) @@ -176,13 +176,13 @@ append_states(void) static void free_storage(void) { - FREE(shift_symbol); - FREE(redset); - FREE(shiftset); - FREE(kernel_base); - FREE(kernel_end); - FREE(kernel_items); - FREE(state_set); + free(shift_symbol); + free(redset); + free(shiftset); + free(kernel_base); + free(kernel_end); + free(kernel_items); + free(state_set); } @@ -290,7 +290,7 @@ initialize_states(void) for (i = 0; start_derives[i] >= 0; ++i) continue; - p = (core *) MALLOC(sizeof(core) + i*sizeof(short)); + p = malloc(sizeof(core) + i*sizeof(short)); if (p == 0) no_space(); p->next = 0; @@ -579,8 +579,8 @@ set_derives(void) #if 0 free_derives() { - FREE(derives[start_symbol]); - FREE(derives); + free(derives[start_symbol]); + free(derives); } #endif @@ -615,7 +615,7 @@ set_nullable(void) int empty; int done1; - nullable = MALLOC(nsyms); + nullable = malloc(nsyms); if (nullable == 0) no_space(); for (i = 0; i < nsyms; ++i) @@ -661,7 +661,7 @@ set_nullable(void) #if 0 free_nullable(void) { - FREE(nullable); + free(nullable); } #endif Modified: head/usr.bin/yacc/main.c ============================================================================== --- head/usr.bin/yacc/main.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/main.c Sun Nov 7 23:22:42 2010 (r214961) @@ -216,15 +216,15 @@ getargs(int argc, char *argv[]) } -char * -allocate(unsigned n) +void * +allocate(size_t n) { - char *p; + void *p; p = NULL; if (n) { - p = CALLOC(1, n); + p = calloc(1, n); if (!p) no_space(); } return (p); @@ -245,11 +245,11 @@ create_file_names(void) if (len && tmpdir[len-1] != '/') ++i; - action_file_name = MALLOC(i); + action_file_name = malloc(i); if (action_file_name == 0) no_space(); - text_file_name = MALLOC(i); + text_file_name = malloc(i); if (text_file_name == 0) no_space(); - union_file_name = MALLOC(i); + union_file_name = malloc(i); if (union_file_name == 0) no_space(); strcpy(action_file_name, tmpdir); @@ -280,7 +280,7 @@ create_file_names(void) else { len = strlen(file_prefix); - output_file_name = MALLOC(len + 7); + output_file_name = malloc(len + 7); if (output_file_name == 0) no_space(); strcpy(output_file_name, file_prefix); @@ -289,7 +289,7 @@ create_file_names(void) if (rflag) { - code_file_name = MALLOC(len + 8); + code_file_name = malloc(len + 8); if (code_file_name == 0) no_space(); strcpy(code_file_name, file_prefix); @@ -314,7 +314,7 @@ create_file_names(void) if (dflag) { - defines_file_name = MALLOC(len + 7); + defines_file_name = malloc(len + 7); if (defines_file_name == 0) no_space(); strcpy(defines_file_name, file_prefix); @@ -332,7 +332,7 @@ create_file_names(void) if (vflag) { - verbose_file_name = MALLOC(len + 8); + verbose_file_name = malloc(len + 8); if (verbose_file_name == 0) no_space(); strcpy(verbose_file_name, file_prefix); Modified: head/usr.bin/yacc/mkpar.c ============================================================================== --- head/usr.bin/yacc/mkpar.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/mkpar.c Sun Nov 7 23:22:42 2010 (r214961) @@ -221,7 +221,7 @@ unused_rules(void) int i; action *p; - rules_used = (short *) MALLOC(nrules*sizeof(short)); + rules_used = malloc(nrules*sizeof(short)); if (rules_used == 0) no_space(); for (i = 0; i < nrules; ++i) @@ -391,7 +391,7 @@ free_action_row(action *p) while (p) { q = p->next; - FREE(p); + free(p); p = q; } } @@ -404,5 +404,5 @@ free_parser(void) for (i = 0; i < nstates; i++) free_action_row(parser[i]); - FREE(parser); + free(parser); } Modified: head/usr.bin/yacc/output.c ============================================================================== --- head/usr.bin/yacc/output.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/output.c Sun Nov 7 23:22:42 2010 (r214961) @@ -270,15 +270,15 @@ output_actions(void) width = NEW2(nvectors, short); token_actions(); - FREE(lookaheads); - FREE(LA); - FREE(LAruleno); - FREE(accessing_symbol); + free(lookaheads); + free(LA); + free(LAruleno); + free(accessing_symbol); goto_actions(); - FREE(goto_map + ntokens); - FREE(from_state); - FREE(to_state); + free(goto_map + ntokens); + free(from_state); + free(to_state); sort_actions(); pack_table(); @@ -370,7 +370,7 @@ token_actions(void) } } } - FREE(actionrow); + free(actionrow); } static void @@ -403,7 +403,7 @@ goto_actions(void) if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(state_count); + free(state_count); } static int @@ -555,14 +555,14 @@ pack_table(void) for (i = 0; i < nvectors; i++) { if (froms[i]) - FREE(froms[i]); + free(froms[i]); if (tos[i]) - FREE(tos[i]); + free(tos[i]); } - FREE(froms); - FREE(tos); - FREE(pos); + free(froms); + free(tos); + free(pos); } @@ -762,7 +762,7 @@ output_base(void) if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(base); + free(base); } @@ -795,7 +795,7 @@ output_table(void) if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(table); + free(table); } @@ -826,7 +826,7 @@ output_check(void) if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(check); + free(check); } @@ -972,7 +972,7 @@ output_debug(void) ++outline; fprintf(code_file, "#define YYMAXTOKEN %d\n", max); - symnam = (char **) MALLOC((max+1)*sizeof(char *)); + symnam = malloc((max+1)*sizeof(char *)); if (symnam == 0) no_space(); /* Note that it is not necessary to initialize the element */ @@ -1108,7 +1108,7 @@ output_debug(void) } if (!rflag) outline += 2; fprintf(output_file, "\n};\n"); - FREE(symnam); + free(symnam); if (!rflag) ++outline; fprintf(output_file, "const char * const %srule[] = {\n", symbol_prefix); @@ -1278,11 +1278,11 @@ free_itemsets(void) { core *cp, *next; - FREE(state_table); + free(state_table); for (cp = first_state; cp; cp = next) { next = cp->next; - FREE(cp); + free(cp); } } @@ -1292,11 +1292,11 @@ free_shifts(void) { shifts *sp, *next; - FREE(shift_table); + free(shift_table); for (sp = first_shift; sp; sp = next) { next = sp->next; - FREE(sp); + free(sp); } } @@ -1307,11 +1307,11 @@ free_reductions(void) { reductions *rp, *next; - FREE(reduction_table); + free(reduction_table); for (rp = first_reduction; rp; rp = next) { next = rp->next; - FREE(rp); + free(rp); } } @@ -1332,9 +1332,9 @@ increase_maxtable(int loc) newmax = maxtable; do { newmax += 200; } while (newmax <= loc); - table = (short *) REALLOC(table, newmax*sizeof(short)); + table = realloc(table, newmax*sizeof(short)); if (table == 0) no_space(); - check = (short *) REALLOC(check, newmax*sizeof(short)); + check = realloc(check, newmax*sizeof(short)); if (check == 0) no_space(); for (l = maxtable; l < newmax; ++l) { Modified: head/usr.bin/yacc/reader.c ============================================================================== --- head/usr.bin/yacc/reader.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/reader.c Sun Nov 7 23:22:42 2010 (r214961) @@ -126,7 +126,7 @@ cachec(int c) if (cinc >= cache_size) { cache_size += 256; - cache = REALLOC(cache, cache_size); + cache = realloc(cache, cache_size); if (cache == 0) no_space(); } cache[cinc] = c; @@ -143,7 +143,7 @@ get_line(void) if (saw_eof || (c = getc(f)) == EOF) { - if (line) { FREE(line); line = 0; } + if (line) { free(line); line = 0; } cptr = 0; saw_eof = 1; return; @@ -151,9 +151,9 @@ get_line(void) if (line == 0 || linesize != (LINESIZE + 1)) { - if (line) FREE(line); + if (line) free(line); linesize = LINESIZE + 1; - line = MALLOC(linesize); + line = malloc(linesize); if (line == 0) no_space(); } @@ -166,7 +166,7 @@ get_line(void) if (++i >= linesize) { linesize += LINESIZE; - line = REALLOC(line, linesize); + line = realloc(line, linesize); if (line == 0) no_space(); } c = getc(f); @@ -189,7 +189,7 @@ dup_line(void) if (line == 0) return (0); s = line; while (*s != '\n') ++s; - p = MALLOC(s - line + 1); + p = malloc(s - line + 1); if (p == 0) no_space(); s = line; @@ -214,7 +214,7 @@ skip_comment(void) if (*s == '*' && s[1] == '/') { cptr = s + 2; - FREE(st_line); + free(st_line); return; } if (*s == '\n') @@ -435,7 +435,7 @@ loop: if (c == quote) { need_newline = 1; - FREE(s_line); + free(s_line); goto loop; } if (c == '\n') @@ -487,7 +487,7 @@ loop: { putc('/', f); ++cptr; - FREE(c_line); + free(c_line); goto loop; } if (c == '\n') @@ -507,7 +507,7 @@ loop: { if (need_newline) putc('\n', f); ++cptr; - FREE(t_line); + free(t_line); return; } /* FALLTHROUGH */ @@ -560,7 +560,7 @@ loop: if (--depth == 0) { fprintf(text_file, " YYSTYPE;\n"); - FREE(u_line); + free(u_line); return; } goto loop; @@ -580,7 +580,7 @@ loop: if (dflag) putc(c, union_file); if (c == quote) { - FREE(s_line); + free(s_line); goto loop; } if (c == '\n') @@ -642,7 +642,7 @@ loop: putc('/', text_file); if (dflag) putc('/', union_file); ++cptr; - FREE(c_line); + free(c_line); goto loop; } if (c == '\n') @@ -751,10 +751,10 @@ get_literal(void) } cachec(c); } - FREE(s_line); + free(s_line); n = cinc; - s = MALLOC(n); + s = malloc(n); if (s == 0) no_space(); for (i = 0; i < n; ++i) @@ -807,7 +807,7 @@ get_literal(void) bp->class = TERM; if (n == 1 && bp->value == UNDEFINED) bp->value = *(unsigned char *)s; - FREE(s); + free(s); return (bp); } @@ -900,17 +900,17 @@ get_tag(void) { tagmax += 16; tag_table = (char **) - (tag_table ? REALLOC(tag_table, tagmax*sizeof(char *)) - : MALLOC(tagmax*sizeof(char *))); + (tag_table ? realloc(tag_table, tagmax*sizeof(char *)) + : malloc(tagmax*sizeof(char *))); if (tag_table == 0) no_space(); } - s = MALLOC(cinc); + s = malloc(cinc); if (s == 0) no_space(); strcpy(s, cache); tag_table[ntags] = s; ++ntags; - FREE(t_line); + free(t_line); return (s); } @@ -1075,7 +1075,7 @@ read_declarations(void) int c, k; cache_size = 256; - cache = MALLOC(cache_size); + cache = malloc(cache_size); if (cache == 0) no_space(); for (;;) @@ -1128,7 +1128,7 @@ initialize_grammar(void) { nitems = 4; maxitems = 300; - pitem = (bucket **) MALLOC(maxitems*sizeof(bucket *)); + pitem = malloc(maxitems*sizeof(bucket *)); if (pitem == 0) no_space(); pitem[0] = 0; pitem[1] = 0; @@ -1137,17 +1137,17 @@ initialize_grammar(void) nrules = 3; maxrules = 100; - plhs = (bucket **) MALLOC(maxrules*sizeof(bucket *)); + plhs = malloc(maxrules*sizeof(bucket *)); if (plhs == 0) no_space(); plhs[0] = 0; plhs[1] = 0; plhs[2] = 0; - rprec = (short *) MALLOC(maxrules*sizeof(short)); + rprec = malloc(maxrules*sizeof(short)); if (rprec == 0) no_space(); rprec[0] = 0; rprec[1] = 0; rprec[2] = 0; - rassoc = (char *) MALLOC(maxrules*sizeof(char)); + rassoc = malloc(maxrules*sizeof(char)); if (rassoc == 0) no_space(); rassoc[0] = TOKEN; rassoc[1] = TOKEN; @@ -1159,7 +1159,7 @@ static void expand_items(void) { maxitems += 300; - pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *)); + pitem = realloc(pitem, maxitems*sizeof(bucket *)); if (pitem == 0) no_space(); } @@ -1168,11 +1168,11 @@ static void expand_rules(void) { maxrules += 100; - plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *)); + plhs = realloc(plhs, maxrules*sizeof(bucket *)); if (plhs == 0) no_space(); - rprec = (short *) REALLOC(rprec, maxrules*sizeof(short)); + rprec = realloc(rprec, maxrules*sizeof(short)); if (rprec == 0) no_space(); - rassoc = (char *) REALLOC(rassoc, maxrules*sizeof(char)); + rassoc = realloc(rassoc, maxrules*sizeof(char)); if (rassoc == 0) no_space(); } @@ -1367,7 +1367,7 @@ loop: { fprintf(f, "yyval.%s", tag); ++cptr; - FREE(d_line); + free(d_line); goto loop; } else if (isdigit(c)) @@ -1375,7 +1375,7 @@ loop: i = get_number(); if (i > n) dollar_warning(d_lineno, i); fprintf(f, "yyvsp[%d].%s", i - n, tag); - FREE(d_line); + free(d_line); goto loop; } else if (c == '-' && isdigit(cptr[1])) @@ -1383,7 +1383,7 @@ loop: ++cptr; i = -get_number() - n; fprintf(f, "yyvsp[%d].%s", i, tag); - FREE(d_line); + free(d_line); goto loop; } else @@ -1479,7 +1479,7 @@ loop: putc(c, f); if (c == quote) { - FREE(s_line); + free(s_line); goto loop; } if (c == '\n') @@ -1529,7 +1529,7 @@ loop: { putc('/', f); ++cptr; - FREE(c_line); + free(c_line); goto loop; } if (c == '\n') @@ -1636,9 +1636,9 @@ free_tags(void) for (i = 0; i < ntags; ++i) { assert(tag_table[i]); - FREE(tag_table[i]); + free(tag_table[i]); } - FREE(tag_table); + free(tag_table); } @@ -1651,7 +1651,7 @@ pack_names(void) name_pool_size = 13; /* 13 == sizeof("$end") + sizeof("$accept") */ for (bp = first_symbol; bp; bp = bp->next) name_pool_size += strlen(bp->name) + 1; - name_pool = MALLOC(name_pool_size); + name_pool = malloc(name_pool_size); if (name_pool == 0) no_space(); strcpy(name_pool, "$accept"); @@ -1662,7 +1662,7 @@ pack_names(void) p = t; s = bp->name; while ((*t++ = *s++)) continue; - FREE(bp->name); + free(bp->name); bp->name = p; } } @@ -1704,16 +1704,16 @@ pack_symbols(void) start_symbol = ntokens; nvars = nsyms - ntokens; - symbol_name = (char **) MALLOC(nsyms*sizeof(char *)); + symbol_name = malloc(nsyms*sizeof(char *)); if (symbol_name == 0) no_space(); - symbol_value = (short *) MALLOC(nsyms*sizeof(short)); + symbol_value = malloc(nsyms*sizeof(short)); if (symbol_value == 0) no_space(); - symbol_prec = (short *) MALLOC(nsyms*sizeof(short)); + symbol_prec = malloc(nsyms*sizeof(short)); if (symbol_prec == 0) no_space(); - symbol_assoc = MALLOC(nsyms); + symbol_assoc = malloc(nsyms); if (symbol_assoc == 0) no_space(); - v = (bucket **) MALLOC(nsyms*sizeof(bucket *)); + v = malloc(nsyms*sizeof(bucket *)); if (v == 0) no_space(); v[0] = 0; @@ -1808,7 +1808,7 @@ pack_symbols(void) symbol_assoc[k] = v[i]->assoc; } - FREE(v); + free(v); } @@ -1818,15 +1818,15 @@ pack_grammar(void) int i, j; int assoc, preced; - ritem = (short *) MALLOC(nitems*sizeof(short)); + ritem = malloc(nitems*sizeof(short)); if (ritem == 0) no_space(); - rlhs = (short *) MALLOC(nrules*sizeof(short)); + rlhs = malloc(nrules*sizeof(short)); if (rlhs == 0) no_space(); - rrhs = (short *) MALLOC((nrules+1)*sizeof(short)); + rrhs = malloc((nrules+1)*sizeof(short)); if (rrhs == 0) no_space(); - rprec = (short *) REALLOC(rprec, nrules*sizeof(short)); + rprec = realloc(rprec, nrules*sizeof(short)); if (rprec == 0) no_space(); - rassoc = REALLOC(rassoc, nrules); + rassoc = realloc(rassoc, nrules); if (rassoc == 0) no_space(); ritem[0] = -1; @@ -1867,8 +1867,8 @@ pack_grammar(void) } rrhs[i] = j; - FREE(plhs); - FREE(pitem); + free(plhs); + free(pitem); } Modified: head/usr.bin/yacc/skeleton.c ============================================================================== --- head/usr.bin/yacc/skeleton.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/skeleton.c Sun Nov 7 23:22:42 2010 (r214961) @@ -157,14 +157,14 @@ const char *body[] = " else if ((newsize *= 2) > YYMAXDEPTH)", " newsize = YYMAXDEPTH;", " i = yyssp - yyss;", - " newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :", - " (short *)malloc(newsize * sizeof *newss);", + " newss = yyss ? realloc(yyss, newsize * sizeof *newss) :", + " malloc(newsize * sizeof *newss);", " if (newss == NULL)", " return -1;", " yyss = newss;", " yyssp = newss + i;", - " newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :", - " (YYSTYPE *)malloc(newsize * sizeof *newvs);", + " newvs = yyvs ? realloc(yyvs, newsize * sizeof *newvs) :", + " malloc(newsize * sizeof *newvs);", " if (newvs == NULL)", " return -1;", " yyvs = newvs;", Modified: head/usr.bin/yacc/symtab.c ============================================================================== --- head/usr.bin/yacc/symtab.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/symtab.c Sun Nov 7 23:22:42 2010 (r214961) @@ -81,11 +81,11 @@ make_bucket(const char *name) bucket *bp; assert(name); - bp = (bucket *) MALLOC(sizeof(bucket)); + bp = malloc(sizeof(bucket)); if (bp == 0) no_space(); bp->link = 0; bp->next = 0; - bp->name = MALLOC(strlen(name) + 1); + bp->name = malloc(strlen(name) + 1); if (bp->name == 0) no_space(); bp->tag = 0; bp->value = UNDEFINED; @@ -130,7 +130,7 @@ create_symbol_table(void) int i; bucket *bp; - symbol_table = (bucket **) MALLOC(TABLE_SIZE*sizeof(bucket *)); + symbol_table = malloc(TABLE_SIZE*sizeof(bucket *)); if (symbol_table == 0) no_space(); for (i = 0; i < TABLE_SIZE; i++) symbol_table[i] = 0; @@ -148,7 +148,7 @@ create_symbol_table(void) void free_symbol_table(void) { - FREE(symbol_table); + free(symbol_table); symbol_table = 0; } @@ -161,6 +161,6 @@ free_symbols(void) for (p = first_symbol; p; p = q) { q = p->next; - FREE(p); + free(p); } } Modified: head/usr.bin/yacc/verbose.c ============================================================================== --- head/usr.bin/yacc/verbose.c Sun Nov 7 23:22:22 2010 (r214960) +++ head/usr.bin/yacc/verbose.c Sun Nov 7 23:22:42 2010 (r214961) @@ -66,12 +66,12 @@ verbose(void) if (!vflag) return; - null_rules = (short *) MALLOC(nrules*sizeof(short)); + null_rules = malloc(nrules*sizeof(short)); if (null_rules == 0) no_space(); fprintf(verbose_file, "\f\n"); for (i = 0; i < nstates; i++) print_state(i); - FREE(null_rules); + free(null_rules); if (nunused) log_unused(); From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 23:23:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79D7D1065670; Sun, 7 Nov 2010 23:23:48 +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 4EFCE8FC1B; Sun, 7 Nov 2010 23:23:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7NNmY8092504; Sun, 7 Nov 2010 23:23:48 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7NNmpp092502; Sun, 7 Nov 2010 23:23:48 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011072323.oA7NNmpp092502@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Nov 2010 23:23: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: r214962 - head/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 23:23:48 -0000 Author: gonzo Date: Sun Nov 7 23:23:48 2010 New Revision: 214962 URL: http://svn.freebsd.org/changeset/base/214962 Log: Fix cross-debugger build Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Nov 7 23:22:42 2010 (r214961) +++ head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Nov 7 23:23:48 2010 (r214962) @@ -46,13 +46,16 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef CROSS_DEBUGGER #include +#endif #include "kgdb.h" void kgdb_trgt_fetch_registers(int regno __unused) { +#ifndef CROSS_DEBUGGER struct kthr *kt; struct pcb pcb; @@ -76,6 +79,7 @@ kgdb_trgt_fetch_registers(int regno __un supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_GP]); supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[PCB_REG_RA]); supply_register(MIPS_EMBED_PC_REGNUM, (char *)&pcb.pcb_context[PCB_REG_PC]); +#endif } void @@ -90,6 +94,7 @@ kgdb_trgt_new_objfile(struct objfile *ob { } +#ifndef CROSS_DEBUGGER struct kgdb_frame_cache { CORE_ADDR pc; CORE_ADDR sp; @@ -194,10 +199,12 @@ static const struct frame_unwind kgdb_tr &kgdb_trgt_trapframe_this_id, &kgdb_trgt_trapframe_prev_register }; +#endif const struct frame_unwind * kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame) { +#ifndef CROSS_DEBUGGER char *pname; CORE_ADDR pc; @@ -211,5 +218,6 @@ kgdb_trgt_trapframe_sniffer(struct frame (strcmp(pname, "MipsUserIntr") == 0) || (strcmp(pname, "MipsUserGenException") == 0)) return (&kgdb_trgt_trapframe_unwind); +#endif return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 23:34:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C77961065670; Sun, 7 Nov 2010 23:34:05 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B57F8FC08; Sun, 7 Nov 2010 23:34:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7NY5Qs093521; Sun, 7 Nov 2010 23:34:05 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7NY578093519; Sun, 7 Nov 2010 23:34:05 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011072334.oA7NY578093519@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 7 Nov 2010 23:34: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: r214963 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 23:34:05 -0000 Author: obrien Date: Sun Nov 7 23:34:05 2010 New Revision: 214963 URL: http://svn.freebsd.org/changeset/base/214963 Log: Inherit WARNS from parent directory. Submitted by: marius Modified: head/usr.bin/yacc/Makefile Modified: head/usr.bin/yacc/Makefile ============================================================================== --- head/usr.bin/yacc/Makefile Sun Nov 7 23:23:48 2010 (r214962) +++ head/usr.bin/yacc/Makefile Sun Nov 7 23:34:05 2010 (r214963) @@ -9,6 +9,4 @@ MAN= yacc.1 yyfix.1 LINKS= ${BINDIR}/yacc ${BINDIR}/byacc MLINKS= yacc.1 byacc.1 -WARNS?= 6 - .include From owner-svn-src-all@FreeBSD.ORG Sun Nov 7 23:44:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59500106566C; Sun, 7 Nov 2010 23:44:41 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 470138FC0A; Sun, 7 Nov 2010 23:44:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA7Nif28094331; Sun, 7 Nov 2010 23:44:41 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA7Nifh9094328; Sun, 7 Nov 2010 23:44:41 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011072344.oA7Nifh9094328@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 7 Nov 2010 23:44: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: r214964 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 23:44:41 -0000 Author: obrien Date: Sun Nov 7 23:44:40 2010 New Revision: 214964 URL: http://svn.freebsd.org/changeset/base/214964 Log: Add '-y' for bison compatibility. Obtained from: http://invisible-island.net Modified: head/usr.bin/yacc/main.c head/usr.bin/yacc/yacc.1 Modified: head/usr.bin/yacc/main.c ============================================================================== --- head/usr.bin/yacc/main.c Sun Nov 7 23:34:05 2010 (r214963) +++ head/usr.bin/yacc/main.c Sun Nov 7 23:44:40 2010 (r214964) @@ -166,7 +166,7 @@ getargs(int argc, char *argv[]) { int ch; - while ((ch = getopt(argc, argv, "b:dlo:p:rtv")) != -1) + while ((ch = getopt(argc, argv, "b:dlo:p:rtvy")) != -1) { switch (ch) { @@ -202,6 +202,10 @@ getargs(int argc, char *argv[]) vflag = 1; break; + case 'y': + /* for bison compatibility -- byacc is already POSIX compatible */ + break; + default: usage(); } Modified: head/usr.bin/yacc/yacc.1 ============================================================================== --- head/usr.bin/yacc/yacc.1 Sun Nov 7 23:34:05 2010 (r214963) +++ head/usr.bin/yacc/yacc.1 Sun Nov 7 23:44:40 2010 (r214964) @@ -44,7 +44,7 @@ .Nd an LALR(1) parser generator .Sh SYNOPSIS .Nm -.Op Fl dlrtv +.Op Fl dlrtvy .Op Fl b Ar file_prefix .Op Fl o Ar output_filename .Op Fl p Ar symbol_prefix @@ -118,6 +118,10 @@ so that debugging statements will be inc Cause a human-readable description of the generated parser to be written to the file .Pa y.output . +.It Fl y +NOOP for bison compatibility. +.Nm +is already designed to be POSIX yacc compatible. .El .Sh ENVIRONMENT .Bl -tag -width ".Ev TMPDIR" From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 00:26:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2CC71065679; Mon, 8 Nov 2010 00:26:49 +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 90ADC8FC12; Mon, 8 Nov 2010 00:26:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA80Qnlj097396; Mon, 8 Nov 2010 00:26:49 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA80QnYx097394; Mon, 8 Nov 2010 00:26:49 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011080026.oA80QnYx097394@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 8 Nov 2010 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: r214965 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 00:26:49 -0000 Author: gonzo Date: Mon Nov 8 00:26:49 2010 New Revision: 214965 URL: http://svn.freebsd.org/changeset/base/214965 Log: - Provide more registers for GDB Modified: head/sys/mips/mips/gdb_machdep.c Modified: head/sys/mips/mips/gdb_machdep.c ============================================================================== --- head/sys/mips/mips/gdb_machdep.c Sun Nov 7 23:44:40 2010 (r214964) +++ head/sys/mips/mips/gdb_machdep.c Mon Nov 8 00:26:49 2010 (r214965) @@ -117,26 +117,33 @@ gdb_cpu_getreg(int regnum, size_t *regsz *regsz = gdb_cpu_regsz(regnum); if (kdb_thread == PCPU_GET(curthread)) { - switch (regnum) { - /* - * XXX: May need to add more registers - */ - case 2: return (&kdb_frame->v0); - case 3: return (&kdb_frame->v1); - } + register_t *zero_ptr = &kdb_frame->zero; + return zero_ptr + regnum; } + switch (regnum) { - case 16: return (&kdb_thrctx->pcb_context[0]); - case 17: return (&kdb_thrctx->pcb_context[1]); - case 18: return (&kdb_thrctx->pcb_context[2]); - case 19: return (&kdb_thrctx->pcb_context[3]); - case 20: return (&kdb_thrctx->pcb_context[4]); - case 21: return (&kdb_thrctx->pcb_context[5]); - case 22: return (&kdb_thrctx->pcb_context[6]); - case 23: return (&kdb_thrctx->pcb_context[7]); - case 29: return (&kdb_thrctx->pcb_context[8]); - case 30: return (&kdb_thrctx->pcb_context[9]); - case 31: return (&kdb_thrctx->pcb_context[10]); + /* + * S0..S7 + */ + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + return (&kdb_thrctx->pcb_context[PCB_REG_S0 + regnum - 16]); + case 28: + return (&kdb_thrctx->pcb_context[PCB_REG_GP]); + case 29: + return (&kdb_thrctx->pcb_context[PCB_REG_SP]); + case 30: + return (&kdb_thrctx->pcb_context[PCB_REG_S8]); + case 31: + return (&kdb_thrctx->pcb_context[PCB_REG_RA]); + case 37: + return (&kdb_thrctx->pcb_context[PCB_REG_PC]); } return (NULL); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 01:15:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 692981065672; Mon, 8 Nov 2010 01:15:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C7B68FC16; Mon, 8 Nov 2010 01:15:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA81FhFJ098889; Mon, 8 Nov 2010 01:15:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA81FhWX098888; Mon, 8 Nov 2010 01:15:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011080115.oA81FhWX098888@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 01:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214968 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 01:15:43 -0000 Author: yongari Date: Mon Nov 8 01:15:42 2010 New Revision: 214968 URL: http://svn.freebsd.org/changeset/base/214968 Log: Use shorten model name instead of showing all controller model numbers. bge(4) supports too many models such that it's unreasonable to list all these controllers in one line description of name. While I'm here mention that BCM590x/BCM5779x is Fast Ethernet controller. bge(4) still lacks support for some controllers but supporting these controllers should be easy now and adding new controllers do not require touching .Nd any more. Obtained from: OpenBSD Modified: head/share/man/man4/bge.4 Modified: head/share/man/man4/bge.4 ============================================================================== --- head/share/man/man4/bge.4 Mon Nov 8 00:42:32 2010 (r214967) +++ head/share/man/man4/bge.4 Mon Nov 8 01:15:42 2010 (r214968) @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2010 +.Dd November 7, 2010 .Dt BGE 4 .Os .Sh NAME .Nm bge -.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5761/5784/5789/57780 PCI Gigabit Ethernet adapter driver" +.Nd "Broadcom BCM57xx/BCM590x Gigabit/Fast Ethernet driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,8 +56,8 @@ if_bge_load="YES" The .Nm driver provides support for various NICs based on the Broadcom BCM570x, -5714, 5721, 5722, 5750, 5751, 5752, 5761, 5784, 5789 and 57780 families -of Gigabit Ethernet controller chips. +571x, 572x, 575x, 576x, 578x, 5776x and 5778x Gigabit Ethernet controller +chips and the 590x and 5779x Fast Ethernet controller chips. .Pp All of these NICs are capable of 10, 100 and 1000Mbps speeds over CAT5 copper cable, except for the SysKonnect SK-9D41 which supports only @@ -82,7 +82,7 @@ copper gigabit transceivers, which support autonegotiation of 10, 100 and 1000Mbps modes in full or half duplex. .Pp -The BCM5700, BCM5701, BCM5702, BCM5703 and BCM5704 also support +The BCM5700, BCM5701, BCM5702, BCM5703, BCM5704 and BCM5717 also support jumbo frames, which can be configured via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 01:54:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2418106566B; Mon, 8 Nov 2010 01:54:42 +0000 (UTC) (envelope-from juli@clockworksquid.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 80ABF8FC0C; Mon, 8 Nov 2010 01:54:42 +0000 (UTC) Received: by gxk9 with SMTP id 9so3213380gxk.13 for ; Sun, 07 Nov 2010 17:54:41 -0800 (PST) Received: by 10.151.14.7 with SMTP id r7mr7636842ybi.19.1289181280906; Sun, 07 Nov 2010 17:54:40 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.236.110.35 with HTTP; Sun, 7 Nov 2010 17:54:20 -0800 (PST) In-Reply-To: <201011072322.oA7NMhb0092364@svn.freebsd.org> References: <201011072322.oA7NMhb0092364@svn.freebsd.org> From: Juli Mallett Date: Sun, 7 Nov 2010 17:54:20 -0800 X-Google-Sender-Auth: 7xRZQ-cdP9xuEOJjnnbKbrERI44 Message-ID: To: "David E. O'Brien" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214961 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 01:54:43 -0000 David, On Sun, Nov 7, 2010 at 15:22, David E. O'Brien wrote: > Author: obrien > Date: Sun Nov =A07 23:22:42 2010 > New Revision: 214961 > URL: http://svn.freebsd.org/changeset/base/214961 > > Log: > =A0Directly use memory allocation functions and remove needless casts in > =A0their usage. =A0Also use associated modern types instead of k&r ones. You do know that changing skeleton.c affects the generated files, right? I'm wondering if whatever sed script you're judiciously-applying knows that. C++ does not do implicit conversions from "void *" so you need the casts on the mallocs there. With a C++ compiler: y.tab.c:116: error: invalid conversion from 'void*' to 'short int*' y.tab.c:122: error: invalid conversion from 'void*' to 'YYSTYPE*' Please back out the changes to the skeleton. From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 03:08:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FEAC106566B; Mon, 8 Nov 2010 03:08:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DEDA8FC17; Mon, 8 Nov 2010 03:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8381Sp005516; Mon, 8 Nov 2010 03:08:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8381oJ005514; Mon, 8 Nov 2010 03:08:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011080308.oA8381oJ005514@svn.freebsd.org> From: Andrew Thompson Date: Mon, 8 Nov 2010 03:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214971 - head/sys/dev/gpio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 03:08:01 -0000 Author: thompsa Date: Mon Nov 8 03:08:01 2010 New Revision: 214971 URL: http://svn.freebsd.org/changeset/base/214971 Log: Set the pin to output on attach, we can't assume it already is. Reviewed by: gonzo Modified: head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpioled.c ============================================================================== --- head/sys/dev/gpio/gpioled.c Mon Nov 8 02:47:29 2010 (r214970) +++ head/sys/dev/gpio/gpioled.c Mon Nov 8 03:08:01 2010 (r214971) @@ -103,6 +103,9 @@ gpioled_attach(device_t dev) device_get_unit(dev), "name", &name)) name = NULL; + GPIOBUS_PIN_SETFLAGS(sc->sc_busdev, sc->sc_dev, GPIOLED_PIN, + GPIO_PIN_OUTPUT); + sc->sc_leddev = led_create(gpioled_control, sc, name ? name : device_get_nameunit(dev)); From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 07:54:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A3E81065780; Mon, 8 Nov 2010 07:54:25 +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 28DF78FC18; Mon, 8 Nov 2010 07:54:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA87sPFB017986; Mon, 8 Nov 2010 07:54:25 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA87sPvp017984; Mon, 8 Nov 2010 07:54:25 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201011080754.oA87sPvp017984@svn.freebsd.org> From: Kevin Lo Date: Mon, 8 Nov 2010 07:54: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: r214972 - head/sys/arm/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 07:54:25 -0000 Author: kevlo Date: Mon Nov 8 07:54:24 2010 New Revision: 214972 URL: http://svn.freebsd.org/changeset/base/214972 Log: Intel IXP425 SoC is based on the ARMv5TE architecture MFC after: 3 days Modified: head/sys/arm/include/cpuconf.h Modified: head/sys/arm/include/cpuconf.h ============================================================================== --- head/sys/arm/include/cpuconf.h Mon Nov 8 03:08:01 2010 (r214971) +++ head/sys/arm/include/cpuconf.h Mon Nov 8 07:54:24 2010 (r214972) @@ -70,7 +70,7 @@ */ #if (defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined(CPU_ARM9) || \ defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110) || \ - defined(CPU_IXP12X0) || defined(CPU_XSCALE_IXP425) || defined(CPU_FA526)) + defined(CPU_IXP12X0) || defined(CPU_FA526)) #define ARM_ARCH_4 1 #else #define ARM_ARCH_4 0 @@ -79,7 +79,8 @@ #if (defined(CPU_ARM9E) || defined(CPU_ARM10) || \ defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ - defined(CPU_XSCALE_PXA2X0) || defined(CPU_FA626TE)) + defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ + defined(CPU_FA626TE)) #define ARM_ARCH_5 1 #else #define ARM_ARCH_5 0 From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 09:18:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C576106566B; Mon, 8 Nov 2010 09:18:39 +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 B08D48FC18; Mon, 8 Nov 2010 09:18:37 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA25673; Mon, 08 Nov 2010 11:18:36 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PFNs4-0003iK-2i; Mon, 08 Nov 2010 11:18:36 +0200 Message-ID: <4CD7C06B.1090505@freebsd.org> Date: Mon, 08 Nov 2010 11:18:35 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Andriy Gapon References: <201011071932.oA7JW3BY072220@svn.freebsd.org> In-Reply-To: <201011071932.oA7JW3BY072220@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r214941 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 09:18:39 -0000 on 07/11/2010 21:32 Andriy Gapon said the following: > Author: avg > Date: Sun Nov 7 19:32:03 2010 > New Revision: 214941 > URL: http://svn.freebsd.org/changeset/base/214941 > > Log: > Followup to r214936: zfs_getpages: account for differences from head > in page locking Reported by: jhell@DataIX.net Report overlooked by: avg > Modified: > stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > > Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > ============================================================================== > --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 7 19:23:25 2010 (r214940) > +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 7 19:32:03 2010 (r214941) > @@ -4181,14 +4181,13 @@ zfs_getpages(struct vnode *vp, vm_page_t > KASSERT(vp->v_object == object, ("mismatching object")); > > VM_OBJECT_LOCK(object); > - > + vm_page_lock_queues(); > for (i = 0; i < pcount; i++) { > if (i != reqpage) { > - vm_page_lock(m[i]); > vm_page_free(m[i]); > - vm_page_unlock(m[i]); > } > } > + vm_page_unlock_queues(); > > if (mreq->valid) { > if (mreq->valid != VM_PAGE_BITS_ALL) -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 09:26:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BB371065670; Mon, 8 Nov 2010 09:26:56 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E7DC8FC0A; Mon, 8 Nov 2010 09:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA89Quio021713; Mon, 8 Nov 2010 09:26:56 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA89Qu7J021711; Mon, 8 Nov 2010 09:26:56 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201011080926.oA89Qu7J021711@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 8 Nov 2010 09: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: r214973 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 09:26:56 -0000 Author: ru Date: Mon Nov 8 09:26:56 2010 New Revision: 214973 URL: http://svn.freebsd.org/changeset/base/214973 Log: A traditional (once per three years) sort by month/day/year/login. While here, fixed badly formatted lines. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Nov 8 07:54:24 2010 (r214972) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Nov 8 09:26:56 2010 (r214973) @@ -7,8 +7,8 @@ #ifndef _calendar_freebsd_ #define _calendar_freebsd_ -01/01 Alexander Langer born in Duesseldorf, Nordrhein-Westfalen, Germany, 1981 01/01 Dimitry Andric born in Utrecht, the Netherlands, 1969 +01/01 Alexander Langer born in Duesseldorf, Nordrhein-Westfalen, Germany, 1981 01/02 Ion-Mihai "IOnut" Tetcu born in Bucharest, Romania, 1980 01/02 Patrick Li born in Beijing, People's Republic of China, 1985 01/03 Tetsurou Okazaki born in Mobara, Chiba, Japan, 1972 @@ -24,13 +24,13 @@ 01/16 Vanilla I. Shu born in Taipei, Taiwan, Republic of China, 1978 01/18 Dejan Lesjak born in Ljubljana, Slovenia, Yugoslavia, 1977 01/19 Marshall Kirk McKusick born in Wilmington, Delaware, United States, 1954 -01/19 Marcelo S. Araujo born in Joinville, Santa Catarina, Brazil, 1981 01/19 Ruslan Ermilov born in Simferopol, USSR, 1974 +01/19 Marcelo S. Araujo born in Joinville, Santa Catarina, Brazil, 1981 01/20 Poul-Henning Kamp born in Korsoer, Denmark, 1966 01/22 Johann Visagie born in Cape Town, South Africa, 1970 01/23 Hideyuki KURASHINA born in Niigata, Japan, 1982 -01/24 Matteo Riondato born in Padova, Italy, 1986 01/24 Fabien Thomas born in Avignon, France, 1971 +01/24 Matteo Riondato born in Padova, Italy, 1986 01/25 Bernd Walter born in Moers, Nordrhein-Westfalen, Germany, 1974 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 @@ -43,19 +43,19 @@ 02/01 Christian Brueffer born in Gronau, Nordrhein-Westfalen, Germany, 1982 02/01 Steven Kreuzer born in Oceanside, New York, 1982 02/01 Juli Mallett born in Washington, Pennsylvania, United States, 1985 -02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Diomidis D. Spinellis born in Athens, Greece, 1967 +02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 02/10 David Greenman born in Portland, Oregon, United States, 1968 02/10 Paul Richards born in Ammanford, Carmarthenshire, United Kingdom, 1968 02/10 Simon Barner born in Rosenheim, Bayern, Germany, 1980 02/13 Jesper Skriver born in Aarhus, Denmark, 1975 +02/13 Steve Wills born in Lynchburg, Virginia, United States, 1975 02/13 Andrey Slusar born in Odessa, USSR, 1979 02/13 David W. Chapman Jr. born in Bethel, Connecticut, United States, 1981 -02/13 Steve Wills born in Lynchburg, Virginia, United States, 1975 -02/14 Erwin Lansing born in 's-Hertogenbosch, the Netherlands, 1975 02/14 Manolis Kiagias born in Chania, Greece, 1970 +02/14 Erwin Lansing born in 's-Hertogenbosch, the Netherlands, 1975 02/14 Martin Blapp born in Olten, Switzerland, 1976 02/19 Murray Stokely born in Jacksonville, Florida, United States, 1979 02/20 Anders Nordby born in Oslo, Norway, 1976 @@ -92,10 +92,10 @@ 03/17 Alexander Motin born in Simferopol, Ukraine, 1979 03/18 Koop Mast born in Dokkum, the Netherlands, 1981 03/19 Mikhail Teterin born in Kyiv, Ukraine, 1972 +03/20 Joseph S. Atkinson born in Batesville, Arkansas, United States, 1977 +03/20 Henrik Brix Andersen born in Aarhus, Denmark, 1978 03/20 MANTANI Nobutaka born in Hiroshima, Japan, 1978 03/20 Cameron Grant died in Hemel Hempstead, United Kingdom, 2005 -03/20 Henrik Brix Andersen born in Aarhus, Denmark, 1978 -03/20 Joseph S. Atkinson born in Batesville, Arkansas, United States, 1977 03/22 Brad Davis born in Farmington, New Mexico, United States, 1983 03/23 Daniel C. Sobral born in Brasilia, Distrito Federal, Brazil, 1971 03/23 Benno Rice born in Adelaide, South Australia, Australia, 1977 @@ -112,7 +112,7 @@ 04/03 Hellmuth Michaelis born in Kiel, Schleswig-Holstein, Germany, 1958 04/03 Tong Liu born in Beijing, People's Republic of China, 1981 04/03 Gabor Pali born in Kunhegyes, Hungary, 1982 -04/05 Stacey Son born in Burley, Idaho, United States. 1967 +04/05 Stacey Son born in Burley, Idaho, United States, 1967 04/07 Edward Tomasz Napierala born in Wolsztyn, Poland, 1981 04/08 Jordan K. Hubbard born in Honolulu, Hawaii, United States, 1963 04/09 Ceri Davies born in Haverfordwest, Pembrokeshire, United Kingdom, 1976 @@ -141,9 +141,9 @@ 05/11 Jesus Rodriguez born in Barcelona, Spain, 1972 05/11 Roman Kurakin born in Moscow, USSR, 1979 05/13 Pete Fritchman born in Lansdale, Pennsylvania, United States, 1983 -05/14 Bruce Cran born in Cambridge, United Kingdom, 1981 05/14 Tatsumi Hosokawa born in Tokyo, Japan, 1968 05/14 Shigeyuku Fukushima born in Osaka, Japan, 1974 +05/14 Bruce Cran born in Cambridge, United Kingdom, 1981 05/16 Johann Kois born in Wolfsberg, Austria, 1975 05/16 Marcus Alves Grando born in Florianopolis, Santa Catarina, Brazil, 1979 05/17 Thomas Abthorpe born in Port Arthur, Ontario, Canada, 1968 @@ -152,12 +152,12 @@ 05/21 Kris Kennaway born in Winnipeg, Manitoba, Canada, 1978 05/22 Clive Tong-I Lin born in Changhua, Taiwan, Republic of China, 1978 05/22 Michael Bushkov born in Rostov-on-Don, Russia, 1985 -05/22 Rui Paulo , born in Evora, Portugal, 1986 +05/22 Rui Paulo born in Evora, Portugal, 1986 05/23 Munechika Sumikawa born in Osaka, Osaka, Japan, 1972 05/24 Duncan McLennan Barclay born in London, Middlesex, United Kingdom, 1970 05/24 Oliver Lehmann born in Karlsburg, Germany, 1981 -05/25 Roman Divacky born in Brno, Czech Republic, 1983 05/25 Tom Rhodes born in Ellwood City, Pennsylvania, United States, 1981 +05/25 Roman Divacky born in Brno, Czech Republic, 1983 05/26 Jim Pirzyk born in Chicago, Illinois, United States, 1968 05/27 Ollivier Robert born in Paris, France, 1967 05/29 Wilko Bulte born in Arnhem, the Netherlands, 1965 @@ -168,13 +168,13 @@ 06/03 CHOI Junho born in Seoul, Korea, 1974 06/03 Wesley Shields born in Binghamton, NY, USA, 1981 06/04 Julian Elischer born in Perth, Australia, 1959 -06/04 Jason Evans born in Greeley, Colorado, United States, 1973 06/04 Justin Gibbs born in San Pedro, California, United States, 1973 +06/04 Jason Evans born in Greeley, Colorado, United States, 1973 06/04 Thomas Moestl born in Braunschweig, Niedersachsen, Germany, 1980 06/06 Sergei Kolobov born in Karpinsk, Russian Federation, 1972 06/06 Alan Eldridge died in Denver, Colorado, 2003 -06/07 Benjamin Close born in Adelaide, Australia, 1978 06/07 Jimmy Olgeni born in Milano, Italy, 1976 +06/07 Benjamin Close born in Adelaide, Australia, 1978 06/17 Tilman Linneweh born in Weinheim, Baden-Wuertemberg, Germany, 1978 06/18 Li-Wen Hsu born in Taipei, Taiwan, Republic of China, 1984 06/18 Roman Bogorodskiy born in Saratov, Russian Federation, 1986 @@ -232,12 +232,12 @@ 08/12 Max Brazhnikov born in Leningradskaya, Russia, 1979 08/14 Stefan Esser born in Cologne, Nordrhein-Westfalen, Germany, 1961 08/17 Olivier Houchard born in Nancy, France, 1980 -08/19 Pav Lucistnik born in Kutna Hora, Czech Republic, 1980 08/19 Chin-San Huang born in Yi-Lan, Taiwan, Republic of China, 1979 +08/19 Pav Lucistnik born in Kutna Hora, Czech Republic, 1980 08/20 Michael Heffner born in Cleona, Pennsylvania, United States, 1981 08/24 Mark Linimon born in Houston, Texas, United States, 1955 -08/25 Jean Milanez Melo born in Divinopolis, Minas Gerais, Brazil, 1982 08/25 Beech Rintoul born in Oakland, California, United States, 1952 +08/25 Jean Milanez Melo born in Divinopolis, Minas Gerais, Brazil, 1982 08/26 Dima Ruban born in Nalchik, USSR, 1970 08/26 Marc Fonvieille born in Avignon, France, 1972 08/26 Herve Quiroz born in Aix-en-Provence, France, 1977 @@ -257,8 +257,8 @@ 09/09 Yoshio Mita born in Hiroshima, Japan, 1972 09/10 Wesley R. Peters born in Hartford, Alabama, United States, 1961 09/12 Weongyo Jeong born in Haman, Korea, 1980 -09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 +09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 09/18 Matthew Fleming born in Cleveland, Ohio, United States, 1975 @@ -287,7 +287,7 @@ 10/22 Jean-Sebastien Pedron born in Redon, Ille-et-Vilaine, France, 1980 10/23 Mario Sergio Fujikawa Ferreira born in Brasilia, Distrito Federal, Brazil, 1976 10/25 Eric Melville born in Los Gatos, California, United States, 1980 -10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 +10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 11/09 Coleman Kane born in Cincinnati, OH, United States, 1980 @@ -310,7 +310,7 @@ 11/28 Stanislav Sedov born in Chelyabinsk, USSR, 1985 12/01 Hajimu Umemoto born in Nara, Japan, 1961 12/01 Alexey Dokuchaev born in Magadan, USSR, 1980 -12/02 Ermal Luçi born in Tirane, Albania, 1980 +12/02 Ermal Luçi born in Tirane, Albania, 1980 12/03 Diane Bruce born in Ottawa, Ontario, Canada, 1952 12/05 Ivan Voras born in Slavonski Brod, Croatia, 1981 12/06 Stefan Farfeleder born in Wien, Austria, 1980 From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 09:50:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4913E106564A; Mon, 8 Nov 2010 09:50:48 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35F518FC0A; Mon, 8 Nov 2010 09:50:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA89omXS022618; Mon, 8 Nov 2010 09:50:48 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA89omSP022616; Mon, 8 Nov 2010 09:50:48 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201011080950.oA89omSP022616@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 8 Nov 2010 09:50: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: r214974 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 09:50:48 -0000 Author: ru Date: Mon Nov 8 09:50:47 2010 New Revision: 214974 URL: http://svn.freebsd.org/changeset/base/214974 Log: Add/expand country/state. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Nov 8 09:26:56 2010 (r214973) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Nov 8 09:50:47 2010 (r214974) @@ -41,7 +41,7 @@ 02/01 Paul Saab born in Champaign-Urbana, Illinois, United States, 1978 02/01 Martin Wilke born in Ludwigsfelde, Brandenburg, Germany, 1980 02/01 Christian Brueffer born in Gronau, Nordrhein-Westfalen, Germany, 1982 -02/01 Steven Kreuzer born in Oceanside, New York, 1982 +02/01 Steven Kreuzer born in Oceanside, New York, United States, 1982 02/01 Juli Mallett born in Washington, Pennsylvania, United States, 1985 02/02 Diomidis D. Spinellis born in Athens, Greece, 1967 02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 @@ -151,7 +151,7 @@ 05/19 Ian Dowse born in Dublin, Ireland, 1975 05/21 Kris Kennaway born in Winnipeg, Manitoba, Canada, 1978 05/22 Clive Tong-I Lin born in Changhua, Taiwan, Republic of China, 1978 -05/22 Michael Bushkov born in Rostov-on-Don, Russia, 1985 +05/22 Michael Bushkov born in Rostov-on-Don, Russian Federation, 1985 05/22 Rui Paulo born in Evora, Portugal, 1986 05/23 Munechika Sumikawa born in Osaka, Osaka, Japan, 1972 05/24 Duncan McLennan Barclay born in London, Middlesex, United Kingdom, 1970 @@ -164,9 +164,9 @@ 05/29 Seigo Tanimura born in Kitakyushu, Fukuoka, Japan, 1976 05/31 Ville Skytta born in Helsinki, Finland, 1974 06/02 Jean-Marc Zucconi born in Pontarlier, France, 1954 -06/02 Alexander Botero-Lowry born in Austin, TX, USA, 1986 +06/02 Alexander Botero-Lowry born in Austin, Texas, United States, 1986 06/03 CHOI Junho born in Seoul, Korea, 1974 -06/03 Wesley Shields born in Binghamton, NY, USA, 1981 +06/03 Wesley Shields born in Binghamton, New York, United States, 1981 06/04 Julian Elischer born in Perth, Australia, 1959 06/04 Justin Gibbs born in San Pedro, California, United States, 1973 06/04 Jason Evans born in Greeley, Colorado, United States, 1973 @@ -229,7 +229,7 @@ 08/07 Jonathan Mini born in San Mateo, California, United States, 1979 08/10 Peter Pentchev born in Sofia, Bulgaria, 1977 08/12 Joe Marcus Clarke born in Lakeland, Florida, United States, 1976 -08/12 Max Brazhnikov born in Leningradskaya, Russia, 1979 +08/12 Max Brazhnikov born in Leningradskaya, Russian Federation, 1979 08/14 Stefan Esser born in Cologne, Nordrhein-Westfalen, Germany, 1961 08/17 Olivier Houchard born in Nancy, France, 1980 08/19 Chin-San Huang born in Yi-Lan, Taiwan, Republic of China, 1979 @@ -272,7 +272,7 @@ 10/02 Beat Gaetzi born in Zurich, Switzerland, 1980 10/05 Hiroki Sato born in Yamagata, Japan, 1977 10/05 Chris Costello born in Houston, Texas, United States, 1985 -10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, 1978 +10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, Germany, 1978 10/12 Pawel Jakub Dawidek born in Radzyn Podlaski, Poland, 1980 10/15 Maxim Konovalov born in Khabarovsk, USSR, 1973 10/16 Remko Lodder born in Rotterdam, the Netherlands, 1983 @@ -290,7 +290,7 @@ 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 -11/09 Coleman Kane born in Cincinnati, OH, United States, 1980 +11/09 Coleman Kane born in Cincinnati, Ohio, United States, 1980 11/09 Antoine Brodin born in Bagnolet, France, 1981 11/10 Gregory Neil Shapiro born in Providence, Rhode Island, United States, 1970 11/13 John Baldwin born in Stuart, Virginia, United States, 1977 From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 10:08:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F22106566B; Mon, 8 Nov 2010 10:08:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3402C8FC0C; Mon, 8 Nov 2010 10:08:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8A8VNr023384; Mon, 8 Nov 2010 10:08:31 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8A8VkX023377; Mon, 8 Nov 2010 10:08:31 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201011081008.oA8A8VkX023377@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 8 Nov 2010 10:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214975 - in stable/8: sbin/geom/class/part sbin/geom/class/sched sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 10:08:31 -0000 Author: ae Date: Mon Nov 8 10:08:30 2010 New Revision: 214975 URL: http://svn.freebsd.org/changeset/base/214975 Log: MFC r214352 adapted to stable/8: Reimplemented "gpart destroy -F". Now it does all work in kernel. This was needed for recover implementation. Implement the recover command for GPT. Now GPT will marked as corrupt when any of three types of corruption will be detected: 1. Damaged primary GPT header or table 2. Damaged secondary GPT header or table 3. Secondary header is not located in the last LBA Marked GPT becomes read-only. Any changes with corrupt table are prohibited. Only "destroy" and "recover" commands are allowed. Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/geom_part.c stable/8/sbin/geom/class/part/gpart.8 stable/8/sys/geom/part/g_part.c stable/8/sys/geom/part/g_part.h stable/8/sys/geom/part/g_part_gpt.c stable/8/sys/geom/part/g_part_if.m Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Mon Nov 8 09:50:47 2010 (r214974) +++ stable/8/sbin/geom/class/part/geom_part.c Mon Nov 8 10:08:30 2010 (r214975) @@ -68,7 +68,6 @@ static char ssize[32]; static const char const bootcode_param[] = "bootcode"; static const char const index_param[] = "index"; static const char const partcode_param[] = "partcode"; -static const char const force_param[] = "force"; static struct gclass *find_class(struct gmesh *, const char *); static struct ggeom * find_geom(struct gclass *, const char *); @@ -85,8 +84,7 @@ static void gpart_show_geom(struct ggeom static int gpart_show_hasopt(struct gctl_req *, const char *, const char *); static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t); static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *); -static void gpart_destroy(struct gctl_req *, unsigned int); -static void gpart_print_error(const char *); +static void gpart_print_error(const char *); struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { @@ -121,8 +119,8 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, - { "destroy", 0, gpart_destroy, { - { 'F', force_param, NULL, G_TYPE_BOOL }, + { "destroy", 0, gpart_issue, { + { 'F', "force", NULL, G_TYPE_BOOL }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL }, @@ -162,6 +160,11 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, + { "recover", 0, gpart_issue, { + { 'f', "flags", flags, G_TYPE_STRING }, + G_OPT_SENTINEL }, + "geom", NULL + }, G_CMD_SENTINEL }; @@ -536,13 +539,17 @@ gpart_show_geom(struct ggeom *gp, const s = find_geomcfg(gp, "last"); last = (off_t)strtoimax(s, NULL, 0); wblocks = strlen(s); + s = find_geomcfg(gp, "state"); + if (s != NULL && *s != 'C') + s = NULL; wname = strlen(gp->lg_name); pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; secsz = pp->lg_sectorsize; - printf("=>%*jd %*jd %*s %s (%s)\n", + printf("=>%*jd %*jd %*s %s (%s)%s\n", wblocks, (intmax_t)first, wblocks, (intmax_t)(last - first + 1), wname, gp->lg_name, - scheme, fmtsize(pp->lg_mediasize)); + scheme, fmtsize(pp->lg_mediasize), + s ? " [CORRUPT]": ""); while ((pp = find_provider(gp, first)) != NULL) { s = find_provcfg(pp, "start"); @@ -857,98 +864,24 @@ gpart_bootcode(struct gctl_req *req, uns } static void -gpart_destroy(struct gctl_req *req, unsigned int fl) -{ - struct gmesh mesh; - struct gclass *classp; - struct gctl_req *req2; - struct ggeom *gp; - struct gprovider *pp; - const char *s; - int error, val; - - if (gctl_has_param(req, force_param)) { - val = gctl_get_int(req, force_param); - error = gctl_delete_param(req, force_param); - if (error) - errc(EXIT_FAILURE, error, "internal error"); - if (val == 0) - goto done; - s = gctl_get_ascii(req, "class"); - if (s == NULL) - abort(); - error = geom_gettree(&mesh); - if (error != 0) - errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); - classp = find_class(&mesh, s); - if (classp == NULL) { - geom_deletetree(&mesh); - errx(EXIT_FAILURE, "Class %s not found.", s); - } - s = gctl_get_ascii(req, "geom"); - if (s == NULL) - abort(); - gp = find_geom(classp, s); - if (gp == NULL) - errx(EXIT_FAILURE, "No such geom: %s.", s); - val = 0; - LIST_FOREACH(pp, &gp->lg_provider, lg_provider){ - s = find_provcfg(pp, "index"); - if (s == NULL) - errx(EXIT_FAILURE, "Index not found for %s.", - pp->lg_name); - req2 = gctl_get_handle(); - gctl_ro_param(req2, "class", -1, classp->lg_name); - gctl_ro_param(req2, "geom", -1, gp->lg_name); - gctl_ro_param(req2, "verb", -1, "delete"); - gctl_ro_param(req2, index_param, -1, s); - gctl_ro_param(req2, "flags", -1, "X"); - s = gctl_issue(req2); - if (s != NULL && s[0] != '\0') { - gpart_print_error(s); - gctl_free(req2); - if (val) { /* try to undo changes */ - req2 = gctl_get_handle(); - gctl_ro_param(req2, "verb", -1, - "undo"); - gctl_ro_param(req2, "class", -1, - classp->lg_name); - gctl_ro_param(req2, "geom", -1, - gp->lg_name); - gctl_issue(req2); - gctl_free(req2); - } - geom_deletetree(&mesh); - exit(EXIT_FAILURE); - } - gctl_free(req2); - val = 1; - } - geom_deletetree(&mesh); - } -done: - gpart_issue(req, fl); -} - -static void -gpart_print_error(const char *errstr) -{ - char *errmsg; - int error; - - error = strtol(errstr, &errmsg, 0); - if (errmsg != errstr) { - while (errmsg[0] == ' ') - errmsg++; - if (errmsg[0] != '\0') - warnc(error, "%s", errmsg); - else - warnc(error, NULL); - } else - warnx("%s", errmsg); -} - -static void +gpart_print_error(const char *errstr) +{ + char *errmsg; + int error; + + error = strtol(errstr, &errmsg, 0); + if (errmsg != errstr) { + while (errmsg[0] == ' ') + errmsg++; + if (errmsg[0] != '\0') + warnc(error, "%s", errmsg); + else + warnc(error, NULL); + } else + warnx("%s", errmsg); +} + +static void gpart_issue(struct gctl_req *req, unsigned int fl __unused) { char buf[4096]; Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Mon Nov 8 09:50:47 2010 (r214974) +++ stable/8/sbin/geom/class/part/gpart.8 Mon Nov 8 10:08:30 2010 (r214975) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2010 +.Dd October 25, 2010 .Dt GPART 8 .Os .Sh NAME @@ -129,6 +129,11 @@ utility: .Op Fl t Ar type .Op Fl f Ar flags .Ar geom +.\" ==== RECOVER ==== +.Nm +.Cm recover +.Op Fl f Ar flags +.Ar geom .\" ==== RESIZE ==== .Nm .Cm resize @@ -353,6 +358,23 @@ See the section entitled below for a discussion about its use. .El +.\" ==== RECOVER ==== +.It Cm recover +Recover corrupt partition's scheme metadata on the geom +.Ar geom . +See the section entitled +.Sx "RECOVERING" +below for the additional information. +.Pp +Additional options include: +.Bl -tag -width 10n +.It Fl f Ar flags +Additional operational flags. +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion +about its use. +.El .\" ==== RESIZE ==== .It Cm resize Resize a partition from geom @@ -629,6 +651,68 @@ the action or reverted with the .Cm undo action. +.Sh RECOVERING +The GEOM class PART supports recovering of partition tables only for GPT. +The GUID partition table has a primary and secondary (backup) copy of +metadata for redundance. They are stored in the begining and in the end +of device respectively. Therefore it is acceptable to have some corruptions +in the metadata that are not fatal to work with GPT. When kernel detects +corrupt metadata it marks this table as corrupt and reports about corruption. +Any changes in corrupt table are prohibited except +.Cm destroy +and +.Cm recover . +.Pp +In case when only first sector is corrupt kernel can not detect GPT even +if partition table is not corrupt. You can write protective MBR with +.Xr dd 1 +command to restore ability of GPT detection. The copy of protective MBR is +usually located in the +.Pa /boot/pmbr +file. +.Pp +In case when some of metadata is corrupt you will get to know about this +from kernel's messages like these: +.Bd -literal -offset indent +GEOM: provider: the primary GPT table is corrupt or invalid. +GEOM: provider: using the secondary instead -- recovery strongly advised. +.Ed +.Pp +or +.Bd -literal -offset indent +GEOM: provider: the secondary GPT table is corrupt or invalid. +GEOM: provider: using the primary only -- recovery suggested. +.Ed +.Pp +Also +.Cm gpart +commands like +.Cm show , +.Cm status +and +.Cm list +will report about corrupt table. +.Pp +In case when the size of device has changed (e.g. volume expansion) the +secondary GPT header will become located not in the last sector. This is +not a metadata corruption, but it is dangerous because any corruption of +the primary GPT will lead to lost of partition table. Kernel reports about +this problem with message: +.Bd -literal -offset indent +GEOM: provider: the secondary GPT header is not in the last LBA. +.Ed +.Pp +A corrupt table can be recovered with +.Cm gpart recover +command. This command does reconstruction of corrupt metadata using +known valid metadata. Also it can relocate secondary GPT to the end of +device. +.Pp +.Pa NOTE : +The GEOM class PART can detect the same partition table on different GEOM +providers and some of them will marked as corrupt. Be careful when choising +a provider for recovering. If you did incorrect choise you can destroy +metadata of another GEOM class, e.g. GEOM MIRROR or GEOM LABEL. .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES @@ -687,6 +771,7 @@ After having created all required partit /sbin/gpart bootcode -p /boot/boot1 da0 .Ed .Sh SEE ALSO +.Xr dd 1 , .Xr geom 4 , .Xr geom 8 .Sh HISTORY Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Mon Nov 8 09:50:47 2010 (r214974) +++ stable/8/sys/geom/part/g_part.c Mon Nov 8 10:08:30 2010 (r214975) @@ -855,7 +855,7 @@ g_part_ctl_destroy(struct gctl_req *req, struct g_consumer *cp; struct g_geom *gp; struct g_provider *pp; - struct g_part_entry *entry; + struct g_part_entry *entry, *tmp; struct g_part_table *null, *table; struct sbuf *sb; int error; @@ -865,13 +865,34 @@ g_part_ctl_destroy(struct gctl_req *req, g_topology_assert(); table = gp->softc; + /* Check for busy providers. */ LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { if (entry->gpe_deleted || entry->gpe_internal) continue; + if (gpp->gpp_force) { + pp = entry->gpe_pp; + if (pp == NULL) + continue; + if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) + continue; + } gctl_error(req, "%d", EBUSY); return (EBUSY); } + if (gpp->gpp_force) { + /* Destroy all providers. */ + LIST_FOREACH_SAFE(entry, &table->gpt_entry, gpe_entry, tmp) { + pp = entry->gpe_pp; + if (pp != NULL) { + pp->private = NULL; + g_wither_provider(pp, ENXIO); + } + LIST_REMOVE(entry, gpe_entry); + g_free(entry); + } + } + error = G_PART_DESTROY(table, gpp); if (error) { gctl_error(req, "%d", error); @@ -968,8 +989,39 @@ g_part_ctl_move(struct gctl_req *req, st static int g_part_ctl_recover(struct gctl_req *req, struct g_part_parms *gpp) { - gctl_error(req, "%d verb 'recover'", ENOSYS); - return (ENOSYS); + struct g_part_table *table; + struct g_geom *gp; + struct sbuf *sb; + int error, recovered; + + gp = gpp->gpp_geom; + G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, gp->name)); + g_topology_assert(); + table = gp->softc; + error = recovered = 0; + + if (table->gpt_corrupt) { + error = G_PART_RECOVER(table); + if (error) { + gctl_error(req, "%d recovering '%s' failed", + error, gp->name); + return (error); + } + recovered = 1; + } + /* Provide feedback if so requested. */ + if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { + sb = sbuf_new_auto(); + if (recovered) + sbuf_printf(sb, "%s recovered\n", gp->name); + else + sbuf_printf(sb, "%s recovering is not needed\n", + gp->name); + sbuf_finish(sb); + gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); + sbuf_delete(sb); + } + return (0); } static int @@ -1273,6 +1325,7 @@ g_part_ctlreq(struct gctl_req *req, stru } else if (!strcmp(verb, "destroy")) { ctlreq = G_PART_CTL_DESTROY; mparms |= G_PART_PARM_GEOM; + oparms |= G_PART_PARM_FORCE; } break; case 'm': @@ -1343,6 +1396,8 @@ g_part_ctlreq(struct gctl_req *req, stru case 'f': if (!strcmp(ap->name, "flags")) parm = G_PART_PARM_FLAGS; + else if (!strcmp(ap->name, "force")) + parm = G_PART_PARM_FORCE; break; case 'g': if (!strcmp(ap->name, "geom")) @@ -1412,6 +1467,9 @@ g_part_ctlreq(struct gctl_req *req, stru continue; error = g_part_parm_str(p, &gpp.gpp_flags); break; + case G_PART_PARM_FORCE: + error = g_part_parm_uint(p, &gpp.gpp_force); + break; case G_PART_PARM_GEOM: error = g_part_parm_geom(p, &gpp.gpp_geom); break; @@ -1465,6 +1523,13 @@ g_part_ctlreq(struct gctl_req *req, stru table = NULL; if (modifies && (gpp.gpp_parms & G_PART_PARM_GEOM)) { table = gpp.gpp_geom->softc; + if (table != NULL && table->gpt_corrupt && + ctlreq != G_PART_CTL_DESTROY && + ctlreq != G_PART_CTL_RECOVER) { + gctl_error(req, "%d table '%s' is corrupt", + EPERM, gpp.gpp_geom->name); + return; + } if (table != NULL && !table->gpt_opened) { error = g_access(LIST_FIRST(&gpp.gpp_geom->consumer), 1, 1, 1); @@ -1729,6 +1794,8 @@ g_part_dumpconf(struct sbuf *sb, const c table->gpt_sectors); sbuf_printf(sb, "%s%u\n", indent, table->gpt_heads); + sbuf_printf(sb, "%s%s\n", indent, + table->gpt_corrupt ? "CORRUPT": "OK"); G_PART_DUMPCONF(table, NULL, sb, indent); } } Modified: stable/8/sys/geom/part/g_part.h ============================================================================== --- stable/8/sys/geom/part/g_part.h Mon Nov 8 09:50:47 2010 (r214974) +++ stable/8/sys/geom/part/g_part.h Mon Nov 8 10:08:30 2010 (r214975) @@ -132,6 +132,7 @@ struct g_part_table { int gpt_modified:1; /* Table changes have been made. */ int gpt_opened:1; /* Permissions obtained. */ int gpt_fixgeom:1; /* Geometry is fixed. */ + int gpt_corrupt:1; /* Table is corrupt. */ }; struct g_part_entry *g_part_new_entry(struct g_part_table *, int, quad_t, @@ -169,6 +170,7 @@ enum g_part_ctl { #define G_PART_PARM_VERSION 0x0800 #define G_PART_PARM_BOOTCODE 0x1000 #define G_PART_PARM_ATTRIB 0x2000 +#define G_PART_PARM_FORCE 0x4000 struct g_part_parms { unsigned int gpp_parms; @@ -186,6 +188,7 @@ struct g_part_parms { const void *gpp_codeptr; unsigned int gpp_codesize; const char *gpp_attrib; + unsigned int gpp_force; }; void g_part_geometry_heads(off_t, u_int, off_t *, u_int *); Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Mon Nov 8 09:50:47 2010 (r214974) +++ stable/8/sys/geom/part/g_part_gpt.c Mon Nov 8 10:08:30 2010 (r214975) @@ -94,7 +94,7 @@ static int g_part_gpt_destroy(struct g_p static void g_part_gpt_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_gpt_dumpto(struct g_part_table *, struct g_part_entry *); -static int g_part_gpt_modify(struct g_part_table *, struct g_part_entry *, +static int g_part_gpt_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static const char *g_part_gpt_name(struct g_part_table *, struct g_part_entry *, char *, size_t); @@ -107,6 +107,7 @@ static const char *g_part_gpt_type(struc static int g_part_gpt_write(struct g_part_table *, struct g_consumer *); static int g_part_gpt_resize(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); +static int g_part_gpt_recover(struct g_part_table *); static kobj_method_t g_part_gpt_methods[] = { KOBJMETHOD(g_part_add, g_part_gpt_add), @@ -120,6 +121,7 @@ static kobj_method_t g_part_gpt_methods[ KOBJMETHOD(g_part_name, g_part_gpt_name), KOBJMETHOD(g_part_probe, g_part_gpt_probe), KOBJMETHOD(g_part_read, g_part_gpt_read), + KOBJMETHOD(g_part_recover, g_part_gpt_recover), KOBJMETHOD(g_part_setunset, g_part_gpt_setunset), KOBJMETHOD(g_part_type, g_part_gpt_type), KOBJMETHOD(g_part_write, g_part_gpt_write), @@ -170,7 +172,7 @@ static struct uuid gpt_uuid_unused = GPT static struct g_part_uuid_alias { struct uuid *uuid; - int alias; + int alias; } gpt_uuid_alias_match[] = { { &gpt_uuid_apple_boot, G_PART_ALIAS_APPLE_BOOT }, { &gpt_uuid_apple_hfs, G_PART_ALIAS_APPLE_HFS }, @@ -217,8 +219,16 @@ gpt_read_hdr(struct g_part_gpt_table *ta pp = cp->provider; last = (pp->mediasize / pp->sectorsize) - 1; - table->lba[elt] = (elt == GPT_ELT_PRIHDR) ? 1 : last; table->state[elt] = GPT_STATE_MISSING; + /* + * If the primary header is valid look for secondary + * header in AlternateLBA, otherwise in the last medium's LBA. + */ + if (elt == GPT_ELT_SECHDR) { + if (table->state[GPT_ELT_PRIHDR] != GPT_STATE_OK) + table->lba[elt] = last; + } else + table->lba[elt] = 1; buf = g_read_data(cp, table->lba[elt] * pp->sectorsize, pp->sectorsize, &error); if (buf == NULL) @@ -244,12 +254,15 @@ gpt_read_hdr(struct g_part_gpt_table *ta table->state[elt] = GPT_STATE_INVALID; hdr->hdr_revision = le32toh(buf->hdr_revision); - if (hdr->hdr_revision < 0x00010000) + if (hdr->hdr_revision < GPT_HDR_REVISION) goto fail; hdr->hdr_lba_self = le64toh(buf->hdr_lba_self); if (hdr->hdr_lba_self != table->lba[elt]) goto fail; hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt); + if (hdr->hdr_lba_alt == hdr->hdr_lba_self || + hdr->hdr_lba_alt > last) + goto fail; /* Check the managed area. */ hdr->hdr_lba_start = le64toh(buf->hdr_lba_start); @@ -283,6 +296,10 @@ gpt_read_hdr(struct g_part_gpt_table *ta le_uuid_dec(&buf->hdr_uuid, &hdr->hdr_uuid); hdr->hdr_crc_table = le32toh(buf->hdr_crc_table); + /* save LBA for secondary header */ + if (elt == GPT_ELT_PRIHDR) + table->lba[GPT_ELT_SECHDR] = hdr->hdr_lba_alt; + g_free(buf); return (hdr); @@ -490,18 +507,21 @@ static int g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) { struct g_part_gpt_table *table; + struct g_provider *pp; table = (struct g_part_gpt_table *)basetable; - if (table->hdr != NULL) - g_free(table->hdr); + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + g_free(table->hdr); table->hdr = NULL; /* - * Wipe the first 2 sectors as well as the last to clear the - * partitioning. + * Wipe the first 2 sectors to clear the partitioning. Wipe the last + * sector only if it has valid secondary header. */ basetable->gpt_smhead |= 3; - basetable->gpt_smtail |= 1; + if (table->state[GPT_ELT_SECHDR] == GPT_STATE_OK && + table->lba[GPT_ELT_SECHDR] == pp->mediasize / pp->sectorsize - 1) + basetable->gpt_smtail |= 1; return (0); } @@ -665,10 +685,12 @@ g_part_gpt_read(struct g_part_table *bas struct g_part_gpt_table *table; struct g_part_gpt_entry *entry; u_char *buf; + uint64_t last; int error, index; table = (struct g_part_gpt_table *)basetable; pp = cp->provider; + last = (pp->mediasize / pp->sectorsize) - 1; /* Read the PMBR */ buf = g_read_data(cp, 0, pp->sectorsize, &error); @@ -732,6 +754,7 @@ g_part_gpt_read(struct g_part_table *bas printf("GEOM: %s: using the secondary instead -- recovery " "strongly advised.\n", pp->name); table->hdr = sechdr; + basetable->gpt_corrupt = 1; if (prihdr != NULL) g_free(prihdr); tbl = sectbl; @@ -743,6 +766,11 @@ g_part_gpt_read(struct g_part_table *bas "or invalid.\n", pp->name); printf("GEOM: %s: using the primary only -- recovery " "suggested.\n", pp->name); + basetable->gpt_corrupt = 1; + } else if (table->lba[GPT_ELT_SECHDR] != last) { + printf( "GEOM: %s: the secondary GPT header is not in " + "the last LBA.\n", pp->name); + basetable->gpt_corrupt = 1; } table->hdr = prihdr; if (sechdr != NULL) @@ -759,8 +787,9 @@ g_part_gpt_read(struct g_part_table *bas for (index = basetable->gpt_entries - 1; index >= 0; index--) { if (EQUUID(&tbl[index].ent_type, &gpt_uuid_unused)) continue; - entry = (struct g_part_gpt_entry *)g_part_new_entry(basetable, - index+1, tbl[index].ent_lba_start, tbl[index].ent_lba_end); + entry = (struct g_part_gpt_entry *)g_part_new_entry( + basetable, index + 1, tbl[index].ent_lba_start, + tbl[index].ent_lba_end); entry->ent = tbl[index]; } @@ -769,6 +798,38 @@ g_part_gpt_read(struct g_part_table *bas } static int +g_part_gpt_recover(struct g_part_table *basetable) +{ + struct g_part_gpt_table *table; + struct g_provider *pp; + uint64_t last; + size_t tblsz; + + table = (struct g_part_gpt_table *)basetable; + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + last = pp->mediasize / pp->sectorsize - 1; + tblsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz + + pp->sectorsize - 1) / pp->sectorsize; + + table->lba[GPT_ELT_PRIHDR] = 1; + table->lba[GPT_ELT_PRITBL] = 2; + table->lba[GPT_ELT_SECHDR] = last; + table->lba[GPT_ELT_SECTBL] = last - tblsz; + table->state[GPT_ELT_PRIHDR] = GPT_STATE_OK; + table->state[GPT_ELT_PRITBL] = GPT_STATE_OK; + table->state[GPT_ELT_SECHDR] = GPT_STATE_OK; + table->state[GPT_ELT_SECTBL] = GPT_STATE_OK; + table->hdr->hdr_lba_start = 2 + tblsz; + table->hdr->hdr_lba_end = last - tblsz - 1; + + basetable->gpt_first = table->hdr->hdr_lba_start; + basetable->gpt_last = table->hdr->hdr_lba_end; + basetable->gpt_corrupt = 0; + + return (0); +} + +static int g_part_gpt_setunset(struct g_part_table *table, struct g_part_entry *baseentry, const char *attrib, unsigned int set) { @@ -867,13 +928,13 @@ g_part_gpt_write(struct g_part_table *ba struct g_part_entry *baseentry; struct g_part_gpt_entry *entry; struct g_part_gpt_table *table; - size_t tlbsz; + size_t tblsz; uint32_t crc; int error, index; pp = cp->provider; table = (struct g_part_gpt_table *)basetable; - tlbsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz + + tblsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz + pp->sectorsize - 1) / pp->sectorsize; /* Write the PMBR */ @@ -885,7 +946,7 @@ g_part_gpt_write(struct g_part_table *ba return (error); /* Allocate space for the header and entries. */ - buf = g_malloc((tlbsz + 1) * pp->sectorsize, M_WAITOK | M_ZERO); + buf = g_malloc((tblsz + 1) * pp->sectorsize, M_WAITOK | M_ZERO); memcpy(buf, table->hdr->hdr_sig, sizeof(table->hdr->hdr_sig)); le32enc(buf + 8, table->hdr->hdr_revision); @@ -924,7 +985,7 @@ g_part_gpt_write(struct g_part_table *ba le32enc(buf + 16, crc); error = g_write_data(cp, table->lba[GPT_ELT_PRITBL] * pp->sectorsize, - buf + pp->sectorsize, tlbsz * pp->sectorsize); + buf + pp->sectorsize, tblsz * pp->sectorsize); if (error) goto out; error = g_write_data(cp, table->lba[GPT_ELT_PRIHDR] * pp->sectorsize, @@ -941,7 +1002,7 @@ g_part_gpt_write(struct g_part_table *ba le32enc(buf + 16, crc); error = g_write_data(cp, table->lba[GPT_ELT_SECTBL] * pp->sectorsize, - buf + pp->sectorsize, tlbsz * pp->sectorsize); + buf + pp->sectorsize, tblsz * pp->sectorsize); if (error) goto out; error = g_write_data(cp, table->lba[GPT_ELT_SECHDR] * pp->sectorsize, Modified: stable/8/sys/geom/part/g_part_if.m ============================================================================== --- stable/8/sys/geom/part/g_part_if.m Mon Nov 8 09:50:47 2010 (r214974) +++ stable/8/sys/geom/part/g_part_if.m Mon Nov 8 10:08:30 2010 (r214975) @@ -65,6 +65,12 @@ CODE { { return (ENOSYS); } + + static int + default_recover(struct g_part_table *t __unused) + { + return (ENOSYS); + } }; # add() - scheme specific processing for the add verb. @@ -163,6 +169,11 @@ METHOD int read { struct g_consumer *cp; }; +# recover() - scheme specific processing for the recover verb. +METHOD int recover { + struct g_part_table *table; +} DEFAULT default_recover; + # setunset() - set or unset partition entry attributes. METHOD int setunset { struct g_part_table *table; From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 10:18:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A727106566B; Mon, 8 Nov 2010 10:18:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07D678FC12; Mon, 8 Nov 2010 10:18:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8AI1U4023808; Mon, 8 Nov 2010 10:18:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8AI1uT023806; Mon, 8 Nov 2010 10:18:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011081018.oA8AI1uT023806@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Nov 2010 10:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214976 - stable/8/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 10:18:02 -0000 Author: kib Date: Mon Nov 8 10:18:01 2010 New Revision: 214976 URL: http://svn.freebsd.org/changeset/base/214976 Log: MFC r214851: Fix a bug in r214049. The nvp == vp case shall be handled specially only for !usevget case. If VFS_VGET is working, the vnode shared lock is obtained recursively and vput() shall be done, not vunref(). Modified: stable/8/sys/nfsserver/nfs_serv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Mon Nov 8 10:08:30 2010 (r214975) +++ stable/8/sys/nfsserver/nfs_serv.c Mon Nov 8 10:18:01 2010 (r214976) @@ -3252,7 +3252,7 @@ again: nfhp->fh_fsid = nvp->v_mount->mnt_stat.f_fsid; if ((error1 = VOP_VPTOFH(nvp, &nfhp->fh_fid)) == 0) error1 = VOP_GETATTR(nvp, vap, cred); - if (vp == nvp) + if (!usevget && vp == nvp) vunref(nvp); else vput(nvp); From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 10:23:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3874106564A; Mon, 8 Nov 2010 10:23:39 +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 C09C18FC1D; Mon, 8 Nov 2010 10:23:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8ANdCd024104; Mon, 8 Nov 2010 10:23:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8ANdj9024099; Mon, 8 Nov 2010 10:23:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011081023.oA8ANdj9024099@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Nov 2010 10:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214977 - stable/8/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 10:23:40 -0000 Author: kib Date: Mon Nov 8 10:23:39 2010 New Revision: 214977 URL: http://svn.freebsd.org/changeset/base/214977 Log: MFC r214026: Do not synchronously start the nfsiod threads at all. The r212506 fixed the issues with file descriptor locks, but the same problems are present for vnode lock/user map lock. Modified: stable/8/sys/nfsclient/nfs.h stable/8/sys/nfsclient/nfs_bio.c stable/8/sys/nfsclient/nfs_nfsiod.c stable/8/sys/nfsclient/nfsnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfsclient/nfs.h ============================================================================== --- stable/8/sys/nfsclient/nfs.h Mon Nov 8 10:18:01 2010 (r214976) +++ stable/8/sys/nfsclient/nfs.h Mon Nov 8 10:23:39 2010 (r214977) @@ -253,7 +253,7 @@ int nfs_writerpc(struct vnode *, struct int nfs_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred, struct thread *td); int nfs_readdirrpc(struct vnode *, struct uio *, struct ucred *); -int nfs_nfsiodnew(int); +void nfs_nfsiodnew(void); void nfs_nfsiodnew_tq(__unused void *, int); int nfs_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); int nfs_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); Modified: stable/8/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/8/sys/nfsclient/nfs_bio.c Mon Nov 8 10:18:01 2010 (r214976) +++ stable/8/sys/nfsclient/nfs_bio.c Mon Nov 8 10:23:39 2010 (r214977) @@ -1379,13 +1379,9 @@ again: /* * Try to create one if none are free. */ - if (!gotiod) { - iod = nfs_nfsiodnew(1); - if (iod != -1) - gotiod = TRUE; - } - - if (gotiod) { + if (!gotiod) + nfs_nfsiodnew(); + else { /* * Found one, so wake it up and tell it which * mount to process. @@ -1405,7 +1401,7 @@ again: if (!gotiod) { if (nmp->nm_bufqiods > 0) { NFS_DPF(ASYNCIO, - ("nfs_asyncio: %d iods are already processing mount %p\n", + ("nfs_asyncio: %d iods are already processing mount %p\n", nmp->nm_bufqiods, nmp)); gotiod = TRUE; } @@ -1420,9 +1416,9 @@ again: * Ensure that the queue never grows too large. We still want * to asynchronize so we block rather then return EIO. */ - while (nmp->nm_bufqlen >= 2*nfs_numasync) { + while (nmp->nm_bufqlen >= 2 * nfs_numasync) { NFS_DPF(ASYNCIO, - ("nfs_asyncio: waiting for mount %p queue to drain\n", nmp)); + ("nfs_asyncio: waiting for mount %p queue to drain\n", nmp)); nmp->nm_bufqwant = TRUE; error = nfs_msleep(td, &nmp->nm_bufq, &nfs_iod_mtx, slpflag | PRIBIO, @@ -1430,7 +1426,7 @@ again: if (error) { error2 = nfs_sigintr(nmp, td); if (error2) { - mtx_unlock(&nfs_iod_mtx); + mtx_unlock(&nfs_iod_mtx); return (error2); } if (slpflag == NFS_PCATCH) { @@ -1442,17 +1438,13 @@ again: * We might have lost our iod while sleeping, * so check and loop if nescessary. */ - if (nmp->nm_bufqiods == 0) { - NFS_DPF(ASYNCIO, - ("nfs_asyncio: no iods after mount %p queue was drained, looping\n", nmp)); - goto again; - } + goto again; } /* We might have lost our nfsiod */ if (nmp->nm_bufqiods == 0) { NFS_DPF(ASYNCIO, - ("nfs_asyncio: no iods after mount %p queue was drained, looping\n", nmp)); +("nfs_asyncio: no iods after mount %p queue was drained, looping\n", nmp)); goto again; } Modified: stable/8/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- stable/8/sys/nfsclient/nfs_nfsiod.c Mon Nov 8 10:18:01 2010 (r214976) +++ stable/8/sys/nfsclient/nfs_nfsiod.c Mon Nov 8 10:23:39 2010 (r214977) @@ -76,16 +76,6 @@ static MALLOC_DEFINE(M_NFSSVC, "nfsclien static void nfssvc_iod(void *); -struct nfsiod_str { - STAILQ_ENTRY(nfsiod_str) ni_links; - int *ni_inst; - int ni_iod; - int ni_error; - int ni_done; -}; -static STAILQ_HEAD(, nfsiod_str) nfsiodhead = - STAILQ_HEAD_INITIALIZER(nfsiodhead); - static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; SYSCTL_DECL(_vfs_nfs); @@ -101,6 +91,8 @@ unsigned int nfs_iodmax = 20; /* Minimum number of nfsiod kthreads to keep as spares */ static unsigned int nfs_iodmin = 0; +static int nfs_nfsiodnew_sync(void); + static int sysctl_iodmin(SYSCTL_HANDLER_ARGS) { @@ -124,7 +116,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) * than the new minimum, create some more. */ for (i = nfs_iodmin - nfs_numasync; i > 0; i--) - nfs_nfsiodnew(0); + nfs_nfsiodnew_sync(); out: mtx_unlock(&nfs_iod_mtx); return (0); @@ -170,68 +162,55 @@ SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, sizeof (nfs_iodmax), sysctl_iodmax, "IU", "Max number of nfsiod kthreads"); +static int +nfs_nfsiodnew_sync(void) +{ + int error, i; + + mtx_assert(&nfs_iod_mtx, MA_OWNED); + for (i = 0; i < nfs_iodmax; i++) { + if (nfs_asyncdaemon[i] == 0) { + nfs_asyncdaemon[i] = 1; + break; + } + } + if (i == nfs_iodmax) + return (0); + mtx_unlock(&nfs_iod_mtx); + error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, + RFHIGHPID, 0, "nfsiod %d", i); + mtx_lock(&nfs_iod_mtx); + if (error == 0) { + nfs_numasync++; + nfs_iodwant[i] = NFSIOD_AVAILABLE; + } else + nfs_asyncdaemon[i] = 0; + return (error); +} + void nfs_nfsiodnew_tq(__unused void *arg, int pending) { - struct nfsiod_str *nip; mtx_lock(&nfs_iod_mtx); - while ((nip = STAILQ_FIRST(&nfsiodhead)) != NULL) { - STAILQ_REMOVE_HEAD(&nfsiodhead, ni_links); - mtx_unlock(&nfs_iod_mtx); - nip->ni_error = kproc_create(nfssvc_iod, nip->ni_inst, NULL, - RFHIGHPID, 0, "nfsiod %d", nip->ni_iod); - nip->ni_done = 1; - mtx_lock(&nfs_iod_mtx); - wakeup(nip); + while (pending > 0) { + pending--; + nfs_nfsiodnew_sync(); } mtx_unlock(&nfs_iod_mtx); } -int -nfs_nfsiodnew(int set_iodwant) +void +nfs_nfsiodnew(void) { - int error, i; - int newiod; - struct nfsiod_str *nip; - if (nfs_numasync >= nfs_iodmax) - return (-1); - newiod = -1; - for (i = 0; i < nfs_iodmax; i++) - if (nfs_asyncdaemon[i] == 0) { - nfs_asyncdaemon[i]++; - newiod = i; - break; - } - if (newiod == -1) - return (-1); - if (set_iodwant > 0) - nfs_iodwant[i] = NFSIOD_CREATED_FOR_NFS_ASYNCIO; - mtx_unlock(&nfs_iod_mtx); - nip = malloc(sizeof(*nip), M_TEMP, M_WAITOK | M_ZERO); - nip->ni_inst = nfs_asyncdaemon + i; - nip->ni_iod = newiod; - mtx_lock(&nfs_iod_mtx); - STAILQ_INSERT_TAIL(&nfsiodhead, nip, ni_links); + mtx_assert(&nfs_iod_mtx, MA_OWNED); taskqueue_enqueue(taskqueue_thread, &nfs_nfsiodnew_task); - while (!nip->ni_done) - mtx_sleep(nip, &nfs_iod_mtx, 0, "niwt", 0); - error = nip->ni_error; - free(nip, M_TEMP); - if (error) { - if (set_iodwant > 0) - nfs_iodwant[i] = NFSIOD_NOT_AVAILABLE; - return (-1); - } - nfs_numasync++; - return (newiod); } static void nfsiod_setup(void *dummy) { - int i; int error; TUNABLE_INT_FETCH("vfs.nfs.iodmin", &nfs_iodmin); @@ -240,8 +219,8 @@ nfsiod_setup(void *dummy) if (nfs_iodmin > NFS_MAXASYNCDAEMON) nfs_iodmin = NFS_MAXASYNCDAEMON; - for (i = 0; i < nfs_iodmin; i++) { - error = nfs_nfsiodnew(0); + while (nfs_numasync < nfs_iodmin) { + error = nfs_nfsiodnew_sync(); if (error == -1) panic("nfsiod_setup: nfs_nfsiodnew failed"); } Modified: stable/8/sys/nfsclient/nfsnode.h ============================================================================== --- stable/8/sys/nfsclient/nfsnode.h Mon Nov 8 10:18:01 2010 (r214976) +++ stable/8/sys/nfsclient/nfsnode.h Mon Nov 8 10:23:39 2010 (r214977) @@ -175,16 +175,13 @@ struct nfsnode { #define NFS_TIMESPEC_COMPARE(T1, T2) (((T1)->tv_sec != (T2)->tv_sec) || ((T1)->tv_nsec != (T2)->tv_nsec)) /* - * NFS iod threads can be in one of these three states once spawned. + * NFS iod threads can be in one of these two states once spawned. * NFSIOD_NOT_AVAILABLE - Cannot be assigned an I/O operation at this time. * NFSIOD_AVAILABLE - Available to be assigned an I/O operation. - * NFSIOD_CREATED_FOR_NFS_ASYNCIO - Newly created for nfs_asyncio() and - * will be used by the thread that called nfs_asyncio(). */ enum nfsiod_state { NFSIOD_NOT_AVAILABLE = 0, NFSIOD_AVAILABLE = 1, - NFSIOD_CREATED_FOR_NFS_ASYNCIO = 2, }; /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 10:39:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1418F106566C; Mon, 8 Nov 2010 10:39:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 012278FC1C; Mon, 8 Nov 2010 10:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8Ad255026192; Mon, 8 Nov 2010 10:39:02 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8Ad2Jn026190; Mon, 8 Nov 2010 10:39:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201011081039.oA8Ad2Jn026190@svn.freebsd.org> From: Rui Paulo Date: Mon, 8 Nov 2010 10:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214978 - in stable/8/lib: librtld_db libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 10:39:03 -0000 Author: rpaulo Date: Mon Nov 8 10:39:02 2010 New Revision: 214978 URL: http://svn.freebsd.org/changeset/base/214978 Log: MFC r210678, r210769: librtld_db is an rtld debugging helper library used by userland DTrace. Added: - copied from r210678, head/lib/librtld_db/ Directory Properties: stable/8/lib/librtld_db/ (props changed) Modified: stable/8/lib/librtld_db/librtld_db.3 Directory Properties: stable/8/lib/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) Modified: stable/8/lib/librtld_db/librtld_db.3 ============================================================================== --- head/lib/librtld_db/librtld_db.3 Sat Jul 31 14:26:10 2010 (r210678) +++ stable/8/lib/librtld_db/librtld_db.3 Mon Nov 8 10:39:02 2010 (r214978) @@ -44,7 +44,7 @@ .Fc .Ft char * .Fo rd_errstr -.Fa "rd_err_e rderr" +.Fa "rd_err_e rderr" .Fc .Ft rd_err_e .Fo rd_event_addr @@ -84,8 +84,8 @@ .Fc .Ft rd_err_e .Fo rd_plt_resolution -.Fa "rd_agent_t *rdap, uintptr_t pc, struct proc *proc -.Fa "uintptr_t plt_base, rd_plt_info_t *rpi" +.Fa "rd_agent_t *rdap, uintptr_t pc, struct proc *proc" +.Fa "uintptr_t plt_base, rd_plt_info_t *rpi" .Fc .Ft rd_err_e .Fo rd_reset @@ -101,7 +101,7 @@ This library must be used along with Most library functions take a .Ft rd_agent_t argument. -This argument is an opaque structure containing information associated with +This argument is an opaque structure containing information associated with the current status of the agent. .Pp Before you start using @@ -163,14 +163,6 @@ type error. The error codes are described in the header file for this library. You can get the error string using .Fn rd_errstr . -.Sh CAVEATS -The functions -.Fn rd_event_enable , -.Fn rd_log , -.Fn rd_objpad_enable -and -.Fn rd_plt_resolution -are not yet implemented. .Sh SEE ALSO .Xr ld 1 , .Xr ld-elf.so.1 1 , @@ -179,13 +171,21 @@ are not yet implemented. .Xr rtld 1 .Sh HISTORY The -.Nm librtld_db +.Nm librtld_db library first appeared in -.Fx 9.0 +.Fx 9.0 and was modeled after the same library present in the Solaris operating system. .Sh AUTHORS The .Nm librtld_db library and this manual page were written by -.An Rui Paulo Aq rpaulo@FreeBSD.org +.An Rui Paulo Aq rpaulo@FreeBSD.org under sponsorship from the FreeBSD Foundation. +.Sh CAVEATS +The functions +.Fn rd_event_enable , +.Fn rd_log , +.Fn rd_objpad_enable +and +.Fn rd_plt_resolution +are not yet implemented. From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 10:45:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81B31106564A; Mon, 8 Nov 2010 10:45:45 +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 6A0338FC12; Mon, 8 Nov 2010 10:45:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8AjjHC026592; Mon, 8 Nov 2010 10:45:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8AjjgM026584; Mon, 8 Nov 2010 10:45:45 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201011081045.oA8AjjgM026584@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 8 Nov 2010 10:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214979 - in vendor-crypto/openssh/dist: . contrib contrib/aix contrib/caldera contrib/cygwin contrib/redhat contrib/suse openbsd-compat regress X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 10:45:45 -0000 Author: des Date: Mon Nov 8 10:45:44 2010 New Revision: 214979 URL: http://svn.freebsd.org/changeset/base/214979 Log: Vendor import of OpenSSH 5.6p1 Added: vendor-crypto/openssh/dist/openbsd-compat/strptime.c (contents, props changed) Modified: vendor-crypto/openssh/dist/ChangeLog vendor-crypto/openssh/dist/Makefile.in vendor-crypto/openssh/dist/PROTOCOL.certkeys vendor-crypto/openssh/dist/PROTOCOL.mux vendor-crypto/openssh/dist/README vendor-crypto/openssh/dist/auth-options.c vendor-crypto/openssh/dist/auth-options.h vendor-crypto/openssh/dist/auth-rsa.c vendor-crypto/openssh/dist/auth.c vendor-crypto/openssh/dist/auth.h vendor-crypto/openssh/dist/auth1.c vendor-crypto/openssh/dist/auth2-hostbased.c vendor-crypto/openssh/dist/auth2-none.c vendor-crypto/openssh/dist/auth2-pubkey.c vendor-crypto/openssh/dist/authfd.c vendor-crypto/openssh/dist/authfile.c vendor-crypto/openssh/dist/authfile.h vendor-crypto/openssh/dist/bufaux.c vendor-crypto/openssh/dist/channels.c vendor-crypto/openssh/dist/channels.h vendor-crypto/openssh/dist/clientloop.c vendor-crypto/openssh/dist/clientloop.h vendor-crypto/openssh/dist/config.h.in vendor-crypto/openssh/dist/configure vendor-crypto/openssh/dist/configure.ac vendor-crypto/openssh/dist/contrib/aix/buildbff.sh vendor-crypto/openssh/dist/contrib/caldera/openssh.spec vendor-crypto/openssh/dist/contrib/cygwin/README vendor-crypto/openssh/dist/contrib/redhat/openssh.spec vendor-crypto/openssh/dist/contrib/ssh-copy-id vendor-crypto/openssh/dist/contrib/ssh-copy-id.1 vendor-crypto/openssh/dist/contrib/suse/openssh.spec vendor-crypto/openssh/dist/jpake.c vendor-crypto/openssh/dist/key.c vendor-crypto/openssh/dist/key.h vendor-crypto/openssh/dist/loginrec.h vendor-crypto/openssh/dist/misc.c vendor-crypto/openssh/dist/misc.h vendor-crypto/openssh/dist/moduli.0 vendor-crypto/openssh/dist/monitor.c vendor-crypto/openssh/dist/mux.c vendor-crypto/openssh/dist/myproposal.h vendor-crypto/openssh/dist/openbsd-compat/Makefile.in vendor-crypto/openssh/dist/openbsd-compat/openbsd-compat.h vendor-crypto/openssh/dist/openbsd-compat/openssl-compat.h vendor-crypto/openssh/dist/openbsd-compat/port-tun.c vendor-crypto/openssh/dist/openbsd-compat/port-uw.c vendor-crypto/openssh/dist/packet.c vendor-crypto/openssh/dist/readconf.c vendor-crypto/openssh/dist/readconf.h vendor-crypto/openssh/dist/regress/Makefile vendor-crypto/openssh/dist/regress/README.regress vendor-crypto/openssh/dist/regress/cert-hostkey.sh vendor-crypto/openssh/dist/regress/cert-userkey.sh vendor-crypto/openssh/dist/regress/login-timeout.sh vendor-crypto/openssh/dist/regress/reconfigure.sh vendor-crypto/openssh/dist/regress/reexec.sh vendor-crypto/openssh/dist/regress/test-exec.sh vendor-crypto/openssh/dist/scp.0 vendor-crypto/openssh/dist/scp.c vendor-crypto/openssh/dist/servconf.c vendor-crypto/openssh/dist/servconf.h vendor-crypto/openssh/dist/session.c vendor-crypto/openssh/dist/sftp-client.c vendor-crypto/openssh/dist/sftp-server.0 vendor-crypto/openssh/dist/sftp.0 vendor-crypto/openssh/dist/sftp.c vendor-crypto/openssh/dist/ssh-add.0 vendor-crypto/openssh/dist/ssh-add.c vendor-crypto/openssh/dist/ssh-agent.0 vendor-crypto/openssh/dist/ssh-agent.c vendor-crypto/openssh/dist/ssh-dss.c vendor-crypto/openssh/dist/ssh-keygen.0 vendor-crypto/openssh/dist/ssh-keygen.1 vendor-crypto/openssh/dist/ssh-keygen.c vendor-crypto/openssh/dist/ssh-keyscan.0 vendor-crypto/openssh/dist/ssh-keyscan.c vendor-crypto/openssh/dist/ssh-keysign.0 vendor-crypto/openssh/dist/ssh-keysign.8 vendor-crypto/openssh/dist/ssh-keysign.c vendor-crypto/openssh/dist/ssh-pkcs11-helper.0 vendor-crypto/openssh/dist/ssh-pkcs11.c vendor-crypto/openssh/dist/ssh-rand-helper.0 vendor-crypto/openssh/dist/ssh-rsa.c vendor-crypto/openssh/dist/ssh.0 vendor-crypto/openssh/dist/ssh.1 vendor-crypto/openssh/dist/ssh.c vendor-crypto/openssh/dist/ssh.h vendor-crypto/openssh/dist/ssh_config.0 vendor-crypto/openssh/dist/ssh_config.5 vendor-crypto/openssh/dist/sshconnect.c vendor-crypto/openssh/dist/sshconnect2.c vendor-crypto/openssh/dist/sshd.0 vendor-crypto/openssh/dist/sshd.8 vendor-crypto/openssh/dist/sshd.c vendor-crypto/openssh/dist/sshd_config.0 vendor-crypto/openssh/dist/sshd_config.5 vendor-crypto/openssh/dist/version.h Modified: vendor-crypto/openssh/dist/ChangeLog ============================================================================== --- vendor-crypto/openssh/dist/ChangeLog Mon Nov 8 10:39:02 2010 (r214978) +++ vendor-crypto/openssh/dist/ChangeLog Mon Nov 8 10:45:44 2010 (r214979) @@ -1,3 +1,522 @@ +20100823 + - (djm) Release OpenSSH-5.6p1 + +20100816 + - (dtucker) [configure.ac openbsd-compat/Makefile.in + openbsd-compat/openbsd-compat.h openbsd-compat/strptime.c] Add strptime to + the compat library which helps on platforms like old IRIX. Based on work + by djm, tested by Tom Christensen. + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/08/12 21:49:44 + [ssh.c] + close any extra file descriptors inherited from parent at start and + reopen stdin/stdout to /dev/null when forking for ControlPersist. + + prevents tools that fork and run a captive ssh for communication from + failing to exit when the ssh completes while they wait for these fds to + close. The inherited fds may persist arbitrarily long if a background + mux master has been started by ControlPersist. cvs and scp were effected + by this. + + "please commit" markus@ + - (djm) [regress/README.regress] typo + +20100812 + - (tim) [regress/login-timeout.sh regress/reconfigure.sh regress/reexec.sh + regress/test-exec.sh] Under certain conditions when testing with sudo + tests would fail because the pidfile could not be read by a regular user. + "cat: cannot open ...../regress/pidfile: Permission denied (error 13)" + Make sure cat is run by $SUDO. no objection from me. djm@ + - (tim) [auth.c] add cast to quiet compiler. Change only affects SVR5 systems. + +20100809 + - (djm) bz#1561: don't bother setting IFF_UP on tun(4) device if it is + already set. Makes FreeBSD user openable tunnels useful; patch from + richard.burakowski+ossh AT mrburak.net, ok dtucker@ + - (dtucker) bug #1530: strip trailing ":" from hostname in ssh-copy-id. + based in part on a patch from Colin Watson, ok djm@ + +20100809 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/08/08 16:26:42 + [version.h] + crank to 5.6 + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + +20100805 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/08/04 05:37:01 + [ssh.1 ssh_config.5 sshd.8] + Remove mentions of weird "addr/port" alternate address format for IPv6 + addresses combinations. It hasn't worked for ages and we have supported + the more commen "[addr]:port" format for a long time. ok jmc@ markus@ + - djm@cvs.openbsd.org 2010/08/04 05:40:39 + [PROTOCOL.certkeys ssh-keygen.c] + tighten the rules for certificate encoding by requiring that options + appear in lexical order and make our ssh-keygen comply. ok markus@ + - djm@cvs.openbsd.org 2010/08/04 05:42:47 + [auth.c auth2-hostbased.c authfile.c authfile.h ssh-keysign.8] + [ssh-keysign.c ssh.c] + enable certificates for hostbased authentication, from Iain Morgan; + "looks ok" markus@ + - djm@cvs.openbsd.org 2010/08/04 05:49:22 + [authfile.c] + commited the wrong version of the hostbased certificate diff; this + version replaces some strlc{py,at} verbosity with xasprintf() at + the request of markus@ + - djm@cvs.openbsd.org 2010/08/04 06:07:11 + [ssh-keygen.1 ssh-keygen.c] + Support CA keys in PKCS#11 tokens; feedback and ok markus@ + - djm@cvs.openbsd.org 2010/08/04 06:08:40 + [ssh-keysign.c] + clean for -Wuninitialized (Id sync only; portable had this change) + - djm@cvs.openbsd.org 2010/08/05 13:08:42 + [channels.c] + Fix a trio of bugs in the local/remote window calculation for datagram + data channels (i.e. TunnelForward): + + Calculate local_consumed correctly in channel_handle_wfd() by measuring + the delta to buffer_len(c->output) from when we start to when we finish. + The proximal problem here is that the output_filter we use in portable + modified the length of the dequeued datagram (to futz with the headers + for !OpenBSD). + + In channel_output_poll(), don't enqueue datagrams that won't fit in the + peer's advertised packet size (highly unlikely to ever occur) or which + won't fit in the peer's remaining window (more likely). + + In channel_input_data(), account for the 4-byte string header in + datagram packets that we accept from the peer and enqueue in c->output. + + report, analysis and testing 2/3 cases from wierbows AT us.ibm.com; + "looks good" markus@ + +20100803 + - (dtucker) [monitor.c] Bug #1795: Initialize the values to be returned from + PAM to sane values in case the PAM method doesn't write to them. Spotted by + Bitman Zhou, ok djm@. + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/07/16 04:45:30 + [ssh-keygen.c] + avoid bogus compiler warning + - djm@cvs.openbsd.org 2010/07/16 14:07:35 + [ssh-rsa.c] + more timing paranoia - compare all parts of the expected decrypted + data before returning. AFAIK not exploitable in the SSH protocol. + "groovy" deraadt@ + - djm@cvs.openbsd.org 2010/07/19 03:16:33 + [sftp-client.c] + bz#1797: fix swapped args in upload_dir_internal(), breaking recursive + upload depth checks and causing verbose printing of transfers to always + be turned on; patch from imorgan AT nas.nasa.gov + - djm@cvs.openbsd.org 2010/07/19 09:15:12 + [clientloop.c readconf.c readconf.h ssh.c ssh_config.5] + add a "ControlPersist" option that automatically starts a background + ssh(1) multiplex master when connecting. This connection can stay alive + indefinitely, or can be set to automatically close after a user-specified + duration of inactivity. bz#1330 - patch by dwmw2 AT infradead.org, but + further hacked on by wmertens AT cisco.com, apb AT cequrux.com, + martin-mindrot-bugzilla AT earth.li and myself; "looks ok" markus@ + - djm@cvs.openbsd.org 2010/07/21 02:10:58 + [misc.c] + sync timingsafe_bcmp() with the one dempsky@ committed to sys/lib/libkern + - dtucker@cvs.openbsd.org 2010/07/23 08:49:25 + [ssh.1] + Ciphers is documented in ssh_config(5) these days + +20100819 + - (dtucker) [contrib/ssh-copy-ud.1] Bug #1786: update ssh-copy-id.1 with more + details about its behaviour WRT existing directories. Patch from + asguthrie at gmail com, ok djm. + +20100716 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/07/02 04:32:44 + [misc.c] + unbreak strdelim() skipping past quoted strings, e.g. + AllowUsers "blah blah" blah + was broken; report and fix in bz#1757 from bitman.zhou AT centrify.com + ok dtucker; + - djm@cvs.openbsd.org 2010/07/12 22:38:52 + [ssh.c] + Make ExitOnForwardFailure work with fork-after-authentication ("ssh -f") + for protocol 2. ok markus@ + - djm@cvs.openbsd.org 2010/07/12 22:41:13 + [ssh.c ssh_config.5] + expand %h to the hostname in ssh_config Hostname options. While this + sounds useless, it is actually handy for working with unqualified + hostnames: + + Host *.* + Hostname %h + Host * + Hostname %h.example.org + + "I like it" markus@ + - djm@cvs.openbsd.org 2010/07/13 11:52:06 + [auth-rsa.c channels.c jpake.c key.c misc.c misc.h monitor.c] + [packet.c ssh-rsa.c] + implement a timing_safe_cmp() function to compare memory without leaking + timing information by short-circuiting like memcmp() and use it for + some of the more sensitive comparisons (though nothing high-value was + readily attackable anyway); "looks ok" markus@ + - djm@cvs.openbsd.org 2010/07/13 23:13:16 + [auth-rsa.c channels.c jpake.c key.c misc.c misc.h monitor.c packet.c] + [ssh-rsa.c] + s/timing_safe_cmp/timingsafe_bcmp/g + - jmc@cvs.openbsd.org 2010/07/14 17:06:58 + [ssh.1] + finally ssh synopsis looks nice again! this commit just removes a ton of + hacks we had in place to make it work with old groff; + - schwarze@cvs.openbsd.org 2010/07/15 21:20:38 + [ssh-keygen.1] + repair incorrect block nesting, which screwed up indentation; + problem reported and fix OK by jmc@ + +20100714 + - (tim) [contrib/redhat/openssh.spec] Bug 1796: Test for skip_x11_askpass + (line 77) should have been for no_x11_askpass. + +20100702 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/06/26 00:57:07 + [ssh_config.5] + tweak previous; + - djm@cvs.openbsd.org 2010/06/26 23:04:04 + [ssh.c] + oops, forgot to #include ; spotted and patch from chl@ + - djm@cvs.openbsd.org 2010/06/29 23:15:30 + [ssh-keygen.1 ssh-keygen.c] + allow import (-i) and export (-e) of PEM and PKCS#8 encoded keys; + bz#1749; ok markus@ + - djm@cvs.openbsd.org 2010/06/29 23:16:46 + [auth2-pubkey.c sshd_config.5] + allow key options (command="..." and friends) in AuthorizedPrincipals; + ok markus@ + - jmc@cvs.openbsd.org 2010/06/30 07:24:25 + [ssh-keygen.1] + tweak previous; + - jmc@cvs.openbsd.org 2010/06/30 07:26:03 + [ssh-keygen.c] + sort usage(); + - jmc@cvs.openbsd.org 2010/06/30 07:28:34 + [sshd_config.5] + tweak previous; + - millert@cvs.openbsd.org 2010/07/01 13:06:59 + [scp.c] + Fix a longstanding problem where if you suspend scp at the + password/passphrase prompt the terminal mode is not restored. + OK djm@ + - phessler@cvs.openbsd.org 2010/06/27 19:19:56 + [regress/Makefile] + fix how we run the tests so we can successfully use SUDO='sudo -E' + in our env + - djm@cvs.openbsd.org 2010/06/29 23:59:54 + [cert-userkey.sh] + regress tests for key options in AuthorizedPrincipals + +20100627 + - (tim) [openbsd-compat/port-uw.c] Reorder includes. auth-options.h now needs + key.h. + +20100626 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/05/21 05:00:36 + [misc.c] + colon() returns char*, so s/return (0)/return NULL/ + - markus@cvs.openbsd.org 2010/06/08 21:32:19 + [ssh-pkcs11.c] + check length of value returned C_GetAttributValue for != 0 + from mdrtbugzilla@codefive.co.uk; bugzilla #1773; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/17 07:07:30 + [mux.c] + Correct sizing of object to be allocated by calloc(), replacing + sizeof(state) with sizeof(*state). This worked by accident since + the struct contained a single int at present, but could have broken + in the future. patch from hyc AT symas.com + - djm@cvs.openbsd.org 2010/06/18 00:58:39 + [sftp.c] + unbreak ls in working directories that contains globbing characters in + their pathnames. bz#1655 reported by vgiffin AT apple.com + - djm@cvs.openbsd.org 2010/06/18 03:16:03 + [session.c] + Missing check for chroot_director == "none" (we already checked against + NULL); bz#1564 from Jan.Pechanec AT Sun.COM + - djm@cvs.openbsd.org 2010/06/18 04:43:08 + [sftp-client.c] + fix memory leak in do_realpath() error path; bz#1771, patch from + anicka AT suse.cz + - djm@cvs.openbsd.org 2010/06/22 04:22:59 + [servconf.c sshd_config.5] + expose some more sshd_config options inside Match blocks: + AuthorizedKeysFile AuthorizedPrincipalsFile + HostbasedUsesNameFromPacketOnly PermitTunnel + bz#1764; feedback from imorgan AT nas.nasa.gov; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/22 04:32:06 + [ssh-keygen.c] + standardise error messages when attempting to open private key + files to include "progname: filename: error reason" + bz#1783; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/22 04:49:47 + [auth.c] + queue auth debug messages for bad ownership or permissions on the user's + keyfiles. These messages will be sent after the user has successfully + authenticated (where our client will display them with LogLevel=debug). + bz#1554; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/22 04:54:30 + [ssh-keyscan.c] + replace verbose and overflow-prone Linebuf code with read_keyfile_line() + based on patch from joachim AT joachimschipper.nl; bz#1565; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/22 04:59:12 + [session.c] + include the user name on "subsystem request for ..." log messages; + bz#1571; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/23 02:59:02 + [ssh-keygen.c] + fix printing of extensions in v01 certificates that I broke in r1.190 + - djm@cvs.openbsd.org 2010/06/25 07:14:46 + [channels.c mux.c readconf.c readconf.h ssh.h] + bz#1327: remove hardcoded limit of 100 permitopen clauses and port + forwards per direction; ok markus@ stevesk@ + - djm@cvs.openbsd.org 2010/06/25 07:20:04 + [channels.c session.c] + bz#1750: fix requirement for /dev/null inside ChrootDirectory for + internal-sftp accidentally introduced in r1.253 by removing the code + that opens and dup /dev/null to stderr and modifying the channels code + to read stderr but discard it instead; ok markus@ + - djm@cvs.openbsd.org 2010/06/25 08:46:17 + [auth1.c auth2-none.c] + skip the initial check for access with an empty password when + PermitEmptyPasswords=no; bz#1638; ok markus@ + - djm@cvs.openbsd.org 2010/06/25 23:10:30 + [ssh.c] + log the hostname and address that we connected to at LogLevel=verbose + after authentication is successful to mitigate "phishing" attacks by + servers with trusted keys that accept authentication silently and + automatically before presenting fake password/passphrase prompts; + "nice!" markus@ + - djm@cvs.openbsd.org 2010/06/25 23:10:30 + [ssh.c] + log the hostname and address that we connected to at LogLevel=verbose + after authentication is successful to mitigate "phishing" attacks by + servers with trusted keys that accept authentication silently and + automatically before presenting fake password/passphrase prompts; + "nice!" markus@ + +20100622 + - (djm) [loginrec.c] crank LINFO_NAMESIZE (username length) to 512 + bz#1579; ok dtucker + +20100618 + - (djm) [contrib/ssh-copy-id] Update key file explicitly under ~ + rather than assuming that $CWD == $HOME. bz#1500, patch from + timothy AT gelter.com + +20100617 + - (tim) [contrib/cygwin/README] Remove a reference to the obsolete + minires-devel package, and to add the reference to the libedit-devel + package since CYgwin now provides libedit. Patch from Corinna Vinschen. + +20100521 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/05/07 11:31:26 + [regress/Makefile regress/cert-userkey.sh] + regress tests for AuthorizedPrincipalsFile and "principals=" key option. + feedback and ok markus@ + - djm@cvs.openbsd.org 2010/05/11 02:58:04 + [auth-rsa.c] + don't accept certificates marked as "cert-authority" here; ok markus@ + - djm@cvs.openbsd.org 2010/05/14 00:47:22 + [ssh-add.c] + check that the certificate matches the corresponding private key before + grafting it on + - djm@cvs.openbsd.org 2010/05/14 23:29:23 + [channels.c channels.h mux.c ssh.c] + Pause the mux channel while waiting for reply from aynch callbacks. + Prevents misordering of replies if new requests arrive while waiting. + + Extend channel open confirm callback to allow signalling failure + conditions as well as success. Use this to 1) fix a memory leak, 2) + start using the above pause mechanism and 3) delay sending a success/ + failure message on mux slave session open until we receive a reply from + the server. + + motivated by and with feedback from markus@ + - markus@cvs.openbsd.org 2010/05/16 12:55:51 + [PROTOCOL.mux clientloop.h mux.c readconf.c readconf.h ssh.1 ssh.c] + mux support for remote forwarding with dynamic port allocation, + use with + LPORT=`ssh -S muxsocket -R0:localhost:25 -O forward somehost` + feedback and ok djm@ + - djm@cvs.openbsd.org 2010/05/20 11:25:26 + [auth2-pubkey.c] + fix logspam when key options (from="..." especially) deny non-matching + keys; reported by henning@ also bz#1765; ok markus@ dtucker@ + - djm@cvs.openbsd.org 2010/05/20 23:46:02 + [PROTOCOL.certkeys auth-options.c ssh-keygen.c] + Move the permit-* options to the non-critical "extensions" field for v01 + certificates. The logic is that if another implementation fails to + implement them then the connection just loses features rather than fails + outright. + + ok markus@ + +20100511 + - (dtucker) [Makefile.in] Bug #1770: Link libopenbsd-compat twice to solve + circular dependency problem on old or odd platforms. From Tom Lane, ok + djm@. + - (djm) [openbsd-compat/openssl-compat.h] Fix build breakage on older + libcrypto by defining OPENSSL_[DR]SA_MAX_MODULUS_BITS if they aren't + already. ok dtucker@ + +20100510 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/04/23 01:47:41 + [ssh-keygen.c] + bz#1740: display a more helpful error message when $HOME is + inaccessible while trying to create .ssh directory. Based on patch + from jchadima AT redhat.com; ok dtucker@ + - djm@cvs.openbsd.org 2010/04/23 22:27:38 + [mux.c] + set "detach_close" flag when registering channel cleanup callbacks. + This causes the channel to close normally when its fds close and + hangs when terminating a mux slave using ~. bz#1758; ok markus@ + - djm@cvs.openbsd.org 2010/04/23 22:42:05 + [session.c] + set stderr to /dev/null for subsystems rather than just closing it. + avoids hangs if a subsystem or shell initialisation writes to stderr. + bz#1750; ok markus@ + - djm@cvs.openbsd.org 2010/04/23 22:48:31 + [ssh-keygen.c] + refuse to generate keys longer than OPENSSL_[RD]SA_MAX_MODULUS_BITS, + since we would refuse to use them anyway. bz#1516; ok dtucker@ + - djm@cvs.openbsd.org 2010/04/26 22:28:24 + [sshconnect2.c] + bz#1502: authctxt.success is declared as an int, but passed by + reference to function that accepts sig_atomic_t*. Convert it to + the latter; ok markus@ dtucker@ + - djm@cvs.openbsd.org 2010/05/01 02:50:50 + [PROTOCOL.certkeys] + typo; jmeltzer@ + - dtucker@cvs.openbsd.org 2010/05/05 04:22:09 + [sftp.c] + restore mput and mget which got lost in the tab-completion changes. + found by Kenneth Whitaker, ok djm@ + - djm@cvs.openbsd.org 2010/05/07 11:30:30 + [auth-options.c auth-options.h auth.c auth.h auth2-pubkey.c] + [key.c servconf.c servconf.h sshd.8 sshd_config.5] + add some optional indirection to matching of principal names listed + in certificates. Currently, a certificate must include the a user's name + to be accepted for authentication. This change adds the ability to + specify a list of certificate principal names that are acceptable. + + When authenticating using a CA trusted through ~/.ssh/authorized_keys, + this adds a new principals="name1[,name2,...]" key option. + + For CAs listed through sshd_config's TrustedCAKeys option, a new config + option "AuthorizedPrincipalsFile" specifies a per-user file containing + the list of acceptable names. + + If either option is absent, the current behaviour of requiring the + username to appear in principals continues to apply. + + These options are useful for role accounts, disjoint account namespaces + and "user@realm"-style naming policies in certificates. + + feedback and ok markus@ + - jmc@cvs.openbsd.org 2010/05/07 12:49:17 + [sshd_config.5] + tweak previous; + +20100423 + - (dtucker) [configure.ac] Bug #1756: Check for the existence of a lib64 dir + in the openssl install directory (some newer openssl versions do this on at + least some amd64 platforms). + +20100418 + - OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/04/16 06:45:01 + [ssh_config.5] + tweak previous; ok djm + - jmc@cvs.openbsd.org 2010/04/16 06:47:04 + [ssh-keygen.1 ssh-keygen.c] + tweak previous; ok djm + - djm@cvs.openbsd.org 2010/04/16 21:14:27 + [sshconnect.c] + oops, %r => remote username, not %u + - djm@cvs.openbsd.org 2010/04/16 01:58:45 + [regress/cert-hostkey.sh regress/cert-userkey.sh] + regression tests for v01 certificate format + includes interop tests for v00 certs + - (dtucker) [contrib/aix/buildbff.sh] Fix creation of ssh_prng_cmds.default + file. + +20100416 + - (djm) Release openssh-5.5p1 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/03/26 03:13:17 + [bufaux.c] + allow buffer_get_int_ret/buffer_get_int64_ret to take a NULL pointer + argument to allow skipping past values in a buffer + - jmc@cvs.openbsd.org 2010/03/26 06:54:36 + [ssh.1] + tweak previous; + - jmc@cvs.openbsd.org 2010/03/27 14:26:55 + [ssh_config.5] + tweak previous; ok dtucker + - djm@cvs.openbsd.org 2010/04/10 00:00:16 + [ssh.c] + bz#1746 - suppress spurious tty warning when using -O and stdin + is not a tty; ok dtucker@ markus@ + - djm@cvs.openbsd.org 2010/04/10 00:04:30 + [sshconnect.c] + fix terminology: we didn't find a certificate in known_hosts, we found + a CA key + - djm@cvs.openbsd.org 2010/04/10 02:08:44 + [clientloop.c] + bz#1698: kill channel when pty allocation requests fail. Fixed + stuck client if the server refuses pty allocation. + ok dtucker@ "think so" markus@ + - djm@cvs.openbsd.org 2010/04/10 02:10:56 + [sshconnect2.c] + show the key type that we are offering in debug(), helps distinguish + between certs and plain keys as the path to the private key is usually + the same. + - djm@cvs.openbsd.org 2010/04/10 05:48:16 + [mux.c] + fix NULL dereference; from matthew.haub AT alumni.adelaide.edu.au + - djm@cvs.openbsd.org 2010/04/14 22:27:42 + [ssh_config.5 sshconnect.c] + expand %r => remote username in ssh_config:ProxyCommand; + ok deraadt markus + - markus@cvs.openbsd.org 2010/04/15 20:32:55 + [ssh-pkcs11.c] + retry lookup for private key if there's no matching key with CKA_SIGN + attribute enabled; this fixes fixes MuscleCard support (bugzilla #1736) + ok djm@ + - djm@cvs.openbsd.org 2010/04/16 01:47:26 + [PROTOCOL.certkeys auth-options.c auth-options.h auth-rsa.c] + [auth2-pubkey.c authfd.c key.c key.h myproposal.h ssh-add.c] + [ssh-agent.c ssh-dss.c ssh-keygen.1 ssh-keygen.c ssh-rsa.c] + [sshconnect.c sshconnect2.c sshd.c] + revised certificate format ssh-{dss,rsa}-cert-v01@openssh.com with the + following changes: + + move the nonce field to the beginning of the certificate where it can + better protect against chosen-prefix attacks on the signature hash + + Rename "constraints" field to "critical options" + + Add a new non-critical "extensions" field + + Add a serial number + + The older format is still support for authentication and cert generation + (use "ssh-keygen -t v00 -s ca_key ..." to generate a v00 certificate) + + ok markus@ + 20100410 - (dtucker) [configure.ac] Put the check for the existence of getaddrinfo back so we disable the IPv6 tests if we don't have it. Modified: vendor-crypto/openssh/dist/Makefile.in ============================================================================== --- vendor-crypto/openssh/dist/Makefile.in Mon Nov 8 10:39:02 2010 (r214978) +++ vendor-crypto/openssh/dist/Makefile.in Mon Nov 8 10:45:44 2010 (r214979) @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.309 2010/03/13 21:41:34 djm Exp $ +# $Id: Makefile.in,v 1.310 2010/05/12 06:51:39 dtucker Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -160,7 +160,7 @@ ssh-keysign$(EXEEXT): $(LIBCOMPAT) libss $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-pkcs11-helper.o ssh-pkcs11.o - $(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) + $(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) Modified: vendor-crypto/openssh/dist/PROTOCOL.certkeys ============================================================================== --- vendor-crypto/openssh/dist/PROTOCOL.certkeys Mon Nov 8 10:39:02 2010 (r214978) +++ vendor-crypto/openssh/dist/PROTOCOL.certkeys Mon Nov 8 10:45:44 2010 (r214979) @@ -16,7 +16,7 @@ These protocol extensions build on the s system already in SSH to allow certificate-based authentication. The certificates used are not traditional X.509 certificates, with numerous options and complex encoding rules, but something rather -more minimal: a key, some identity information and usage constraints +more minimal: a key, some identity information and usage options that have been signed with some other trusted key. A sshd server may be configured to allow authentication via certified @@ -27,7 +27,7 @@ of acceptance of certified host keys, by to specify CA keys in ~/.ssh/known_hosts. Certified keys are represented using two new key types: -ssh-rsa-cert-v00@openssh.com and ssh-dss-cert-v00@openssh.com that +ssh-rsa-cert-v01@openssh.com and ssh-dss-cert-v01@openssh.com that include certification information along with the public key that is used to sign challenges. ssh-keygen performs the CA signing operation. @@ -47,7 +47,7 @@ in RFC4252 section 7. New public key formats ---------------------- -The ssh-rsa-cert-v00@openssh.com and ssh-dss-cert-v00@openssh.com key +The ssh-rsa-cert-v01@openssh.com and ssh-dss-cert-v01@openssh.com key types take a similar high-level format (note: data types and encoding are as per RFC4251 section 5). The serialised wire encoding of these certificates is also used for storing them on disk. @@ -57,42 +57,55 @@ these certificates is also used for stor RSA certificate - string "ssh-rsa-cert-v00@openssh.com" + string "ssh-rsa-cert-v01@openssh.com" + string nonce mpint e mpint n + uint64 serial uint32 type string key id string valid principals uint64 valid after uint64 valid before - string constraints - string nonce + string critical options + string extensions string reserved string signature key string signature DSA certificate - string "ssh-dss-cert-v00@openssh.com" + string "ssh-dss-cert-v01@openssh.com" + string nonce mpint p mpint q mpint g mpint y + uint64 serial uint32 type string key id string valid principals uint64 valid after uint64 valid before - string constraints - string nonce + string critical options + string extensions string reserved string signature key string signature +The nonce field is a CA-provided random bitstring of arbitrary length +(but typically 16 or 32 bytes) included to make attacks that depend on +inducing collisions in the signature hash infeasible. + e and n are the RSA exponent and public modulus respectively. p, q, g, y are the DSA parameters as described in FIPS-186-2. +serial is an optional certificate serial number set by the CA to +provide an abbreviated way to refer to certificates from that CA. +If a CA does not wish to number its certificates it must set this +field to zero. + type specifies whether this certificate is for identification of a user or a host using a SSH_CERT_TYPE_... value. @@ -112,13 +125,15 @@ certificate. Each represents a time in s 00:00:00. A certificate is considered valid if: valid after <= current time < valid before -constraints is a set of zero or more key constraints encoded as below. +criticial options is a set of zero or more key options encoded as +below. All such options are "critical" in the sense that an implementation +must refuse to authorise a key that has an unrecognised option. + +extensions is a set of zero or more optional extensions. These extensions +are not critical, and an implementation that encounters one that it does +not recognise may safely ignore it. -The nonce field is a CA-provided random bitstring of arbitrary length -(but typically 16 or 32 bytes) included to make attacks that depend on -inducing collisions in the signature hash infeasible. - -The reserved field is current unused and is ignored in this version of +The reserved field is currently unused and is ignored in this version of the protocol. signature key contains the CA key used to sign the certificate. @@ -132,22 +147,25 @@ up to, and including the signature key. encoded according to the rules defined for the CA's public key algorithm (RFC4253 section 6.6 for ssh-rsa and ssh-dss). -Constraints ------------ +Critical options +---------------- -The constraints section of the certificate specifies zero or more -constraints on the certificates validity. The format of this field +The critical options section of the certificate specifies zero or more +options on the certificates validity. The format of this field is a sequence of zero or more tuples: string name string data -The name field identifies the constraint and the data field encodes -constraint-specific information (see below). All constraints are -"critical", if an implementation does not recognise a constraint +Options must be lexically ordered by "name" if they appear in the +sequence. + +The name field identifies the option and the data field encodes +option-specific information (see below). All options are +"critical", if an implementation does not recognise a option then the validating party should refuse to accept the certificate. -The supported constraints and the contents and structure of their +The supported options and the contents and structure of their data fields are: Name Format Description @@ -157,37 +175,51 @@ force-command string Sp ssh command-line) whenever this key is used for authentication. +source-address string Comma-separated list of source addresses + from which this certificate is accepted + for authentication. Addresses are + specified in CIDR format (nn.nn.nn.nn/nn + or hhhh::hhhh/nn). + If this option is not present then + certificates may be presented from any + source address. + +Extensions +---------- + +The extensions section of the certificate specifies zero or more +non-critical certificate extensions. The encoding and ordering of +extensions in this field is identical to that of the critical options. +If an implementation does not recognise an extension, then it should +ignore it. + +The supported extensions and the contents and structure of their data +fields are: + +Name Format Description +----------------------------------------------------------------------------- permit-X11-forwarding empty Flag indicating that X11 forwarding should be permitted. X11 forwarding will - be refused if this constraint is absent. + be refused if this option is absent. permit-agent-forwarding empty Flag indicating that agent forwarding should be allowed. Agent forwarding must not be permitted unless this - constraint is present. + option is present. permit-port-forwarding empty Flag indicating that port-forwarding - should be allowed. If this constraint is + should be allowed. If this option is not present then no port forwarding will be allowed. permit-pty empty Flag indicating that PTY allocation should be permitted. In the absence of - this constraint PTY allocation will be + this option PTY allocation will be disabled. permit-user-rc empty Flag indicating that execution of ~/.ssh/rc should be permitted. Execution of this script will not be permitted if - this constraint is not present. - -source-address string Comma-separated list of source addresses - from which this certificate is accepted - for authentication. Addresses are - specified in CIDR format (nn.nn.nn.nn/nn - or hhhh::hhhh/nn). - If this constraint is not present then - certificates may be presented from any - source address. + this option is not present. -$OpenBSD: PROTOCOL.certkeys,v 1.3 2010/03/03 22:50:40 djm Exp $ +$OpenBSD: PROTOCOL.certkeys,v 1.7 2010/08/04 05:40:39 djm Exp $ Modified: vendor-crypto/openssh/dist/PROTOCOL.mux ============================================================================== --- vendor-crypto/openssh/dist/PROTOCOL.mux Mon Nov 8 10:39:02 2010 (r214978) +++ vendor-crypto/openssh/dist/PROTOCOL.mux Mon Nov 8 10:45:44 2010 (r214979) @@ -109,8 +109,14 @@ A client may request the master to estab forwarding type may be MUX_FWD_LOCAL, MUX_FWD_REMOTE, MUX_FWD_DYNAMIC. -A server may reply with a MUX_S_OK, a MUX_S_PERMISSION_DENIED or a -MUX_S_FAILURE. +A server may reply with a MUX_S_OK, a MUX_S_REMOTE_PORT, a +MUX_S_PERMISSION_DENIED or a MUX_S_FAILURE. + +For dynamically allocated listen port the server replies with + + uint32 MUX_S_REMOTE_PORT + uint32 client request id + uint32 allocated remote listen port 5. Requesting closure of port forwards @@ -178,6 +184,7 @@ The MUX_S_PERMISSION_DENIED and MUX_S_FA #define MUX_S_EXIT_MESSAGE 0x80000004 #define MUX_S_ALIVE 0x80000005 #define MUX_S_SESSION_OPENED 0x80000006 +#define MUX_S_REMOTE_PORT 0x80000007 #define MUX_FWD_LOCAL 1 #define MUX_FWD_REMOTE 2 @@ -193,4 +200,4 @@ XXX server->client error/warning notific XXX port0 rfwd (need custom response message) XXX send signals via mux -$OpenBSD: PROTOCOL.mux,v 1.1 2010/01/26 01:28:35 djm Exp $ +$OpenBSD: PROTOCOL.mux,v 1.2 2010/05/16 12:55:51 markus Exp $ Modified: vendor-crypto/openssh/dist/README ============================================================================== --- vendor-crypto/openssh/dist/README Mon Nov 8 10:39:02 2010 (r214978) +++ vendor-crypto/openssh/dist/README Mon Nov 8 10:45:44 2010 (r214979) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-5.5 for the release notes. +See http://www.openssh.com/txt/release-5.6 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.73 2010/03/21 19:11:55 djm Exp $ +$Id: README,v 1.74 2010/08/08 16:32:06 djm Exp $ Modified: vendor-crypto/openssh/dist/auth-options.c ============================================================================== --- vendor-crypto/openssh/dist/auth-options.c Mon Nov 8 10:39:02 2010 (r214978) +++ vendor-crypto/openssh/dist/auth-options.c Mon Nov 8 10:45:44 2010 (r214979) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.49 2010/03/16 15:46:52 stevesk Exp $ */ +/* $OpenBSD: auth-options.c,v 1.52 2010/05/20 23:46:02 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -27,10 +27,10 @@ #include "canohost.h" #include "buffer.h" #include "channels.h" -#include "auth-options.h" #include "servconf.h" #include "misc.h" #include "key.h" +#include "auth-options.h" #include "hostfile.h" #include "auth.h" #ifdef GSSAPI @@ -55,6 +55,9 @@ struct envstring *custom_environment = N /* "tunnel=" option. */ int forced_tun_device = -1; +/* "principals=" option. */ +char *authorized_principals = NULL; + extern ServerOptions options; void @@ -76,6 +79,10 @@ auth_clear_options(void) xfree(forced_command); forced_command = NULL; } + if (authorized_principals) { + xfree(authorized_principals); + authorized_principals = NULL; + } forced_tun_device = -1; channel_clear_permitted_opens(); } @@ -141,6 +148,8 @@ auth_parse_options(struct passwd *pw, ch cp = "command=\""; if (strncasecmp(opts, cp, strlen(cp)) == 0) { opts += strlen(cp); + if (forced_command != NULL) + xfree(forced_command); forced_command = xmalloc(strlen(opts) + 1); i = 0; while (*opts) { @@ -167,6 +176,38 @@ auth_parse_options(struct passwd *pw, ch opts++; goto next_option; } + cp = "principals=\""; + if (strncasecmp(opts, cp, strlen(cp)) == 0) { + opts += strlen(cp); + if (authorized_principals != NULL) + xfree(authorized_principals); + authorized_principals = xmalloc(strlen(opts) + 1); + i = 0; + while (*opts) { + if (*opts == '"') + break; + if (*opts == '\\' && opts[1] == '"') { + opts += 2; + authorized_principals[i++] = '"'; + continue; + } + authorized_principals[i++] = *opts++; + } + if (!*opts) { + debug("%.100s, line %lu: missing end quote", + file, linenum); + auth_debug_add("%.100s, line %lu: missing end quote", + file, linenum); + xfree(authorized_principals); + authorized_principals = NULL; + goto bad_option; + } + authorized_principals[i] = '\0'; + auth_debug_add("principals: %.900s", + authorized_principals); + opts++; + goto next_option; + } cp = "environment=\""; if (options.permit_user_env && strncasecmp(opts, cp, strlen(cp)) == 0) { @@ -376,123 +417,147 @@ bad_option: return 0; } -/* - * Set options from certificate constraints. These supersede user key options - * so this must be called after auth_parse_options(). - */ -int -auth_cert_constraints(Buffer *c_orig, struct passwd *pw) +#define OPTIONS_CRITICAL 1 +#define OPTIONS_EXTENSIONS 2 +static int +parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw, + u_int which, int crit, + int *cert_no_port_forwarding_flag, + int *cert_no_agent_forwarding_flag, + int *cert_no_x11_forwarding_flag, + int *cert_no_pty_flag, + int *cert_no_user_rc, + char **cert_forced_command, + int *cert_source_address_done) { + char *command, *allowed; + const char *remote_ip; u_char *name = NULL, *data_blob = NULL; u_int nlen, dlen, clen; Buffer c, data; - int ret = -1; - - int cert_no_port_forwarding_flag = 1; - int cert_no_agent_forwarding_flag = 1; - int cert_no_x11_forwarding_flag = 1; - int cert_no_pty_flag = 1; - int cert_no_user_rc = 1; - char *cert_forced_command = NULL; - int cert_source_address_done = 0; + int ret = -1, found; buffer_init(&data); /* Make copy to avoid altering original */ buffer_init(&c); - buffer_append(&c, buffer_ptr(c_orig), buffer_len(c_orig)); + buffer_append(&c, optblob, optblob_len); while (buffer_len(&c) > 0) { if ((name = buffer_get_string_ret(&c, &nlen)) == NULL || (data_blob = buffer_get_string_ret(&c, &dlen)) == NULL) { - error("Certificate constraints corrupt"); + error("Certificate options corrupt"); goto out; } buffer_append(&data, data_blob, dlen); - debug3("found certificate constraint \"%.100s\" len %u", + debug3("found certificate option \"%.100s\" len %u", name, dlen); if (strlen(name) != nlen) { error("Certificate constraint name contains \\0"); goto out; } - if (strcmp(name, "permit-X11-forwarding") == 0) - cert_no_x11_forwarding_flag = 0; - else if (strcmp(name, "permit-agent-forwarding") == 0) - cert_no_agent_forwarding_flag = 0; - else if (strcmp(name, "permit-port-forwarding") == 0) - cert_no_port_forwarding_flag = 0; - else if (strcmp(name, "permit-pty") == 0) - cert_no_pty_flag = 0; - else if (strcmp(name, "permit-user-rc") == 0) - cert_no_user_rc = 0; - else if (strcmp(name, "force-command") == 0) { - char *command = buffer_get_string_ret(&data, &clen); - - if (command == NULL) { - error("Certificate constraint \"%s\" corrupt", - name); - goto out; - } - if (strlen(command) != clen) { - error("force-command constraint contains \\0"); - goto out; - } - if (cert_forced_command != NULL) { - error("Certificate has multiple " - "force-command constraints"); - xfree(command); - goto out; - } - cert_forced_command = command; - } else if (strcmp(name, "source-address") == 0) { - char *allowed = buffer_get_string_ret(&data, &clen); - const char *remote_ip = get_remote_ipaddr(); - - if (allowed == NULL) { - error("Certificate constraint \"%s\" corrupt", - name); - goto out; - } - if (strlen(allowed) != clen) { - error("source-address constraint contains \\0"); - goto out; - } - if (cert_source_address_done++) { - error("Certificate has multiple " - "source-address constraints"); - xfree(allowed); - goto out; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 10:46:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D899E1065673; Mon, 8 Nov 2010 10:46:51 +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 AC8F78FC0A; Mon, 8 Nov 2010 10:46:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8Akprd026730; Mon, 8 Nov 2010 10:46:51 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8AkpOB026729; Mon, 8 Nov 2010 10:46:51 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201011081046.oA8AkpOB026729@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 8 Nov 2010 10:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214980 - vendor-crypto/openssh/5.6p1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 10:46:51 -0000 Author: des Date: Mon Nov 8 10:46:51 2010 New Revision: 214980 URL: http://svn.freebsd.org/changeset/base/214980 Log: Tag OpenSSH 5.5p1 Added: vendor-crypto/openssh/5.6p1/ - copied from r214979, vendor-crypto/openssh/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 11:22:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36538106564A; Mon, 8 Nov 2010 11:22:56 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4608FC15; Mon, 8 Nov 2010 11:22:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8BMuou028125; Mon, 8 Nov 2010 11:22:56 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8BMte8028123; Mon, 8 Nov 2010 11:22:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201011081122.oA8BMte8028123@svn.freebsd.org> From: Rui Paulo Date: Mon, 8 Nov 2010 11:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214981 - in stable/8/lib: . libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 11:22:56 -0000 Author: rpaulo Date: Mon Nov 8 11:22:55 2010 New Revision: 214981 URL: http://svn.freebsd.org/changeset/base/214981 Log: MFC r210682, r210683, r210690: Build librtld_db. Simplify the Makefile. The i386 and amd64 sections are equal. libproc is going to be i386/amd64 only with the next update. Modified: stable/8/lib/Makefile Directory Properties: stable/8/lib/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) Modified: stable/8/lib/Makefile ============================================================================== --- stable/8/lib/Makefile Mon Nov 8 10:46:51 2010 (r214980) +++ stable/8/lib/Makefile Mon Nov 8 11:22:55 2010 (r214981) @@ -86,8 +86,9 @@ SUBDIR= ${SUBDIR_ORDERED} \ libpam \ libpcap \ ${_libpmc} \ - libproc \ + ${_libproc} \ librt \ + ${_librtld_db} \ ${_libsdp} \ ${_libsm} \ ${_libsmb} \ @@ -159,26 +160,20 @@ _libnetgraph= libnetgraph _libypclnt= libypclnt .endif -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" .if ${MK_NCP} != "no" _libncp= libncp .endif _libsmb= libsmb _libvgl= libvgl +_libproc= libproc +_librtld_db= librtld_db .endif .if ${MACHINE_ARCH} == "ia64" _libsmb= libsmb .endif -.if ${MACHINE_ARCH} == "amd64" -.if ${MK_NCP} != "no" -_libncp= libncp -.endif -_libsmb= libsmb -_libvgl= libvgl -.endif - .if ${MACHINE_ARCH} == "powerpc" _libsmb= libsmb .endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 12:04:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72DB51065672; Mon, 8 Nov 2010 12:04:41 +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 612AB8FC0C; Mon, 8 Nov 2010 12:04:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8C4fH5030469; Mon, 8 Nov 2010 12:04:41 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8C4fE5030467; Mon, 8 Nov 2010 12:04:41 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201011081204.oA8C4fE5030467@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 8 Nov 2010 12:04: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: r214982 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 12:04:41 -0000 Author: des Date: Mon Nov 8 12:04:41 2010 New Revision: 214982 URL: http://svn.freebsd.org/changeset/base/214982 Log: Fix CPU ID in /proc/cpuinfo. PR: kern/56451 Submitted by: arundel@ MFC after: 3 weeks Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Nov 8 11:22:55 2010 (r214981) +++ head/sys/compat/linprocfs/linprocfs.c Mon Nov 8 12:04:41 2010 (r214982) @@ -276,11 +276,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) sbuf_printf(sb, "processor\t: %d\n" "vendor_id\t: %.20s\n" - "cpu family\t: %d\n" - "model\t\t: %d\n" + "cpu family\t: %u\n" + "model\t\t: %u\n" "model name\t: %s\n" - "stepping\t: %d\n\n", - i, cpu_vendor, class, cpu, model, cpu_id & 0xf); + "stepping\t: %u\n\n", + i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING); /* XXX per-cpu vendor / class / model / id? */ } From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 12:54:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A05B2106564A; Mon, 8 Nov 2010 12:54:56 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 886418FC0A; Mon, 8 Nov 2010 12:54:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8CsuAo032384; Mon, 8 Nov 2010 12:54:56 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8Csu0M032339; Mon, 8 Nov 2010 12:54:56 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201011081254.oA8Csu0M032339@svn.freebsd.org> From: Rui Paulo Date: Mon, 8 Nov 2010 12:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214983 - in stable/8: cddl/contrib/dtracetoolkit cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof cddl/contrib/opensolaris/cmd/dtrace/test/cmd/ch... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 12:54:56 -0000 Author: rpaulo Date: Mon Nov 8 12:54:55 2010 New Revision: 214983 URL: http://svn.freebsd.org/changeset/base/214983 Log: MFC r210688 r210689 r210694 r211184 r212831 r210682 r210683 r210690 r209539 r210199 r210237 r210692 r210695 r210767 r210775 r210776 r211545 r211554 r211562 r212092 r212358 r212414 r212462 r212495 r210693 r211547 r211550 r211554 r211561 r211577 r210691 r210697 r211563 r211564 r211841 r211842 r211562 r212649 r211187 r211555: Userland DTrace MFC. This only includes the userland side of userland DTrace. Added: stable/8/cddl/contrib/dtracetoolkit/ - copied from r214982, vendor/dtracetoolkit/dist/ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/ - copied from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cpc/ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/ - copied from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.GetAggregate.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.killonerror.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh - copied, changed from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/ - copied from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.D_AGG_SPEC.SpeculateWithStddev.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile - copied unchanged from r211545, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c - copied unchanged from r211545, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d - copied unchanged from r211545, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h - copied unchanged from r211545, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh - copied, changed from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/ - copied from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe - copied unchanged from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/err.D_PROC_ALIGN.misaligned.exe stable/8/cddl/contrib/opensolaris/cmd/plockstat/ - copied from r210237, head/cddl/contrib/opensolaris/cmd/plockstat/ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh - copied unchanged from r210767, head/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh - copied unchanged from r210767, head/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh stable/8/cddl/contrib/opensolaris/lib/libdtrace/i386/ - copied from r210199, head/cddl/contrib/opensolaris/lib/libdtrace/i386/ stable/8/cddl/contrib/opensolaris/lib/libdtrace/sparc/ - copied from r210199, head/cddl/contrib/opensolaris/lib/libdtrace/sparc/ stable/8/cddl/lib/libdtrace/libproc_compat.h - copied unchanged from r211554, head/cddl/lib/libdtrace/libproc_compat.h stable/8/cddl/lib/libdtrace/regs_x86.d - copied unchanged from r211554, head/cddl/lib/libdtrace/regs_x86.d stable/8/cddl/usr.bin/ctfconvert/ctfconvert.1 - copied unchanged from r211187, head/cddl/usr.bin/ctfconvert/ctfconvert.1 stable/8/cddl/usr.bin/ctfdump/ctfdump.1 - copied unchanged from r211187, head/cddl/usr.bin/ctfdump/ctfdump.1 stable/8/cddl/usr.bin/ctfmerge/ctfmerge.1 - copied unchanged from r211187, head/cddl/usr.bin/ctfmerge/ctfmerge.1 stable/8/cddl/usr.sbin/dtruss/ - copied from r211563, head/cddl/usr.sbin/dtruss/ stable/8/cddl/usr.sbin/dtruss/dtruss.1 - copied unchanged from r211841, head/cddl/usr.sbin/dtruss/dtruss.1 stable/8/cddl/usr.sbin/plockstat/ - copied from r211562, head/cddl/usr.sbin/plockstat/ stable/8/cddl/usr.sbin/plockstat/plockstat.1 - copied unchanged from r212649, head/cddl/usr.sbin/plockstat/plockstat.1 stable/8/lib/libproc/proc_bkpt.c - copied, changed from r210688, head/lib/libproc/proc_bkpt.c stable/8/lib/libproc/proc_regs.c - copied unchanged from r210688, head/lib/libproc/proc_regs.c stable/8/lib/libproc/proc_rtld.c - copied, changed from r210688, head/lib/libproc/proc_rtld.c stable/8/lib/libproc/test/ - copied from r210688, head/lib/libproc/test/ Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl (contents, props changed) stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl (contents, props changed) stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.ksh.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.probemod.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.basics.d.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.c stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/funcs/tst.badcopyin.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh stable/8/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c stable/8/cddl/contrib/opensolaris/common/avl/avl.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h stable/8/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c stable/8/cddl/contrib/opensolaris/lib/libgen/common/gmatch.c stable/8/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c stable/8/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c stable/8/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.h stable/8/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c stable/8/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c stable/8/cddl/lib/Makefile stable/8/cddl/lib/drti/Makefile stable/8/cddl/lib/libdtrace/Makefile stable/8/cddl/usr.bin/ctfconvert/Makefile stable/8/cddl/usr.bin/ctfdump/Makefile stable/8/cddl/usr.bin/ctfmerge/Makefile stable/8/cddl/usr.sbin/Makefile stable/8/cddl/usr.sbin/dtrace/Makefile stable/8/cddl/usr.sbin/dtruss/Makefile stable/8/cddl/usr.sbin/lockstat/Makefile stable/8/cddl/usr.sbin/plockstat/Makefile stable/8/lib/libproc/Makefile stable/8/lib/libproc/_libproc.h stable/8/lib/libproc/libproc.h stable/8/lib/libproc/proc_create.c stable/8/lib/libproc/proc_sym.c stable/8/lib/libproc/proc_util.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Mon Nov 8 12:54:55 2010 (r214983) @@ -773,19 +773,27 @@ compile_str(dtrace_cmd_t *dcp) static void prochandler(struct ps_prochandle *P, const char *msg, void *arg) { -fatal("DOODAD in function %s, file %s, line %d\n",__FUNCTION__,__FILE__,__LINE__); -#ifdef DOODAD +#if defined(sun) const psinfo_t *prp = Ppsinfo(P); int pid = Pstatus(P)->pr_pid; char name[SIG2STR_MAX]; +#else + int wstatus = proc_getwstat(P); + int pid = proc_getpid(P); +#endif if (msg != NULL) { notice("pid %d: %s\n", pid, msg); return; } +#if defined(sun) switch (Pstate(P)) { +#else + switch (proc_state(P)) { +#endif case PS_UNDEAD: +#if defined(sun) /* * Ideally we would like to always report pr_wstat here, but it * isn't possible given current /proc semantics. If we grabbed @@ -798,9 +806,20 @@ fatal("DOODAD in function %s, file %s, l notice("pid %d terminated by %s\n", pid, proc_signame(WTERMSIG(prp->pr_wstat), name, sizeof (name))); +#else + if (WIFSIGNALED(wstatus)) { + notice("pid %d terminated by %d\n", pid, + WTERMSIG(wstatus)); +#endif +#if defined(sun) } else if (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) { notice("pid %d exited with status %d\n", pid, WEXITSTATUS(prp->pr_wstat)); +#else + } else if (WEXITSTATUS(wstatus) != 0) { + notice("pid %d exited with status %d\n", + pid, WEXITSTATUS(wstatus)); +#endif } else { notice("pid %d has exited\n", pid); } @@ -812,7 +831,6 @@ fatal("DOODAD in function %s, file %s, l g_pslive--; break; } -#endif } /*ARGSUSED*/ Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/baddof/baddof.c Mon Nov 8 12:54:55 2010 (r214983) @@ -20,12 +20,10 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -162,7 +160,7 @@ main(int argc, char **argv) FILE *fp; unsigned char *dof, *copy; - if (argc < 1) + if (argc < 2) fatal("expected D script as argument\n"); if ((fp = fopen(filename, "r")) == NULL) Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/chkargs/chkargs.c Mon Nov 8 12:54:55 2010 (r214983) @@ -20,12 +20,10 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -35,6 +33,7 @@ static int g_errs; static int g_fd; static int g_verbose; static int g_errexit; +static char *g_progname; static int probe(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp, void *data) @@ -91,9 +90,11 @@ main(int argc, char *argv[]) int err, c; char *p; + g_progname = argv[0]; + if ((dtp = dtrace_open(DTRACE_VERSION, 0, &err)) == NULL) { (void) fprintf(stderr, "%s: failed to open dtrace: %s\n", - argv[0], dtrace_errmsg(dtp, err)); + g_progname, dtrace_errmsg(dtp, err)); return (1); } @@ -111,7 +112,7 @@ main(int argc, char *argv[]) if (dtrace_setopt(dtp, optarg, p) != 0) { (void) fprintf(stderr, "%s: failed to set " - "option -x %s: %s\n", argv[0], optarg, + "option -x %s: %s\n", g_progname, optarg, dtrace_errmsg(dtp, dtrace_errno(dtp))); return (2); } @@ -119,7 +120,7 @@ main(int argc, char *argv[]) default: (void) fprintf(stderr, "Usage: %s [-ev] " - "[-x opt[=arg]] [probedesc]\n", argv[0]); + "[-x opt[=arg]] [probedesc]\n", g_progname); return (2); } } @@ -128,9 +129,9 @@ main(int argc, char *argv[]) argc -= optind; if (argc > 0) { - if (dtrace_str2desc(dtp, DTRACE_PROBESPEC_NAME, argv[1], &pd)) { + if (dtrace_str2desc(dtp, DTRACE_PROBESPEC_NAME, argv[0], &pd)) { (void) fprintf(stderr, "%s: invalid probe description " - "%s: %s\n", argv[0], argv[1], + "%s: %s\n", g_progname, argv[0], dtrace_errmsg(dtp, dtrace_errno(dtp))); return (2); } Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Mon Nov 8 12:54:55 2010 (r214983) @@ -21,12 +21,11 @@ # # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -require 5.6.1; +require 5.8.4; $PNAME = $0; $PNAME =~ s:.*/::; Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Mon Nov 8 12:54:55 2010 (r214983) @@ -24,9 +24,8 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -require 5.6.1; +require 5.8.4; use File::Find; use File::Basename; @@ -40,10 +39,11 @@ $OPTSTR = 'abd:fghi:jlnqsx:'; $USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] " . "[-x opt[=arg]] [file | dir ...]\n"; ($MACH = `uname -p`) =~ s/\W*\n//; +($PLATFORM = `uname -i`) =~ s/\W*\n//; @dtrace_argv = (); -$ksh_path = '/bin/sh'; +$ksh_path = '/usr/local/bin/ksh'; @files = (); %exceptions = (); @@ -215,17 +215,17 @@ sub is_exception { } # -# Iterate over the set of test files specified on the command-line or by -# a find on "$defdir/common" and "$defdir/$MACH" and execute each one. -# If the test file is executable, we fork and exec it. If the test is a -# .ksh file, we run it with $ksh_path. Otherwise we run dtrace -s on it. -# If the file is named tst.* we assume it should return exit status 0. -# If the file is named err.* we assume it should return exit status 1. -# If the file is named err.D_[A-Z0-9]+[.*].d we use dtrace -xerrtags and -# examine stderr to ensure that a matching error tag was produced. -# If the file is named drp.[A-Z0-9]+[.*].d we use dtrace -xdroptags and -# examine stderr to ensure that a matching drop tag was produced. -# If any *.out or *.err files are found we perform output comparisons. +# Iterate over the set of test files specified on the command-line or by a find +# on "$defdir/common", "$defdir/$MACH" and "$defdir/$PLATFORM" and execute each +# one. If the test file is executable, we fork and exec it. If the test is a +# .ksh file, we run it with $ksh_path. Otherwise we run dtrace -s on it. If +# the file is named tst.* we assume it should return exit status 0. If the +# file is named err.* we assume it should return exit status 1. If the file is +# named err.D_[A-Z0-9]+[.*].d we use dtrace -xerrtags and examine stderr to +# ensure that a matching error tag was produced. If the file is named +# drp.[A-Z0-9]+[.*].d we use dtrace -xdroptags and examine stderr to ensure +# that a matching drop tag was produced. If any *.out or *.err files are found +# we perform output comparisons. # # run_tests takes two arguments: The first is the pathname of the dtrace # command to invoke when running the tests. The second is the pathname @@ -548,6 +548,7 @@ $bindir = -d $dt_bin ? $dt_bin : '.'; find(\&wanted, "$defdir/common") if (scalar(@ARGV) == 0); find(\&wanted, "$defdir/$MACH") if (scalar(@ARGV) == 0); +find(\&wanted, "$defdir/$PLATFORM") if (scalar(@ARGV) == 0); die $USAGE if (scalar(@files) == 0); $dtrace_path = '/usr/sbin/dtrace'; Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d (from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d Mon Nov 8 12:54:55 2010 (r214983, copy of r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_AGG_SCALAR.stddevtoofew.d) @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * stddev() should not accept a non-scalar value + * + * SECTION: Aggregations/Aggregations + * + */ + +#pragma D option quiet + +BEGIN +{ + @a[pid] = stddev(probefunc); +} + Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d (from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d Mon Nov 8 12:54:55 2010 (r214983, copy of r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevnoarg.d) @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * stddev() should not accept a call with no arguments + * + * SECTION: Aggregations/Aggregations + * + */ + +#pragma D option quiet + +BEGIN +{ + @a[1] = stddev(); +} + Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d (from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d Mon Nov 8 12:54:55 2010 (r214983, copy of r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/err.D_PROTO_LEN.stddevtoomany.d) @@ -0,0 +1,41 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * stddev() should not have more than one argument + * + * SECTION: Aggregations/Aggregations + * + */ + +#pragma D option quiet + +BEGIN +{ + @a[1] = stddev(1, 2); +} + Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d (from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d Mon Nov 8 12:54:55 2010 (r214983, copy of r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d) @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * ASSERTION: + * Positive stddev() test + * + * SECTION: Aggregations/Aggregations + * + * NOTES: + * Verifies that printing a clear()'d aggregation with an stddev() + * aggregation function doesn't cause problems. + * + */ + +#pragma D option quiet + +tick-10ms +/i++ < 5/ +{ + @a = stddev(timestamp); +} + +tick-10ms +/i == 5/ +{ + exit(2); +} + +END +{ + clear(@a); + exit(0); +} Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out (from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out Mon Nov 8 12:54:55 2010 (r214983, copy of r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.clearstddev.d.out) @@ -0,0 +1,2 @@ + + 0 Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs1.d Mon Nov 8 12:54:55 2010 (r214983) @@ -20,15 +20,13 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: - * Multiple aggregates can be used within the same D script. + * Multiple aggregates can be used within the same D script. * * SECTION: Aggregations/Aggregations * @@ -52,9 +50,11 @@ tick-10ms @c[pid] = avg(new_time); @d[pid] = sum(new_time); @e[pid] = quantize(new_time); - @f[timestamp] = max(new_time); - @g[timestamp] = quantize(new_time); - @h[timestamp] = lquantize(new_time, 0, 10000, 1000); + @f[pid] = stddev(new_time); + @g[timestamp] = max(new_time); + @h[timestamp] = quantize(new_time); + @i[timestamp] = lquantize(new_time, 0, 10000, 1000); + time_1 = time_2; i++; } Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d Mon Nov 8 12:54:55 2010 (r214983) @@ -20,18 +20,16 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: - * Test multiple aggregations and the default output order + * Test multiple aggregations and the default output order * * SECTION: Aggregations/Aggregations; - * Aggregations/Output + * Aggregations/Output * */ @@ -51,6 +49,7 @@ tick-10ms @d = max(i); @e = quantize(i); @f = lquantize(i, 0, 1000, 100); + @g = stddev(i); i += 100; } Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs2.d.out Mon Nov 8 12:54:55 2010 (r214983) @@ -34,3 +34,4 @@ 900 |@@@@ 1 >= 1000 | 0 + 287 Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d Mon Nov 8 12:54:55 2010 (r214983) @@ -20,19 +20,17 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ASSERTION: - * Test multiple aggregations and overriding default order with - * printa() statements. + * Test multiple aggregations and overriding default order with + * printa() statements. * * SECTION: Aggregations/Aggregations; - * Aggregations/Output + * Aggregations/Output * * NOTES: This is a simple verifiable test. * @@ -55,6 +53,7 @@ tick-10ms @e = max(i); @f = quantize(i); @g = lquantize(i, 0, 1000, 100); + @h = stddev(i); i += 100; } @@ -62,6 +61,7 @@ tick-10ms tick-10ms /i == 1000/ { + printa("%@d\n", @h); printa("%@d\n", @g); printa("%@d\n", @f); printa("%@d\n", @e); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.multiaggs3.d.out Mon Nov 8 12:54:55 2010 (r214983) @@ -1,3 +1,4 @@ +287 value ------------- Distribution ------------- count < 0 | 0 Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d Mon Nov 8 12:54:55 2010 (r214983) @@ -20,20 +20,19 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - - /* * ASSERTION: - * Positive stddev() test + * Positive stddev() test * * SECTION: Aggregations/Aggregations * * NOTES: This is a simple verifiable positive test of the stddev() function. + * printa() for one aggregation, default printing behavior for the other + * so that we exercise both code paths. */ #pragma D option quiet @@ -60,5 +59,6 @@ BEGIN @b = stddev(-5000000700); @b = stddev(-5000000800); @b = stddev(-5000000900); + printa("%@d\n", @a); exit(0); } Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.stddev.d.out Mon Nov 8 12:54:55 2010 (r214983) @@ -1,3 +1,3 @@ +287 287 - 287 Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d Mon Nov 8 12:54:55 2010 (r214983) @@ -26,7 +26,6 @@ #pragma ident "%Z%%M% %I% %E% SMI" -#include #define INTFUNC(x) \ BEGIN \ Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d Mon Nov 8 12:54:55 2010 (r214983) @@ -39,13 +39,13 @@ BEGIN } BEGIN -/b[curthread->t_did] == 0/ +/b[curthread->td_flags] == 0/ { exit(0); } BEGIN { - printf("value should be 0; value is %x!", b[curthread->t_did]); + printf("value should be 0; value is %x!", b[curthread->td_flags]); exit(1); } Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -78,5 +78,5 @@ if [ "$status" -ne 0 ]; then exit $status fi -/usr/bin/rm -f $tempfile +/bin/rm -f $tempfile exit 0 Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -44,7 +44,7 @@ fi dtrace=$1 -$dtrace -qwm unix'{chill(15); printf("Done chilling"); exit(0);}' +$dtrace -qwm kernel'{chill(15); printf("Done chilling"); exit(0);}' status=$? if [ "$status" -ne 0 ]; then Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -69,5 +69,5 @@ if [ ! -a "d.out" ]; then exit 1 fi -/usr/bin/rm -f "d.out" +/bin/rm -f "d.out" exit 0 Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -70,5 +70,5 @@ if [ ! -a "outputFile" ]; then exit 1 fi -/usr/bin/rm -f "outputFile" +/bin/rm -f "outputFile" exit 0 Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -43,7 +43,6 @@ script() { $dtrace -CH -s /dev/stdin < BEGIN { Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d Mon Nov 8 12:54:55 2010 (r214983) @@ -34,7 +34,7 @@ * */ -lockstat:genunix:mutex_enter:adaptive-acquire +lockstat:kernel:mtx_lock:adaptive-acquire { mutex_owned(); exit(1); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d Mon Nov 8 12:54:55 2010 (r214983) @@ -34,7 +34,7 @@ * */ -lockstat:genunix:mutex_enter:adaptive-acquire +lockstat:kernel:mtx_lock:adaptive-acquire { mutex_owned((kmutex_t *)arg0, 99); exit(1); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d Mon Nov 8 12:54:55 2010 (r214983) @@ -36,7 +36,7 @@ */ -lockstat:genunix:mutex_enter:adaptive-acquire +lockstat:kernel:mtx_lock:adaptive-acquire { mutex_type_adaptive(); exit(1); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d Mon Nov 8 12:54:55 2010 (r214983) @@ -35,7 +35,7 @@ */ -lockstat:genunix:mutex_enter:adaptive-acquire +lockstat:kernel:mtx_lock:adaptive-acquire { mutex_type_adaptive((kmutex_t *)arg0, 99); exit(1); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d Mon Nov 8 12:54:55 2010 (r214983) @@ -80,7 +80,7 @@ BEGIN i++; end = j = k = 0; - printf("#!/usr/perl5/bin/perl\n\nBEGIN {\n"); + printf("#!/usr/bin/perl\n\nBEGIN {\n"); } tick-1ms Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl Mon Nov 8 12:54:55 2010 (r214983) @@ -50,7 +50,7 @@ my $local = ""; my $remote = ""; my %Broadcast; my $up; -open IFCONFIG, '/usr/sbin/ifconfig -a |' or die "Couldn't run ifconfig: $!\n"; +open IFCONFIG, '/sbin/ifconfig -a |' or die "Couldn't run ifconfig: $!\n"; while () { next if /^lo/; @@ -73,7 +73,7 @@ die "Could not determine local IP addres # Find the first remote host that responds to an icmp echo, # which isn't a local address. # -open PING, "/usr/sbin/ping -ns $Broadcast{$local} 56 $MAXHOSTS |" or +open PING, "/sbin/ping -ns $Broadcast{$local} 56 $MAXHOSTS |" or die "Couldn't run ping: $!\n"; while () { if (/bytes from (.*): / and not defined $Broadcast{$1}) { Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Mon Nov 8 12:54:55 2010 (r214983) @@ -50,7 +50,7 @@ my $local = ""; my $remote = ""; my %Local; my $up; -open IFCONFIG, '/usr/sbin/ifconfig -a inet6 |' +open IFCONFIG, '/sbin/ifconfig -a inet6 |' or die "Couldn't run ifconfig: $!\n"; while () { next if /^lo/; @@ -74,7 +74,7 @@ exit 1 if $local eq ""; # Find the first remote host that responds to an icmp echo, # which isn't a local address. # -open PING, "/usr/sbin/ping -ns -A inet6 $MULTICAST 56 $MAXHOSTS |" or +open PING, "/sbin/ping -ns -A inet6 $MULTICAST 56 $MAXHOSTS |" or die "Couldn't run ping: $!\n"; while () { if (/bytes from (.*): / and not defined $Local{$1}) { Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -45,7 +45,7 @@ fi dtrace=$1 local=127.0.0.1 -$dtrace -c "/usr/sbin/ping $local 3" -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && args[4]->ipv4_protocol == IPPROTO_ICMP/ Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -120,6 +120,6 @@ EODTRACE status=$? cd / -/usr/bin/rm -rf $DIR +/bin/rm -rf $DIR exit $status Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -57,7 +57,7 @@ fi dtrace=$1 local=127.0.0.1 -$dtrace -c "/usr/sbin/ping -U $local" -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -123,6 +123,6 @@ EODTRACE status=$? cd / -/usr/bin/rm -rf $DIR +/bin/rm -rf $DIR exit $? Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -60,7 +60,7 @@ if (( $? != 0 )); then exit 4 fi -$dtrace -c "/usr/sbin/ping -U $dest" -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/ Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -62,9 +62,9 @@ fi # # Shake loose any ICMPv6 Neighbor advertisement messages before tracing. # -/usr/sbin/ping $dest 3 > /dev/null 2>&1 +/sbin/ping $dest 3 > /dev/null 2>&1 -$dtrace -c "/usr/sbin/ping $dest 3" -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" && Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -177,6 +177,6 @@ EODTRACE status=$? cd / -/usr/bin/rm -rf $DIR +/bin/rm -rf $DIR exit $status Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh Mon Aug 2 13:40:53 2010 (r210767) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh Mon Nov 8 12:54:55 2010 (r214983) @@ -167,6 +167,6 @@ EODTRACE status=$? cd / -/usr/bin/rm -rf $DIR +/bin/rm -rf $DIR exit $status Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java Mon Nov 8 12:04:41 2010 (r214982) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestFunctionLookup.java Mon Nov 8 12:54:55 2010 (r214983) @@ -20,10 +20,8 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * - * ident "%Z%%M% %I% %E% SMI" */ import org.opensolaris.os.dtrace.*; @@ -70,7 +68,7 @@ public class TestFunctionLookup { long addr = (Long)address; f = consumer.lookupKernelFunction(addr); } - if (f.equals("genunix`setrun")) { + if (f.equals("genunix`cv_wakeup")) { System.out.println(f); done = true; } Copied: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java (from r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java Mon Nov 8 12:54:55 2010 (r214983, copy of r210767, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/src/TestGetAggregate.java) @@ -0,0 +1,252 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +import org.opensolaris.os.dtrace.*; +import java.util.*; + +/** + * Assert getAggregate() can explicitly specify the anonymous aggregation. + */ +public class TestGetAggregate { + static final String programString = + "profile:::tick-50ms" + + "{" + + " @ = count();" + + " @a = count();" + + "}"; + + static final String ANONYMOUS_AGGREGATION = ""; + static final int TICK = 50; + static final int EXPECTED_TICKS = 3; + static final int INTERVALS = 4; + + static void + testIncluded(Consumer consumer, String ... aggregationNames) + throws DTraceException, InterruptedException + { + Aggregate aggregate; + Set included = new HashSet (); + int n = 1; + + for (String name : aggregationNames) { + included.add(name); + } + + // Wait up to a full second to obtain aggregate data. Without a + // time limit, we'll loop forever if no aggregation was + // successfully included. + do { + Thread.sleep(TICK); + aggregate = consumer.getAggregate(included, null); + } while (aggregate.asMap().isEmpty() && n++ < (1000 / TICK)); + + for (String name : included) { + if (aggregate.getAggregation(name) == null) { + throw new IllegalStateException("@" + name + + " was explicitly included but did not appear " + + "in the aggregate"); + } + } + for (Aggregation a : aggregate.getAggregations()) { + if (!included.contains(a.getName())) { + throw new IllegalStateException("@" + a.getName() + + " was not explicitly included but appeared " + + "in the aggregate anyway"); + } + } + + if (!consumer.isRunning()) { + throw new IllegalStateException("consumer exited"); + } + } + + static void + testCleared(Consumer consumer, String ... aggregationNames) + throws DTraceException, InterruptedException + { + Aggregate aggregate; + AggregationRecord rec; + long value; + Long firstValue; + int n = 1; + Map firstValues = new HashMap (); + Set cleared = new HashSet (); + + for (String name : aggregationNames) { + cleared.add(name); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 13:31:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1617106564A; Mon, 8 Nov 2010 13:31:44 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEE568FC12; Mon, 8 Nov 2010 13:31:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8DViIe033725; Mon, 8 Nov 2010 13:31:44 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8DViNq033723; Mon, 8 Nov 2010 13:31:44 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201011081331.oA8DViNq033723@svn.freebsd.org> From: Rui Paulo Date: Mon, 8 Nov 2010 13:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214984 - stable/8/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 13:31:44 -0000 Author: rpaulo Date: Mon Nov 8 13:31:44 2010 New Revision: 214984 URL: http://svn.freebsd.org/changeset/base/214984 Log: Don't use basename_r(). Modified: stable/8/lib/libproc/proc_sym.c Modified: stable/8/lib/libproc/proc_sym.c ============================================================================== --- stable/8/lib/libproc/proc_sym.c Mon Nov 8 12:54:55 2010 (r214983) +++ stable/8/lib/libproc/proc_sym.c Mon Nov 8 13:31:44 2010 (r214984) @@ -109,7 +109,7 @@ proc_iter_objs(struct proc_handle *p, pr size_t i; rd_loadobj_t *rdl; prmap_t map; - char path[MAXPATHLEN]; + char *path; char last[MAXPATHLEN]; if (p->nobjs == 0) @@ -118,7 +118,7 @@ proc_iter_objs(struct proc_handle *p, pr for (i = 0; i < p->nobjs; i++) { rdl = &p->rdobjs[i]; proc_rdl2prmap(rdl, &map); - basename_r(rdl->rdl_path, path); + path = basename(rdl->rdl_path); /* * We shouldn't call the callback twice with the same object. * To do that we are assuming the fact that if there are @@ -331,7 +331,7 @@ proc_name2map(struct proc_handle *p, con size_t i; int cnt; prmap_t *map; - char tmppath[MAXPATHLEN]; + char *tmppath; struct kinfo_vmentry *kves, *kve; rd_loadobj_t *rdl; @@ -346,7 +346,7 @@ proc_name2map(struct proc_handle *p, con return (NULL); for (i = 0; i < (size_t)cnt; i++) { kve = kves + i; - basename_r(kve->kve_path, tmppath); + tmppath = basename(kve->kve_path); if (strcmp(tmppath, name) == 0) { map = proc_addr2map(p, kve->kve_start); free(kves); @@ -362,7 +362,7 @@ proc_name2map(struct proc_handle *p, con } for (i = 0; i < p->nobjs; i++) { rdl = &p->rdobjs[i]; - basename_r(rdl->rdl_path, tmppath); + tmppath = basename(rdl->rdl_path); if (strcmp(tmppath, name) == 0) { if ((map = malloc(sizeof(*map))) == NULL) return (NULL); From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 14:47:19 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3615B106564A; Mon, 8 Nov 2010 14:47:19 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2A18FC0C; Mon, 8 Nov 2010 14:47:18 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.4/8.14.4) with ESMTP/inet6 id oA8EkV7Y020666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Nov 2010 23:47:09 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Mon, 08 Nov 2010 23:46:31 +0900 Message-ID: From: Hajimu UMEMOTO To: Rui Paulo In-Reply-To: <201011081331.oA8DViNq033723@svn.freebsd.org> References: <201011081331.oA8DViNq033723@svn.freebsd.org> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.2 (i386-portbld-freebsd8.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.1-STABLE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Mon, 08 Nov 2010 23:47:09 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96.4 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on asuka.mahoroba.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r214984 - stable/8/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 14:47:19 -0000 Hi, >>>>> On Mon, 8 Nov 2010 13:31:44 +0000 (UTC) >>>>> Rui Paulo said: rpaulo> Author: rpaulo rpaulo> Date: Mon Nov 8 13:31:44 2010 rpaulo> New Revision: 214984 rpaulo> URL: http://svn.freebsd.org/changeset/base/214984 rpaulo> Log: rpaulo> Don't use basename_r(). rpaulo> Modified: rpaulo> stable/8/lib/libproc/proc_sym.c Shouldn't MFCing basename_r() be better rather than stopping use of it? Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 15:06:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B611010656CB; Mon, 8 Nov 2010 15:06:17 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 853098FC26; Mon, 8 Nov 2010 15:06:17 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id 84E9911B897; Mon, 8 Nov 2010 09:06:16 -0600 (CST) Received: from 192.168.1.70 (bl17-210-129.dsl.telepac.pt [188.82.210.129]) by lavabit.com with ESMTP id K3I515Q28UBF; Mon, 08 Nov 2010 09:06:16 -0600 References: <201011081331.oA8DViNq033723@svn.freebsd.org> In-Reply-To: Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii Message-Id: Content-Transfer-Encoding: quoted-printable From: Rui Paulo Date: Mon, 8 Nov 2010 15:06:12 +0000 To: Hajimu UMEMOTO X-Mailer: Apple Mail (2.1081) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r214984 - stable/8/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 15:06:17 -0000 On Nov 8, 2010, at 2:46 PM, Hajimu UMEMOTO wrote: > Hi, >=20 >>>>>> On Mon, 8 Nov 2010 13:31:44 +0000 (UTC) >>>>>> Rui Paulo said: >=20 > rpaulo> Author: rpaulo > rpaulo> Date: Mon Nov 8 13:31:44 2010 > rpaulo> New Revision: 214984 > rpaulo> URL: http://svn.freebsd.org/changeset/base/214984 >=20 > rpaulo> Log: > rpaulo> Don't use basename_r(). >=20 > rpaulo> Modified: > rpaulo> stable/8/lib/libproc/proc_sym.c >=20 > Shouldn't MFCing basename_r() be better rather than stopping use of > it? It's on my plans, but basename_r is not POSIX and there was a private = discussion about it a couple of weeks ago. The conclusion is that we = should adopt the Android semantics of basename_r(). Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 15:14:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53758106566C; Mon, 8 Nov 2010 15:14:15 +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 207D58FC0C; Mon, 8 Nov 2010 15:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8FEFab037277; Mon, 8 Nov 2010 15:14:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8FEF5m037275; Mon, 8 Nov 2010 15:14:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201011081514.oA8FEF5m037275@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 8 Nov 2010 15:14: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: r214985 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 15:14:15 -0000 Author: des Date: Mon Nov 8 15:14:14 2010 New Revision: 214985 URL: http://svn.freebsd.org/changeset/base/214985 Log: Break long line. Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Nov 8 13:31:44 2010 (r214984) +++ head/sys/compat/linprocfs/linprocfs.c Mon Nov 8 15:14:14 2010 (r214985) @@ -280,7 +280,8 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) "model\t\t: %u\n" "model name\t: %s\n" "stepping\t: %u\n\n", - i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING); + i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), + CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING); /* XXX per-cpu vendor / class / model / id? */ } From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 15:19:32 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23FF01065674; Mon, 8 Nov 2010 15:19:32 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 75AE48FC20; Mon, 8 Nov 2010 15:19:31 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.4/8.14.4) with ESMTP/inet6 id oA8FJPbc059378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Nov 2010 00:19:26 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 09 Nov 2010 00:19:25 +0900 Message-ID: From: Hajimu UMEMOTO To: Rui Paulo In-Reply-To: References: <201011081331.oA8DViNq033723@svn.freebsd.org> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.2 (i386-portbld-freebsd8.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.1-STABLE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 09 Nov 2010 00:19:26 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96.4 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on asuka.mahoroba.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r214984 - stable/8/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 15:19:32 -0000 Hi, >>>>> On Mon, 8 Nov 2010 15:06:12 +0000 >>>>> Rui Paulo said: rpaulo> It's on my plans, but basename_r is not POSIX and there was a private discussion about it a couple of weeks ago. The conclusion is that we should adopt the Android semantics of basename_r(). I found the thread, and understood it. However, I still wonderling if breaking thread-safeness in proc_sym.c is okay, though it may not be necessary. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 15:22:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 008181065788; Mon, 8 Nov 2010 15:22:21 +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 D8DB88FC27; Mon, 8 Nov 2010 15:22:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8FMKhd037634; Mon, 8 Nov 2010 15:22:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8FMKSd037627; Mon, 8 Nov 2010 15:22:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011081522.oA8FMKSd037627@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Nov 2010 15:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214986 - stable/7/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 15:22:21 -0000 Author: kib Date: Mon Nov 8 15:22:20 2010 New Revision: 214986 URL: http://svn.freebsd.org/changeset/base/214986 Log: MFC r203072 (by rmacklem, to be reverted by MFC of r214026): Fix a race that can occur when nfs nfsiod threads are being created. MFC r212506: Do not fork nfsiod directly from the vop methods. MFC r214026: Do not synchronously start the nfsiod threads at all. Tested by: jhb Modified: stable/7/sys/nfsclient/nfs.h stable/7/sys/nfsclient/nfs_bio.c stable/7/sys/nfsclient/nfs_nfsiod.c stable/7/sys/nfsclient/nfs_subs.c stable/7/sys/nfsclient/nfs_vnops.c stable/7/sys/nfsclient/nfsnode.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfsclient/nfs.h ============================================================================== --- stable/7/sys/nfsclient/nfs.h Mon Nov 8 15:14:14 2010 (r214985) +++ stable/7/sys/nfsclient/nfs.h Mon Nov 8 15:22:20 2010 (r214986) @@ -135,6 +135,7 @@ extern struct uma_zone *nfsmount_zone; extern struct callout nfs_callout; extern struct nfsstats nfsstats; extern struct mtx nfs_iod_mtx; +extern struct task nfs_nfsiodnew_task; extern int nfs_numasync; extern unsigned int nfs_iodmax; @@ -305,7 +306,8 @@ int nfs_writerpc(struct vnode *, struct int nfs_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred, struct thread *td); int nfs_readdirrpc(struct vnode *, struct uio *, struct ucred *); -int nfs_nfsiodnew(void); +void nfs_nfsiodnew(void); +void nfs_nfsiodnew_tq(__unused void *, int); int nfs_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); int nfs_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); void nfs_doio_directwrite (struct buf *); Modified: stable/7/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/7/sys/nfsclient/nfs_bio.c Mon Nov 8 15:14:14 2010 (r214985) +++ stable/7/sys/nfsclient/nfs_bio.c Mon Nov 8 15:22:20 2010 (r214986) @@ -1375,7 +1375,7 @@ again: * Find a free iod to process this request. */ for (iod = 0; iod < nfs_numasync; iod++) - if (nfs_iodwant[iod]) { + if (nfs_iodwant[iod] == NFSIOD_AVAILABLE) { gotiod = TRUE; break; } @@ -1383,20 +1383,16 @@ again: /* * Try to create one if none are free. */ - if (!gotiod) { - iod = nfs_nfsiodnew(); - if (iod != -1) - gotiod = TRUE; - } - - if (gotiod) { + if (!gotiod) + nfs_nfsiodnew(); + else { /* * Found one, so wake it up and tell it which * mount to process. */ NFS_DPF(ASYNCIO, ("nfs_asyncio: waking iod %d for mount %p\n", iod, nmp)); - nfs_iodwant[iod] = NULL; + nfs_iodwant[iod] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[iod] = nmp; nmp->nm_bufqiods++; wakeup(&nfs_iodwant[iod]); @@ -1409,7 +1405,7 @@ again: if (!gotiod) { if (nmp->nm_bufqiods > 0) { NFS_DPF(ASYNCIO, - ("nfs_asyncio: %d iods are already processing mount %p\n", + ("nfs_asyncio: %d iods are already processing mount %p\n", nmp->nm_bufqiods, nmp)); gotiod = TRUE; } @@ -1424,9 +1420,9 @@ again: * Ensure that the queue never grows too large. We still want * to asynchronize so we block rather then return EIO. */ - while (nmp->nm_bufqlen >= 2*nfs_numasync) { + while (nmp->nm_bufqlen >= 2 * nfs_numasync) { NFS_DPF(ASYNCIO, - ("nfs_asyncio: waiting for mount %p queue to drain\n", nmp)); + ("nfs_asyncio: waiting for mount %p queue to drain\n", nmp)); nmp->nm_bufqwant = TRUE; error = nfs_msleep(td, &nmp->nm_bufq, &nfs_iod_mtx, slpflag | PRIBIO, @@ -1434,7 +1430,7 @@ again: if (error) { error2 = nfs_sigintr(nmp, NULL, td); if (error2) { - mtx_unlock(&nfs_iod_mtx); + mtx_unlock(&nfs_iod_mtx); return (error2); } if (slpflag == PCATCH) { @@ -1446,17 +1442,13 @@ again: * We might have lost our iod while sleeping, * so check and loop if nescessary. */ - if (nmp->nm_bufqiods == 0) { - NFS_DPF(ASYNCIO, - ("nfs_asyncio: no iods after mount %p queue was drained, looping\n", nmp)); - goto again; - } + goto again; } /* We might have lost our nfsiod */ if (nmp->nm_bufqiods == 0) { NFS_DPF(ASYNCIO, - ("nfs_asyncio: no iods after mount %p queue was drained, looping\n", nmp)); +("nfs_asyncio: no iods after mount %p queue was drained, looping\n", nmp)); goto again; } Modified: stable/7/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- stable/7/sys/nfsclient/nfs_nfsiod.c Mon Nov 8 15:14:14 2010 (r214985) +++ stable/7/sys/nfsclient/nfs_nfsiod.c Mon Nov 8 15:22:20 2010 (r214986) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -92,6 +93,8 @@ unsigned int nfs_iodmax = 20; /* Minimum number of nfsiod kthreads to keep as spares */ static unsigned int nfs_iodmin = 0; +static int nfs_nfsiodnew_sync(void); + static int sysctl_iodmin(SYSCTL_HANDLER_ARGS) { @@ -115,7 +118,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) * than the new minimum, create some more. */ for (i = nfs_iodmin - nfs_numasync; i > 0; i--) - nfs_nfsiodnew(); + nfs_nfsiodnew_sync(); out: mtx_unlock(&nfs_iod_mtx); return (0); @@ -148,7 +151,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) */ iod = nfs_numasync - 1; for (i = 0; i < nfs_numasync - nfs_iodmax; i++) { - if (nfs_iodwant[iod]) + if (nfs_iodwant[iod] == NFSIOD_AVAILABLE) wakeup(&nfs_iodwant[iod]); iod--; } @@ -159,37 +162,55 @@ out: SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, sizeof (nfs_iodmax), sysctl_iodmax, "IU", ""); -int -nfs_nfsiodnew(void) +static int +nfs_nfsiodnew_sync(void) { int error, i; - int newiod; - if (nfs_numasync >= nfs_iodmax) - return (-1); - newiod = -1; - for (i = 0; i < nfs_iodmax; i++) + mtx_assert(&nfs_iod_mtx, MA_OWNED); + for (i = 0; i < nfs_iodmax; i++) { if (nfs_asyncdaemon[i] == 0) { - nfs_asyncdaemon[i]++; - newiod = i; + nfs_asyncdaemon[i] = 1; break; } - if (newiod == -1) - return (-1); + } + if (i == nfs_iodmax) + return (0); mtx_unlock(&nfs_iod_mtx); - error = kthread_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, - 0, "nfsiod %d", newiod); + error = kthread_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, + RFHIGHPID, 0, "nfsiod %d", i); + mtx_lock(&nfs_iod_mtx); + if (error == 0) { + nfs_numasync++; + nfs_iodwant[i] = NFSIOD_AVAILABLE; + } else + nfs_asyncdaemon[i] = 0; + return (error); +} + +void +nfs_nfsiodnew_tq(__unused void *arg, int pending) +{ + mtx_lock(&nfs_iod_mtx); - if (error) - return (-1); - nfs_numasync++; - return (newiod); + while (pending > 0) { + pending--; + nfs_nfsiodnew_sync(); + } + mtx_unlock(&nfs_iod_mtx); +} + +void +nfs_nfsiodnew(void) +{ + + mtx_assert(&nfs_iod_mtx, MA_OWNED); + taskqueue_enqueue(taskqueue_thread, &nfs_nfsiodnew_task); } static void nfsiod_setup(void *dummy) { - int i; int error; TUNABLE_INT_FETCH("vfs.nfs.iodmin", &nfs_iodmin); @@ -198,8 +219,8 @@ nfsiod_setup(void *dummy) if (nfs_iodmin > NFS_MAXASYNCDAEMON) nfs_iodmin = NFS_MAXASYNCDAEMON; - for (i = 0; i < nfs_iodmin; i++) { - error = nfs_nfsiodnew(); + while (nfs_numasync < nfs_iodmin) { + error = nfs_nfsiodnew_sync(); if (error == -1) panic("nfsiod_setup: nfs_nfsiodnew failed"); } @@ -235,7 +256,8 @@ nfssvc_iod(void *instance) goto finish; if (nmp) nmp->nm_bufqiods--; - nfs_iodwant[myiod] = curthread->td_proc; + if (nfs_iodwant[myiod] == NFSIOD_NOT_AVAILABLE) + nfs_iodwant[myiod] = NFSIOD_AVAILABLE; nfs_iodmount[myiod] = NULL; /* * Always keep at least nfs_iodmin kthreads. @@ -302,7 +324,7 @@ finish: nfs_asyncdaemon[myiod] = 0; if (nmp) nmp->nm_bufqiods--; - nfs_iodwant[myiod] = NULL; + nfs_iodwant[myiod] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[myiod] = NULL; /* Someone may be waiting for the last nfsiod to terminate. */ if (--nfs_numasync == 0) Modified: stable/7/sys/nfsclient/nfs_subs.c ============================================================================== --- stable/7/sys/nfsclient/nfs_subs.c Mon Nov 8 15:14:14 2010 (r214985) +++ stable/7/sys/nfsclient/nfs_subs.c Mon Nov 8 15:22:20 2010 (r214986) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -103,6 +104,7 @@ struct nfs_reqq nfs_reqq; struct mtx nfs_reqq_mtx; struct nfs_bufq nfs_bufq; static struct mtx nfs_xid_mtx; +struct task nfs_nfsiodnew_task; /* * and the reverse mapping from generic to Version 2 procedure numbers @@ -422,7 +424,7 @@ nfs_init(struct vfsconf *vfsp) nfs_ticks = 1; /* Ensure async daemons disabled */ for (i = 0; i < NFS_MAXASYNCDAEMON; i++) { - nfs_iodwant[i] = NULL; + nfs_iodwant[i] = NFSIOD_NOT_AVAILABLE; nfs_iodmount[i] = NULL; } nfs_nhinit(); /* Init the nfsnode table */ @@ -435,6 +437,7 @@ nfs_init(struct vfsconf *vfsp) mtx_init(&nfs_reqq_mtx, "NFS reqq lock", NULL, MTX_DEF); mtx_init(&nfs_iod_mtx, "NFS iod lock", NULL, MTX_DEF); mtx_init(&nfs_xid_mtx, "NFS xid lock", NULL, MTX_DEF); + TASK_INIT(&nfs_nfsiodnew_task, 0, nfs_nfsiodnew_tq, NULL); nfs_pbuf_freecnt = nswbuf / 2 + 1; @@ -454,11 +457,15 @@ nfs_uninit(struct vfsconf *vfsp) /* * Tell all nfsiod processes to exit. Clear nfs_iodmax, and wakeup * any sleeping nfsiods so they check nfs_iodmax and exit. + * Drain nfsiodnew task before we wait for them to finish. */ mtx_lock(&nfs_iod_mtx); nfs_iodmax = 0; + mtx_unlock(&nfs_iod_mtx); + taskqueue_drain(taskqueue_thread, &nfs_nfsiodnew_task); + mtx_lock(&nfs_iod_mtx); for (i = 0; i < nfs_numasync; i++) - if (nfs_iodwant[i]) + if (nfs_iodwant[i] == NFSIOD_AVAILABLE) wakeup(&nfs_iodwant[i]); /* The last nfsiod to exit will wake us up when nfs_numasync hits 0 */ while (nfs_numasync) Modified: stable/7/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vnops.c Mon Nov 8 15:14:14 2010 (r214985) +++ stable/7/sys/nfsclient/nfs_vnops.c Mon Nov 8 15:22:20 2010 (r214986) @@ -195,7 +195,7 @@ static int nfs_renameit(struct vnode *sd * Global variables */ struct mtx nfs_iod_mtx; -struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON]; +enum nfsiod_state nfs_iodwant[NFS_MAXASYNCDAEMON]; struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON]; int nfs_numasync = 0; vop_advlock_t *nfs_advlock_p = nfs_dolock; Modified: stable/7/sys/nfsclient/nfsnode.h ============================================================================== --- stable/7/sys/nfsclient/nfsnode.h Mon Nov 8 15:14:14 2010 (r214985) +++ stable/7/sys/nfsclient/nfsnode.h Mon Nov 8 15:22:20 2010 (r214986) @@ -173,10 +173,20 @@ struct nfsnode { #define NFS_TIMESPEC_COMPARE(T1, T2) (((T1)->tv_sec != (T2)->tv_sec) || ((T1)->tv_nsec != (T2)->tv_nsec)) /* + * NFS iod threads can be in one of these two states once spawned. + * NFSIOD_NOT_AVAILABLE - Cannot be assigned an I/O operation at this time. + * NFSIOD_AVAILABLE - Available to be assigned an I/O operation. + */ +enum nfsiod_state { + NFSIOD_NOT_AVAILABLE = 0, + NFSIOD_AVAILABLE = 1, +}; + +/* * Queue head for nfsiod's */ extern TAILQ_HEAD(nfs_bufq, buf) nfs_bufq; -extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON]; +extern enum nfsiod_state nfs_iodwant[NFS_MAXASYNCDAEMON]; extern struct nfsmount *nfs_iodmount[NFS_MAXASYNCDAEMON]; #if defined(_KERNEL) From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 15:25:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD6EE106566B; Mon, 8 Nov 2010 15:25:12 +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 B01378FC1D; Mon, 8 Nov 2010 15:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8FPC4X037777; Mon, 8 Nov 2010 15:25:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8FPCqe037775; Mon, 8 Nov 2010 15:25:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011081525.oA8FPCqe037775@svn.freebsd.org> From: Alexander Motin Date: Mon, 8 Nov 2010 15:25: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: r214987 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 15:25:12 -0000 Author: mav Date: Mon Nov 8 15:25:12 2010 New Revision: 214987 URL: http://svn.freebsd.org/changeset/base/214987 Log: On APs startup skip hard-/statclock events, which time passed before CPU was lauched. Few seconds event burst, accumulated during long startup, reported to cause panic in SCHED_ULE priority calculation logic. Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Mon Nov 8 15:22:20 2010 (r214986) +++ head/sys/kern/kern_clocksource.c Mon Nov 8 15:25:12 2010 (r214987) @@ -208,12 +208,13 @@ handleevents(struct bintime *now, int fa bintime_add(&state->nexthard, &hardperiod); runs++; } - if (runs) { + if (runs && fake < 2) { hardclock_anycpu(runs, usermode); done = 1; } while (bintime_cmp(now, &state->nextstat, >=)) { - statclock(usermode); + if (fake < 2) + statclock(usermode); bintime_add(&state->nextstat, &statperiod); done = 1; } @@ -227,6 +228,10 @@ handleevents(struct bintime *now, int fa } else state->nextprof = state->nextstat; getnextcpuevent(&t, 0); + if (fake == 2) { + state->nextevent = t; + return (done); + } ET_HW_LOCK(state); if (!busy) { state->idle = 0; @@ -383,6 +388,11 @@ loadtimer(struct bintime *now, int start uint64_t tmp; int eq; + if (timer->et_flags & ET_FLAGS_PERCPU) { + state = DPCPU_PTR(timerstate); + next = &state->nexttick; + } else + next = &nexttick; if (periodic) { if (start) { /* @@ -391,20 +401,18 @@ loadtimer(struct bintime *now, int start */ tmp = ((uint64_t)now->sec << 36) + (now->frac >> 28); tmp = (tmp % (timerperiod.frac >> 28)) << 28; - tmp = timerperiod.frac - tmp; - new = timerperiod; - bintime_addx(&new, tmp); + new.sec = 0; + new.frac = timerperiod.frac - tmp; + if (new.frac < tmp) /* Left less then passed. */ + bintime_add(&new, &timerperiod); CTR5(KTR_SPARE2, "load p at %d: now %d.%08x first in %d.%08x", curcpu, now->sec, (unsigned int)(now->frac >> 32), new.sec, (unsigned int)(new.frac >> 32)); + *next = new; + bintime_add(next, now); et_start(timer, &new, &timerperiod); } } else { - if (timer->et_flags & ET_FLAGS_PERCPU) { - state = DPCPU_PTR(timerstate); - next = &state->nexttick; - } else - next = &nexttick; getnextevent(&new); eq = bintime_cmp(&new, next, ==); CTR5(KTR_SPARE2, "load at %d: next %d.%08x%08x eq %d", @@ -669,13 +677,19 @@ cpu_initclocks_ap(void) struct bintime now; struct pcpu_state *state; - if (timer->et_flags & ET_FLAGS_PERCPU) { - state = DPCPU_PTR(timerstate); - binuptime(&now); - ET_HW_LOCK(state); + state = DPCPU_PTR(timerstate); + binuptime(&now); + ET_HW_LOCK(state); + if ((timer->et_flags & ET_FLAGS_PERCPU) == 0 && periodic) { + state->now = nexttick; + bintime_sub(&state->now, &timerperiod); + } else + state->now = now; + hardclock_sync(curcpu); + handleevents(&state->now, 2); + if (timer->et_flags & ET_FLAGS_PERCPU) loadtimer(&now, 1); - ET_HW_UNLOCK(state); - } + ET_HW_UNLOCK(state); } /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 15:36:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF9F8106564A; Mon, 8 Nov 2010 15:36:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD06C8FC0A; Mon, 8 Nov 2010 15:36:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8FaFKW038226; Mon, 8 Nov 2010 15:36:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8FaF7j038222; Mon, 8 Nov 2010 15:36:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011081536.oA8FaF7j038222@svn.freebsd.org> From: Alexander Motin Date: Mon, 8 Nov 2010 15:36: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: r214988 - in head/sys/dev: ahci ata siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 15:36:15 -0000 Author: mav Date: Mon Nov 8 15:36:15 2010 New Revision: 214988 URL: http://svn.freebsd.org/changeset/base/214988 Log: Teach ahci(4), siis(4) and ATA_CAM ata(4) wrapper report to CAM residual I/O length on underruns, that often happens for some SCSI commands. Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-all.c head/sys/dev/siis/siis.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Nov 8 15:25:12 2010 (r214987) +++ head/sys/dev/ahci/ahci.c Mon Nov 8 15:36:15 2010 (r214988) @@ -1625,12 +1625,13 @@ ahci_execute_transaction(struct ahci_slo /* Setup the command list entry */ clp = (struct ahci_cmd_list *) (ch->dma.work + AHCI_CL_OFFSET + (AHCI_CL_SIZE * slot->slot)); - clp->prd_length = slot->dma.nsegs; - clp->cmd_flags = (ccb->ccb_h.flags & CAM_DIR_OUT ? AHCI_CMD_WRITE : 0) | - (ccb->ccb_h.func_code == XPT_SCSI_IO ? - (AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH) : 0) | - (fis_size / sizeof(u_int32_t)) | - (port << 12); + clp->cmd_flags = htole16( + (ccb->ccb_h.flags & CAM_DIR_OUT ? AHCI_CMD_WRITE : 0) | + (ccb->ccb_h.func_code == XPT_SCSI_IO ? + (AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH) : 0) | + (fis_size / sizeof(u_int32_t)) | + (port << 12)); + clp->prd_length = htole16(slot->dma.nsegs); /* Special handling for Soft Reset command. */ if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) { @@ -1650,7 +1651,7 @@ ahci_execute_transaction(struct ahci_slo clp->cmd_table_phys = htole64(ch->dma.work_bus + AHCI_CT_OFFSET + (AHCI_CT_SIZE * slot->slot)); bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); bus_dmamap_sync(ch->dma.rfis_tag, ch->dma.rfis_map, BUS_DMASYNC_PREREAD); /* Set ACTIVE bit for NCQ commands. */ @@ -1855,10 +1856,13 @@ ahci_end_transaction(struct ahci_slot *s device_t dev = slot->dev; struct ahci_channel *ch = device_get_softc(dev); union ccb *ccb = slot->ccb; + struct ahci_cmd_list *clp; int lastto; bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, - BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + clp = (struct ahci_cmd_list *) + (ch->dma.work + AHCI_CL_OFFSET + (AHCI_CL_SIZE * slot->slot)); /* Read result registers to the result struct * May be incorrect if several commands finished same time, * so read only when sure or have to. @@ -1893,6 +1897,16 @@ ahci_end_transaction(struct ahci_slot *s res->sector_count_exp = fis[13]; } else bzero(res, sizeof(*res)); + if ((ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) == 0 && + (ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + ccb->ataio.resid = + ccb->ataio.dxfer_len - le32toh(clp->bytecount); + } + } else { + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + ccb->csio.resid = + ccb->csio.dxfer_len - le32toh(clp->bytecount); + } } if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map, Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Mon Nov 8 15:25:12 2010 (r214987) +++ head/sys/dev/ata/ata-all.c Mon Nov 8 15:36:15 2010 (r214988) @@ -1517,6 +1517,15 @@ ata_cam_end_transaction(device_t dev, st res->sector_count = request->u.ata.count; res->sector_count_exp = request->u.ata.count >> 8; } + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + ccb->ataio.resid = + ccb->ataio.dxfer_len - request->donecount; + } else { + ccb->csio.resid = + ccb->csio.dxfer_len - request->donecount; + } + } ata_free_request(request); xpt_done(ccb); /* Do error recovery if needed. */ Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Mon Nov 8 15:25:12 2010 (r214987) +++ head/sys/dev/siis/siis.c Mon Nov 8 15:36:15 2010 (r214988) @@ -1208,6 +1208,17 @@ siis_end_transaction(struct siis_slot *s res->sector_count_exp = ATA_INB(ch->r_mem, offs + 13); } else bzero(res, sizeof(*res)); + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN && + ch->numrslots == 1) { + ccb->ataio.resid = ccb->ataio.dxfer_len - + ATA_INL(ch->r_mem, SIIS_P_LRAM_SLOT(slot->slot) + 4); + } + } else { + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN && + ch->numrslots == 1) { + ccb->csio.resid = ccb->csio.dxfer_len - + ATA_INL(ch->r_mem, SIIS_P_LRAM_SLOT(slot->slot) + 4); + } } if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmamap_sync(ch->dma.data_tag, slot->dma.data_map, From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 15:37:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63E96106566C; Mon, 8 Nov 2010 15:37:15 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 308908FC1D; Mon, 8 Nov 2010 15:37:14 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id 816C511B850; Mon, 8 Nov 2010 09:37:14 -0600 (CST) Received: from 192.168.1.70 (bl17-210-129.dsl.telepac.pt [188.82.210.129]) by lavabit.com with ESMTP id YNFCF895O5B0; Mon, 08 Nov 2010 09:37:14 -0600 References: <201011081331.oA8DViNq033723@svn.freebsd.org> In-Reply-To: Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii Message-Id: Content-Transfer-Encoding: quoted-printable From: Rui Paulo Date: Mon, 8 Nov 2010 15:37:10 +0000 To: Hajimu UMEMOTO X-Mailer: Apple Mail (2.1081) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r214984 - stable/8/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 15:37:15 -0000 On Nov 8, 2010, at 3:19 PM, Hajimu UMEMOTO wrote: > Hi, >=20 >>>>>> On Mon, 8 Nov 2010 15:06:12 +0000 >>>>>> Rui Paulo said: >=20 > rpaulo> It's on my plans, but basename_r is not POSIX and there was a = private discussion about it a couple of weeks ago. The conclusion is = that we should adopt the Android semantics of basename_r(). >=20 > I found the thread, and understood it. However, I still wonderling if > breaking thread-safeness in proc_sym.c is okay, though it may not be > necessary. We can live with it for now while I work on a new basename_r(). Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 15:59:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D709E1065672; Mon, 8 Nov 2010 15:59:41 +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 C55B28FC16; Mon, 8 Nov 2010 15:59:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8FxfYb039175; Mon, 8 Nov 2010 15:59:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8FxfQs039172; Mon, 8 Nov 2010 15:59:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011081559.oA8FxfQs039172@svn.freebsd.org> From: Alexander Motin Date: Mon, 8 Nov 2010 15:59: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: r214989 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 15:59:41 -0000 Author: mav Date: Mon Nov 8 15:59:41 2010 New Revision: 214989 URL: http://svn.freebsd.org/changeset/base/214989 Log: When requesting sense data for SIM not doing it automatically (such as ATAPI or USB), request only as much data as requested by consumer. On the way back -- report how much sense data we have actually received. Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Mon Nov 8 15:36:15 2010 (r214988) +++ head/sys/cam/cam_periph.c Mon Nov 8 15:59:41 2010 (r214989) @@ -1055,6 +1055,7 @@ camperiphsensedone(struct cam_periph *pe saved_ccb->ccb_h.status |= CAM_AUTOSENSE_FAIL; } + saved_ccb->csio.sense_resid = done_ccb->csio.resid; bcopy(saved_ccb, done_ccb, sizeof(union ccb)); xpt_free_ccb(saved_ccb); break; @@ -1211,7 +1212,7 @@ camperiphdone(struct cam_periph *periph, scsi_request_sense(&done_ccb->csio, /*retries*/1, camperiphsensedone, &save_ccb->csio.sense_data, - sizeof(save_ccb->csio.sense_data), + save_ccb->csio.sense_len, CAM_TAG_ACTION_NONE, /*sense_len*/SSD_FULL_SIZE, /*timeout*/5000); @@ -1602,7 +1603,7 @@ camperiphscsisenseerror(union ccb *ccb, scsi_request_sense(&ccb->csio, /*retries*/1, camperiphsensedone, &orig_ccb->csio.sense_data, - sizeof(orig_ccb->csio.sense_data), + orig_ccb->csio.sense_len, CAM_TAG_ACTION_NONE, /*sense_len*/SSD_FULL_SIZE, /*timeout*/5000); From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 16:10:44 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE2E31065675; Mon, 8 Nov 2010 16:10:44 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 3976F8FC24; Mon, 8 Nov 2010 16:10:44 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.4/8.14.4) with ESMTP/inet6 id oA8GAcsu003396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Nov 2010 01:10:38 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 09 Nov 2010 01:10:37 +0900 Message-ID: From: Hajimu UMEMOTO To: Rui Paulo In-Reply-To: References: <201011081331.oA8DViNq033723@svn.freebsd.org> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.2 (i386-portbld-freebsd8.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.1-STABLE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 09 Nov 2010 01:10:38 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96.4 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on asuka.mahoroba.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r214984 - stable/8/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 16:10:45 -0000 Hi, >>>>> On Mon, 8 Nov 2010 15:37:10 +0000 >>>>> Rui Paulo said: rpaulo> We can live with it for now while I work on a new basename_r(). Okay, thanks. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:00:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A8F6106564A; Mon, 8 Nov 2010 19:00:22 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7877A8FC16; Mon, 8 Nov 2010 19:00:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8J0MOY046769; Mon, 8 Nov 2010 19:00:22 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8J0MRe046767; Mon, 8 Nov 2010 19:00:22 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011081900.oA8J0MRe046767@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 8 Nov 2010 19:00: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: r214990 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:00:22 -0000 Author: obrien Date: Mon Nov 8 19:00:22 2010 New Revision: 214990 URL: http://svn.freebsd.org/changeset/base/214990 Log: Back out r214961 for skeleton.c -- it broke the groff build. Modified: head/usr.bin/yacc/skeleton.c Modified: head/usr.bin/yacc/skeleton.c ============================================================================== --- head/usr.bin/yacc/skeleton.c Mon Nov 8 15:59:41 2010 (r214989) +++ head/usr.bin/yacc/skeleton.c Mon Nov 8 19:00:22 2010 (r214990) @@ -157,14 +157,14 @@ const char *body[] = " else if ((newsize *= 2) > YYMAXDEPTH)", " newsize = YYMAXDEPTH;", " i = yyssp - yyss;", - " newss = yyss ? realloc(yyss, newsize * sizeof *newss) :", - " malloc(newsize * sizeof *newss);", + " newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :", + " (short *)malloc(newsize * sizeof *newss);", " if (newss == NULL)", " return -1;", " yyss = newss;", " yyssp = newss + i;", - " newvs = yyvs ? realloc(yyvs, newsize * sizeof *newvs) :", - " malloc(newsize * sizeof *newvs);", + " newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :", + " (YYSTYPE *)malloc(newsize * sizeof *newvs);", " if (newvs == NULL)", " return -1;", " yyvs = newvs;", From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:12:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49A99106566B; Mon, 8 Nov 2010 19:12:20 +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 35E3A8FC12; Mon, 8 Nov 2010 19:12:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JCKlQ047409; Mon, 8 Nov 2010 19:12:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JCKIt047407; Mon, 8 Nov 2010 19:12:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011081912.oA8JCKIt047407@svn.freebsd.org> From: Alexander Motin Date: Mon, 8 Nov 2010 19:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214991 - stable/8/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:12:20 -0000 Author: mav Date: Mon Nov 8 19:12:19 2010 New Revision: 214991 URL: http://svn.freebsd.org/changeset/base/214991 Log: MFC r214321: Do some whitespace and `identify` output cleanup. Modified: stable/8/sbin/camcontrol/camcontrol.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Mon Nov 8 19:00:22 2010 (r214990) +++ stable/8/sbin/camcontrol/camcontrol.c Mon Nov 8 19:12:19 2010 (r214991) @@ -116,7 +116,7 @@ typedef enum { } cam_argmask; struct camcontrol_opts { - const char *optname; + const char *optname; cam_cmdmask cmdnum; cam_argmask argnum; const char *subopt; @@ -204,7 +204,7 @@ static int readdefects(struct cam_device char *combinedopt, int retry_count, int timeout); static void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); -static int scsicmd(struct cam_device *device, int argc, char **argv, +static int scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int tagcontrol(struct cam_device *device, int argc, char **argv, char *combinedopt); @@ -234,7 +234,7 @@ static int atapm(struct cam_device *devi #endif camcontrol_optret -getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, +getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, const char **subopt) { struct camcontrol_opts *opts; @@ -622,7 +622,7 @@ scsistart(struct cam_device *device, int else fprintf(stdout, "Error received from stop unit command\n"); - + if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); @@ -688,7 +688,7 @@ scsiinquiry(struct cam_device *device, i union ccb *ccb; struct scsi_inquiry_data *inq_buf; int error = 0; - + ccb = cam_getccb(device); if (ccb == NULL) { @@ -721,13 +721,13 @@ scsiinquiry(struct cam_device *device, i * scsi_inquiry() will convert an inq_len (which is passed in as * a u_int32_t, but the field in the CDB is only 1 byte) of 256 * to 0. Evidently, very few devices meet the spec in that - * regard. Some devices, like many Seagate disks, take the 0 as + * regard. Some devices, like many Seagate disks, take the 0 as * 0, and don't return any data. One Pioneer DVD-R drive * returns more data than the command asked for. * * So, since there are numerous devices that just don't work * right with the full inquiry size, we don't send the full size. - * + * * - The second reason not to use the full inquiry data length is * that we don't need it here. The only reason we issue a * standard inquiry is to get the vendor name, device name, @@ -1181,7 +1181,7 @@ atacapprint(struct ata_params *parm) } printf("\nFeature " - "Support Enable Value Vendor\n"); + "Support Enabled Value Vendor\n"); printf("read ahead %s %s\n", parm->support.command1 & ATA_SUPPORT_LOOKAHEAD ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_LOOKAHEAD ? "yes" : "no"); @@ -1201,16 +1201,13 @@ atacapprint(struct ata_params *parm) ATA_QUEUE_LEN(parm->queue) + 1); } else printf("\n"); - if (parm->satacapabilities && parm->satacapabilities != 0xffff) { - printf("Native Command Queuing (NCQ) %s ", - parm->satacapabilities & ATA_SUPPORT_NCQ ? - "yes" : "no"); - if (parm->satacapabilities & ATA_SUPPORT_NCQ) { - printf(" %d tags\n", - ATA_QUEUE_LEN(parm->queue) + 1); - } else - printf("\n"); - } + printf("Native Command Queuing (NCQ) "); + if (parm->satacapabilities != 0xffff && + (parm->satacapabilities & ATA_SUPPORT_NCQ)) { + printf("yes %d tags\n", + ATA_QUEUE_LEN(parm->queue) + 1); + } else + printf("no\n"); printf("SMART %s %s\n", parm->support.command1 & ATA_SUPPORT_SMART ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_SMART ? "yes" : "no"); @@ -1223,28 +1220,39 @@ atacapprint(struct ata_params *parm) printf("power management %s %s\n", parm->support.command1 & ATA_SUPPORT_POWERMGT ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_POWERMGT ? "yes" : "no"); - printf("advanced power management %s %s %d/0x%02X\n", + printf("advanced power management %s %s", parm->support.command2 & ATA_SUPPORT_APM ? "yes" : "no", - parm->enabled.command2 & ATA_SUPPORT_APM ? "yes" : "no", - parm->apm_value, parm->apm_value); - printf("automatic acoustic management %s %s " - "%d/0x%02X %d/0x%02X\n", + parm->enabled.command2 & ATA_SUPPORT_APM ? "yes" : "no"); + if (parm->support.command2 & ATA_SUPPORT_APM) { + printf(" %d/0x%02X\n", + parm->apm_value, parm->apm_value); + } else + printf("\n"); + printf("automatic acoustic management %s %s", parm->support.command2 & ATA_SUPPORT_AUTOACOUSTIC ? "yes" :"no", - parm->enabled.command2 & ATA_SUPPORT_AUTOACOUSTIC ? "yes" :"no", - ATA_ACOUSTIC_CURRENT(parm->acoustic), - ATA_ACOUSTIC_CURRENT(parm->acoustic), - ATA_ACOUSTIC_VENDOR(parm->acoustic), - ATA_ACOUSTIC_VENDOR(parm->acoustic)); + parm->enabled.command2 & ATA_SUPPORT_AUTOACOUSTIC ? "yes" :"no"); + if (parm->support.command2 & ATA_SUPPORT_AUTOACOUSTIC) { + printf(" %d/0x%02X %d/0x%02X\n", + ATA_ACOUSTIC_CURRENT(parm->acoustic), + ATA_ACOUSTIC_CURRENT(parm->acoustic), + ATA_ACOUSTIC_VENDOR(parm->acoustic), + ATA_ACOUSTIC_VENDOR(parm->acoustic)); + } else + printf("\n"); printf("media status notification %s %s\n", parm->support.command2 & ATA_SUPPORT_NOTIFY ? "yes" : "no", parm->enabled.command2 & ATA_SUPPORT_NOTIFY ? "yes" : "no"); printf("power-up in Standby %s %s\n", parm->support.command2 & ATA_SUPPORT_STANDBY ? "yes" : "no", parm->enabled.command2 & ATA_SUPPORT_STANDBY ? "yes" : "no"); - printf("write-read-verify %s %s %d/0x%x\n", + printf("write-read-verify %s %s", parm->support2 & ATA_SUPPORT_WRITEREADVERIFY ? "yes" : "no", - parm->enabled2 & ATA_SUPPORT_WRITEREADVERIFY ? "yes" : "no", - parm->wrv_mode, parm->wrv_mode); + parm->enabled2 & ATA_SUPPORT_WRITEREADVERIFY ? "yes" : "no"); + if (parm->support2 & ATA_SUPPORT_WRITEREADVERIFY) { + printf(" %d/0x%x\n", + parm->wrv_mode, parm->wrv_mode); + } else + printf("\n"); printf("unload %s %s\n", parm->support.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no", parm->enabled.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no"); @@ -1255,7 +1263,6 @@ atacapprint(struct ata_params *parm) parm->support_dsm & ATA_SUPPORT_DSM_TRIM ? "yes" : "no"); } - static int ataidentify(struct cam_device *device, int retry_count, int timeout) { @@ -1902,7 +1909,7 @@ readdefects(struct cam_device *device, i /* * XXX KDM I should probably clean up the printout format for the - * disk defects. + * disk defects. */ switch (returned_format & SRDDH10_DLIST_FORMAT_MASK){ case SRDDH10_PHYSICAL_SECTOR_FORMAT: @@ -2011,7 +2018,7 @@ void reassignblocks(struct cam_device *device, u_int32_t *blocks, int num_blocks) { union ccb *ccb; - + ccb = cam_getccb(device); cam_freeccb(ccb); @@ -2114,7 +2121,7 @@ mode_select(struct cam_device *device, i err(1, "error sending mode select command"); else errx(1, "error sending mode select command"); - + } cam_freeccb(ccb); @@ -2294,7 +2301,7 @@ scsicmd(struct cam_device *device, int a if (arglist & CAM_ARG_CMD_IN) { warnx("command must either be " "read or write, not both"); - error = 1; + error = 1; goto scsicmd_bailout; } arglist |= CAM_ARG_CMD_OUT; @@ -2611,7 +2618,7 @@ camdebug(int argc, char **argv, char *co warnx("bus:target, or bus:target:lun to debug"); } } - + if (error == 0) { ccb.ccb_h.func_code = XPT_DEBUG; @@ -2874,7 +2881,7 @@ cts_print(struct cam_device *device, str } /* - * Get a path inquiry CCB for the specified device. + * Get a path inquiry CCB for the specified device. */ static int get_cpi(struct cam_device *device, struct ccb_pathinq *cpi) @@ -2913,7 +2920,7 @@ get_cpi_bailout: } /* - * Get a get device CCB for the specified device. + * Get a get device CCB for the specified device. */ static int get_cgd(struct cam_device *device, struct ccb_getdev *cgd) @@ -3754,9 +3761,9 @@ doreport: fprintf(stdout, "\rFormatting: %ju.%02u %% " "(%d/%d) done", - (uintmax_t)(percentage / + (uintmax_t)(percentage / (0x10000 * 100)), - (unsigned)((percentage / + (unsigned)((percentage / 0x10000) % 100), val, 0x10000); fflush(stdout); @@ -3946,7 +3953,7 @@ retry: case RPL_LUNDATA_ATYP_PERIPH: if ((lundata->luns[i].lundata[j] & RPL_LUNDATA_PERIPH_BUS_MASK) != 0) - fprintf(stdout, "%d:", + fprintf(stdout, "%d:", lundata->luns[i].lundata[j] & RPL_LUNDATA_PERIPH_BUS_MASK); else if ((j == 0) @@ -3984,7 +3991,7 @@ retry: field_len_code = (lundata->luns[i].lundata[j] & RPL_LUNDATA_EXT_LEN_MASK) >> 4; field_len = field_len_code * 2; - + if ((eam_code == RPL_LUNDATA_EXT_EAM_WK) && (field_len_code == 0x00)) { fprintf(stdout, "%d", @@ -4342,7 +4349,7 @@ bailout: #endif /* MINIMALISTIC */ -void +void usage(int verbose) { fprintf(verbose ? stdout : stderr, @@ -4484,7 +4491,7 @@ usage(int verbose) #endif /* MINIMALISTIC */ } -int +int main(int argc, char **argv) { int c; @@ -4534,7 +4541,7 @@ main(int argc, char **argv) * this. getopt is kinda braindead, so you end up having to run * through the options twice, and give each invocation of getopt * the option string for the other invocation. - * + * * You would think that you could just have two groups of options. * The first group would get parsed by the first invocation of * getopt, and the second group would get parsed by the second @@ -4543,13 +4550,13 @@ main(int argc, char **argv) * to the argument _after_ the first argument in the second group. * So when the second invocation of getopt comes around, it doesn't * recognize the first argument it gets and then bails out. - * + * * A nice alternative would be to have a flag for getopt that says * "just keep parsing arguments even when you encounter an unknown * argument", but there isn't one. So there's no real clean way to * easily parse two sets of arguments without having one invocation * of getopt know about the other. - * + * * Without this hack, the first invocation of getopt would work as * long as the generic arguments are first, but the second invocation * (in the subfunction) would fail in one of two ways. In the case @@ -4563,14 +4570,14 @@ main(int argc, char **argv) * whether optind had been incremented one option too far. The * mechanics of that, however, are more daunting than just giving * both invocations all of the expect options for either invocation. - * + * * Needless to say, I wouldn't mind if someone invented a better * (non-GPL!) command line parsing interface than getopt. I * wouldn't mind if someone added more knobs to getopt to make it * work better. Who knows, I may talk myself into doing it someday, * if the standards weenies let me. As it is, it just leads to * hackery like this and causes people to avoid it in some cases. - * + * * KDM, September 8th, 1998 */ if (subopt != NULL) From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:15:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D045106566B; Mon, 8 Nov 2010 19:15:32 +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 20D278FC14; Mon, 8 Nov 2010 19:15:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JFWaj047579; Mon, 8 Nov 2010 19:15:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JFWPj047577; Mon, 8 Nov 2010 19:15:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011081915.oA8JFWPj047577@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 19:15: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: r214992 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:15:32 -0000 Author: yongari Date: Mon Nov 8 19:15:31 2010 New Revision: 214992 URL: http://svn.freebsd.org/changeset/base/214992 Log: Reduce spin wait time consumed in GMII register access routine. There were a couple of attempts in the past to reduce it since it took more than 1ms. Because mii_tick() periodically polls link status, waiting more than 1ms for each GMII register access was overkill. Unfortunately all previous attempts were failed with various ways on different controllers. This time, add additional 20us dealy at the end of GMII register access which seems to requirement of all RealTek controllers to issue next GMII register access request. This is the same way what Linux does. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Nov 8 19:12:19 2010 (r214991) +++ head/sys/dev/re/if_re.c Mon Nov 8 19:15:31 2010 (r214992) @@ -423,13 +423,12 @@ re_gmii_readreg(device_t dev, int phy, i } CSR_WRITE_4(sc, RL_PHYAR, reg << 16); - DELAY(1000); for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); if (rval & RL_PHYAR_BUSY) break; - DELAY(100); + DELAY(25); } if (i == RL_PHY_TIMEOUT) { @@ -437,6 +436,11 @@ re_gmii_readreg(device_t dev, int phy, i return (0); } + /* + * Controller requires a 20us delay to process next MDIO request. + */ + DELAY(20); + return (rval & RL_PHYAR_PHYDATA); } @@ -451,13 +455,12 @@ re_gmii_writereg(device_t dev, int phy, CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) | (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); - DELAY(1000); for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); if (!(rval & RL_PHYAR_BUSY)) break; - DELAY(100); + DELAY(25); } if (i == RL_PHY_TIMEOUT) { @@ -465,6 +468,11 @@ re_gmii_writereg(device_t dev, int phy, return (0); } + /* + * Controller requires a 20us delay to process next MDIO request. + */ + DELAY(20); + return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:22:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 726BB1065670; Mon, 8 Nov 2010 19:22:37 +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 45B448FC08; Mon, 8 Nov 2010 19:22:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JMbCJ047924; Mon, 8 Nov 2010 19:22:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JMbiF047921; Mon, 8 Nov 2010 19:22:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011081922.oA8JMbiF047921@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 19:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214993 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:22:37 -0000 Author: yongari Date: Mon Nov 8 19:22:36 2010 New Revision: 214993 URL: http://svn.freebsd.org/changeset/base/214993 Log: MFC r214427: Add BCM5717C 10/100/1000TX PHY id. Modified: stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/miidevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Mon Nov 8 19:15:31 2010 (r214992) +++ stable/8/sys/dev/mii/brgphy.c Mon Nov 8 19:22:36 2010 (r214993) @@ -141,6 +141,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S), + MII_PHY_DESC(xxBROADCOM_ALT2, BCM5717C), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; @@ -253,6 +254,9 @@ brgphy_attach(device_t dev) break; } break; + case MII_OUI_xxBROADCOM_ALT2: + /* No special handling yet. */ + break; default: device_printf(dev, "Unrecognized OUI for PHY!\n"); } @@ -1011,6 +1015,7 @@ brgphy_reset(struct mii_softc *sc) } break; case MII_OUI_xxBROADCOM_ALT1: + case MII_OUI_xxBROADCOM_ALT2: break; } Modified: stable/8/sys/dev/mii/miidevs ============================================================================== --- stable/8/sys/dev/mii/miidevs Mon Nov 8 19:15:31 2010 (r214992) +++ stable/8/sys/dev/mii/miidevs Mon Nov 8 19:22:36 2010 (r214993) @@ -81,6 +81,7 @@ oui xxINTEL 0x00f800 Intel oui xxALTIMA 0x000895 Altima Communications oui xxBROADCOM 0x000818 Broadcom Corporation oui xxBROADCOM_ALT1 0x0050ef Broadcom Corporation +oui xxBROADCOM_ALT2 0x00d897 Broadcom Corporation oui xxICS 0x00057d Integrated Circuit Systems oui xxSEEQ 0x0005be Seeq oui xxSIS 0x000760 Silicon Integrated Systems @@ -153,6 +154,7 @@ model xxBROADCOM_ALT1 BCM5784 0x003a BCM model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5761 0x003d BCM5761 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5709S 0x003f BCM5709S 1000/2500baseSX PHY +model xxBROADCOM_ALT2 BCM5717C 0x0020 BCM5717C 10/100/1000baseTX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:25:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFFEC1065670; Mon, 8 Nov 2010 19:25:47 +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 B38B08FC14; Mon, 8 Nov 2010 19:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JPlq2048103; Mon, 8 Nov 2010 19:25:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JPluj048100; Mon, 8 Nov 2010 19:25:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011081925.oA8JPluj048100@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 19:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214994 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:25:48 -0000 Author: yongari Date: Mon Nov 8 19:25:47 2010 New Revision: 214994 URL: http://svn.freebsd.org/changeset/base/214994 Log: MFC r214427: Add BCM5717C 10/100/1000TX PHY id. Modified: stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/miidevs Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Mon Nov 8 19:22:36 2010 (r214993) +++ stable/7/sys/dev/mii/brgphy.c Mon Nov 8 19:25:47 2010 (r214994) @@ -141,6 +141,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S), + MII_PHY_DESC(xxBROADCOM_ALT2, BCM5717C), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; @@ -253,6 +254,9 @@ brgphy_attach(device_t dev) break; } break; + case MII_OUI_xxBROADCOM_ALT2: + /* No special handling yet. */ + break; default: device_printf(dev, "Unrecognized OUI for PHY!\n"); } @@ -999,6 +1003,7 @@ brgphy_reset(struct mii_softc *sc) } break; case MII_OUI_xxBROADCOM_ALT1: + case MII_OUI_xxBROADCOM_ALT2: break; } Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Mon Nov 8 19:22:36 2010 (r214993) +++ stable/7/sys/dev/mii/miidevs Mon Nov 8 19:25:47 2010 (r214994) @@ -79,6 +79,7 @@ oui xxINTEL 0x00f800 Intel oui xxALTIMA 0x000895 Altima Communications oui xxBROADCOM 0x000818 Broadcom Corporation oui xxBROADCOM_ALT1 0x0050ef Broadcom Corporation +oui xxBROADCOM_ALT2 0x00d897 Broadcom Corporation oui xxICS 0x00057d Integrated Circuit Systems oui xxSEEQ 0x0005be Seeq oui xxSIS 0x000760 Silicon Integrated Systems @@ -148,6 +149,7 @@ model xxBROADCOM_ALT1 BCM5784 0x003a BCM model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5761 0x003d BCM5761 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5709S 0x003f BCM5709S 1000/2500baseSX PHY +model xxBROADCOM_ALT2 BCM5717C 0x0020 BCM5717C 10/100/1000baseTX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:31:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE7D1106566B; Mon, 8 Nov 2010 19:31:41 +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 CBF9F8FC16; Mon, 8 Nov 2010 19:31:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JVfaD048405; Mon, 8 Nov 2010 19:31:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JVfkN048403; Mon, 8 Nov 2010 19:31:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011081931.oA8JVfkN048403@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 19:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214995 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:31:42 -0000 Author: yongari Date: Mon Nov 8 19:31:41 2010 New Revision: 214995 URL: http://svn.freebsd.org/changeset/base/214995 Log: MFC r213486: Remove bge_tx_buf_ratio, unused member of softc. Modified: stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Nov 8 19:25:47 2010 (r214994) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Nov 8 19:31:41 2010 (r214995) @@ -2759,7 +2759,6 @@ struct bge_softc { uint32_t bge_tx_prodidx; uint32_t bge_rx_max_coal_bds; uint32_t bge_tx_max_coal_bds; - uint32_t bge_tx_buf_ratio; uint32_t bge_mi_mode; int bge_if_flags; int bge_txcnt; From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:33:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F24FA1065670; Mon, 8 Nov 2010 19:33:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFC468FC16; Mon, 8 Nov 2010 19:33:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JXDDU048538; Mon, 8 Nov 2010 19:33:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JXDQT048536; Mon, 8 Nov 2010 19:33:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011081933.oA8JXDQT048536@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 19:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214996 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:33:14 -0000 Author: yongari Date: Mon Nov 8 19:33:13 2010 New Revision: 214996 URL: http://svn.freebsd.org/changeset/base/214996 Log: MFC r213486: Remove bge_tx_buf_ratio, unused member of softc. Modified: stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Mon Nov 8 19:31:41 2010 (r214995) +++ stable/7/sys/dev/bge/if_bgereg.h Mon Nov 8 19:33:13 2010 (r214996) @@ -2759,7 +2759,6 @@ struct bge_softc { uint32_t bge_tx_prodidx; uint32_t bge_rx_max_coal_bds; uint32_t bge_tx_max_coal_bds; - uint32_t bge_tx_buf_ratio; uint32_t bge_mi_mode; int bge_if_flags; int bge_txcnt; From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:36:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1B461065670; Mon, 8 Nov 2010 19:36:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE0938FC12; Mon, 8 Nov 2010 19:36:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8Ja0l6048707; Mon, 8 Nov 2010 19:36:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8Ja0kP048704; Mon, 8 Nov 2010 19:36:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011081936.oA8Ja0kP048704@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 19:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214997 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:36:00 -0000 Author: yongari Date: Mon Nov 8 19:36:00 2010 New Revision: 214997 URL: http://svn.freebsd.org/changeset/base/214997 Log: MFC r214428: Add initial BCM5718 family support. The BCM5718 family includes the dual port BCM5717 and BCM5718 devices which are intended for mainstream workstation and entry-level server designs and represents the twelfth generation of NetXtreme Ethernet controllers. This family is the successor to the BCM5714/BCM5715 family and supports IPv4/IPv6 checksum offloading, TSO, VLAN hardware tagging, jumbo frames, MSI/MSIX, IOV, RSS and TSS. This change set supports all hardware features except IOV and RSS/TSS. Unlike its predecessors, only extended RX buffer descriptors can be posted to the jumbo producer ring. Single RX buffer descriptors for jumbo frame are not supported. RSS requires a more substantial set of changes and will apply to a larger set of NetXtreme devices so RSS/TSS multi-queue support will be implemented in a future releases. Special thanks to Broadcom who kindly sent a sample board to me and to davidch who gave provided the initial support code. Submitted by: davidch (initial version) HW donated by: Broadcom Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Nov 8 19:33:13 2010 (r214996) +++ stable/8/sys/dev/bge/if_bge.c Mon Nov 8 19:36:00 2010 (r214997) @@ -169,6 +169,8 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5714S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5715 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5715S }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5717 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5718 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, @@ -289,6 +291,8 @@ static const struct bge_revision { { BGE_CHIPID_BCM5715_A0, "BCM5715 A0" }, { BGE_CHIPID_BCM5715_A1, "BCM5715 A1" }, { BGE_CHIPID_BCM5715_A3, "BCM5715 A3" }, + { BGE_CHIPID_BCM5717_A0, "BCM5717 A0" }, + { BGE_CHIPID_BCM5717_B0, "BCM5717 B0" }, { BGE_CHIPID_BCM5755_A0, "BCM5755 A0" }, { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, @@ -332,6 +336,7 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, + { BGE_ASICREV_BCM5717, "unknown BCM5717" }, { 0, NULL } }; @@ -342,6 +347,7 @@ static const struct bge_revision bge_maj #define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5714_FAMILY) #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) #define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) +#define BGE_IS_5717_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5717_PLUS) const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); @@ -367,6 +373,7 @@ static int bge_get_eaddr_eeprom(struct b static int bge_get_eaddr(struct bge_softc *, uint8_t[]); static void bge_txeof(struct bge_softc *, uint16_t); +static void bge_rxcsum(struct bge_softc *, struct bge_rx_bd *, struct mbuf *); static int bge_rxeof(struct bge_softc *, uint16_t, int); static void bge_asf_driver_up (struct bge_softc *); @@ -376,7 +383,7 @@ static void bge_stats_update(struct bge_ static void bge_stats_update_regs(struct bge_softc *); static struct mbuf *bge_check_short_dma(struct mbuf *); static struct mbuf *bge_setup_tso(struct bge_softc *, struct mbuf *, - uint16_t *); + uint16_t *, uint16_t *); static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); @@ -1349,12 +1356,15 @@ bge_stop_fw(struct bge_softc *sc) static int bge_chipinit(struct bge_softc *sc) { - uint32_t dma_rw_ctl; + uint32_t dma_rw_ctl, misc_ctl; uint16_t val; int i; /* Set endianness before we access any non-PCI registers. */ - pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4); + misc_ctl = BGE_INIT; + if (sc->bge_flags & BGE_FLAG_TAGGED_STATUS) + misc_ctl |= BGE_PCIMISCCTL_TAGGED_STATUS; + pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, misc_ctl, 4); /* Clear the MAC control register */ CSR_WRITE_4(sc, BGE_MAC_MODE, 0); @@ -1446,6 +1456,8 @@ bge_chipinit(struct bge_softc *sc) if (sc->bge_asicrev == BGE_ASICREV_BCM5703 || sc->bge_asicrev == BGE_ASICREV_BCM5704) dma_rw_ctl &= ~BGE_PCIDMARWCTL_MINDMA; + if (BGE_IS_5717_PLUS(sc)) + dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT; pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); /* @@ -1529,7 +1541,16 @@ bge_blockinit(struct bge_softc *sc) } /* Configure mbuf pool watermarks */ - if (!BGE_IS_5705_PLUS(sc)) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0); + if (sc->bge_ifp->if_mtu > ETHERMTU) { + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x7e); + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xea); + } else { + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x2a); + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xa0); + } + } else if (!BGE_IS_5705_PLUS(sc)) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x50); CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x20); CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60); @@ -1621,7 +1642,16 @@ bge_blockinit(struct bge_softc *sc) BGE_ADDR_HI(sc->bge_ldata.bge_rx_std_ring_paddr); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREREAD); - if (BGE_IS_5705_PLUS(sc)) { + if (BGE_IS_5717_PLUS(sc)) { + /* + * Bits 31-16: Programmable ring size (2048, 1024, 512, .., 32) + * Bits 15-2 : Maximum RX frame size + * Bit 1 : 1 = Ring Disabled, 0 = Ring ENabled + * Bit 0 : Reserved + */ + rcb->bge_maxlen_flags = + BGE_RCB_MAXLEN_FLAGS(512, BGE_MAX_FRAMELEN << 2); + } else if (BGE_IS_5705_PLUS(sc)) { /* * Bits 31-16: Programmable ring size (512, 256, 128, 64, 32) * Bits 15-2 : Reserved (should be 0) @@ -1640,7 +1670,10 @@ bge_blockinit(struct bge_softc *sc) rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); } - rcb->bge_nicaddr = BGE_STD_RX_RINGS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + rcb->bge_nicaddr = BGE_STD_RX_RINGS_5717; + else + rcb->bge_nicaddr = BGE_STD_RX_RINGS; /* Write the standard receive producer ring control block. */ CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_HI, rcb->bge_hostaddr.bge_addr_hi); CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_LO, rcb->bge_hostaddr.bge_addr_lo); @@ -1669,7 +1702,10 @@ bge_blockinit(struct bge_softc *sc) BUS_DMASYNC_PREREAD); rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED); - rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS_5717; + else + rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_HI, rcb->bge_hostaddr.bge_addr_hi); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_LO, @@ -1726,6 +1762,10 @@ bge_blockinit(struct bge_softc *sc) if (BGE_IS_JUMBO_CAPABLE(sc)) CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, BGE_JUMBO_RX_RING_CNT/8); + if (BGE_IS_5717_PLUS(sc)) { + CSR_WRITE_4(sc, BGE_STD_REPLENISH_LWM, 32); + CSR_WRITE_4(sc, BGE_JMB_REPLENISH_LWM, 16); + } /* * Disable all send rings by setting the 'ring disabled' bit @@ -1750,8 +1790,11 @@ bge_blockinit(struct bge_softc *sc) BGE_HOSTADDR(taddr, sc->bge_ldata.bge_tx_ring_paddr); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, taddr.bge_addr_hi); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); - RCB_WRITE_4(sc, vrcb, bge_nicaddr, - BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT)); + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + RCB_WRITE_4(sc, vrcb, bge_nicaddr, BGE_SEND_RING_5717); + else + RCB_WRITE_4(sc, vrcb, bge_nicaddr, + BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT)); RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, BGE_RCB_MAXLEN_FLAGS(BGE_TX_RING_CNT, 0)); @@ -1760,7 +1803,10 @@ bge_blockinit(struct bge_softc *sc) * 'ring diabled' bit in the flags field of all the receive * return ring control blocks, located in NIC memory. */ - if (!BGE_IS_5705_PLUS(sc)) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + /* Should be 17, use 16 until we get an SRAM map. */ + limit = 16; + } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; else if (sc->bge_asicrev == BGE_ASICREV_BCM5755) limit = 4; @@ -1936,6 +1982,10 @@ bge_blockinit(struct bge_softc *sc) /* Turn on read DMA state machine */ val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS; + + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + val |= BGE_RDMAMODE_MULT_DMA_RD_DIS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780) @@ -1944,16 +1994,18 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; - if (sc->bge_flags & BGE_FLAG_TSO) { + if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) { val |= BGE_RDMAMODE_TSO4_ENABLE; - if (sc->bge_asicrev == BGE_ASICREV_BCM5785 || + if (sc->bge_flags & BGE_FLAG_TSO3 || + sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780) val |= BGE_RDMAMODE_TSO6_ENABLE; } if (sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || - sc->bge_asicrev == BGE_ASICREV_BCM57780) { + sc->bge_asicrev == BGE_ASICREV_BCM57780 || + BGE_IS_5717_PLUS(sc)) { /* * Enable fix for read DMA FIFO overruns. * The fix is to limit the number of RX BDs @@ -1989,8 +2041,9 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ - if (sc->bge_flags & BGE_FLAG_TSO) - CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE | 0x08); + if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) + CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE | + BGE_SDIMODE_HW_LSO_PRE_DMA); else CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); @@ -2104,9 +2157,22 @@ bge_probe(device_t dev) id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; - if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) - id = pci_read_config(dev, - BGE_PCI_PRODID_ASICREV, 4); + if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) { + /* + * Find the ASCI revision. Different chips + * use different registers. + */ + switch (pci_get_device(dev)) { + case BCOM_DEVICEID_BCM5717: + case BCOM_DEVICEID_BCM5718: + id = pci_read_config(dev, + BGE_PCI_GEN2_PRODID_ASICREV, 4); + break; + default: + id = pci_read_config(dev, + BGE_PCI_PRODID_ASICREV, 4); + } + } br = bge_lookup_rev(id); v = bge_lookup_vendor(vid); { @@ -2423,7 +2489,7 @@ bge_dma_alloc(struct bge_softc *sc) return (ENOMEM); } /* Create tag for Tx mbufs. */ - if (sc->bge_flags & BGE_FLAG_TSO) { + if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) { txsegsz = BGE_TSOSEG_SZ; txmaxsegsz = 65535 + sizeof(struct ether_vlan_header); } else { @@ -2539,6 +2605,10 @@ bge_can_use_msi(struct bge_softc *sc) { int can_use_msi = 0; + /* Disable MSI for polling(4). */ +#ifdef DEVICE_POLLING + return (0); +#endif switch (sc->bge_asicrev) { case BGE_ASICREV_BCM5714_A0: case BGE_ASICREV_BCM5714: @@ -2568,7 +2638,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, msicount, phy_addr, reg, rid, trys; + int error, f, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2594,14 +2664,55 @@ bge_attach(device_t dev) sc->bge_chipid = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; - if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) - sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, - 4); + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) { + /* + * Find the ASCI revision. Different chips use different + * registers. + */ + switch (pci_get_device(dev)) { + case BCOM_DEVICEID_BCM5717: + case BCOM_DEVICEID_BCM5718: + sc->bge_chipid = pci_read_config(dev, + BGE_PCI_GEN2_PRODID_ASICREV, 4); + break; + default: + sc->bge_chipid = pci_read_config(dev, + BGE_PCI_PRODID_ASICREV, 4); + } + } sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); /* Set default PHY address. */ phy_addr = 1; + /* + * PHY address mapping for various devices. + * + * | F0 Cu | F0 Sr | F1 Cu | F1 Sr | + * ---------+-------+-------+-------+-------+ + * BCM57XX | 1 | X | X | X | + * BCM5704 | 1 | X | 1 | X | + * BCM5717 | 1 | 8 | 2 | 9 | + * + * Other addresses may respond but they are not + * IEEE compliant PHYs and should be ignored. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + f = pci_get_function(dev); + if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) { + if (CSR_READ_4(sc, BGE_SGDIG_STS) & + BGE_SGDIGSTS_IS_SERDES) + phy_addr = f + 8; + else + phy_addr = f + 1; + } else if (sc->bge_chipid == BGE_CHIPID_BCM5717_B0) { + if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & + BGE_CPMU_PHY_STRAP_IS_SERDES) + phy_addr = f + 8; + else + phy_addr = f + 1; + } + } /* * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the @@ -2610,7 +2721,8 @@ bge_attach(device_t dev) if (sc->bge_asicrev != BGE_ASICREV_BCM5700 && sc->bge_asicrev != BGE_ASICREV_BCM5906 && sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && - sc->bge_chipid != BGE_CHIPID_BCM5705_A1) + sc->bge_chipid != BGE_CHIPID_BCM5705_A1 && + !BGE_IS_5717_PLUS(sc)) sc->bge_phy_flags |= BGE_PHY_WIRESPEED; if (bge_has_eaddr(sc)) @@ -2618,6 +2730,11 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5717: + sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS | + BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO | + BGE_FLAG_SHORT_DMA_BUG | BGE_FLAG_JUMBO_FRAME; + break; case BGE_ASICREV_BCM5755: case BGE_ASICREV_BCM5761: case BGE_ASICREV_BCM5784: @@ -2663,6 +2780,7 @@ bge_attach(device_t dev) sc->bge_phy_flags |= BGE_PHY_NO_3LED; if ((BGE_IS_5705_PLUS(sc)) && sc->bge_asicrev != BGE_ASICREV_BCM5906 && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && sc->bge_asicrev != BGE_ASICREV_BCM5785 && sc->bge_asicrev != BGE_ASICREV_BCM57780) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || @@ -2679,7 +2797,8 @@ bge_attach(device_t dev) } /* Identify the chips that use an CPMU. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || + if (BGE_IS_5717_PLUS(sc) || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780) @@ -2722,7 +2841,10 @@ bge_attach(device_t dev) * the TSO to the controllers that are not affected TSO issues * (e.g. 5755 or higher). */ - if (BGE_IS_5755_PLUS(sc)) { + if (BGE_IS_5717_PLUS(sc)) { + /* BCM5717 requires different TSO configuration. */ + sc->bge_flags |= BGE_FLAG_TSO3; + } else if (BGE_IS_5755_PLUS(sc)) { /* * BCM5754 and BCM5787 shares the same ASIC id so * explicit device id check is required. @@ -2785,6 +2907,16 @@ bge_attach(device_t dev) } } + /* + * All controllers except BCM5700 supports tagged status but + * we use tagged status only for MSI case on BCM5717. Otherwise + * MSI on BCM5717 does not work. + */ +#ifndef DEVICE_POLLING + if (sc->bge_flags & BGE_FLAG_MSI && BGE_IS_5717_PLUS(sc)) + sc->bge_flags |= BGE_FLAG_TAGGED_STATUS; +#endif + sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -2848,7 +2980,9 @@ bge_attach(device_t dev) } /* 5705 limits RX return ring to 512 entries. */ - if (BGE_IS_5705_PLUS(sc)) + if (BGE_IS_5717_PLUS(sc)) + sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT; + else if (BGE_IS_5705_PLUS(sc)) sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705; else sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT; @@ -2893,7 +3027,7 @@ bge_attach(device_t dev) ifp->if_hwassist = sc->bge_csum_features; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; - if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { + if ((sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) != 0) { ifp->if_hwassist |= CSUM_TSO; ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO; } @@ -3340,6 +3474,7 @@ bge_reset(struct bge_softc *sc) /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && sc->bge_chipid != BGE_CHIPID_BCM5750_A0 && sc->bge_asicrev != BGE_ASICREV_BCM5785) { /* Enable Data FIFO protection. */ @@ -3480,20 +3615,8 @@ bge_rxeof(struct bge_softc *sc, uint16_t m->m_pkthdr.len = m->m_len = cur_rx->bge_len - ETHER_CRC_LEN; m->m_pkthdr.rcvif = ifp; - if (ifp->if_capenable & IFCAP_RXCSUM) { - if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; - if ((cur_rx->bge_ip_csum ^ 0xFFFF) == 0) - m->m_pkthdr.csum_flags |= CSUM_IP_VALID; - } - if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM && - m->m_pkthdr.len >= ETHER_MIN_NOPAD) { - m->m_pkthdr.csum_data = - cur_rx->bge_tcp_udp_csum; - m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - } - } + if (ifp->if_capenable & IFCAP_RXCSUM) + bge_rxcsum(sc, cur_rx, m); /* * If we received a packet with a vlan tag, @@ -3552,6 +3675,41 @@ bge_rxeof(struct bge_softc *sc, uint16_t } static void +bge_rxcsum(struct bge_softc *sc, struct bge_rx_bd *cur_rx, struct mbuf *m) +{ + + if (BGE_IS_5717_PLUS(sc)) { + if ((cur_rx->bge_flags & BGE_RXBDFLAG_IPV6) == 0) { + if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((cur_rx->bge_error_flag & + BGE_RXERRFLAG_IP_CSUM_NOK) == 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + } + if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM) { + m->m_pkthdr.csum_data = + cur_rx->bge_tcp_udp_csum; + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + } + } + } else { + if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((cur_rx->bge_ip_csum ^ 0xFFFF) == 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + } + if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM && + m->m_pkthdr.len >= ETHER_MIN_NOPAD) { + m->m_pkthdr.csum_data = + cur_rx->bge_tcp_udp_csum; + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + } + } +} + +static void bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { struct bge_tx_bd *cur_tx; @@ -3668,7 +3826,7 @@ bge_intr_task(void *arg, int pending) { struct bge_softc *sc; struct ifnet *ifp; - uint32_t status; + uint32_t status, status_tag; uint16_t rx_prod, tx_cons; sc = (struct bge_softc *)arg; @@ -3689,16 +3847,19 @@ bge_intr_task(void *arg, int pending) rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; status = sc->bge_ldata.bge_status_block->bge_status; + status_tag = sc->bge_ldata.bge_status_block->bge_status_tag << 24; sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + if ((sc->bge_flags & BGE_FLAG_TAGGED_STATUS) == 0) + status_tag = 0; if ((status & BGE_STATFLAG_LINKSTATE_CHANGED) != 0) bge_link_upd(sc); /* Let controller work. */ - bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); + bge_writembx(sc, BGE_MBX_IRQ0_LO, status_tag); if (ifp->if_drv_flags & IFF_DRV_RUNNING && sc->bge_rx_saved_considx != rx_prod) { @@ -4104,7 +4265,8 @@ bge_check_short_dma(struct mbuf *m) } static struct mbuf * -bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss) +bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss, + uint16_t *flags) { struct ip *ip; struct tcphdr *tcp; @@ -4147,14 +4309,30 @@ bge_setup_tso(struct bge_softc *sc, stru * Broadcom controllers uses different descriptor format for * TSO depending on ASIC revision. Due to TSO-capable firmware * license issue and lower performance of firmware based TSO - * we only support hardware based TSO which is applicable for - * BCM5755 or newer controllers. Hardware based TSO uses 11 - * bits to store MSS and upper 5 bits are used to store IP/TCP - * header length(including IP/TCP options). The header length - * is expressed as 32 bits unit. + * we only support hardware based TSO. */ + /* Calculate header length, incl. TCP/IP options, in 32 bit units. */ hlen = ((ip->ip_hl << 2) + (tcp->th_off << 2)) >> 2; - *mss |= (hlen << 11); + if (sc->bge_flags & BGE_FLAG_TSO3) { + /* + * For BCM5717 and newer controllers, hardware based TSO + * uses the 14 lower bits of the bge_mss field to store the + * MSS and the upper 2 bits to store the lowest 2 bits of + * the IP/TCP header length. The upper 6 bits of the header + * length are stored in the bge_flags[14:10,4] field. Jumbo + * frames are supported. + */ + *mss |= ((hlen & 0x3) << 14); + *flags |= ((hlen & 0xF8) << 7) | ((hlen & 0x4) << 2); + } else { + /* + * For BCM5755 and newer controllers, hardware based TSO uses + * the lower 11 bits to store the MSS and the upper 5 bits to + * store the IP/TCP header length. Jumbo frames are not + * supported. + */ + *mss |= (hlen << 11); + } return (m); } @@ -4184,7 +4362,7 @@ bge_encap(struct bge_softc *sc, struct m m = *m_head; } if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - *m_head = m = bge_setup_tso(sc, m, &mss); + *m_head = m = bge_setup_tso(sc, m, &mss, &csum_flags); if (*m_head == NULL) return (ENOBUFS); csum_flags |= BGE_TXBDFLAG_CPU_PRE_DMA | @@ -4207,21 +4385,26 @@ bge_encap(struct bge_softc *sc, struct m csum_flags |= BGE_TXBDFLAG_IP_FRAG; } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0 && - sc->bge_forced_collapse > 0 && - (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) { - /* - * Forcedly collapse mbuf chains to overcome hardware - * limitation which only support a single outstanding - * DMA read operation. - */ - if (sc->bge_forced_collapse == 1) - m = m_defrag(m, M_DONTWAIT); - else - m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse); - if (m == NULL) - m = *m_head; - *m_head = m; + if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0) { + if (sc->bge_flags & BGE_FLAG_JUMBO_FRAME && + m->m_pkthdr.len > ETHER_MAX_LEN) + csum_flags |= BGE_TXBDFLAG_JUMBO_FRAME; + if (sc->bge_forced_collapse > 0 && + (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) { + /* + * Forcedly collapse mbuf chains to overcome hardware + * limitation which only support a single outstanding + * DMA read operation. + */ + if (sc->bge_forced_collapse == 1) + m = m_defrag(m, M_DONTWAIT); + else + m = m_collapse(m, M_DONTWAIT, + sc->bge_forced_collapse); + if (m == NULL) + m = *m_head; + *m_head = m; + } } map = sc->bge_cdata.bge_tx_dmamap[idx]; Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Nov 8 19:33:13 2010 (r214996) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Nov 8 19:36:00 2010 (r214997) @@ -82,6 +82,7 @@ #define BGE_UNMAPPED_END 0x00001FFF #define BGE_DMA_DESCRIPTORS 0x00002000 #define BGE_DMA_DESCRIPTORS_END 0x00003FFF +#define BGE_SEND_RING_5717 0x00004000 #define BGE_SEND_RING_1_TO_4 0x00004000 #define BGE_SEND_RING_1_TO_4_END 0x00005FFF @@ -100,6 +101,8 @@ #define BGE_BUFFPOOL_2_END 0x00017FFF #define BGE_BUFFPOOL_3 0x00018000 /* or expansion ROM */ #define BGE_BUFFPOOL_3_END 0x0001FFFF +#define BGE_STD_RX_RINGS_5717 0x00040000 +#define BGE_JUMBO_RX_RINGS_5717 0x00044400 /* Mappings for external SSRAM configurations */ #define BGE_SEND_RING_5_TO_6 0x00006000 @@ -219,6 +222,7 @@ #define BGE_PCI_ISR_MBX_HI 0xB0 #define BGE_PCI_ISR_MBX_LO 0xB4 #define BGE_PCI_PRODID_ASICREV 0xBC +#define BGE_PCI_GEN2_PRODID_ASICREV 0xF4 /* PCI Misc. Host control register */ #define BGE_PCIMISCCTL_CLEAR_INTA 0x00000001 @@ -229,6 +233,7 @@ #define BGE_PCIMISCCTL_CLOCKCTL_RW 0x00000020 #define BGE_PCIMISCCTL_REG_WORDSWAP 0x00000040 #define BGE_PCIMISCCTL_INDIRECT_ACCESS 0x00000080 +#define BGE_PCIMISCCTL_TAGGED_STATUS 0x00000200 #define BGE_PCIMISCCTL_ASICREV 0xFFFF0000 #define BGE_PCIMISCCTL_ASICREV_SHIFT 16 @@ -311,6 +316,8 @@ #define BGE_CHIPID_BCM5906_A2 0xc002 #define BGE_CHIPID_BCM57780_A0 0x57780000 #define BGE_CHIPID_BCM57780_A1 0x57780001 +#define BGE_CHIPID_BCM5717_A0 0x05717000 +#define BGE_CHIPID_BCM5717_B0 0x05717100 /* shorthand one */ #define BGE_ASICREV(x) ((x) >> 12) @@ -331,6 +338,7 @@ /* Should consult BGE_PCI_PRODID_ASICREV for ChipID */ #define BGE_ASICREV_USE_PRODID_REG 0x0f /* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ +#define BGE_ASICREV_BCM5717 0x5717 #define BGE_ASICREV_BCM5761 0x5761 #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 @@ -348,11 +356,14 @@ #define BGE_CHIPREV_5750_AX 0x40 #define BGE_CHIPREV_5750_BX 0x41 /* BGE_PCI_PRODID_ASICREV chip rev. identifiers. */ +#define BGE_CHIPREV_5717_AX 0x57170 +#define BGE_CHIPREV_5717_BX 0x57171 #define BGE_CHIPREV_5761_AX 0x57611 #define BGE_CHIPREV_5784_AX 0x57841 /* PCI DMA Read/Write Control register */ #define BGE_PCIDMARWCTL_MINDMA 0x000000FF +#define BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT 0x00000001 #define BGE_PCIDMARWCTL_RDADRR_BNDRY 0x00000700 #define BGE_PCIDMARWCTL_WRADDR_BNDRY 0x00003800 #define BGE_PCIDMARWCTL_ONEDMA_ATONCE 0x0000C000 @@ -566,6 +577,7 @@ #define BGE_TX_RINGS_MAX 4 #define BGE_TX_RINGS_EXTSSRAM_MAX 16 #define BGE_RX_RINGS_MAX 16 +#define BGE_RX_RINGS_MAX_5717 17 /* Ethernet MAC control registers */ #define BGE_MAC_MODE 0x0400 @@ -843,9 +855,10 @@ #define BGE_SGDIGCFG_AUTO 0x80000000 /* SGDIG status (not documented) */ +#define BGE_SGDIGSTS_DONE 0x00000002 +#define BGE_SGDIGSTS_IS_SERDES 0x00000100 #define BGE_SGDIGSTS_PAUSE_CAP 0x00080000 #define BGE_SGDIGSTS_ASYM_PAUSE 0x00100000 -#define BGE_SGDIGSTS_DONE 0x00000002 /* MI communication register */ @@ -911,6 +924,7 @@ #define BGE_SDIMODE_RESET 0x00000001 #define BGE_SDIMODE_ENABLE 0x00000002 #define BGE_SDIMODE_STATS_OFLOW_ATTN 0x00000004 +#define BGE_SDIMODE_HW_LSO_PRE_DMA 0x00000008 /* Send Data Initiator stats register */ #define BGE_SDISTAT_STATS_OFLOW_ATTN 0x00000004 @@ -1188,6 +1202,9 @@ #define BGE_RBDI_STD_REPL_THRESH 0x2C18 #define BGE_RBDI_JUMBO_REPL_THRESH 0x2C1C +#define BGE_STD_REPLENISH_LWM 0x2D00 +#define BGE_JMB_REPLENISH_LWM 0x2D04 + /* Receive BD Initiator Mode register */ #define BGE_RBDIMODE_RESET 0x00000001 #define BGE_RBDIMODE_ENABLE 0x00000002 @@ -1501,6 +1518,7 @@ #define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 +#define BGE_RDMAMODE_MULT_DMA_RD_DIS 0x01000000 #define BGE_RDMAMODE_TSO4_ENABLE 0x08000000 #define BGE_RDMAMODE_TSO6_ENABLE 0x10000000 @@ -2068,15 +2086,27 @@ struct bge_tx_bd { #define BGE_TXBDFLAG_IP_CSUM 0x0002 #define BGE_TXBDFLAG_END 0x0004 #define BGE_TXBDFLAG_IP_FRAG 0x0008 +#define BGE_TXBDFLAG_JUMBO_FRAME 0x0008 /* 5717 */ #define BGE_TXBDFLAG_IP_FRAG_END 0x0010 +#define BGE_TXBDFLAG_HDRLEN_BIT2 0x0010 /* 5717 */ +#define BGE_TXBDFLAG_SNAP 0x0020 /* 5717 */ #define BGE_TXBDFLAG_VLAN_TAG 0x0040 #define BGE_TXBDFLAG_COAL_NOW 0x0080 #define BGE_TXBDFLAG_CPU_PRE_DMA 0x0100 #define BGE_TXBDFLAG_CPU_POST_DMA 0x0200 +#define BGE_TXBDFLAG_HDRLEN_BIT3 0x0400 /* 5717 */ +#define BGE_TXBDFLAG_HDRLEN_BIT4 0x0800 /* 5717 */ #define BGE_TXBDFLAG_INSERT_SRC_ADDR 0x1000 +#define BGE_TXBDFLAG_HDRLEN_BIT5 0x1000 /* 5717 */ +#define BGE_TXBDFLAG_HDRLEN_BIT6 0x2000 /* 5717 */ +#define BGE_TXBDFLAG_HDRLEN_BIT7 0x4000 /* 5717 */ #define BGE_TXBDFLAG_CHOOSE_SRC_ADDR 0x6000 #define BGE_TXBDFLAG_NO_CRC 0x8000 +#define BGE_TXBDFLAG_MSS_SIZE_MASK 0x3FFF /* 5717 */ +/* Bits [1:0] of the MSS header length. */ +#define BGE_TXBDFLAG_MSS_HDRLEN_MASK 0xC000 /* 5717 */ + #define BGE_NIC_TXRING_ADDR(ringno, size) \ BGE_SEND_RING_1_TO_4 + \ ((ringno * sizeof(struct bge_tx_bd) * size) / 4) @@ -2153,6 +2183,7 @@ struct bge_extrx_bd { #define BGE_RXBDFLAG_IP_CSUM 0x1000 #define BGE_RXBDFLAG_TCP_UDP_CSUM 0x2000 #define BGE_RXBDFLAG_TCP_UDP_IS_TCP 0x4000 +#define BGE_RXBDFLAG_IPV6 0x8000 #define BGE_RXERRFLAG_BAD_CRC 0x0001 #define BGE_RXERRFLAG_COLL_DETECT 0x0002 @@ -2162,6 +2193,7 @@ struct bge_extrx_bd { #define BGE_RXERRFLAG_RUNT 0x0020 #define BGE_RXERRFLAG_TRUNC_NO_RSRCS 0x0040 #define BGE_RXERRFLAG_GIANT 0x0080 +#define BGE_RXERRFLAG_IP_CSUM_NOK 0x1000 /* 5717 */ struct bge_sts_idx { #if BYTE_ORDER == LITTLE_ENDIAN @@ -2175,7 +2207,7 @@ struct bge_sts_idx { struct bge_status_block { uint32_t bge_status; - uint32_t bge_rsvd0; + uint32_t bge_status_tag; #if BYTE_ORDER == LITTLE_ENDIAN uint16_t bge_rx_jumbo_cons_idx; uint16_t bge_rx_std_cons_idx; @@ -2221,6 +2253,8 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5714S 0x1669 #define BCOM_DEVICEID_BCM5715 0x1678 #define BCOM_DEVICEID_BCM5715S 0x1679 +#define BCOM_DEVICEID_BCM5717 0x1655 +#define BCOM_DEVICEID_BCM5718 0x1656 #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A @@ -2717,16 +2751,20 @@ struct bge_softc { #define BGE_FLAG_EADDR 0x00000008 #define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_CPMU_PRESENT 0x00000020 +#define BGE_FLAG_TAGGED_STATUS 0x00000040 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 #define BGE_FLAG_TSO 0x00000800 +#define BGE_FLAG_TSO3 0x00001000 +#define BGE_FLAG_JUMBO_FRAME 0x00002000 #define BGE_FLAG_5700_FAMILY 0x00010000 #define BGE_FLAG_5705_PLUS 0x00020000 #define BGE_FLAG_5714_FAMILY 0x00040000 #define BGE_FLAG_575X_PLUS 0x00080000 #define BGE_FLAG_5755_PLUS 0x00100000 #define BGE_FLAG_5788 0x00200000 +#define BGE_FLAG_5717_PLUS 0x00400000 #define BGE_FLAG_40BIT_BUG 0x01000000 #define BGE_FLAG_4G_BNDRY_BUG 0x02000000 #define BGE_FLAG_RX_ALIGNBUG 0x04000000 From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:52:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08C34106566B; Mon, 8 Nov 2010 19:52:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB1808FC26; Mon, 8 Nov 2010 19:52:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JqEnC049441; Mon, 8 Nov 2010 19:52:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JqE1n049439; Mon, 8 Nov 2010 19:52:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011081952.oA8JqE1n049439@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 8 Nov 2010 19:52: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: r214998 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:52:15 -0000 Author: jkim Date: Mon Nov 8 19:52:14 2010 New Revision: 214998 URL: http://svn.freebsd.org/changeset/base/214998 Log: Consistently use padding `_' in the comment. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Nov 8 19:36:00 2010 (r214997) +++ head/sys/dev/acpica/acpi.c Mon Nov 8 19:52:14 2010 (r214998) @@ -1693,7 +1693,7 @@ acpi_probe_child(ACPI_HANDLE handle, UIN /* * Since we scan from \, be sure to skip system scope objects. * \_SB_ and \_TZ_ are defined in ACPICA as devices to work around - * BIOS bugs. For example, \_SB_ is to allow \_SB._INI to be run + * BIOS bugs. For example, \_SB_ is to allow \_SB_._INI to be run * during the intialization and \_TZ_ is to support Notify() on it. */ if (strcmp(handle_str, "\\_SB_") == 0 || From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:53:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3E1C1065670; Mon, 8 Nov 2010 19:53:16 +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 B18DA8FC28; Mon, 8 Nov 2010 19:53:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JrGgL049519; Mon, 8 Nov 2010 19:53:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JrG7L049517; Mon, 8 Nov 2010 19:53:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011081953.oA8JrG7L049517@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 8 Nov 2010 19:53: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: r214999 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:53:16 -0000 Author: nwhitehorn Date: Mon Nov 8 19:53:16 2010 New Revision: 214999 URL: http://svn.freebsd.org/changeset/base/214999 Log: Provide support for IIC_M_NOSTOP/IIC_M_NOSTART for bit-banging and otherwise low-level controllers. Reviewed by: thompsa Modified: head/sys/dev/iicbus/iiconf.c Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Mon Nov 8 19:52:14 2010 (r214998) +++ head/sys/dev/iicbus/iiconf.c Mon Nov 8 19:53:16 2010 (r214999) @@ -363,7 +363,7 @@ iicbus_transfer(device_t bus, struct iic int iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { - int i, error, lenread, lenwrote, nkid; + int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; if ((error = device_get_children(dev, &children, &nkid)) != 0) @@ -373,14 +373,38 @@ iicbus_transfer_gen(device_t dev, struct return (EIO); } bus = children[0]; + rpstart = 0; free(children, M_TEMP); for (i = 0, error = 0; i < nmsgs && error == 0; i++) { + addr = msgs[i].slave; if (msgs[i].flags & IIC_M_RD) - error = iicbus_block_read(bus, msgs[i].slave, - msgs[i].buf, msgs[i].len, &lenread); + addr |= LSB; else - error = iicbus_block_write(bus, msgs[i].slave, - msgs[i].buf, msgs[i].len, &lenwrote); + addr &= ~LSB; + + if (!(msgs[i].flags & IIC_M_NOSTART)) { + if (rpstart) + error = iicbus_repeated_start(bus, addr, 0); + else + error = iicbus_start(bus, addr, 0); + } + + if (error) + break; + + if (msgs[i].flags & IIC_M_RD) + error = iicbus_read(bus, msgs[i].buf, msgs[i].len, + &lenread, IIC_LAST_READ, 0); + else + error = iicbus_write(bus, msgs[i].buf, msgs[i].len, + &lenwrote, 0); + + if (!(msgs[i].flags & IIC_M_NOSTOP)) { + rpstart = 0; + iicbus_stop(bus); + } else { + rpstart = 1; /* Next message gets repeated start */ + } } return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 19:54:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 461AD1065673; Mon, 8 Nov 2010 19:54:45 +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 3234A8FC23; Mon, 8 Nov 2010 19:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8JsjrV049637; Mon, 8 Nov 2010 19:54:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8JsjHu049634; Mon, 8 Nov 2010 19:54:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011081954.oA8JsjHu049634@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 19:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215000 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 19:54:45 -0000 Author: yongari Date: Mon Nov 8 19:54:44 2010 New Revision: 215000 URL: http://svn.freebsd.org/changeset/base/215000 Log: MFC r214428: Add initial BCM5718 family support. The BCM5718 family includes the dual port BCM5717 and BCM5718 devices which are intended for mainstream workstation and entry-level server designs and represents the twelfth generation of NetXtreme Ethernet controllers. This family is the successor to the BCM5714/BCM5715 family and supports IPv4/IPv6 checksum offloading, TSO, VLAN hardware tagging, jumbo frames, MSI/MSIX, IOV, RSS and TSS. This change set supports all hardware features except IOV and RSS/TSS. Unlike its predecessors, only extended RX buffer descriptors can be posted to the jumbo producer ring. Single RX buffer descriptors for jumbo frame are not supported. RSS requires a more substantial set of changes and will apply to a larger set of NetXtreme devices so RSS/TSS multi-queue support will be implemented in a future releases. Special thanks to Broadcom who kindly sent a sample board to me and to davidch who gave provided the initial support code. Submitted by: davidch (initial version) HW donated by: Broadcom Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Mon Nov 8 19:53:16 2010 (r214999) +++ stable/7/sys/dev/bge/if_bge.c Mon Nov 8 19:54:44 2010 (r215000) @@ -169,6 +169,8 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5714S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5715 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5715S }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5717 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5718 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, @@ -289,6 +291,8 @@ static const struct bge_revision { { BGE_CHIPID_BCM5715_A0, "BCM5715 A0" }, { BGE_CHIPID_BCM5715_A1, "BCM5715 A1" }, { BGE_CHIPID_BCM5715_A3, "BCM5715 A3" }, + { BGE_CHIPID_BCM5717_A0, "BCM5717 A0" }, + { BGE_CHIPID_BCM5717_B0, "BCM5717 B0" }, { BGE_CHIPID_BCM5755_A0, "BCM5755 A0" }, { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, @@ -332,6 +336,7 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, + { BGE_ASICREV_BCM5717, "unknown BCM5717" }, { 0, NULL } }; @@ -342,6 +347,7 @@ static const struct bge_revision bge_maj #define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5714_FAMILY) #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) #define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) +#define BGE_IS_5717_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5717_PLUS) const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); @@ -367,6 +373,7 @@ static int bge_get_eaddr_eeprom(struct b static int bge_get_eaddr(struct bge_softc *, uint8_t[]); static void bge_txeof(struct bge_softc *, uint16_t); +static void bge_rxcsum(struct bge_softc *, struct bge_rx_bd *, struct mbuf *); static void bge_rxeof(struct bge_softc *, uint16_t, int); static void bge_asf_driver_up (struct bge_softc *); @@ -376,7 +383,7 @@ static void bge_stats_update(struct bge_ static void bge_stats_update_regs(struct bge_softc *); static struct mbuf *bge_check_short_dma(struct mbuf *); static struct mbuf *bge_setup_tso(struct bge_softc *, struct mbuf *, - uint16_t *); + uint16_t *, uint16_t *); static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); @@ -1349,12 +1356,15 @@ bge_stop_fw(struct bge_softc *sc) static int bge_chipinit(struct bge_softc *sc) { - uint32_t dma_rw_ctl; + uint32_t dma_rw_ctl, misc_ctl; uint16_t val; int i; /* Set endianness before we access any non-PCI registers. */ - pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4); + misc_ctl = BGE_INIT; + if (sc->bge_flags & BGE_FLAG_TAGGED_STATUS) + misc_ctl |= BGE_PCIMISCCTL_TAGGED_STATUS; + pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, misc_ctl, 4); /* Clear the MAC control register */ CSR_WRITE_4(sc, BGE_MAC_MODE, 0); @@ -1446,6 +1456,8 @@ bge_chipinit(struct bge_softc *sc) if (sc->bge_asicrev == BGE_ASICREV_BCM5703 || sc->bge_asicrev == BGE_ASICREV_BCM5704) dma_rw_ctl &= ~BGE_PCIDMARWCTL_MINDMA; + if (BGE_IS_5717_PLUS(sc)) + dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT; pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); /* @@ -1529,7 +1541,16 @@ bge_blockinit(struct bge_softc *sc) } /* Configure mbuf pool watermarks */ - if (!BGE_IS_5705_PLUS(sc)) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0); + if (sc->bge_ifp->if_mtu > ETHERMTU) { + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x7e); + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xea); + } else { + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x2a); + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xa0); + } + } else if (!BGE_IS_5705_PLUS(sc)) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x50); CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x20); CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60); @@ -1621,7 +1642,16 @@ bge_blockinit(struct bge_softc *sc) BGE_ADDR_HI(sc->bge_ldata.bge_rx_std_ring_paddr); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREREAD); - if (BGE_IS_5705_PLUS(sc)) { + if (BGE_IS_5717_PLUS(sc)) { + /* + * Bits 31-16: Programmable ring size (2048, 1024, 512, .., 32) + * Bits 15-2 : Maximum RX frame size + * Bit 1 : 1 = Ring Disabled, 0 = Ring ENabled + * Bit 0 : Reserved + */ + rcb->bge_maxlen_flags = + BGE_RCB_MAXLEN_FLAGS(512, BGE_MAX_FRAMELEN << 2); + } else if (BGE_IS_5705_PLUS(sc)) { /* * Bits 31-16: Programmable ring size (512, 256, 128, 64, 32) * Bits 15-2 : Reserved (should be 0) @@ -1640,7 +1670,10 @@ bge_blockinit(struct bge_softc *sc) rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); } - rcb->bge_nicaddr = BGE_STD_RX_RINGS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + rcb->bge_nicaddr = BGE_STD_RX_RINGS_5717; + else + rcb->bge_nicaddr = BGE_STD_RX_RINGS; /* Write the standard receive producer ring control block. */ CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_HI, rcb->bge_hostaddr.bge_addr_hi); CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_LO, rcb->bge_hostaddr.bge_addr_lo); @@ -1669,7 +1702,10 @@ bge_blockinit(struct bge_softc *sc) BUS_DMASYNC_PREREAD); rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED); - rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS_5717; + else + rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_HI, rcb->bge_hostaddr.bge_addr_hi); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_LO, @@ -1726,6 +1762,10 @@ bge_blockinit(struct bge_softc *sc) if (BGE_IS_JUMBO_CAPABLE(sc)) CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, BGE_JUMBO_RX_RING_CNT/8); + if (BGE_IS_5717_PLUS(sc)) { + CSR_WRITE_4(sc, BGE_STD_REPLENISH_LWM, 32); + CSR_WRITE_4(sc, BGE_JMB_REPLENISH_LWM, 16); + } /* * Disable all send rings by setting the 'ring disabled' bit @@ -1750,8 +1790,11 @@ bge_blockinit(struct bge_softc *sc) BGE_HOSTADDR(taddr, sc->bge_ldata.bge_tx_ring_paddr); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, taddr.bge_addr_hi); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); - RCB_WRITE_4(sc, vrcb, bge_nicaddr, - BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT)); + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + RCB_WRITE_4(sc, vrcb, bge_nicaddr, BGE_SEND_RING_5717); + else + RCB_WRITE_4(sc, vrcb, bge_nicaddr, + BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT)); RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, BGE_RCB_MAXLEN_FLAGS(BGE_TX_RING_CNT, 0)); @@ -1760,7 +1803,10 @@ bge_blockinit(struct bge_softc *sc) * 'ring diabled' bit in the flags field of all the receive * return ring control blocks, located in NIC memory. */ - if (!BGE_IS_5705_PLUS(sc)) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + /* Should be 17, use 16 until we get an SRAM map. */ + limit = 16; + } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; else if (sc->bge_asicrev == BGE_ASICREV_BCM5755) limit = 4; @@ -1936,6 +1982,10 @@ bge_blockinit(struct bge_softc *sc) /* Turn on read DMA state machine */ val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS; + + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + val |= BGE_RDMAMODE_MULT_DMA_RD_DIS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780) @@ -1944,16 +1994,18 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; - if (sc->bge_flags & BGE_FLAG_TSO) { + if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) { val |= BGE_RDMAMODE_TSO4_ENABLE; - if (sc->bge_asicrev == BGE_ASICREV_BCM5785 || + if (sc->bge_flags & BGE_FLAG_TSO3 || + sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780) val |= BGE_RDMAMODE_TSO6_ENABLE; } if (sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || - sc->bge_asicrev == BGE_ASICREV_BCM57780) { + sc->bge_asicrev == BGE_ASICREV_BCM57780 || + BGE_IS_5717_PLUS(sc)) { /* * Enable fix for read DMA FIFO overruns. * The fix is to limit the number of RX BDs @@ -1989,8 +2041,9 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ - if (sc->bge_flags & BGE_FLAG_TSO) - CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE | 0x08); + if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) + CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE | + BGE_SDIMODE_HW_LSO_PRE_DMA); else CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); @@ -2104,9 +2157,22 @@ bge_probe(device_t dev) id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; - if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) - id = pci_read_config(dev, - BGE_PCI_PRODID_ASICREV, 4); + if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) { + /* + * Find the ASCI revision. Different chips + * use different registers. + */ + switch (pci_get_device(dev)) { + case BCOM_DEVICEID_BCM5717: + case BCOM_DEVICEID_BCM5718: + id = pci_read_config(dev, + BGE_PCI_GEN2_PRODID_ASICREV, 4); + break; + default: + id = pci_read_config(dev, + BGE_PCI_PRODID_ASICREV, 4); + } + } br = bge_lookup_rev(id); v = bge_lookup_vendor(vid); { @@ -2423,7 +2489,7 @@ bge_dma_alloc(struct bge_softc *sc) return (ENOMEM); } /* Create tag for Tx mbufs. */ - if (sc->bge_flags & BGE_FLAG_TSO) { + if (sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) { txsegsz = BGE_TSOSEG_SZ; txmaxsegsz = 65535 + sizeof(struct ether_vlan_header); } else { @@ -2539,6 +2605,10 @@ bge_can_use_msi(struct bge_softc *sc) { int can_use_msi = 0; + /* Disable MSI for polling(4). */ +#ifdef DEVICE_POLLING + return (0); +#endif switch (sc->bge_asicrev) { case BGE_ASICREV_BCM5714_A0: case BGE_ASICREV_BCM5714: @@ -2568,7 +2638,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, msicount, phy_addr, reg, rid, trys; + int error, f, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2594,14 +2664,55 @@ bge_attach(device_t dev) sc->bge_chipid = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; - if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) - sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, - 4); + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) { + /* + * Find the ASCI revision. Different chips use different + * registers. + */ + switch (pci_get_device(dev)) { + case BCOM_DEVICEID_BCM5717: + case BCOM_DEVICEID_BCM5718: + sc->bge_chipid = pci_read_config(dev, + BGE_PCI_GEN2_PRODID_ASICREV, 4); + break; + default: + sc->bge_chipid = pci_read_config(dev, + BGE_PCI_PRODID_ASICREV, 4); + } + } sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); /* Set default PHY address. */ phy_addr = 1; + /* + * PHY address mapping for various devices. + * + * | F0 Cu | F0 Sr | F1 Cu | F1 Sr | + * ---------+-------+-------+-------+-------+ + * BCM57XX | 1 | X | X | X | + * BCM5704 | 1 | X | 1 | X | + * BCM5717 | 1 | 8 | 2 | 9 | + * + * Other addresses may respond but they are not + * IEEE compliant PHYs and should be ignored. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + f = pci_get_function(dev); + if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) { + if (CSR_READ_4(sc, BGE_SGDIG_STS) & + BGE_SGDIGSTS_IS_SERDES) + phy_addr = f + 8; + else + phy_addr = f + 1; + } else if (sc->bge_chipid == BGE_CHIPID_BCM5717_B0) { + if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & + BGE_CPMU_PHY_STRAP_IS_SERDES) + phy_addr = f + 8; + else + phy_addr = f + 1; + } + } /* * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the @@ -2610,7 +2721,8 @@ bge_attach(device_t dev) if (sc->bge_asicrev != BGE_ASICREV_BCM5700 && sc->bge_asicrev != BGE_ASICREV_BCM5906 && sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && - sc->bge_chipid != BGE_CHIPID_BCM5705_A1) + sc->bge_chipid != BGE_CHIPID_BCM5705_A1 && + !BGE_IS_5717_PLUS(sc)) sc->bge_phy_flags |= BGE_PHY_WIRESPEED; if (bge_has_eaddr(sc)) @@ -2618,6 +2730,11 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5717: + sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS | + BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO | + BGE_FLAG_SHORT_DMA_BUG | BGE_FLAG_JUMBO_FRAME; + break; case BGE_ASICREV_BCM5755: case BGE_ASICREV_BCM5761: case BGE_ASICREV_BCM5784: @@ -2663,6 +2780,7 @@ bge_attach(device_t dev) sc->bge_phy_flags |= BGE_PHY_NO_3LED; if ((BGE_IS_5705_PLUS(sc)) && sc->bge_asicrev != BGE_ASICREV_BCM5906 && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && sc->bge_asicrev != BGE_ASICREV_BCM5785 && sc->bge_asicrev != BGE_ASICREV_BCM57780) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || @@ -2679,7 +2797,8 @@ bge_attach(device_t dev) } /* Identify the chips that use an CPMU. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || + if (BGE_IS_5717_PLUS(sc) || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780) @@ -2722,7 +2841,10 @@ bge_attach(device_t dev) * the TSO to the controllers that are not affected TSO issues * (e.g. 5755 or higher). */ - if (BGE_IS_5755_PLUS(sc)) { + if (BGE_IS_5717_PLUS(sc)) { + /* BCM5717 requires different TSO configuration. */ + sc->bge_flags |= BGE_FLAG_TSO3; + } else if (BGE_IS_5755_PLUS(sc)) { /* * BCM5754 and BCM5787 shares the same ASIC id so * explicit device id check is required. @@ -2785,6 +2907,16 @@ bge_attach(device_t dev) } } + /* + * All controllers except BCM5700 supports tagged status but + * we use tagged status only for MSI case on BCM5717. Otherwise + * MSI on BCM5717 does not work. + */ +#ifndef DEVICE_POLLING + if (sc->bge_flags & BGE_FLAG_MSI && BGE_IS_5717_PLUS(sc)) + sc->bge_flags |= BGE_FLAG_TAGGED_STATUS; +#endif + sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -2848,7 +2980,9 @@ bge_attach(device_t dev) } /* 5705 limits RX return ring to 512 entries. */ - if (BGE_IS_5705_PLUS(sc)) + if (BGE_IS_5717_PLUS(sc)) + sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT; + else if (BGE_IS_5705_PLUS(sc)) sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705; else sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT; @@ -2893,7 +3027,7 @@ bge_attach(device_t dev) ifp->if_hwassist = sc->bge_csum_features; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; - if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { + if ((sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) != 0) { ifp->if_hwassist |= CSUM_TSO; ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO; } @@ -3340,6 +3474,7 @@ bge_reset(struct bge_softc *sc) /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE && + sc->bge_asicrev != BGE_ASICREV_BCM5717 && sc->bge_chipid != BGE_CHIPID_BCM5750_A0 && sc->bge_asicrev != BGE_ASICREV_BCM5785) { /* Enable Data FIFO protection. */ @@ -3480,20 +3615,8 @@ bge_rxeof(struct bge_softc *sc, uint16_t m->m_pkthdr.len = m->m_len = cur_rx->bge_len - ETHER_CRC_LEN; m->m_pkthdr.rcvif = ifp; - if (ifp->if_capenable & IFCAP_RXCSUM) { - if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; - if ((cur_rx->bge_ip_csum ^ 0xFFFF) == 0) - m->m_pkthdr.csum_flags |= CSUM_IP_VALID; - } - if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM && - m->m_pkthdr.len >= ETHER_MIN_NOPAD) { - m->m_pkthdr.csum_data = - cur_rx->bge_tcp_udp_csum; - m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - } - } + if (ifp->if_capenable & IFCAP_RXCSUM) + bge_rxcsum(sc, cur_rx, m); /* * If we received a packet with a vlan tag, @@ -3550,6 +3673,41 @@ bge_rxeof(struct bge_softc *sc, uint16_t } static void +bge_rxcsum(struct bge_softc *sc, struct bge_rx_bd *cur_rx, struct mbuf *m) +{ + + if (BGE_IS_5717_PLUS(sc)) { + if ((cur_rx->bge_flags & BGE_RXBDFLAG_IPV6) == 0) { + if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((cur_rx->bge_error_flag & + BGE_RXERRFLAG_IP_CSUM_NOK) == 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + } + if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM) { + m->m_pkthdr.csum_data = + cur_rx->bge_tcp_udp_csum; + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + } + } + } else { + if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((cur_rx->bge_ip_csum ^ 0xFFFF) == 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + } + if (cur_rx->bge_flags & BGE_RXBDFLAG_TCP_UDP_CSUM && + m->m_pkthdr.len >= ETHER_MIN_NOPAD) { + m->m_pkthdr.csum_data = + cur_rx->bge_tcp_udp_csum; + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + } + } +} + +static void bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { struct bge_tx_bd *cur_tx; @@ -3664,7 +3822,7 @@ bge_intr_task(void *arg, int pending) { struct bge_softc *sc; struct ifnet *ifp; - uint32_t status; + uint32_t status, status_tag; uint16_t rx_prod, tx_cons; sc = (struct bge_softc *)arg; @@ -3685,16 +3843,19 @@ bge_intr_task(void *arg, int pending) rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; status = sc->bge_ldata.bge_status_block->bge_status; + status_tag = sc->bge_ldata.bge_status_block->bge_status_tag << 24; sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + if ((sc->bge_flags & BGE_FLAG_TAGGED_STATUS) == 0) + status_tag = 0; if ((status & BGE_STATFLAG_LINKSTATE_CHANGED) != 0) bge_link_upd(sc); /* Let controller work. */ - bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); + bge_writembx(sc, BGE_MBX_IRQ0_LO, status_tag); if (ifp->if_drv_flags & IFF_DRV_RUNNING && sc->bge_rx_saved_considx != rx_prod) { @@ -4100,7 +4261,8 @@ bge_check_short_dma(struct mbuf *m) } static struct mbuf * -bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss) +bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss, + uint16_t *flags) { struct ip *ip; struct tcphdr *tcp; @@ -4143,14 +4305,30 @@ bge_setup_tso(struct bge_softc *sc, stru * Broadcom controllers uses different descriptor format for * TSO depending on ASIC revision. Due to TSO-capable firmware * license issue and lower performance of firmware based TSO - * we only support hardware based TSO which is applicable for - * BCM5755 or newer controllers. Hardware based TSO uses 11 - * bits to store MSS and upper 5 bits are used to store IP/TCP - * header length(including IP/TCP options). The header length - * is expressed as 32 bits unit. + * we only support hardware based TSO. */ + /* Calculate header length, incl. TCP/IP options, in 32 bit units. */ hlen = ((ip->ip_hl << 2) + (tcp->th_off << 2)) >> 2; - *mss |= (hlen << 11); + if (sc->bge_flags & BGE_FLAG_TSO3) { + /* + * For BCM5717 and newer controllers, hardware based TSO + * uses the 14 lower bits of the bge_mss field to store the + * MSS and the upper 2 bits to store the lowest 2 bits of + * the IP/TCP header length. The upper 6 bits of the header + * length are stored in the bge_flags[14:10,4] field. Jumbo + * frames are supported. + */ + *mss |= ((hlen & 0x3) << 14); + *flags |= ((hlen & 0xF8) << 7) | ((hlen & 0x4) << 2); + } else { + /* + * For BCM5755 and newer controllers, hardware based TSO uses + * the lower 11 bits to store the MSS and the upper 5 bits to + * store the IP/TCP header length. Jumbo frames are not + * supported. + */ + *mss |= (hlen << 11); + } return (m); } @@ -4180,7 +4358,7 @@ bge_encap(struct bge_softc *sc, struct m m = *m_head; } if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - *m_head = m = bge_setup_tso(sc, m, &mss); + *m_head = m = bge_setup_tso(sc, m, &mss, &csum_flags); if (*m_head == NULL) return (ENOBUFS); csum_flags |= BGE_TXBDFLAG_CPU_PRE_DMA | @@ -4203,21 +4381,26 @@ bge_encap(struct bge_softc *sc, struct m csum_flags |= BGE_TXBDFLAG_IP_FRAG; } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0 && - sc->bge_forced_collapse > 0 && - (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) { - /* - * Forcedly collapse mbuf chains to overcome hardware - * limitation which only support a single outstanding - * DMA read operation. - */ - if (sc->bge_forced_collapse == 1) - m = m_defrag(m, M_DONTWAIT); - else - m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse); - if (m == NULL) - m = *m_head; - *m_head = m; + if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0) { + if (sc->bge_flags & BGE_FLAG_JUMBO_FRAME && + m->m_pkthdr.len > ETHER_MAX_LEN) + csum_flags |= BGE_TXBDFLAG_JUMBO_FRAME; + if (sc->bge_forced_collapse > 0 && + (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) { + /* + * Forcedly collapse mbuf chains to overcome hardware + * limitation which only support a single outstanding + * DMA read operation. + */ + if (sc->bge_forced_collapse == 1) + m = m_defrag(m, M_DONTWAIT); + else + m = m_collapse(m, M_DONTWAIT, + sc->bge_forced_collapse); + if (m == NULL) + m = *m_head; + *m_head = m; + } } map = sc->bge_cdata.bge_tx_dmamap[idx]; Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Mon Nov 8 19:53:16 2010 (r214999) +++ stable/7/sys/dev/bge/if_bgereg.h Mon Nov 8 19:54:44 2010 (r215000) @@ -82,6 +82,7 @@ #define BGE_UNMAPPED_END 0x00001FFF #define BGE_DMA_DESCRIPTORS 0x00002000 #define BGE_DMA_DESCRIPTORS_END 0x00003FFF +#define BGE_SEND_RING_5717 0x00004000 #define BGE_SEND_RING_1_TO_4 0x00004000 #define BGE_SEND_RING_1_TO_4_END 0x00005FFF @@ -100,6 +101,8 @@ #define BGE_BUFFPOOL_2_END 0x00017FFF #define BGE_BUFFPOOL_3 0x00018000 /* or expansion ROM */ #define BGE_BUFFPOOL_3_END 0x0001FFFF +#define BGE_STD_RX_RINGS_5717 0x00040000 +#define BGE_JUMBO_RX_RINGS_5717 0x00044400 /* Mappings for external SSRAM configurations */ #define BGE_SEND_RING_5_TO_6 0x00006000 @@ -219,6 +222,7 @@ #define BGE_PCI_ISR_MBX_HI 0xB0 #define BGE_PCI_ISR_MBX_LO 0xB4 #define BGE_PCI_PRODID_ASICREV 0xBC +#define BGE_PCI_GEN2_PRODID_ASICREV 0xF4 /* PCI Misc. Host control register */ #define BGE_PCIMISCCTL_CLEAR_INTA 0x00000001 @@ -229,6 +233,7 @@ #define BGE_PCIMISCCTL_CLOCKCTL_RW 0x00000020 #define BGE_PCIMISCCTL_REG_WORDSWAP 0x00000040 #define BGE_PCIMISCCTL_INDIRECT_ACCESS 0x00000080 +#define BGE_PCIMISCCTL_TAGGED_STATUS 0x00000200 #define BGE_PCIMISCCTL_ASICREV 0xFFFF0000 #define BGE_PCIMISCCTL_ASICREV_SHIFT 16 @@ -311,6 +316,8 @@ #define BGE_CHIPID_BCM5906_A2 0xc002 #define BGE_CHIPID_BCM57780_A0 0x57780000 #define BGE_CHIPID_BCM57780_A1 0x57780001 +#define BGE_CHIPID_BCM5717_A0 0x05717000 +#define BGE_CHIPID_BCM5717_B0 0x05717100 /* shorthand one */ #define BGE_ASICREV(x) ((x) >> 12) @@ -331,6 +338,7 @@ /* Should consult BGE_PCI_PRODID_ASICREV for ChipID */ #define BGE_ASICREV_USE_PRODID_REG 0x0f /* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ +#define BGE_ASICREV_BCM5717 0x5717 #define BGE_ASICREV_BCM5761 0x5761 #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 @@ -348,11 +356,14 @@ #define BGE_CHIPREV_5750_AX 0x40 #define BGE_CHIPREV_5750_BX 0x41 /* BGE_PCI_PRODID_ASICREV chip rev. identifiers. */ +#define BGE_CHIPREV_5717_AX 0x57170 +#define BGE_CHIPREV_5717_BX 0x57171 #define BGE_CHIPREV_5761_AX 0x57611 #define BGE_CHIPREV_5784_AX 0x57841 /* PCI DMA Read/Write Control register */ #define BGE_PCIDMARWCTL_MINDMA 0x000000FF +#define BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT 0x00000001 #define BGE_PCIDMARWCTL_RDADRR_BNDRY 0x00000700 #define BGE_PCIDMARWCTL_WRADDR_BNDRY 0x00003800 #define BGE_PCIDMARWCTL_ONEDMA_ATONCE 0x0000C000 @@ -566,6 +577,7 @@ #define BGE_TX_RINGS_MAX 4 #define BGE_TX_RINGS_EXTSSRAM_MAX 16 #define BGE_RX_RINGS_MAX 16 +#define BGE_RX_RINGS_MAX_5717 17 /* Ethernet MAC control registers */ #define BGE_MAC_MODE 0x0400 @@ -843,9 +855,10 @@ #define BGE_SGDIGCFG_AUTO 0x80000000 /* SGDIG status (not documented) */ +#define BGE_SGDIGSTS_DONE 0x00000002 +#define BGE_SGDIGSTS_IS_SERDES 0x00000100 #define BGE_SGDIGSTS_PAUSE_CAP 0x00080000 #define BGE_SGDIGSTS_ASYM_PAUSE 0x00100000 -#define BGE_SGDIGSTS_DONE 0x00000002 /* MI communication register */ @@ -911,6 +924,7 @@ #define BGE_SDIMODE_RESET 0x00000001 #define BGE_SDIMODE_ENABLE 0x00000002 #define BGE_SDIMODE_STATS_OFLOW_ATTN 0x00000004 +#define BGE_SDIMODE_HW_LSO_PRE_DMA 0x00000008 /* Send Data Initiator stats register */ #define BGE_SDISTAT_STATS_OFLOW_ATTN 0x00000004 @@ -1188,6 +1202,9 @@ #define BGE_RBDI_STD_REPL_THRESH 0x2C18 #define BGE_RBDI_JUMBO_REPL_THRESH 0x2C1C +#define BGE_STD_REPLENISH_LWM 0x2D00 +#define BGE_JMB_REPLENISH_LWM 0x2D04 + /* Receive BD Initiator Mode register */ #define BGE_RBDIMODE_RESET 0x00000001 #define BGE_RBDIMODE_ENABLE 0x00000002 @@ -1501,6 +1518,7 @@ #define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 +#define BGE_RDMAMODE_MULT_DMA_RD_DIS 0x01000000 #define BGE_RDMAMODE_TSO4_ENABLE 0x08000000 #define BGE_RDMAMODE_TSO6_ENABLE 0x10000000 @@ -2068,15 +2086,27 @@ struct bge_tx_bd { #define BGE_TXBDFLAG_IP_CSUM 0x0002 #define BGE_TXBDFLAG_END 0x0004 #define BGE_TXBDFLAG_IP_FRAG 0x0008 +#define BGE_TXBDFLAG_JUMBO_FRAME 0x0008 /* 5717 */ #define BGE_TXBDFLAG_IP_FRAG_END 0x0010 +#define BGE_TXBDFLAG_HDRLEN_BIT2 0x0010 /* 5717 */ +#define BGE_TXBDFLAG_SNAP 0x0020 /* 5717 */ #define BGE_TXBDFLAG_VLAN_TAG 0x0040 #define BGE_TXBDFLAG_COAL_NOW 0x0080 #define BGE_TXBDFLAG_CPU_PRE_DMA 0x0100 #define BGE_TXBDFLAG_CPU_POST_DMA 0x0200 +#define BGE_TXBDFLAG_HDRLEN_BIT3 0x0400 /* 5717 */ +#define BGE_TXBDFLAG_HDRLEN_BIT4 0x0800 /* 5717 */ #define BGE_TXBDFLAG_INSERT_SRC_ADDR 0x1000 +#define BGE_TXBDFLAG_HDRLEN_BIT5 0x1000 /* 5717 */ +#define BGE_TXBDFLAG_HDRLEN_BIT6 0x2000 /* 5717 */ +#define BGE_TXBDFLAG_HDRLEN_BIT7 0x4000 /* 5717 */ #define BGE_TXBDFLAG_CHOOSE_SRC_ADDR 0x6000 #define BGE_TXBDFLAG_NO_CRC 0x8000 +#define BGE_TXBDFLAG_MSS_SIZE_MASK 0x3FFF /* 5717 */ +/* Bits [1:0] of the MSS header length. */ +#define BGE_TXBDFLAG_MSS_HDRLEN_MASK 0xC000 /* 5717 */ + #define BGE_NIC_TXRING_ADDR(ringno, size) \ BGE_SEND_RING_1_TO_4 + \ ((ringno * sizeof(struct bge_tx_bd) * size) / 4) @@ -2153,6 +2183,7 @@ struct bge_extrx_bd { #define BGE_RXBDFLAG_IP_CSUM 0x1000 #define BGE_RXBDFLAG_TCP_UDP_CSUM 0x2000 #define BGE_RXBDFLAG_TCP_UDP_IS_TCP 0x4000 +#define BGE_RXBDFLAG_IPV6 0x8000 #define BGE_RXERRFLAG_BAD_CRC 0x0001 #define BGE_RXERRFLAG_COLL_DETECT 0x0002 @@ -2162,6 +2193,7 @@ struct bge_extrx_bd { #define BGE_RXERRFLAG_RUNT 0x0020 #define BGE_RXERRFLAG_TRUNC_NO_RSRCS 0x0040 #define BGE_RXERRFLAG_GIANT 0x0080 +#define BGE_RXERRFLAG_IP_CSUM_NOK 0x1000 /* 5717 */ struct bge_sts_idx { #if BYTE_ORDER == LITTLE_ENDIAN @@ -2175,7 +2207,7 @@ struct bge_sts_idx { struct bge_status_block { uint32_t bge_status; - uint32_t bge_rsvd0; + uint32_t bge_status_tag; #if BYTE_ORDER == LITTLE_ENDIAN uint16_t bge_rx_jumbo_cons_idx; uint16_t bge_rx_std_cons_idx; @@ -2221,6 +2253,8 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5714S 0x1669 #define BCOM_DEVICEID_BCM5715 0x1678 #define BCOM_DEVICEID_BCM5715S 0x1679 +#define BCOM_DEVICEID_BCM5717 0x1655 +#define BCOM_DEVICEID_BCM5718 0x1656 #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A @@ -2717,16 +2751,20 @@ struct bge_softc { #define BGE_FLAG_EADDR 0x00000008 #define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_CPMU_PRESENT 0x00000020 +#define BGE_FLAG_TAGGED_STATUS 0x00000040 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 #define BGE_FLAG_TSO 0x00000800 +#define BGE_FLAG_TSO3 0x00001000 +#define BGE_FLAG_JUMBO_FRAME 0x00002000 #define BGE_FLAG_5700_FAMILY 0x00010000 #define BGE_FLAG_5705_PLUS 0x00020000 #define BGE_FLAG_5714_FAMILY 0x00040000 #define BGE_FLAG_575X_PLUS 0x00080000 #define BGE_FLAG_5755_PLUS 0x00100000 #define BGE_FLAG_5788 0x00200000 +#define BGE_FLAG_5717_PLUS 0x00400000 #define BGE_FLAG_40BIT_BUG 0x01000000 #define BGE_FLAG_4G_BNDRY_BUG 0x02000000 #define BGE_FLAG_RX_ALIGNBUG 0x04000000 From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:03:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38A501065674; Mon, 8 Nov 2010 20:03:52 +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 2702A8FC14; Mon, 8 Nov 2010 20:03:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8K3qYv050205; Mon, 8 Nov 2010 20:03:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8K3qE9050203; Mon, 8 Nov 2010 20:03:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011082003.oA8K3qE9050203@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Nov 2010 20: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: r215001 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:03:52 -0000 Author: jhb Date: Mon Nov 8 20:03:51 2010 New Revision: 215001 URL: http://svn.freebsd.org/changeset/base/215001 Log: Only dump the values of the PMC and CMCI local vector table entries on a local APIC if those LVT entries are valid. This quiets spurious illegal register local APIC errors during boot on a CPU that doesn't support those vectors. MFC after: 1 week Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Nov 8 19:54:44 2010 (r215000) +++ head/sys/x86/x86/local_apic.c Mon Nov 8 20:03:51 2010 (r215001) @@ -324,16 +324,21 @@ lapic_create(u_int apic_id, int boot_cpu void lapic_dump(const char* str) { + uint32_t maxlvt; + maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; printf("cpu%d %s:\n", PCPU_GET(cpuid), str); printf(" ID: 0x%08x VER: 0x%08x LDR: 0x%08x DFR: 0x%08x\n", lapic->id, lapic->version, lapic->ldr, lapic->dfr); printf(" lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n", lapic->lvt_lint0, lapic->lvt_lint1, lapic->tpr, lapic->svr); - printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x pmc: 0x%08x\n", - lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error, - lapic->lvt_pcint); - printf(" cmci: 0x%08x\n", lapic->lvt_cmci); + printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x", + lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error); + if (maxlvt >= LVT_PMC) + printf(" pmc: 0x%08x", lapic->lvt_pcint); + printf("\n"); + if (maxlvt >= LVT_CMCI) + printf(" cmci: 0x%08x\n", lapic->lvt_cmci); } void From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:05:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FB9F106564A; Mon, 8 Nov 2010 20:05:22 +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 534448FC33; Mon, 8 Nov 2010 20:05:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8K5MvX050320; Mon, 8 Nov 2010 20:05:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8K5MxV050316; Mon, 8 Nov 2010 20:05:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011082005.oA8K5MxV050316@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Nov 2010 20:05: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: r215002 - in head/sys: amd64/acpica amd64/amd64 i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:05:22 -0000 Author: jhb Date: Mon Nov 8 20:05:22 2010 New Revision: 215002 URL: http://svn.freebsd.org/changeset/base/215002 Log: A few small style and whitespace fixes. Modified: head/sys/amd64/acpica/madt.c head/sys/amd64/amd64/mp_machdep.c head/sys/i386/acpica/madt.c Modified: head/sys/amd64/acpica/madt.c ============================================================================== --- head/sys/amd64/acpica/madt.c Mon Nov 8 20:03:51 2010 (r215001) +++ head/sys/amd64/acpica/madt.c Mon Nov 8 20:05:22 2010 (r215002) @@ -203,8 +203,7 @@ madt_register(void *dummy __unused) apic_register_enumerator(&madt_enumerator); } -SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, - madt_register, NULL); +SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, madt_register, NULL); /* * Call the handler routine for each entry in the MADT table. Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Nov 8 20:03:51 2010 (r215001) +++ head/sys/amd64/amd64/mp_machdep.c Mon Nov 8 20:05:22 2010 (r215002) @@ -422,7 +422,7 @@ cpu_add(u_int apic_id, char boot_cpu) } if (mp_ncpus < MAXCPU) { mp_ncpus++; - mp_maxid = mp_ncpus -1; + mp_maxid = mp_ncpus - 1; } if (bootverbose) printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" : @@ -445,7 +445,7 @@ cpu_mp_setmaxid(void) else KASSERT(mp_maxid >= mp_ncpus - 1, ("%s: counters out of sync: max %d, count %d", __func__, - mp_maxid, mp_ncpus)); + mp_maxid, mp_ncpus)); } int Modified: head/sys/i386/acpica/madt.c ============================================================================== --- head/sys/i386/acpica/madt.c Mon Nov 8 20:03:51 2010 (r215001) +++ head/sys/i386/acpica/madt.c Mon Nov 8 20:05:22 2010 (r215002) @@ -95,7 +95,6 @@ static struct apic_enumerator madt_enume madt_setup_io }; - /* * Look for an ACPI Multiple APIC Description Table ("APIC") */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:11:43 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B2A81065675; Mon, 8 Nov 2010 20:11:43 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 07C028FC2E; Mon, 8 Nov 2010 20:11:43 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id oA8KBgaD090910; Mon, 8 Nov 2010 12:11:42 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id oA8KBgo6090909; Mon, 8 Nov 2010 12:11:42 -0800 (PST) (envelope-from obrien) Date: Mon, 8 Nov 2010 12:11:42 -0800 From: "David O'Brien" To: Juli Mallett Message-ID: <20101108201142.GB90846@dragon.NUXI.org> References: <201011072322.oA7NMhb0092364@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r214961 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:11:43 -0000 On Sun, Nov 07, 2010 at 05:54:20PM -0800, Juli Mallett wrote: > On Sun, Nov 7, 2010 at 15:22, David E. O'Brien wrote: > > Author: obrien > > Date: Sun Nov  7 23:22:42 2010 > > New Revision: 214961 > > URL: http://svn.freebsd.org/changeset/base/214961 > > > > Log: > >  Directly use memory allocation functions and remove needless casts in > >  their usage.  Also use associated modern types instead of k&r ones. > > You do know that changing skeleton.c affects the generated files, > right? Yes Juli, I know how byacc works. > I'm wondering if whatever sed script you're > judiciously-applying knows that. C++ does not do implicit conversions > from "void *" so you need the casts on the mallocs there. The changes I made were tested on building several other applications. > With a C++ compiler: But as you indirectly point out -- they were all C applications. -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:14:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 524F3106564A; Mon, 8 Nov 2010 20:14:39 +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 3F0CE8FC15; Mon, 8 Nov 2010 20:14:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KEdOE050871; Mon, 8 Nov 2010 20:14:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KEdcB050869; Mon, 8 Nov 2010 20:14:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011082014.oA8KEdcB050869@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 20:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215003 - stable/8/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:14:39 -0000 Author: yongari Date: Mon Nov 8 20:14:38 2010 New Revision: 215003 URL: http://svn.freebsd.org/changeset/base/215003 Log: MFC r214542: Don't bother to enable ASPM L1 to save more power. Even though I am not able to trigger the issue with sample boards, some users seems to suffer from freeze/lockup when system is booted without UTP cable plugged in. I'm not sure whether this is BIOS issue or controller bug. This change fixes AR8132 lockup issue seen on EEE PC. Reported by: kmoore Tested by: kmoore Modified: stable/8/sys/dev/alc/if_alc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Mon Nov 8 20:05:22 2010 (r215002) +++ stable/8/sys/dev/alc/if_alc.c Mon Nov 8 20:14:38 2010 (r215003) @@ -331,8 +331,8 @@ alc_miibus_statchg(device_t dev) reg = CSR_READ_4(sc, ALC_MAC_CFG); reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; CSR_WRITE_4(sc, ALC_MAC_CFG, reg); + alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); } - alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); } static void From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:16:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDA18106566C; Mon, 8 Nov 2010 20:16:42 +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 DB6A78FC22; Mon, 8 Nov 2010 20:16:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KGgsI051027; Mon, 8 Nov 2010 20:16:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KGgGG051025; Mon, 8 Nov 2010 20:16:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011082016.oA8KGgGG051025@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 20:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215004 - stable/7/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:16:43 -0000 Author: yongari Date: Mon Nov 8 20:16:42 2010 New Revision: 215004 URL: http://svn.freebsd.org/changeset/base/215004 Log: MFC r214542: Don't bother to enable ASPM L1 to save more power. Even though I am not able to trigger the issue with sample boards, some users seems to suffer from freeze/lockup when system is booted without UTP cable plugged in. I'm not sure whether this is BIOS issue or controller bug. This change fixes AR8132 lockup issue seen on EEE PC. Reported by: kmoore Tested by: kmoore Modified: stable/7/sys/dev/alc/if_alc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Mon Nov 8 20:14:38 2010 (r215003) +++ stable/7/sys/dev/alc/if_alc.c Mon Nov 8 20:16:42 2010 (r215004) @@ -331,8 +331,8 @@ alc_miibus_statchg(device_t dev) reg = CSR_READ_4(sc, ALC_MAC_CFG); reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; CSR_WRITE_4(sc, ALC_MAC_CFG, reg); + alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); } - alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); } static void From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:21:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D7F1106566B; Mon, 8 Nov 2010 20:21:25 +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 3A60B8FC29; Mon, 8 Nov 2010 20:21:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KLP7I051364; Mon, 8 Nov 2010 20:21:25 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KLPRt051362; Mon, 8 Nov 2010 20:21:25 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201011082021.oA8KLPRt051362@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 8 Nov 2010 20:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215005 - in stable: 7/share/misc 8/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:21:25 -0000 Author: uqs Date: Mon Nov 8 20:21:24 2010 New Revision: 215005 URL: http://svn.freebsd.org/changeset/base/215005 Log: MFC r173289,174783,175454,191681,191698,191834,195044,197304,198210,199858-199859,201348,205578,208327,208336,210871,214628: Sync bsd-family-tree with head. Modified: stable/8/share/misc/bsd-family-tree Directory Properties: stable/8/share/misc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/share/misc/bsd-family-tree Directory Properties: stable/7/share/misc/ (props changed) Modified: stable/8/share/misc/bsd-family-tree ============================================================================== --- stable/8/share/misc/bsd-family-tree Mon Nov 8 20:16:42 2010 (r215004) +++ stable/8/share/misc/bsd-family-tree Mon Nov 8 20:21:24 2010 (r215005) @@ -151,7 +151,7 @@ FreeBSD 4.0 | | | | | NetBSD 1. | FreeBSD 4.5 | | | | | | | | \ | | | | BSD/OS 4.3 | FreeBSD 4.6 \ | | | OpenBSD 3.1 | - | | \ | | NetBSD 1.5.3 | | + | | \ | | NetBSD 1.5.3 | | | FreeBSD 4.6.2 Mac OS X | | | | | 10.2 | | | | FreeBSD 4.7 | | | | @@ -228,10 +228,22 @@ FreeBSD 5.2 | | | FreeBSD 7.1 | | | | | | | | | DragonFly 2.2.0 | FreeBSD 7.2 | NetBSD 5.0 OpenBSD 4.5 | - | | | | | | + | \ | | | | + | | | | | DragonFly 2.4.0 + | | | | OpenBSD 4.6 | + | | | | | | + *--FreeBSD | | | | | + | 8.0 | | | | | + | | FreeBSD | | | | + | | 7.3 | | | DragonFly 2.6.0 + | | | | OpenBSD 4.7 | + | FreeBSD | | | | + | 8.1 | | | | + | | | | | DragonFly 2.8.0 + | | | | OpenBSD 4.8 | | V | | | | | | | | | -FreeBSD 8 -current | NetBSD -current OpenBSD -current | +FreeBSD 9 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -502,6 +514,15 @@ DragonFly 2.2.0 2009-02-17 [DFB] NetBSD 5.0 2009-04-29 [NBD] OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] +DragonFly 2.4.0 2009-09-16 [DFB] +OpenBSD 4.6 2009-10-18 [OBD] +FreeBSD 8.0 2009-11-26 [FBD] +FreeBSD 7.3 2010-03-23 [FBD] +DragonFly 2.6.0 2010-03-28 [DFB] +OpenBSD 4.7 2010-05-19 [OBD] +FreeBSD 8.1 2010-07-24 [FBD] +DragonFly 2.8.0 2010-10-30 [DFB] +OpenBSD 4.8 2010-11-01 [OBD] Bibliography ------------------------ @@ -534,7 +555,7 @@ Andreas Klemm, Lars Köller. If you're go Die freien BSD-Varianten von Unix. c't April 1997, page 368ff. BSD Release Announcements collection. -URL: http://www.de.FreeBSD.org/de/ftp/releases/ +URL: http://www.FreeBSD.org/releases/ BSD Hypertext Man Pages URL: http://www.FreeBSD.org/cgi/man.cgi From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:21:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1141065670; Mon, 8 Nov 2010 20:21:25 +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 5AD1C8FC3D; Mon, 8 Nov 2010 20:21:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KLPsI051370; Mon, 8 Nov 2010 20:21:25 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KLPZv051368; Mon, 8 Nov 2010 20:21:25 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201011082021.oA8KLPZv051368@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 8 Nov 2010 20:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215005 - in stable: 7/share/misc 8/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:21:25 -0000 Author: uqs Date: Mon Nov 8 20:21:24 2010 New Revision: 215005 URL: http://svn.freebsd.org/changeset/base/215005 Log: MFC r173289,174783,175454,191681,191698,191834,195044,197304,198210,199858-199859,201348,205578,208327,208336,210871,214628: Sync bsd-family-tree with head. Modified: stable/7/share/misc/bsd-family-tree Directory Properties: stable/7/share/misc/ (props changed) Changes in other areas also in this revision: Modified: stable/8/share/misc/bsd-family-tree Directory Properties: stable/8/share/misc/ (props changed) Modified: stable/7/share/misc/bsd-family-tree ============================================================================== --- stable/7/share/misc/bsd-family-tree Mon Nov 8 20:16:42 2010 (r215004) +++ stable/7/share/misc/bsd-family-tree Mon Nov 8 20:21:24 2010 (r215005) @@ -25,7 +25,7 @@ Seventh Edition (V7) | \/ | 3BSD | | | - 4.0BSD 2.7.9BSD + 4.0BSD 2.79BSD | | 4.1BSD --------------> 2.8BSD | | @@ -151,7 +151,7 @@ FreeBSD 4.0 | | | | | NetBSD 1. | FreeBSD 4.5 | | | | | | | | \ | | | | BSD/OS 4.3 | FreeBSD 4.6 \ | | | OpenBSD 3.1 | - | | \ | | NetBSD 1.5.3 | | + | | \ | | NetBSD 1.5.3 | | | FreeBSD 4.6.2 Mac OS X | | | | | 10.2 | | | | FreeBSD 4.7 | | | | @@ -228,10 +228,22 @@ FreeBSD 5.2 | | | FreeBSD 7.1 | | | | | | | | | DragonFly 2.2.0 | FreeBSD 7.2 | NetBSD 5.0 OpenBSD 4.5 | - | | | | | | + | \ | | | | + | | | | | DragonFly 2.4.0 + | | | | OpenBSD 4.6 | + | | | | | | + *--FreeBSD | | | | | + | 8.0 | | | | | + | | FreeBSD | | | | + | | 7.3 | | | DragonFly 2.6.0 + | | | | OpenBSD 4.7 | + | FreeBSD | | | | + | 8.1 | | | | + | | | | | DragonFly 2.8.0 + | | | | OpenBSD 4.8 | | V | | | | | | | | | -FreeBSD 8 -current | NetBSD -current OpenBSD -current | +FreeBSD 9 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -260,6 +272,7 @@ was the announcement in Usenet or if it [OBD] OpenBSD Project, The. [QCU] Salus, Peter H. A quarter century of UNIX. [SMS] Steven M. Schultz. 2.11BSD, UNIX for the PDP-11. +[TUHS] The Unix Historical Society. http://minnie.tuhs.org/Unix_History/. [USE] Usenet announcement. [WRS] Wind River Systems, Inc. [dmr] Dennis Ritchie, via E-Mail @@ -297,15 +310,15 @@ Tenth Edition 1989-10-xx [QCU] PDP-11, Pascal, ex(1) 30 free copies of 1BSD sent out 35 tapes sold for 50 USD [QCU] -2BSD mid 1978 [QCU] +2BSD mid 1978 [QCU] 1979-05-10 [TUHS] 75 2BSD tapes shipped -2.7.9BSD ?? [SMS] +2.79BSD 1980-04-xx [TUHS] 2.8BSD 1981-07-xx [KSJ] 2.8.1BSD 1982-01-xx [QCU] set of performance improvements 2.9BSD 1983-07-xx [KSJ] -2.9.1BSD 1983-11-xx +2.9.1BSD 1983-11-xx [TUHS] 2.9BSD-Seismo 1985-08-xx [SMS] 2.10BSD 1987-04-xx [KKK] 2.10.1BSD 1989-01-xx [SMS] @@ -313,7 +326,7 @@ Tenth Edition 1989-10-xx [QCU] 2.11BSD rev #430 1999-12-13 [SMS] 32V 1978-1[01]-xx [QCU] -3BSD late 1979 [QCU] +3BSD late 1979 [QCU] March 1980 [TUHS] virtual memory, page replacement, demand paging 4.0BSD 1980-10-xx @@ -501,6 +514,15 @@ DragonFly 2.2.0 2009-02-17 [DFB] NetBSD 5.0 2009-04-29 [NBD] OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] +DragonFly 2.4.0 2009-09-16 [DFB] +OpenBSD 4.6 2009-10-18 [OBD] +FreeBSD 8.0 2009-11-26 [FBD] +FreeBSD 7.3 2010-03-23 [FBD] +DragonFly 2.6.0 2010-03-28 [DFB] +OpenBSD 4.7 2010-05-19 [OBD] +FreeBSD 8.1 2010-07-24 [FBD] +DragonFly 2.8.0 2010-10-30 [DFB] +OpenBSD 4.8 2010-11-01 [OBD] Bibliography ------------------------ @@ -533,7 +555,7 @@ Andreas Klemm, Lars Köller. If you're go Die freien BSD-Varianten von Unix. c't April 1997, page 368ff. BSD Release Announcements collection. -URL: http://www.de.FreeBSD.org/de/ftp/releases/ +URL: http://www.FreeBSD.org/releases/ BSD Hypertext Man Pages URL: http://www.FreeBSD.org/cgi/man.cgi From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:25:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27F50106564A; Mon, 8 Nov 2010 20:25:20 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0458FC0C; Mon, 8 Nov 2010 20:25:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KPJ6v051624; Mon, 8 Nov 2010 20:25:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KPJrh051621; Mon, 8 Nov 2010 20:25:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011082025.oA8KPJrh051621@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 8 Nov 2010 20:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215006 - in stable/8: share/man/man4 sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:25:20 -0000 Author: jkim Date: Mon Nov 8 20:25:19 2010 New Revision: 215006 URL: http://svn.freebsd.org/changeset/base/215006 Log: MFC: r213755 Use AcpiReset() from ACPICA instead of rolling our own, which is actually incomplete. If FADT says the register is available, enable the capability by default. Remove the previous default value from acpi(4). Modified: stable/8/share/man/man4/acpi.4 stable/8/sys/dev/acpica/acpi.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/acpi.4 ============================================================================== --- stable/8/share/man/man4/acpi.4 Mon Nov 8 20:21:24 2010 (r215005) +++ stable/8/share/man/man4/acpi.4 Mon Nov 8 20:25:19 2010 (r215006) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2010 +.Dd October 12, 2010 .Dt ACPI 4 .Os .Sh NAME @@ -112,7 +112,6 @@ exiting to legacy mode first. Default is 0, leave ACPI enabled. .It Va hw.acpi.handle_reboot Use the ACPI Reset Register capability to reboot the system. -Default is 0, use legacy reboot support. Some newer systems require use of this register, while some only work with legacy rebooting support. .It Va hw.acpi.lid_switch_state Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Mon Nov 8 20:21:24 2010 (r215005) +++ stable/8/sys/dev/acpica/acpi.c Mon Nov 8 20:25:19 2010 (r215006) @@ -590,6 +590,10 @@ acpi_attach(device_t dev) freeenv(env); } + /* Only enable reboot by default if the FADT says it is available. */ + if (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) + sc->acpi_handle_reboot = 1; + /* Only enable S4BIOS by default if the FACS says it is available. */ if (AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT) sc->acpi_s4bios = 1; @@ -1828,19 +1832,15 @@ acpi_shutdown_final(void *arg, int howto DELAY(1000000); device_printf(sc->acpi_dev, "power-off failed - timeout\n"); } - } else if ((howto & RB_HALT) == 0 && - (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) && - sc->acpi_handle_reboot) { + } else if ((howto & RB_HALT) == 0 && sc->acpi_handle_reboot) { /* Reboot using the reset register. */ - status = AcpiWrite( - AcpiGbl_FADT.ResetValue, &AcpiGbl_FADT.ResetRegister); - if (ACPI_FAILURE(status)) - device_printf(sc->acpi_dev, "reset failed - %s\n", - AcpiFormatException(status)); - else { + status = AcpiReset(); + if (ACPI_SUCCESS(status)) { DELAY(1000000); device_printf(sc->acpi_dev, "reset failed - timeout\n"); - } + } else if (status != AE_NOT_EXIST) + device_printf(sc->acpi_dev, "reset failed - %s\n", + AcpiFormatException(status)); } else if (sc->acpi_do_disable && panicstr == NULL) { /* * Only disable ACPI if the user requested. On some systems, writing From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:31:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 141A3106566B; Mon, 8 Nov 2010 20:31:00 +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 BF02B8FC1C; Mon, 8 Nov 2010 20:30:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KUxuX051941; Mon, 8 Nov 2010 20:30:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KUx1P051939; Mon, 8 Nov 2010 20:30:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011082030.oA8KUx1P051939@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Nov 2010 20:30: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: r215007 - head/sys/modules/acpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:31:00 -0000 Author: jhb Date: Mon Nov 8 20:30:59 2010 New Revision: 215007 URL: http://svn.freebsd.org/changeset/base/215007 Log: Disconnect acpi.ko from the build on i386. ACPI is now only supported when compiled into the kernel, not as a loadable module. Modified: head/sys/modules/acpi/Makefile Modified: head/sys/modules/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/Makefile Mon Nov 8 20:25:19 2010 (r215006) +++ head/sys/modules/acpi/Makefile Mon Nov 8 20:30:59 2010 (r215007) @@ -1,10 +1,6 @@ # $FreeBSD$ -.if ${MACHINE} == "i386" -SUBDIR= acpi -.endif - -SUBDIR+= acpi_asus acpi_fujitsu acpi_hp acpi_ibm \ +SUBDIR= acpi_asus acpi_fujitsu acpi_hp acpi_ibm \ acpi_panasonic acpi_sony acpi_toshiba acpi_video \ acpi_dock acpi_wmi aibs From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:32:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38AC9106564A; Mon, 8 Nov 2010 20:32:36 +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 0CFC58FC26; Mon, 8 Nov 2010 20:32:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KWZjF052052; Mon, 8 Nov 2010 20:32:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KWZou052050; Mon, 8 Nov 2010 20:32:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011082032.oA8KWZou052050@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Nov 2010 20:32: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: r215008 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:32:36 -0000 Author: jhb Date: Mon Nov 8 20:32:35 2010 New Revision: 215008 URL: http://svn.freebsd.org/changeset/base/215008 Log: Remove stub symbols for APIC-related functions when 'device apic' is not included in a kernel config. These stubs had existed previously so that acpi.ko could always include the MADT parsing code and still link with a kernel that did not include 'device apic'. Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Nov 8 20:30:59 2010 (r215007) +++ head/sys/i386/i386/machdep.c Mon Nov 8 20:32:35 2010 (r215008) @@ -40,7 +40,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_apic.h" #include "opt_atalk.h" #include "opt_compat.h" #include "opt_cpu.h" @@ -3614,102 +3613,6 @@ user_dbreg_trap(void) return 0; } -#ifndef DEV_APIC -#include - -/* - * Provide stub functions so that the MADT APIC enumerator in the acpi - * kernel module will link against a kernel without 'device apic'. - * - * XXX - This is a gross hack. - */ -void -apic_register_enumerator(struct apic_enumerator *enumerator) -{ -} - -void * -ioapic_create(vm_paddr_t addr, int32_t apic_id, int intbase) -{ - return (NULL); -} - -int -ioapic_disable_pin(void *cookie, u_int pin) -{ - return (ENXIO); -} - -int -ioapic_get_vector(void *cookie, u_int pin) -{ - return (-1); -} - -void -ioapic_register(void *cookie) -{ -} - -int -ioapic_remap_vector(void *cookie, u_int pin, int vector) -{ - return (ENXIO); -} - -int -ioapic_set_extint(void *cookie, u_int pin) -{ - return (ENXIO); -} - -int -ioapic_set_nmi(void *cookie, u_int pin) -{ - return (ENXIO); -} - -int -ioapic_set_polarity(void *cookie, u_int pin, enum intr_polarity pol) -{ - return (ENXIO); -} - -int -ioapic_set_triggermode(void *cookie, u_int pin, enum intr_trigger trigger) -{ - return (ENXIO); -} - -void -lapic_create(u_int apic_id, int boot_cpu) -{ -} - -void -lapic_init(vm_paddr_t addr) -{ -} - -int -lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode) -{ - return (ENXIO); -} - -int -lapic_set_lvt_polarity(u_int apic_id, u_int lvt, enum intr_polarity pol) -{ - return (ENXIO); -} - -int -lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger) -{ - return (ENXIO); -} -#endif - #ifdef KDB /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:35:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267241065674; Mon, 8 Nov 2010 20:35:10 +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 13F5B8FC2C; Mon, 8 Nov 2010 20:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KZ9A2052222; Mon, 8 Nov 2010 20:35:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KZ9c6052216; Mon, 8 Nov 2010 20:35:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011082035.oA8KZ9c6052216@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Nov 2010 20:35: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: r215009 - in head/sys: i386/acpica i386/i386 i386/xen x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:35:10 -0000 Author: jhb Date: Mon Nov 8 20:35:09 2010 New Revision: 215009 URL: http://svn.freebsd.org/changeset/base/215009 Log: Sync the APIC startup sequence with amd64: - Register APIC enumerators at SI_SUB_TUNABLES - 1 instead of SI_SUB_CPU - 1. - Probe CPUs at SI_SUB_TUNABLES - 1. This allows i386 to set a truly accurate mp_maxid value rather than always setting it to MAXCPU - 1. Modified: head/sys/i386/acpica/madt.c head/sys/i386/i386/mp_machdep.c head/sys/i386/xen/mptable.c head/sys/x86/x86/local_apic.c head/sys/x86/x86/mptable.c Modified: head/sys/i386/acpica/madt.c ============================================================================== --- head/sys/i386/acpica/madt.c Mon Nov 8 20:32:35 2010 (r215008) +++ head/sys/i386/acpica/madt.c Mon Nov 8 20:35:09 2010 (r215009) @@ -203,7 +203,7 @@ madt_register(void *dummy __unused) apic_register_enumerator(&madt_enumerator); } -SYSINIT(madt_register, SI_SUB_CPU - 1, SI_ORDER_SECOND, madt_register, NULL); +SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, madt_register, NULL); /* * Call the handler routine for each entry in the MADT table. Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Nov 8 20:32:35 2010 (r215008) +++ head/sys/i386/i386/mp_machdep.c Mon Nov 8 20:35:09 2010 (r215009) @@ -465,8 +465,10 @@ cpu_add(u_int apic_id, char boot_cpu) boot_cpu_id = apic_id; cpu_info[apic_id].cpu_bsp = 1; } - if (mp_ncpus < MAXCPU) + if (mp_ncpus < MAXCPU) { mp_ncpus++; + mp_maxid = mp_ncpus - 1; + } if (bootverbose) printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" : "AP"); @@ -476,7 +478,19 @@ void cpu_mp_setmaxid(void) { - mp_maxid = MAXCPU - 1; + /* + * mp_maxid should be already set by calls to cpu_add(). + * Just sanity check its value here. + */ + if (mp_ncpus == 0) + KASSERT(mp_maxid == 0, + ("%s: mp_ncpus is zero, but mp_maxid is not", __func__)); + else if (mp_ncpus == 1) + mp_maxid = 0; + else + KASSERT(mp_maxid >= mp_ncpus - 1, + ("%s: counters out of sync: max %d, count %d", __func__, + mp_maxid, mp_ncpus)); } int @@ -504,6 +518,7 @@ cpu_mp_probe(void) * One CPU was found, so this must be a UP system with * an I/O APIC. */ + mp_maxid = 0; return (0); } Modified: head/sys/i386/xen/mptable.c ============================================================================== --- head/sys/i386/xen/mptable.c Mon Nov 8 20:32:35 2010 (r215008) +++ head/sys/i386/xen/mptable.c Mon Nov 8 20:35:09 2010 (r215009) @@ -109,7 +109,7 @@ mptable_register(void *dummy __unused) apic_register_enumerator(&mptable_enumerator); } -SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register, +SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, mptable_register, NULL); Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Nov 8 20:32:35 2010 (r215008) +++ head/sys/x86/x86/local_apic.c Mon Nov 8 20:35:09 2010 (r215009) @@ -1285,7 +1285,7 @@ apic_init(void *dummy __unused) if (resource_disabled("apic", 0)) return; - /* First, probe all the enumerators to find the best match. */ + /* Probe all the enumerators to find the best match. */ best_enum = NULL; best = 0; SLIST_FOREACH(enumerator, &enumerators, apic_next) { @@ -1321,13 +1321,12 @@ apic_init(void *dummy __unused) } #endif - /* Second, probe the CPU's in the system. */ + /* Probe the CPU's in the system. */ retval = best_enum->apic_probe_cpus(); if (retval != 0) printf("%s: Failed to probe CPUs: returned %d\n", best_enum->apic_name, retval); -#ifdef __amd64__ } SYSINIT(apic_init, SI_SUB_TUNABLES - 1, SI_ORDER_SECOND, apic_init, NULL); @@ -1342,19 +1341,14 @@ apic_setup_local(void *dummy __unused) if (best_enum == NULL) return; -#endif - /* Third, initialize the local APIC. */ + + /* Initialize the local APIC. */ retval = best_enum->apic_setup_local(); if (retval != 0) printf("%s: Failed to setup the local APIC: returned %d\n", best_enum->apic_name, retval); } -#ifdef __amd64__ -SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local, - NULL); -#else -SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_SECOND, apic_init, NULL); -#endif +SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local, NULL); /* * Setup the I/O APICs. Modified: head/sys/x86/x86/mptable.c ============================================================================== --- head/sys/x86/x86/mptable.c Mon Nov 8 20:32:35 2010 (r215008) +++ head/sys/x86/x86/mptable.c Mon Nov 8 20:35:09 2010 (r215009) @@ -389,7 +389,7 @@ mptable_register(void *dummy __unused) apic_register_enumerator(&mptable_enumerator); } -SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register, +SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, mptable_register, NULL); /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:44:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 047C2106566B; Mon, 8 Nov 2010 20:44:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E74D28FC0A; Mon, 8 Nov 2010 20:44:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KiBa5052642; Mon, 8 Nov 2010 20:44:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KiBEX052640; Mon, 8 Nov 2010 20:44:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011082044.oA8KiBEX052640@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Nov 2010 20:44: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: r215010 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:44:12 -0000 Author: jhb Date: Mon Nov 8 20:44:11 2010 New Revision: 215010 URL: http://svn.freebsd.org/changeset/base/215010 Log: Don't mention 'device acpi' or loading ACPI as a kernel module since the latter is not supported. This is also more consistent with manpages for other vendor-specific drivers such as acpi_ibm(4) and acpi_sony(4). Modified: head/share/man/man4/aibs.4 Modified: head/share/man/man4/aibs.4 ============================================================================== --- head/share/man/man4/aibs.4 Mon Nov 8 20:35:09 2010 (r215009) +++ head/share/man/man4/aibs.4 Mon Nov 8 20:44:11 2010 (r215010) @@ -24,18 +24,16 @@ .Nd "ASUSTeK AI Booster ACPI ATK0110 voltage, temperature and fan sensor" .Sh SYNOPSIS To compile this driver into the kernel, -place the following lines in your +place the following line in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device acpi" .Cd "device aibs" .Ed .Pp Alternatively, to load the driver as a -module at boot time, place the following lines in +module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -acpi_load="YES" aibs_load="YES" .Ed .Sh DESCRIPTION From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:56:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00B9106566B; Mon, 8 Nov 2010 20:56:31 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADCD68FC12; Mon, 8 Nov 2010 20:56:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8KuVM3053229; Mon, 8 Nov 2010 20:56:31 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8KuVoJ053224; Mon, 8 Nov 2010 20:56:31 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201011082056.oA8KuVoJ053224@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 8 Nov 2010 20:56: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: r215011 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:56:31 -0000 Author: mdf Date: Mon Nov 8 20:56:31 2010 New Revision: 215011 URL: http://svn.freebsd.org/changeset/base/215011 Log: Add a taskqueue_cancel(9) to cancel a pending task without waiting for it to run as taskqueue_drain(9) does. Requested by: hselasky Original code: jeff Reviewed by: jhb MFC after: 2 weeks Modified: head/share/man/man9/Makefile head/share/man/man9/taskqueue.9 head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Nov 8 20:44:11 2010 (r215010) +++ head/share/man/man9/Makefile Mon Nov 8 20:56:31 2010 (r215011) @@ -1212,6 +1212,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent sysctl_ctx_init.9 sysctl_ctx_entry_find.9 \ sysctl_ctx_init.9 sysctl_ctx_free.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ + taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Mon Nov 8 20:44:11 2010 (r215010) +++ head/share/man/man9/taskqueue.9 Mon Nov 8 20:56:31 2010 (r215011) @@ -63,6 +63,8 @@ struct task { .Fn taskqueue_enqueue "struct taskqueue *queue" "struct task *task" .Ft int .Fn taskqueue_enqueue_fast "struct taskqueue *queue" "struct task *task" +.Ft int +.Fn taskqueue_cancel "struct taskqueue *queue" "struct task *task" "u_int *pendp" .Ft void .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" .Ft int @@ -162,6 +164,31 @@ is called on the task pointer passed to .Fn taskqueue_enqueue . .Pp The +.Fn taskqueue_cancel +function is used to cancel a task. +The +.Va ta_pending +count is cleared, and the old value returned in the reference +parameter +.Fa pendp , +if it is non- Dv NULL . +If the task is currently running, +.Dv EBUSY +is returned, otherwise 0. +To implement a blocking +.Fn taskqueue_cancel +that waits for a running task to finish, it could look like: +.Bd -literal -offset indent +while (taskqueue_cancel(tq, task, NULL) != 0) + taskqueue_drain(tq, task); +.Ed +.Pp +Note that, as with +.Fn taskqueue_drain , +the caller is responsible for ensuring that the task is not re-enqueued +after being canceled. +.Pp +The .Fn taskqueue_drain function is used to wait for the task to finish. There is no guarantee that the task will not be Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Mon Nov 8 20:44:11 2010 (r215010) +++ head/sys/kern/subr_taskqueue.c Mon Nov 8 20:56:31 2010 (r215011) @@ -275,6 +275,24 @@ task_is_running(struct taskqueue *queue, return (0); } +int +taskqueue_cancel(struct taskqueue *queue, struct task *task, u_int *pendp) +{ + u_int pending; + int error; + + TQ_LOCK(queue); + if ((pending = task->ta_pending) > 0) + STAILQ_REMOVE(&queue->tq_queue, task, task, ta_link); + task->ta_pending = 0; + error = task_is_running(queue, task) ? EBUSY : 0; + TQ_UNLOCK(queue); + + if (pendp != NULL) + *pendp = pending; + return (error); +} + void taskqueue_drain(struct taskqueue *queue, struct task *task) { Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Mon Nov 8 20:44:11 2010 (r215010) +++ head/sys/sys/taskqueue.h Mon Nov 8 20:56:31 2010 (r215011) @@ -54,6 +54,8 @@ struct taskqueue *taskqueue_create(const int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, const char *name, ...) __printflike(4, 5); int taskqueue_enqueue(struct taskqueue *queue, struct task *task); +int taskqueue_cancel(struct taskqueue *queue, struct task *task, + u_int *pendp); void taskqueue_drain(struct taskqueue *queue, struct task *task); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:57:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F23541065698; Mon, 8 Nov 2010 20:57: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 DEC368FC13; Mon, 8 Nov 2010 20:57:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8Kv2R7053298; Mon, 8 Nov 2010 20:57:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8Kv2PO053293; Mon, 8 Nov 2010 20:57:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011082057.oA8Kv2PO053293@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Nov 2010 20:57: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: r215012 - in head/sys: amd64/acpica conf i386/acpica modules/acpi/acpi x86/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:57:03 -0000 Author: jhb Date: Mon Nov 8 20:57:02 2010 New Revision: 215012 URL: http://svn.freebsd.org/changeset/base/215012 Log: Move the MADT parser for amd64 and i386 to sys/x86/acpica now that it is identical on both platforms. Added: head/sys/x86/acpica/madt.c - copied unchanged from r215009, head/sys/i386/acpica/madt.c Deleted: head/sys/amd64/acpica/madt.c head/sys/i386/acpica/madt.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/acpi/acpi/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Nov 8 20:56:31 2010 (r215011) +++ head/sys/conf/files.amd64 Mon Nov 8 20:57:02 2010 (r215012) @@ -92,7 +92,6 @@ acpi_wakedata.h optional acpi \ clean "acpi_wakedata.h" # amd64/acpica/acpi_wakeup.c optional acpi -amd64/acpica/madt.c optional acpi amd64/amd64/amd64_mem.c optional mem #amd64/amd64/apic_vector.S standard amd64/amd64/atomic.c standard @@ -301,6 +300,7 @@ contrib/x86emu/x86emu.c optional x86bio # # x86 shared code between IA32, AMD64 and PC98 architectures # +x86/acpica/madt.c optional acpi x86/acpica/srat.c optional acpi x86/bios/smbios.c optional smbios x86/bios/vpd.c optional vpd Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Nov 8 20:56:31 2010 (r215011) +++ head/sys/conf/files.i386 Mon Nov 8 20:57:02 2010 (r215012) @@ -247,7 +247,6 @@ acpi_wakecode.h optional acpi \ no-obj no-implicit-rule before-depend \ clean "acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin" # -i386/acpica/madt.c optional acpi apic i386/bios/apm.c optional apm i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi @@ -374,6 +373,7 @@ compat/x86bios/x86bios.c optional x86bio # # x86 shared code between IA32, AMD64 and PC98 architectures # +x86/acpica/madt.c optional acpi apic x86/acpica/srat.c optional acpi x86/bios/smbios.c optional smbios x86/bios/vpd.c optional vpd Modified: head/sys/modules/acpi/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/acpi/Makefile Mon Nov 8 20:56:31 2010 (r215011) +++ head/sys/modules/acpi/acpi/Makefile Mon Nov 8 20:57:02 2010 (r215012) @@ -22,7 +22,8 @@ ${.CURDIR}/../../../pci \ ${.CURDIR}/../../../dev/acpica \ ${.CURDIR}/../../../dev/acpica/Osd \ - ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica + ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica \ + ${.CURDIR}/../../../x86/acpica KMOD= acpi Copied: head/sys/x86/acpica/madt.c (from r215009, head/sys/i386/acpica/madt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/acpica/madt.c Mon Nov 8 20:57:02 2010 (r215012, copy of r215009, head/sys/i386/acpica/madt.c) @@ -0,0 +1,572 @@ +/*- + * Copyright (c) 2003 John Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +/* These two arrays are indexed by APIC IDs. */ +struct ioapic_info { + void *io_apic; + UINT32 io_vector; +} ioapics[MAX_APIC_ID + 1]; + +struct lapic_info { + u_int la_enabled:1; + u_int la_acpi_id:8; +} lapics[MAX_APIC_ID + 1]; + +static int madt_found_sci_override; +static ACPI_TABLE_MADT *madt; +static vm_paddr_t madt_physaddr; +static vm_offset_t madt_length; + +MALLOC_DEFINE(M_MADT, "madt_table", "ACPI MADT Table Items"); + +static enum intr_polarity interrupt_polarity(UINT16 IntiFlags, UINT8 Source); +static enum intr_trigger interrupt_trigger(UINT16 IntiFlags, UINT8 Source); +static int madt_find_cpu(u_int acpi_id, u_int *apic_id); +static int madt_find_interrupt(int intr, void **apic, u_int *pin); +static void madt_parse_apics(ACPI_SUBTABLE_HEADER *entry, void *arg); +static void madt_parse_interrupt_override( + ACPI_MADT_INTERRUPT_OVERRIDE *intr); +static void madt_parse_ints(ACPI_SUBTABLE_HEADER *entry, + void *arg __unused); +static void madt_parse_local_nmi(ACPI_MADT_LOCAL_APIC_NMI *nmi); +static void madt_parse_nmi(ACPI_MADT_NMI_SOURCE *nmi); +static int madt_probe(void); +static int madt_probe_cpus(void); +static void madt_probe_cpus_handler(ACPI_SUBTABLE_HEADER *entry, + void *arg __unused); +static void madt_register(void *dummy); +static int madt_setup_local(void); +static int madt_setup_io(void); +static void madt_walk_table(acpi_subtable_handler *handler, void *arg); + +static struct apic_enumerator madt_enumerator = { + "MADT", + madt_probe, + madt_probe_cpus, + madt_setup_local, + madt_setup_io +}; + +/* + * Look for an ACPI Multiple APIC Description Table ("APIC") + */ +static int +madt_probe(void) +{ + + madt_physaddr = acpi_find_table(ACPI_SIG_MADT); + if (madt_physaddr == 0) + return (ENXIO); + return (0); +} + +/* + * Run through the MP table enumerating CPUs. + */ +static int +madt_probe_cpus(void) +{ + + madt = acpi_map_table(madt_physaddr, ACPI_SIG_MADT); + madt_length = madt->Header.Length; + KASSERT(madt != NULL, ("Unable to re-map MADT")); + madt_walk_table(madt_probe_cpus_handler, NULL); + acpi_unmap_table(madt); + madt = NULL; + return (0); +} + +/* + * Initialize the local APIC on the BSP. + */ +static int +madt_setup_local(void) +{ + + madt = pmap_mapbios(madt_physaddr, madt_length); + lapic_init(madt->Address); + printf("ACPI APIC Table: <%.*s %.*s>\n", + (int)sizeof(madt->Header.OemId), madt->Header.OemId, + (int)sizeof(madt->Header.OemTableId), madt->Header.OemTableId); + + /* + * We ignore 64-bit local APIC override entries. Should we + * perhaps emit a warning here if we find one? + */ + return (0); +} + +/* + * Enumerate I/O APICs and setup interrupt sources. + */ +static int +madt_setup_io(void) +{ + void *ioapic; + u_int pin; + int i; + + /* Try to initialize ACPI so that we can access the FADT. */ + i = acpi_Startup(); + if (ACPI_FAILURE(i)) { + printf("MADT: ACPI Startup failed with %s\n", + AcpiFormatException(i)); + printf("Try disabling either ACPI or apic support.\n"); + panic("Using MADT but ACPI doesn't work"); + } + + /* First, we run through adding I/O APIC's. */ + madt_walk_table(madt_parse_apics, NULL); + + /* Second, we run through the table tweaking interrupt sources. */ + madt_walk_table(madt_parse_ints, NULL); + + /* + * If there was not an explicit override entry for the SCI, + * force it to use level trigger and active-low polarity. + */ + if (!madt_found_sci_override) { + if (madt_find_interrupt(AcpiGbl_FADT.SciInterrupt, &ioapic, + &pin) != 0) + printf("MADT: Could not find APIC for SCI IRQ %u\n", + AcpiGbl_FADT.SciInterrupt); + else { + printf( + "MADT: Forcing active-low polarity and level trigger for SCI\n"); + ioapic_set_polarity(ioapic, pin, INTR_POLARITY_LOW); + ioapic_set_triggermode(ioapic, pin, INTR_TRIGGER_LEVEL); + } + } + + /* Third, we register all the I/O APIC's. */ + for (i = 0; i <= MAX_APIC_ID; i++) + if (ioapics[i].io_apic != NULL) + ioapic_register(ioapics[i].io_apic); + + /* Finally, we throw the switch to enable the I/O APIC's. */ + acpi_SetDefaultIntrModel(ACPI_INTR_APIC); + + return (0); +} + +static void +madt_register(void *dummy __unused) +{ + + apic_register_enumerator(&madt_enumerator); +} +SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, madt_register, NULL); + +/* + * Call the handler routine for each entry in the MADT table. + */ +static void +madt_walk_table(acpi_subtable_handler *handler, void *arg) +{ + + acpi_walk_subtables(madt + 1, (char *)madt + madt->Header.Length, + handler, arg); +} + +static void +madt_probe_cpus_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) +{ + ACPI_MADT_LOCAL_APIC *proc; + struct lapic_info *la; + + switch (entry->Type) { + case ACPI_MADT_TYPE_LOCAL_APIC: + /* + * The MADT does not include a BSP flag, so we have to + * let the MP code figure out which CPU is the BSP on + * its own. + */ + proc = (ACPI_MADT_LOCAL_APIC *)entry; + if (bootverbose) + printf("MADT: Found CPU APIC ID %u ACPI ID %u: %s\n", + proc->Id, proc->ProcessorId, + (proc->LapicFlags & ACPI_MADT_ENABLED) ? + "enabled" : "disabled"); + if (!(proc->LapicFlags & ACPI_MADT_ENABLED)) + break; + if (proc->Id > MAX_APIC_ID) + panic("%s: CPU ID %u too high", __func__, proc->Id); + la = &lapics[proc->Id]; + KASSERT(la->la_enabled == 0, + ("Duplicate local APIC ID %u", proc->Id)); + la->la_enabled = 1; + la->la_acpi_id = proc->ProcessorId; + lapic_create(proc->Id, 0); + break; + } +} + + +/* + * Add an I/O APIC from an entry in the table. + */ +static void +madt_parse_apics(ACPI_SUBTABLE_HEADER *entry, void *arg __unused) +{ + ACPI_MADT_IO_APIC *apic; + + switch (entry->Type) { + case ACPI_MADT_TYPE_IO_APIC: + apic = (ACPI_MADT_IO_APIC *)entry; + if (bootverbose) + printf( + "MADT: Found IO APIC ID %u, Interrupt %u at %p\n", + apic->Id, apic->GlobalIrqBase, + (void *)(uintptr_t)apic->Address); + if (apic->Id > MAX_APIC_ID) + panic("%s: I/O APIC ID %u too high", __func__, + apic->Id); + if (ioapics[apic->Id].io_apic != NULL) + panic("%s: Double APIC ID %u", __func__, apic->Id); + if (apic->GlobalIrqBase >= FIRST_MSI_INT) { + printf("MADT: Ignoring bogus I/O APIC ID %u", apic->Id); + break; + } + ioapics[apic->Id].io_apic = ioapic_create(apic->Address, + apic->Id, apic->GlobalIrqBase); + ioapics[apic->Id].io_vector = apic->GlobalIrqBase; + break; + default: + break; + } +} + +/* + * Determine properties of an interrupt source. Note that for ACPI these + * functions are only used for ISA interrupts, so we assume ISA bus values + * (Active Hi, Edge Triggered) for conforming values except for the ACPI + * SCI for which we use Active Lo, Level Triggered. + */ +static enum intr_polarity +interrupt_polarity(UINT16 IntiFlags, UINT8 Source) +{ + + switch (IntiFlags & ACPI_MADT_POLARITY_MASK) { + case ACPI_MADT_POLARITY_CONFORMS: + if (Source == AcpiGbl_FADT.SciInterrupt) + return (INTR_POLARITY_LOW); + else + return (INTR_POLARITY_HIGH); + case ACPI_MADT_POLARITY_ACTIVE_HIGH: + return (INTR_POLARITY_HIGH); + case ACPI_MADT_POLARITY_ACTIVE_LOW: + return (INTR_POLARITY_LOW); + default: + panic("Bogus Interrupt Polarity"); + } +} + +static enum intr_trigger +interrupt_trigger(UINT16 IntiFlags, UINT8 Source) +{ + + switch (IntiFlags & ACPI_MADT_TRIGGER_MASK) { + case ACPI_MADT_TRIGGER_CONFORMS: + if (Source == AcpiGbl_FADT.SciInterrupt) + return (INTR_TRIGGER_LEVEL); + else + return (INTR_TRIGGER_EDGE); + case ACPI_MADT_TRIGGER_EDGE: + return (INTR_TRIGGER_EDGE); + case ACPI_MADT_TRIGGER_LEVEL: + return (INTR_TRIGGER_LEVEL); + default: + panic("Bogus Interrupt Trigger Mode"); + } +} + +/* + * Find the local APIC ID associated with a given ACPI Processor ID. + */ +static int +madt_find_cpu(u_int acpi_id, u_int *apic_id) +{ + int i; + + for (i = 0; i <= MAX_APIC_ID; i++) { + if (!lapics[i].la_enabled) + continue; + if (lapics[i].la_acpi_id != acpi_id) + continue; + *apic_id = i; + return (0); + } + return (ENOENT); +} + +/* + * Find the IO APIC and pin on that APIC associated with a given global + * interrupt. + */ +static int +madt_find_interrupt(int intr, void **apic, u_int *pin) +{ + int i, best; + + best = -1; + for (i = 0; i <= MAX_APIC_ID; i++) { + if (ioapics[i].io_apic == NULL || + ioapics[i].io_vector > intr) + continue; + if (best == -1 || + ioapics[best].io_vector < ioapics[i].io_vector) + best = i; + } + if (best == -1) + return (ENOENT); + *apic = ioapics[best].io_apic; + *pin = intr - ioapics[best].io_vector; + if (*pin > 32) + printf("WARNING: Found intpin of %u for vector %d\n", *pin, + intr); + return (0); +} + +/* + * Parse an interrupt source override for an ISA interrupt. + */ +static void +madt_parse_interrupt_override(ACPI_MADT_INTERRUPT_OVERRIDE *intr) +{ + void *new_ioapic, *old_ioapic; + u_int new_pin, old_pin; + enum intr_trigger trig; + enum intr_polarity pol; + char buf[64]; + + if (acpi_quirks & ACPI_Q_MADT_IRQ0 && intr->SourceIrq == 0 && + intr->GlobalIrq == 2) { + if (bootverbose) + printf("MADT: Skipping timer override\n"); + return; + } + if (bootverbose) + printf("MADT: Interrupt override: source %u, irq %u\n", + intr->SourceIrq, intr->GlobalIrq); + KASSERT(intr->Bus == 0, ("bus for interrupt overrides must be zero")); + if (madt_find_interrupt(intr->GlobalIrq, &new_ioapic, &new_pin) != 0) { + printf("MADT: Could not find APIC for vector %u (IRQ %u)\n", + intr->GlobalIrq, intr->SourceIrq); + return; + } + + /* + * Lookup the appropriate trigger and polarity modes for this + * entry. + */ + trig = interrupt_trigger(intr->IntiFlags, intr->SourceIrq); + pol = interrupt_polarity(intr->IntiFlags, intr->SourceIrq); + + /* + * If the SCI is identity mapped but has edge trigger and + * active-hi polarity or the force_sci_lo tunable is set, + * force it to use level/lo. + */ + if (intr->SourceIrq == AcpiGbl_FADT.SciInterrupt) { + madt_found_sci_override = 1; + if (getenv_string("hw.acpi.sci.trigger", buf, sizeof(buf))) { + if (tolower(buf[0]) == 'e') + trig = INTR_TRIGGER_EDGE; + else if (tolower(buf[0]) == 'l') + trig = INTR_TRIGGER_LEVEL; + else + panic( + "Invalid trigger %s: must be 'edge' or 'level'", + buf); + printf("MADT: Forcing SCI to %s trigger\n", + trig == INTR_TRIGGER_EDGE ? "edge" : "level"); + } + if (getenv_string("hw.acpi.sci.polarity", buf, sizeof(buf))) { + if (tolower(buf[0]) == 'h') + pol = INTR_POLARITY_HIGH; + else if (tolower(buf[0]) == 'l') + pol = INTR_POLARITY_LOW; + else + panic( + "Invalid polarity %s: must be 'high' or 'low'", + buf); + printf("MADT: Forcing SCI to active %s polarity\n", + pol == INTR_POLARITY_HIGH ? "high" : "low"); + } + } + + /* Remap the IRQ if it is mapped to a different interrupt vector. */ + if (intr->SourceIrq != intr->GlobalIrq) { + /* + * If the SCI is remapped to a non-ISA global interrupt, + * then override the vector we use to setup and allocate + * the interrupt. + */ + if (intr->GlobalIrq > 15 && + intr->SourceIrq == AcpiGbl_FADT.SciInterrupt) + acpi_OverrideInterruptLevel(intr->GlobalIrq); + else + ioapic_remap_vector(new_ioapic, new_pin, + intr->SourceIrq); + if (madt_find_interrupt(intr->SourceIrq, &old_ioapic, + &old_pin) != 0) + printf("MADT: Could not find APIC for source IRQ %u\n", + intr->SourceIrq); + else if (ioapic_get_vector(old_ioapic, old_pin) == + intr->SourceIrq) + ioapic_disable_pin(old_ioapic, old_pin); + } + + /* Program the polarity and trigger mode. */ + ioapic_set_triggermode(new_ioapic, new_pin, trig); + ioapic_set_polarity(new_ioapic, new_pin, pol); +} + +/* + * Parse an entry for an NMI routed to an IO APIC. + */ +static void +madt_parse_nmi(ACPI_MADT_NMI_SOURCE *nmi) +{ + void *ioapic; + u_int pin; + + if (madt_find_interrupt(nmi->GlobalIrq, &ioapic, &pin) != 0) { + printf("MADT: Could not find APIC for vector %u\n", + nmi->GlobalIrq); + return; + } + + ioapic_set_nmi(ioapic, pin); + if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS)) + ioapic_set_triggermode(ioapic, pin, + interrupt_trigger(nmi->IntiFlags, 0)); + if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS)) + ioapic_set_polarity(ioapic, pin, + interrupt_polarity(nmi->IntiFlags, 0)); +} + +/* + * Parse an entry for an NMI routed to a local APIC LVT pin. + */ +static void +madt_parse_local_nmi(ACPI_MADT_LOCAL_APIC_NMI *nmi) +{ + u_int apic_id, pin; + + if (nmi->ProcessorId == 0xff) + apic_id = APIC_ID_ALL; + else if (madt_find_cpu(nmi->ProcessorId, &apic_id) != 0) { + if (bootverbose) + printf("MADT: Ignoring local NMI routed to " + "ACPI CPU %u\n", nmi->ProcessorId); + return; + } + if (nmi->Lint == 0) + pin = LVT_LINT0; + else + pin = LVT_LINT1; + lapic_set_lvt_mode(apic_id, pin, APIC_LVT_DM_NMI); + if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS)) + lapic_set_lvt_triggermode(apic_id, pin, + interrupt_trigger(nmi->IntiFlags, 0)); + if (!(nmi->IntiFlags & ACPI_MADT_POLARITY_CONFORMS)) + lapic_set_lvt_polarity(apic_id, pin, + interrupt_polarity(nmi->IntiFlags, 0)); +} + +/* + * Parse interrupt entries. + */ +static void +madt_parse_ints(ACPI_SUBTABLE_HEADER *entry, void *arg __unused) +{ + + switch (entry->Type) { + case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: + madt_parse_interrupt_override( + (ACPI_MADT_INTERRUPT_OVERRIDE *)entry); + break; + case ACPI_MADT_TYPE_NMI_SOURCE: + madt_parse_nmi((ACPI_MADT_NMI_SOURCE *)entry); + break; + case ACPI_MADT_TYPE_LOCAL_APIC_NMI: + madt_parse_local_nmi((ACPI_MADT_LOCAL_APIC_NMI *)entry); + break; + } +} + +/* + * Setup per-CPU ACPI IDs. + */ +static void +madt_set_ids(void *dummy) +{ + struct lapic_info *la; + struct pcpu *pc; + u_int i; + + if (madt == NULL) + return; + CPU_FOREACH(i) { + pc = pcpu_find(i); + KASSERT(pc != NULL, ("no pcpu data for CPU %u", i)); + la = &lapics[pc->pc_apic_id]; + if (!la->la_enabled) + panic("APIC: CPU with APIC ID %u is not enabled", + pc->pc_apic_id); + pc->pc_acpi_id = la->la_acpi_id; + if (bootverbose) + printf("APIC: CPU %u has ACPI ID %u\n", i, + la->la_acpi_id); + } +} +SYSINIT(madt_set_ids, SI_SUB_CPU, SI_ORDER_ANY, madt_set_ids, NULL); From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 20:57:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44B4710656A5; Mon, 8 Nov 2010 20:57:09 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324BD8FC12; Mon, 8 Nov 2010 20:57:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8Kv9Wl053341; Mon, 8 Nov 2010 20:57:09 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8Kv9Sr053339; Mon, 8 Nov 2010 20:57:09 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201011082057.oA8Kv9Sr053339@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 8 Nov 2010 20:57: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: r215013 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 20:57:09 -0000 Author: mdf Date: Mon Nov 8 20:57:08 2010 New Revision: 215013 URL: http://svn.freebsd.org/changeset/base/215013 Log: Whitespace and other aspects of style(9). No functional changes. MFC after: 3 days Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Mon Nov 8 20:57:02 2010 (r215012) +++ head/sys/kern/link_elf.c Mon Nov 8 20:57:08 2010 (r215013) @@ -74,52 +74,52 @@ __FBSDID("$FreeBSD$"); #define MAXSEGS 4 typedef struct elf_file { - struct linker_file lf; /* Common fields */ - int preloaded; /* Was file pre-loaded */ - caddr_t address; /* Relocation address */ + struct linker_file lf; /* Common fields */ + int preloaded; /* Was file pre-loaded */ + caddr_t address; /* Relocation address */ #ifdef SPARSE_MAPPING - vm_object_t object; /* VM object to hold file pages */ + vm_object_t object; /* VM object to hold file pages */ #endif - Elf_Dyn* dynamic; /* Symbol table etc. */ - Elf_Hashelt nbuckets; /* DT_HASH info */ - Elf_Hashelt nchains; - const Elf_Hashelt* buckets; - const Elf_Hashelt* chains; - caddr_t hash; - caddr_t strtab; /* DT_STRTAB */ - int strsz; /* DT_STRSZ */ - const Elf_Sym* symtab; /* DT_SYMTAB */ - Elf_Addr* got; /* DT_PLTGOT */ - const Elf_Rel* pltrel; /* DT_JMPREL */ - int pltrelsize; /* DT_PLTRELSZ */ - const Elf_Rela* pltrela; /* DT_JMPREL */ - int pltrelasize; /* DT_PLTRELSZ */ - const Elf_Rel* rel; /* DT_REL */ - int relsize; /* DT_RELSZ */ - const Elf_Rela* rela; /* DT_RELA */ - int relasize; /* DT_RELASZ */ - caddr_t modptr; - const Elf_Sym* ddbsymtab; /* The symbol table we are using */ - long ddbsymcnt; /* Number of symbols */ - caddr_t ddbstrtab; /* String table */ - long ddbstrcnt; /* number of bytes in string table */ - caddr_t symbase; /* malloc'ed symbold base */ - caddr_t strbase; /* malloc'ed string base */ - caddr_t ctftab; /* CTF table */ - long ctfcnt; /* number of bytes in CTF table */ - caddr_t ctfoff; /* CTF offset table */ - caddr_t typoff; /* Type offset table */ - long typlen; /* Number of type entries. */ - Elf_Addr pcpu_start; /* Pre-relocation pcpu set start. */ - Elf_Addr pcpu_stop; /* Pre-relocation pcpu set stop. */ - Elf_Addr pcpu_base; /* Relocated pcpu set address. */ + Elf_Dyn *dynamic; /* Symbol table etc. */ + Elf_Hashelt nbuckets; /* DT_HASH info */ + Elf_Hashelt nchains; + const Elf_Hashelt *buckets; + const Elf_Hashelt *chains; + caddr_t hash; + caddr_t strtab; /* DT_STRTAB */ + int strsz; /* DT_STRSZ */ + const Elf_Sym *symtab; /* DT_SYMTAB */ + Elf_Addr *got; /* DT_PLTGOT */ + const Elf_Rel *pltrel; /* DT_JMPREL */ + int pltrelsize; /* DT_PLTRELSZ */ + const Elf_Rela *pltrela; /* DT_JMPREL */ + int pltrelasize; /* DT_PLTRELSZ */ + const Elf_Rel *rel; /* DT_REL */ + int relsize; /* DT_RELSZ */ + const Elf_Rela *rela; /* DT_RELA */ + int relasize; /* DT_RELASZ */ + caddr_t modptr; + const Elf_Sym *ddbsymtab; /* The symbol table we are using */ + long ddbsymcnt; /* Number of symbols */ + caddr_t ddbstrtab; /* String table */ + long ddbstrcnt; /* number of bytes in string table */ + caddr_t symbase; /* malloc'ed symbold base */ + caddr_t strbase; /* malloc'ed string base */ + caddr_t ctftab; /* CTF table */ + long ctfcnt; /* number of bytes in CTF table */ + caddr_t ctfoff; /* CTF offset table */ + caddr_t typoff; /* Type offset table */ + long typlen; /* Number of type entries. */ + Elf_Addr pcpu_start; /* Pre-relocation pcpu set start. */ + Elf_Addr pcpu_stop; /* Pre-relocation pcpu set stop. */ + Elf_Addr pcpu_base; /* Relocated pcpu set address. */ #ifdef VIMAGE - Elf_Addr vnet_start; /* Pre-relocation vnet set start. */ - Elf_Addr vnet_stop; /* Pre-relocation vnet set stop. */ - Elf_Addr vnet_base; /* Relocated vnet set address. */ + Elf_Addr vnet_start; /* Pre-relocation vnet set start. */ + Elf_Addr vnet_stop; /* Pre-relocation vnet set stop. */ + Elf_Addr vnet_base; /* Relocated vnet set address. */ #endif #ifdef GDB - struct link_map gdb; /* hooks for gdb */ + struct link_map gdb; /* hooks for gdb */ #endif } *elf_file_t; @@ -127,70 +127,71 @@ typedef struct elf_file { static int link_elf_link_common_finish(linker_file_t); static int link_elf_link_preload(linker_class_t cls, - const char*, linker_file_t*); + const char *, linker_file_t *); static int link_elf_link_preload_finish(linker_file_t); -static int link_elf_load_file(linker_class_t, const char*, linker_file_t*); -static int link_elf_lookup_symbol(linker_file_t, const char*, - c_linker_sym_t*); -static int link_elf_symbol_values(linker_file_t, c_linker_sym_t, linker_symval_t*); -static int link_elf_search_symbol(linker_file_t, caddr_t value, - c_linker_sym_t* sym, long* diffp); +static int link_elf_load_file(linker_class_t, const char *, + linker_file_t *); +static int link_elf_lookup_symbol(linker_file_t, const char *, + c_linker_sym_t *); +static int link_elf_symbol_values(linker_file_t, c_linker_sym_t, + linker_symval_t *); +static int link_elf_search_symbol(linker_file_t, caddr_t, + c_linker_sym_t *, long *); static void link_elf_unload_file(linker_file_t); static void link_elf_unload_preload(linker_file_t); static int link_elf_lookup_set(linker_file_t, const char *, - void ***, void ***, int *); + void ***, void ***, int *); static int link_elf_each_function_name(linker_file_t, - int (*)(const char *, void *), - void *); + int (*)(const char *, void *), void *); static int link_elf_each_function_nameval(linker_file_t, - linker_function_nameval_callback_t, - void *); + linker_function_nameval_callback_t, void *); static void link_elf_reloc_local(linker_file_t); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); -static Elf_Addr elf_lookup(linker_file_t lf, Elf_Size symidx, int deps); +static Elf_Addr elf_lookup(linker_file_t, Elf_Size, int); static kobj_method_t link_elf_methods[] = { - KOBJMETHOD(linker_lookup_symbol, link_elf_lookup_symbol), - KOBJMETHOD(linker_symbol_values, link_elf_symbol_values), - KOBJMETHOD(linker_search_symbol, link_elf_search_symbol), - KOBJMETHOD(linker_unload, link_elf_unload_file), - KOBJMETHOD(linker_load_file, link_elf_load_file), - KOBJMETHOD(linker_link_preload, link_elf_link_preload), - KOBJMETHOD(linker_link_preload_finish, link_elf_link_preload_finish), - KOBJMETHOD(linker_lookup_set, link_elf_lookup_set), - KOBJMETHOD(linker_each_function_name, link_elf_each_function_name), - KOBJMETHOD(linker_each_function_nameval, link_elf_each_function_nameval), - KOBJMETHOD(linker_ctf_get, link_elf_ctf_get), - KOBJMETHOD(linker_symtab_get, link_elf_symtab_get), - KOBJMETHOD(linker_strtab_get, link_elf_strtab_get), - { 0, 0 } + KOBJMETHOD(linker_lookup_symbol, link_elf_lookup_symbol), + KOBJMETHOD(linker_symbol_values, link_elf_symbol_values), + KOBJMETHOD(linker_search_symbol, link_elf_search_symbol), + KOBJMETHOD(linker_unload, link_elf_unload_file), + KOBJMETHOD(linker_load_file, link_elf_load_file), + KOBJMETHOD(linker_link_preload, link_elf_link_preload), + KOBJMETHOD(linker_link_preload_finish, link_elf_link_preload_finish), + KOBJMETHOD(linker_lookup_set, link_elf_lookup_set), + KOBJMETHOD(linker_each_function_name, link_elf_each_function_name), + KOBJMETHOD(linker_each_function_nameval, link_elf_each_function_nameval), + KOBJMETHOD(linker_ctf_get, link_elf_ctf_get), + KOBJMETHOD(linker_symtab_get, link_elf_symtab_get), + KOBJMETHOD(linker_strtab_get, link_elf_strtab_get), + { 0, 0 } }; static struct linker_class link_elf_class = { #if ELF_TARG_CLASS == ELFCLASS32 - "elf32", + "elf32", #else - "elf64", + "elf64", #endif - link_elf_methods, sizeof(struct elf_file) + link_elf_methods, sizeof(struct elf_file) }; -static int parse_dynamic(elf_file_t ef); -static int relocate_file(elf_file_t ef); -static int link_elf_preload_parse_symbols(elf_file_t ef); +static int parse_dynamic(elf_file_t); +static int relocate_file(elf_file_t); +static int link_elf_preload_parse_symbols(elf_file_t); #ifdef GDB -static void r_debug_state(struct r_debug *dummy_one, - struct link_map *dummy_two); +static void r_debug_state(struct r_debug *, struct link_map *); /* * A list of loaded modules for GDB to use for loading symbols. */ struct r_debug r_debug; -#define GDB_STATE(s) r_debug.r_state = s; r_debug_state(NULL, NULL); +#define GDB_STATE(s) do { \ + r_debug.r_state = s; r_debug_state(NULL, NULL); \ +} while (0) /* * Function for the debugger to set a breakpoint on to gain control. @@ -204,35 +205,37 @@ r_debug_state(struct r_debug *dummy_one static void link_elf_add_gdb(struct link_map *l) { - struct link_map *prev; + struct link_map *prev; - l->l_next = NULL; + l->l_next = NULL; - if (r_debug.r_map == NULL) { - /* Add first. */ - l->l_prev = NULL; - r_debug.r_map = l; - } else { - /* Append to list. */ - for (prev = r_debug.r_map; prev->l_next != NULL; prev = prev->l_next) - ; - l->l_prev = prev; - prev->l_next = l; - } + if (r_debug.r_map == NULL) { + /* Add first. */ + l->l_prev = NULL; + r_debug.r_map = l; + } else { + /* Append to list. */ + for (prev = r_debug.r_map; + prev->l_next != NULL; + prev = prev->l_next) + ; + l->l_prev = prev; + prev->l_next = l; + } } static void link_elf_delete_gdb(struct link_map *l) { - if (l->l_prev == NULL) { - /* Remove first. */ - if ((r_debug.r_map = l->l_next) != NULL) - l->l_next->l_prev = NULL; - } else { - /* Remove any but first. */ - if ((l->l_prev->l_next = l->l_next) != NULL) - l->l_next->l_prev = l->l_prev; - } + if (l->l_prev == NULL) { + /* Remove first. */ + if ((r_debug.r_map = l->l_next) != NULL) + l->l_next->l_prev = NULL; + } else { + /* Remove any but first. */ + if ((l->l_prev->l_next = l->l_next) != NULL) + l->l_next->l_prev = l->l_prev; + } } #endif /* GDB */ @@ -262,85 +265,86 @@ static int link_elf_link_common_finish(linker_file_t lf) { #ifdef GDB - elf_file_t ef = (elf_file_t)lf; - char *newfilename; + elf_file_t ef = (elf_file_t)lf; + char *newfilename; #endif - int error; + int error; - /* Notify MD code that a module is being loaded. */ - error = elf_cpu_load_file(lf); - if (error) - return (error); + /* Notify MD code that a module is being loaded. */ + error = elf_cpu_load_file(lf); + if (error != 0) + return (error); #ifdef GDB - GDB_STATE(RT_ADD); - ef->gdb.l_addr = lf->address; - newfilename = malloc(strlen(lf->filename) + 1, M_LINKER, M_WAITOK); - strcpy(newfilename, lf->filename); - ef->gdb.l_name = newfilename; - ef->gdb.l_ld = ef->dynamic; - link_elf_add_gdb(&ef->gdb); - GDB_STATE(RT_CONSISTENT); + GDB_STATE(RT_ADD); + ef->gdb.l_addr = lf->address; + newfilename = malloc(strlen(lf->filename) + 1, M_LINKER, M_WAITOK); + strcpy(newfilename, lf->filename); + ef->gdb.l_name = newfilename; + ef->gdb.l_ld = ef->dynamic; + link_elf_add_gdb(&ef->gdb); + GDB_STATE(RT_CONSISTENT); #endif - return (0); + return (0); } static void link_elf_init(void* arg) { - Elf_Dyn *dp; - caddr_t modptr, baseptr, sizeptr; - elf_file_t ef; - char *modname; - - linker_add_class(&link_elf_class); - - dp = (Elf_Dyn*) &_DYNAMIC; - modname = NULL; - modptr = preload_search_by_type("elf" __XSTRING(__ELF_WORD_SIZE) " kernel"); - if (modptr == NULL) - modptr = preload_search_by_type("elf kernel"); - if (modptr) - modname = (char *)preload_search_info(modptr, MODINFO_NAME); - if (modname == NULL) - modname = "kernel"; - linker_kernel_file = linker_make_file(modname, &link_elf_class); - if (linker_kernel_file == NULL) - panic("link_elf_init: Can't create linker structures for kernel"); - - ef = (elf_file_t) linker_kernel_file; - ef->preloaded = 1; - ef->address = 0; + Elf_Dyn *dp; + caddr_t modptr, baseptr, sizeptr; + elf_file_t ef; + char *modname; + + linker_add_class(&link_elf_class); + + dp = (Elf_Dyn *)&_DYNAMIC; + modname = NULL; + modptr = preload_search_by_type("elf" __XSTRING(__ELF_WORD_SIZE) " kernel"); + if (modptr == NULL) + modptr = preload_search_by_type("elf kernel"); + if (modptr != NULL) + modname = (char *)preload_search_info(modptr, MODINFO_NAME); + if (modname == NULL) + modname = "kernel"; + linker_kernel_file = linker_make_file(modname, &link_elf_class); + if (linker_kernel_file == NULL) + panic("%s: Can't create linker structures for kernel", + __func__); + + ef = (elf_file_t) linker_kernel_file; + ef->preloaded = 1; + ef->address = 0; #ifdef SPARSE_MAPPING - ef->object = 0; + ef->object = 0; #endif - ef->dynamic = dp; - - if (dp) - parse_dynamic(ef); - linker_kernel_file->address = (caddr_t) KERNBASE; - linker_kernel_file->size = -(intptr_t)linker_kernel_file->address; + ef->dynamic = dp; - if (modptr) { - ef->modptr = modptr; - baseptr = preload_search_info(modptr, MODINFO_ADDR); - if (baseptr) - linker_kernel_file->address = *(caddr_t *)baseptr; - sizeptr = preload_search_info(modptr, MODINFO_SIZE); - if (sizeptr) - linker_kernel_file->size = *(size_t *)sizeptr; - } - (void)link_elf_preload_parse_symbols(ef); + if (dp != NULL) + parse_dynamic(ef); + linker_kernel_file->address = (caddr_t) KERNBASE; + linker_kernel_file->size = -(intptr_t)linker_kernel_file->address; + + if (modptr != NULL) { + ef->modptr = modptr; + baseptr = preload_search_info(modptr, MODINFO_ADDR); + if (baseptr != NULL) + linker_kernel_file->address = *(caddr_t *)baseptr; + sizeptr = preload_search_info(modptr, MODINFO_SIZE); + if (sizeptr != NULL) + linker_kernel_file->size = *(size_t *)sizeptr; + } + (void)link_elf_preload_parse_symbols(ef); #ifdef GDB - r_debug.r_map = NULL; - r_debug.r_brk = r_debug_state; - r_debug.r_state = RT_CONSISTENT; + r_debug.r_map = NULL; + r_debug.r_brk = r_debug_state; + r_debug.r_state = RT_CONSISTENT; #endif - (void)link_elf_link_common_finish(linker_kernel_file); - linker_kernel_file->flags |= LINKER_FILE_LINKED; + (void)link_elf_link_common_finish(linker_kernel_file); + linker_kernel_file->flags |= LINKER_FILE_LINKED; } SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_THIRD, link_elf_init, 0); @@ -348,795 +352,807 @@ SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_T static int link_elf_preload_parse_symbols(elf_file_t ef) { - caddr_t pointer; - caddr_t ssym, esym, base; - caddr_t strtab; - int strcnt; - Elf_Sym* symtab; - int symcnt; - - if (ef->modptr == NULL) - return 0; - pointer = preload_search_info(ef->modptr, MODINFO_METADATA|MODINFOMD_SSYM); - if (pointer == NULL) - return 0; - ssym = *(caddr_t *)pointer; - pointer = preload_search_info(ef->modptr, MODINFO_METADATA|MODINFOMD_ESYM); - if (pointer == NULL) - return 0; - esym = *(caddr_t *)pointer; - - base = ssym; - - symcnt = *(long *)base; - base += sizeof(long); - symtab = (Elf_Sym *)base; - base += roundup(symcnt, sizeof(long)); - - if (base > esym || base < ssym) { - printf("Symbols are corrupt!\n"); - return EINVAL; - } + caddr_t pointer; + caddr_t ssym, esym, base; + caddr_t strtab; + int strcnt; + Elf_Sym *symtab; + int symcnt; - strcnt = *(long *)base; - base += sizeof(long); - strtab = base; - base += roundup(strcnt, sizeof(long)); - - if (base > esym || base < ssym) { - printf("Symbols are corrupt!\n"); - return EINVAL; - } + if (ef->modptr == NULL) + return (0); + pointer = preload_search_info(ef->modptr, + MODINFO_METADATA | MODINFOMD_SSYM); + if (pointer == NULL) + return (0); + ssym = *(caddr_t *)pointer; + pointer = preload_search_info(ef->modptr, + MODINFO_METADATA | MODINFOMD_ESYM); + if (pointer == NULL) + return (0); + esym = *(caddr_t *)pointer; + + base = ssym; + + symcnt = *(long *)base; + base += sizeof(long); + symtab = (Elf_Sym *)base; + base += roundup(symcnt, sizeof(long)); + + if (base > esym || base < ssym) { + printf("Symbols are corrupt!\n"); + return (EINVAL); + } - ef->ddbsymtab = symtab; - ef->ddbsymcnt = symcnt / sizeof(Elf_Sym); - ef->ddbstrtab = strtab; - ef->ddbstrcnt = strcnt; + strcnt = *(long *)base; + base += sizeof(long); + strtab = base; + base += roundup(strcnt, sizeof(long)); - return 0; + if (base > esym || base < ssym) { + printf("Symbols are corrupt!\n"); + return (EINVAL); + } + + ef->ddbsymtab = symtab; + ef->ddbsymcnt = symcnt / sizeof(Elf_Sym); + ef->ddbstrtab = strtab; + ef->ddbstrcnt = strcnt; + + return (0); } static int parse_dynamic(elf_file_t ef) { - Elf_Dyn *dp; - int plttype = DT_REL; + Elf_Dyn *dp; + int plttype = DT_REL; - for (dp = ef->dynamic; dp->d_tag != DT_NULL; dp++) { - switch (dp->d_tag) { - case DT_HASH: - { - /* From src/libexec/rtld-elf/rtld.c */ - const Elf_Hashelt *hashtab = (const Elf_Hashelt *) - (ef->address + dp->d_un.d_ptr); - ef->nbuckets = hashtab[0]; - ef->nchains = hashtab[1]; - ef->buckets = hashtab + 2; - ef->chains = ef->buckets + ef->nbuckets; - break; - } - case DT_STRTAB: - ef->strtab = (caddr_t) (ef->address + dp->d_un.d_ptr); - break; - case DT_STRSZ: - ef->strsz = dp->d_un.d_val; - break; - case DT_SYMTAB: - ef->symtab = (Elf_Sym*) (ef->address + dp->d_un.d_ptr); - break; - case DT_SYMENT: - if (dp->d_un.d_val != sizeof(Elf_Sym)) - return ENOEXEC; - break; - case DT_PLTGOT: - ef->got = (Elf_Addr *) (ef->address + dp->d_un.d_ptr); - break; - case DT_REL: - ef->rel = (const Elf_Rel *) (ef->address + dp->d_un.d_ptr); - break; - case DT_RELSZ: - ef->relsize = dp->d_un.d_val; - break; - case DT_RELENT: - if (dp->d_un.d_val != sizeof(Elf_Rel)) - return ENOEXEC; - break; - case DT_JMPREL: - ef->pltrel = (const Elf_Rel *) (ef->address + dp->d_un.d_ptr); - break; - case DT_PLTRELSZ: - ef->pltrelsize = dp->d_un.d_val; - break; - case DT_RELA: - ef->rela = (const Elf_Rela *) (ef->address + dp->d_un.d_ptr); - break; - case DT_RELASZ: - ef->relasize = dp->d_un.d_val; - break; - case DT_RELAENT: - if (dp->d_un.d_val != sizeof(Elf_Rela)) - return ENOEXEC; - break; - case DT_PLTREL: - plttype = dp->d_un.d_val; - if (plttype != DT_REL && plttype != DT_RELA) - return ENOEXEC; - break; + for (dp = ef->dynamic; dp->d_tag != DT_NULL; dp++) { + switch (dp->d_tag) { + case DT_HASH: + { + /* From src/libexec/rtld-elf/rtld.c */ + const Elf_Hashelt *hashtab = (const Elf_Hashelt *) + (ef->address + dp->d_un.d_ptr); + ef->nbuckets = hashtab[0]; + ef->nchains = hashtab[1]; + ef->buckets = hashtab + 2; + ef->chains = ef->buckets + ef->nbuckets; + break; + } + case DT_STRTAB: + ef->strtab = (caddr_t) (ef->address + dp->d_un.d_ptr); + break; + case DT_STRSZ: + ef->strsz = dp->d_un.d_val; + break; + case DT_SYMTAB: + ef->symtab = (Elf_Sym*) (ef->address + dp->d_un.d_ptr); + break; + case DT_SYMENT: + if (dp->d_un.d_val != sizeof(Elf_Sym)) + return (ENOEXEC); + break; + case DT_PLTGOT: + ef->got = (Elf_Addr *) (ef->address + dp->d_un.d_ptr); + break; + case DT_REL: + ef->rel = (const Elf_Rel *) (ef->address + dp->d_un.d_ptr); + break; + case DT_RELSZ: + ef->relsize = dp->d_un.d_val; + break; + case DT_RELENT: + if (dp->d_un.d_val != sizeof(Elf_Rel)) + return (ENOEXEC); + break; + case DT_JMPREL: + ef->pltrel = (const Elf_Rel *) (ef->address + dp->d_un.d_ptr); + break; + case DT_PLTRELSZ: + ef->pltrelsize = dp->d_un.d_val; + break; + case DT_RELA: + ef->rela = (const Elf_Rela *) (ef->address + dp->d_un.d_ptr); + break; + case DT_RELASZ: + ef->relasize = dp->d_un.d_val; + break; + case DT_RELAENT: + if (dp->d_un.d_val != sizeof(Elf_Rela)) + return (ENOEXEC); + break; + case DT_PLTREL: + plttype = dp->d_un.d_val; + if (plttype != DT_REL && plttype != DT_RELA) + return (ENOEXEC); + break; #ifdef GDB - case DT_DEBUG: - dp->d_un.d_ptr = (Elf_Addr) &r_debug; - break; + case DT_DEBUG: + dp->d_un.d_ptr = (Elf_Addr)&r_debug; + break; #endif + } } - } - if (plttype == DT_RELA) { - ef->pltrela = (const Elf_Rela *) ef->pltrel; - ef->pltrel = NULL; - ef->pltrelasize = ef->pltrelsize; - ef->pltrelsize = 0; - } + if (plttype == DT_RELA) { + ef->pltrela = (const Elf_Rela *)ef->pltrel; + ef->pltrel = NULL; + ef->pltrelasize = ef->pltrelsize; + ef->pltrelsize = 0; + } - ef->ddbsymtab = ef->symtab; - ef->ddbsymcnt = ef->nchains; - ef->ddbstrtab = ef->strtab; - ef->ddbstrcnt = ef->strsz; + ef->ddbsymtab = ef->symtab; + ef->ddbsymcnt = ef->nchains; + ef->ddbstrtab = ef->strtab; + ef->ddbstrcnt = ef->strsz; - return 0; + return (0); } static int parse_dpcpu(elf_file_t ef) { - int count; - int error; + int count; + int error; - ef->pcpu_start = 0; - ef->pcpu_stop = 0; - error = link_elf_lookup_set(&ef->lf, "pcpu", (void ***)&ef->pcpu_start, - (void ***)&ef->pcpu_stop, &count); - /* Error just means there is no pcpu set to relocate. */ - if (error) - return (0); - count *= sizeof(void *); - /* - * Allocate space in the primary pcpu area. Copy in our initialization - * from the data section and then initialize all per-cpu storage from - * that. - */ - ef->pcpu_base = (Elf_Addr)(uintptr_t)dpcpu_alloc(count); - if (ef->pcpu_base == (Elf_Addr)NULL) - return (ENOSPC); - memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, count); - dpcpu_copy((void *)ef->pcpu_base, count); + ef->pcpu_start = 0; + ef->pcpu_stop = 0; + error = link_elf_lookup_set(&ef->lf, "pcpu", (void ***)&ef->pcpu_start, + (void ***)&ef->pcpu_stop, &count); + /* Error just means there is no pcpu set to relocate. */ + if (error != 0) + return (0); + count *= sizeof(void *); + /* + * Allocate space in the primary pcpu area. Copy in our + * initialization from the data section and then initialize + * all per-cpu storage from that. + */ + ef->pcpu_base = (Elf_Addr)(uintptr_t)dpcpu_alloc(count); + if (ef->pcpu_base == 0) + return (ENOSPC); + memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, count); + dpcpu_copy((void *)ef->pcpu_base, count); - return (0); + return (0); } #ifdef VIMAGE static int parse_vnet(elf_file_t ef) { - int count; - int error; + int count; + int error; - ef->vnet_start = 0; - ef->vnet_stop = 0; - error = link_elf_lookup_set(&ef->lf, "vnet", (void ***)&ef->vnet_start, - (void ***)&ef->vnet_stop, &count); - /* Error just means there is no vnet data set to relocate. */ - if (error) - return (0); - count *= sizeof(void *); - /* - * Allocate space in the primary vnet area. Copy in our initialization - * from the data section and then initialize all per-vnet storage from - * that. - */ - ef->vnet_base = (Elf_Addr)(uintptr_t)vnet_data_alloc(count); - if (ef->vnet_base == (Elf_Addr)NULL) - return (ENOSPC); - memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, count); - vnet_data_copy((void *)ef->vnet_base, count); + ef->vnet_start = 0; + ef->vnet_stop = 0; + error = link_elf_lookup_set(&ef->lf, "vnet", (void ***)&ef->vnet_start, + (void ***)&ef->vnet_stop, &count); + /* Error just means there is no vnet data set to relocate. */ + if (error != 0) + return (0); + count *= sizeof(void *); + /* + * Allocate space in the primary vnet area. Copy in our + * initialization from the data section and then initialize + * all per-vnet storage from that. + */ + ef->vnet_base = (Elf_Addr)(uintptr_t)vnet_data_alloc(count); + if (ef->vnet_base == 0) + return (ENOSPC); + memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, count); + vnet_data_copy((void *)ef->vnet_base, count); - return (0); + return (0); } #endif static int link_elf_link_preload(linker_class_t cls, - const char* filename, linker_file_t *result) + const char* filename, linker_file_t *result) { - caddr_t modptr, baseptr, sizeptr, dynptr; - char *type; - elf_file_t ef; - linker_file_t lf; - int error; - vm_offset_t dp; - - /* Look to see if we have the file preloaded */ - modptr = preload_search_by_name(filename); - if (modptr == NULL) - return ENOENT; - - type = (char *)preload_search_info(modptr, MODINFO_TYPE); - baseptr = preload_search_info(modptr, MODINFO_ADDR); - sizeptr = preload_search_info(modptr, MODINFO_SIZE); - dynptr = preload_search_info(modptr, MODINFO_METADATA|MODINFOMD_DYNAMIC); - if (type == NULL || - (strcmp(type, "elf" __XSTRING(__ELF_WORD_SIZE) " module") != 0 && - strcmp(type, "elf module") != 0)) - return (EFTYPE); - if (baseptr == NULL || sizeptr == NULL || dynptr == NULL) - return (EINVAL); - - lf = linker_make_file(filename, &link_elf_class); - if (lf == NULL) { - return ENOMEM; - } + caddr_t modptr, baseptr, sizeptr, dynptr; + char *type; + elf_file_t ef; + linker_file_t lf; + int error; + vm_offset_t dp; + + /* Look to see if we have the file preloaded */ + modptr = preload_search_by_name(filename); + if (modptr == NULL) + return (ENOENT); - ef = (elf_file_t) lf; - ef->preloaded = 1; - ef->modptr = modptr; - ef->address = *(caddr_t *)baseptr; + type = (char *)preload_search_info(modptr, MODINFO_TYPE); + baseptr = preload_search_info(modptr, MODINFO_ADDR); + sizeptr = preload_search_info(modptr, MODINFO_SIZE); + dynptr = preload_search_info(modptr, + MODINFO_METADATA | MODINFOMD_DYNAMIC); + if (type == NULL || + (strcmp(type, "elf" __XSTRING(__ELF_WORD_SIZE) " module") != 0 && + strcmp(type, "elf module") != 0)) + return (EFTYPE); + if (baseptr == NULL || sizeptr == NULL || dynptr == NULL) + return (EINVAL); + + lf = linker_make_file(filename, &link_elf_class); + if (lf == NULL) + return (ENOMEM); + + ef = (elf_file_t) lf; + ef->preloaded = 1; + ef->modptr = modptr; + ef->address = *(caddr_t *)baseptr; #ifdef SPARSE_MAPPING - ef->object = 0; + ef->object = 0; #endif - dp = (vm_offset_t)ef->address + *(vm_offset_t *)dynptr; - ef->dynamic = (Elf_Dyn *)dp; - lf->address = ef->address; - lf->size = *(size_t *)sizeptr; - - error = parse_dynamic(ef); - if (error == 0) - error = parse_dpcpu(ef); + dp = (vm_offset_t)ef->address + *(vm_offset_t *)dynptr; + ef->dynamic = (Elf_Dyn *)dp; + lf->address = ef->address; + lf->size = *(size_t *)sizeptr; + + error = parse_dynamic(ef); + if (error == 0) + error = parse_dpcpu(ef); #ifdef VIMAGE - if (error == 0) - error = parse_vnet(ef); + if (error == 0) + error = parse_vnet(ef); #endif - if (error) { - linker_file_unload(lf, LINKER_UNLOAD_FORCE); - return error; - } - link_elf_reloc_local(lf); - *result = lf; - return (0); + if (error != 0) { + linker_file_unload(lf, LINKER_UNLOAD_FORCE); + return (error); + } + link_elf_reloc_local(lf); + *result = lf; + return (0); } static int link_elf_link_preload_finish(linker_file_t lf) { - elf_file_t ef; - int error; + elf_file_t ef; + int error; - ef = (elf_file_t) lf; + ef = (elf_file_t) lf; #if 0 /* this will be more trouble than it's worth for now */ - for (dp = ef->dynamic; dp->d_tag != DT_NULL; dp++) { - if (dp->d_tag != DT_NEEDED) - continue; - modname = ef->strtab + dp->d_un.d_val; - error = linker_load_module(modname, lf); - if (error) - goto out; + for (dp = ef->dynamic; dp->d_tag != DT_NULL; dp++) { + if (dp->d_tag != DT_NEEDED) + continue; + modname = ef->strtab + dp->d_un.d_val; + error = linker_load_module(modname, lf); + if (error != 0) + goto out; } #endif - error = relocate_file(ef); - if (error) - return error; - (void)link_elf_preload_parse_symbols(ef); + error = relocate_file(ef); + if (error != 0) + return (error); + (void)link_elf_preload_parse_symbols(ef); - return (link_elf_link_common_finish(lf)); + return (link_elf_link_common_finish(lf)); } static int link_elf_load_file(linker_class_t cls, const char* filename, - linker_file_t* result) + linker_file_t* result) { - struct nameidata nd; - struct thread* td = curthread; /* XXX */ - Elf_Ehdr *hdr; - caddr_t firstpage; - int nbytes, i; - Elf_Phdr *phdr; - Elf_Phdr *phlimit; - Elf_Phdr *segs[MAXSEGS]; - int nsegs; - Elf_Phdr *phdyn; - Elf_Phdr *phphdr; - caddr_t mapbase; - size_t mapsize; - Elf_Off base_offset; - Elf_Addr base_vaddr; - Elf_Addr base_vlimit; - int error = 0; - int resid, flags; - elf_file_t ef; - linker_file_t lf; - Elf_Shdr *shdr; - int symtabindex; - int symstrindex; - int symcnt; - int strcnt; - int vfslocked; - - shdr = NULL; - lf = NULL; - - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, filename, td); - flags = FREAD; - error = vn_open(&nd, &flags, 0, NULL); - if (error) - return error; - vfslocked = NDHASGIANT(&nd); - NDFREE(&nd, NDF_ONLY_PNBUF); - if (nd.ni_vp->v_type != VREG) { - error = ENOEXEC; - firstpage = NULL; - goto out; - } + struct nameidata nd; + struct thread* td = curthread; /* XXX */ + Elf_Ehdr *hdr; + caddr_t firstpage; + int nbytes, i; + Elf_Phdr *phdr; + Elf_Phdr *phlimit; + Elf_Phdr *segs[MAXSEGS]; + int nsegs; + Elf_Phdr *phdyn; + Elf_Phdr *phphdr; + caddr_t mapbase; + size_t mapsize; + Elf_Off base_offset; + Elf_Addr base_vaddr; + Elf_Addr base_vlimit; + int error = 0; + int resid, flags; + elf_file_t ef; + linker_file_t lf; + Elf_Shdr *shdr; + int symtabindex; + int symstrindex; + int symcnt; + int strcnt; + int vfslocked; + + shdr = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 21:22:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE0D106566B; Mon, 8 Nov 2010 21:22:55 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE4228FC1E; Mon, 8 Nov 2010 21:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8LMteh054602; Mon, 8 Nov 2010 21:22:55 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8LMtLj054598; Mon, 8 Nov 2010 21:22:55 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011082122.oA8LMtLj054598@svn.freebsd.org> From: Juli Mallett Date: Mon, 8 Nov 2010 21:22: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: r215014 - head/sys/contrib/octeon-sdk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 21:22:56 -0000 Author: jmallett Date: Mon Nov 8 21:22:55 2010 New Revision: 215014 URL: http://svn.freebsd.org/changeset/base/215014 Log: o) Recognize the Lanner MR-730. o) Fix enumeration of PHY addresses on the MR-955. o) Parse link state for the MR-730 using the Broadcom PHY support in the SDK. It's not clear that this is entirely-correct, but it seems to work. Since this board uses a BCM5482S, this may mean that we work correctly for copper but not SFI, which is untested. Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper.c Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Mon Nov 8 20:57:08 2010 (r215013) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Mon Nov 8 21:22:55 2010 (r215014) @@ -193,6 +193,9 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_CUST_GCT108 = 10012, CVMX_BOARD_TYPE_CUST_AGS109 = 10013, CVMX_BOARD_TYPE_CUST_GCT110 = 10014, +#if defined(OCTEON_VENDOR_LANNER) + CVMX_BOARD_TYPE_CUST_LANNER_MR730= 10021, +#endif CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000, /* Set aside a range for customer private use. The SDK won't @@ -272,6 +275,9 @@ static inline const char *cvmx_board_typ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT108) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS109) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT110) +#if defined(OCTEON_VENDOR_LANNER) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR730) +#endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX) /* Customer private range */ Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov 8 20:57:08 2010 (r215013) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov 8 21:22:55 2010 (r215014) @@ -114,9 +114,6 @@ int cvmx_helper_board_get_mii_address(in case CVMX_BOARD_TYPE_EBT5800: case CVMX_BOARD_TYPE_THUNDER: case CVMX_BOARD_TYPE_NICPRO2: -#if defined(OCTEON_VENDOR_LANNER) - case CVMX_BOARD_TYPE_CUST_LANNER_MR955: -#endif /* Interface 0 is SPI4, interface 1 is RGMII */ if ((ipd_port >= 16) && (ipd_port < 20)) return ipd_port - 16; @@ -180,6 +177,15 @@ int cvmx_helper_board_get_mii_address(in /* Private vendor-defined boards. */ #if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + /* Interface 1 is 12 BCM5482S PHYs. */ + if ((ipd_port >= 16) && (ipd_port < 28)) + return ipd_port - 16; + return -1; + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + if ((ipd_port >= 0) && (ipd_port < 4)) + return ipd_port; + return -1; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: /* Port 0 is a Marvell 88E6161 switch, ports 1 and 2 are Marvell 88E1111 interfaces. */ @@ -291,6 +297,10 @@ cvmx_helper_link_info_t __cvmx_helper_bo break; /* Private vendor-defined boards. */ #if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + /* Ports are BCM5482S */ + is_broadcom_phy = 1; + break; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: /* Port 0 connects to the switch */ if (ipd_port == 0) Modified: head/sys/contrib/octeon-sdk/cvmx-helper.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper.c Mon Nov 8 20:57:08 2010 (r215013) +++ head/sys/contrib/octeon-sdk/cvmx-helper.c Mon Nov 8 21:22:55 2010 (r215014) @@ -105,6 +105,8 @@ int cvmx_helper_get_number_of_interfaces #if defined(OCTEON_VENDOR_LANNER) case CVMX_BOARD_TYPE_CUST_LANNER_MR955: return 2; + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + return 1; #endif default: break; From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 21:23:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B16B1065673; Mon, 8 Nov 2010 21:23:29 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19CB88FC1E; Mon, 8 Nov 2010 21:23:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8LNSna054667; Mon, 8 Nov 2010 21:23:28 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8LNSQV054664; Mon, 8 Nov 2010 21:23:28 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011082123.oA8LNSQV054664@svn.freebsd.org> From: Juli Mallett Date: Mon, 8 Nov 2010 21:23: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: r215015 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 21:23:29 -0000 Author: jmallett Date: Mon Nov 8 21:23:28 2010 New Revision: 215015 URL: http://svn.freebsd.org/changeset/base/215015 Log: Recognize the BCM5482S. Modified: head/sys/dev/mii/brgphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Mon Nov 8 21:22:55 2010 (r215014) +++ head/sys/dev/mii/brgphy.c Mon Nov 8 21:23:28 2010 (r215015) @@ -132,6 +132,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM, BCM5754), MII_PHY_DESC(xxBROADCOM, BCM5780), MII_PHY_DESC(xxBROADCOM, BCM5708C), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5482S), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5755), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S), Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Mon Nov 8 21:22:55 2010 (r215014) +++ head/sys/dev/mii/miidevs Mon Nov 8 21:23:28 2010 (r215015) @@ -145,6 +145,7 @@ model xxBROADCOM BCM54K2 0x002e BCM54K2 model xxBROADCOM BCM5714 0x0034 BCM5714 10/100/1000baseTX PHY model xxBROADCOM BCM5780 0x0035 BCM5780 10/100/1000baseTX PHY model xxBROADCOM BCM5708C 0x0036 BCM5708C 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5482S 0x000b BCM5482S Dual-Port 10/100/1000baseX/FX PHY model xxBROADCOM_ALT1 BCM5755 0x000c BCM5755 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5787 0x000e BCM5787 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5708S 0x0015 BCM5708S 1000/2500BaseSX PHY From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 21:50:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EA2C106566B; Mon, 8 Nov 2010 21:50:46 +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 2C3968FC19; Mon, 8 Nov 2010 21:50:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8Lok2J055877; Mon, 8 Nov 2010 21:50:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8LokTg055871; Mon, 8 Nov 2010 21:50:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011082150.oA8LokTg055871@svn.freebsd.org> From: John Baldwin Date: Mon, 8 Nov 2010 21:50: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: r215016 - in head/sys/boot: common forth i386/libi386 i386/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 21:50:46 -0000 Author: jhb Date: Mon Nov 8 21:50:45 2010 New Revision: 215016 URL: http://svn.freebsd.org/changeset/base/215016 Log: Remove support for autoloading ACPI from the loader. Leave in the code to detect ACPI and export info such as the location of the RSDP via hints as that is still useful. Modified: head/sys/boot/common/loader.8 head/sys/boot/forth/beastie.4th head/sys/boot/i386/libi386/biosacpi.c head/sys/boot/i386/libi386/i386_module.c head/sys/boot/i386/loader/help.i386 Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Mon Nov 8 21:23:28 2010 (r215015) +++ head/sys/boot/common/loader.8 Mon Nov 8 21:50:45 2010 (r215016) @@ -334,12 +334,6 @@ Some options may require a value, while others define behavior just by being set. Both types of builtin variables are described below. .Bl -tag -width bootfile -.It Va acpi_load -Unset this to disable automatic loading of the ACPI module. -See also -.Va hint.acpi.0.disabled -in -.Xr device.hints 5 . .It Va autoboot_delay Number of seconds .Ic autoboot Modified: head/sys/boot/forth/beastie.4th ============================================================================== --- head/sys/boot/forth/beastie.4th Mon Nov 8 21:23:28 2010 (r215015) +++ head/sys/boot/forth/beastie.4th Mon Nov 8 21:50:45 2010 (r215016) @@ -141,13 +141,11 @@ at-xy ." `--{__________) " ; : acpienabled? ( -- flag ) - s" acpi_load" getenv + s" hint.acpi.0.rsdp" getenv dup -1 = if drop false exit then - s" YES" compare-insensitive 0<> if - false exit - then + 2drop s" hint.acpi.0.disabled" getenv dup -1 <> if s" 0" compare 0<> if @@ -254,11 +252,9 @@ set-current dup bootkey @ = if 0 boot then dup bootacpikey @ = if acpienabled? if - s" acpi_load" unsetenv s" 1" s" hint.acpi.0.disabled" setenv s" 1" s" loader.acpi_disabled_by_user" setenv else - s" YES" s" acpi_load" setenv s" 0" s" hint.acpi.0.disabled" setenv then 0 boot @@ -266,7 +262,6 @@ set-current dup bootsafekey @ = if s" arch-i386" environment? if drop - s" acpi_load" unsetenv s" 1" s" hint.acpi.0.disabled" setenv s" 1" s" loader.acpi_disabled_by_user" setenv s" 1" s" hint.apic.0.disabled" setenv Modified: head/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- head/sys/boot/i386/libi386/biosacpi.c Mon Nov 8 21:23:28 2010 (r215015) +++ head/sys/boot/i386/libi386/biosacpi.c Mon Nov 8 21:50:45 2010 (r215016) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include "actbl.h" /* - * Detect ACPI and export information about the APCI BIOS into the + * Detect ACPI and export information about the ACPI BIOS into the * environment. */ @@ -56,8 +56,6 @@ biosacpi_detect(void) char buf[24]; int revision; - /* XXX check the BIOS datestamp */ - /* locate and validate the RSDP */ if ((rsdp = biosacpi_find_rsdp()) == NULL) return; @@ -82,9 +80,6 @@ biosacpi_detect(void) sprintf(buf, "%d", rsdp->Length); setenv("hint.acpi.0.xsdt_length", buf, 1); } - /* XXX other tables? */ - - setenv("acpi_load", "YES", 1); } /* Modified: head/sys/boot/i386/libi386/i386_module.c ============================================================================== --- head/sys/boot/i386/libi386/i386_module.c Mon Nov 8 21:23:28 2010 (r215015) +++ head/sys/boot/i386/libi386/i386_module.c Mon Nov 8 21:50:45 2010 (r215016) @@ -44,25 +44,7 @@ __FBSDID("$FreeBSD$"); int i386_autoload(void) { - int error; - int disabled; - char *rv; /* XXX use PnP to locate stuff here */ - - /* autoload ACPI support */ - /* XXX should be in 4th keyed off acpi_load */ - disabled = 0; - rv = getenv("hint.acpi.0.disabled"); - if (rv != NULL && strncmp(rv, "0", 1) != 0) { - disabled = 1; - } - - if (getenv("acpi_load") && (!disabled)) { - error = mod_load("acpi", NULL, 0, NULL); - if (error != 0) - printf("ACPI autoload failed - %s\n", strerror(error)); - } - return(0); } Modified: head/sys/boot/i386/loader/help.i386 ============================================================================== --- head/sys/boot/i386/loader/help.i386 Mon Nov 8 21:23:28 2010 (r215015) +++ head/sys/boot/i386/loader/help.i386 Mon Nov 8 21:50:45 2010 (r215016) @@ -1,22 +1,4 @@ ################################################################################ -# TACPI DControl ACPI module behaviour - - $acpi_load - - If set, the ACPI module will be loaded. Clear it with - - unset acpi_load - - $hint.acpi.0.disabled="1" - - If set, the ACPI module won't be loaded. - - Note that the ACPI autodetection sets a number of hints to - pass information to the ACPI module. These should not be - overridden, or system behaviour will be undefined. - - -################################################################################ # Treboot DReboot the system reboot From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 21:50:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41B0E1065675; Mon, 8 Nov 2010 21:50:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15E428FC1B; Mon, 8 Nov 2010 21:50:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8LooV8055915; Mon, 8 Nov 2010 21:50:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8LooED055912; Mon, 8 Nov 2010 21:50:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011082150.oA8LooED055912@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 21:50: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: r215017 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 21:50:51 -0000 Author: yongari Date: Mon Nov 8 21:50:50 2010 New Revision: 215017 URL: http://svn.freebsd.org/changeset/base/215017 Log: Follow the lead of vendor's interrupt moderation mechanism. It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt moderation mechanism but it is not documented at all. The magic value dramatically reduced number of interrupts without noticeable performance drops so apply it to all RTL8169/RTL8169 controllers. Vendor's FreeBSD driver also applies it to RTL810xE controllers but their Linux driver explicitly cleared the register, so do not enable interrupt moderation for RTL810xE controllers. While I'm here sort 8169 specific registers. Obtained from: RealTek FreeBSD driver Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Nov 8 21:50:45 2010 (r215016) +++ head/sys/dev/re/if_re.c Mon Nov 8 21:50:50 2010 (r215017) @@ -2715,6 +2715,24 @@ re_init_locked(struct rl_softc *sc) */ re_set_rxmode(sc); + /* Configure interrupt moderation. */ + if (sc->rl_type == RL_8169) { + switch (sc->rl_hwrev) { + case RL_HWREV_8100E: + case RL_HWREV_8101E: + case RL_HWREV_8102E: + case RL_HWREV_8102EL: + case RL_HWREV_8102EL_SPIN1: + case RL_HWREV_8103E: + CSR_WRITE_2(sc, RL_INTRMOD, 0); + break; + default: + /* Magic from vendor. */ + CSR_WRITE_2(sc, RL_INTRMOD, 0x5151); + break; + } + } + #ifdef DEVICE_POLLING /* * Disable interrupts if we are polling. Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Nov 8 21:50:45 2010 (r215016) +++ head/sys/pci/if_rlreg.h Mon Nov 8 21:50:50 2010 (r215017) @@ -125,6 +125,7 @@ /* * Registers specific to the 8169 gigE chip */ +#define RL_GTXSTART 0x0038 /* 8 bits */ #define RL_TIMERINT_8169 0x0058 /* different offset than 8139 */ #define RL_PHYAR 0x0060 #define RL_TBICSR 0x0064 @@ -135,7 +136,7 @@ #define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ #define RL_PMCH 0x006F /* 8 bits */ #define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ -#define RL_GTXSTART 0x0038 /* 8 bits */ +#define RL_INTRMOD 0x00E2 /* 16 bits */ /* * TX config register bits From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 22:03:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9835106564A; Mon, 8 Nov 2010 22:03:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B76258FC12; Mon, 8 Nov 2010 22:03:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8M3eA9056526; Mon, 8 Nov 2010 22:03:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8M3ebO056524; Mon, 8 Nov 2010 22:03:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011082203.oA8M3ebO056524@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 22:03: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: r215018 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 22:03:40 -0000 Author: yongari Date: Mon Nov 8 22:03:40 2010 New Revision: 215018 URL: http://svn.freebsd.org/changeset/base/215018 Log: Consistently use tab character instead of using space character. No functional changes. Modified: head/sys/pci/if_rlreg.h Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Nov 8 21:50:50 2010 (r215017) +++ head/sys/pci/if_rlreg.h Mon Nov 8 22:03:40 2010 (r215018) @@ -36,211 +36,211 @@ * RealTek 8129/8139 register offsets */ #define RL_IDR0 0x0000 /* ID register 0 (station addr) */ -#define RL_IDR1 0x0001 /* Must use 32-bit accesses (?) */ -#define RL_IDR2 0x0002 -#define RL_IDR3 0x0003 -#define RL_IDR4 0x0004 -#define RL_IDR5 0x0005 +#define RL_IDR1 0x0001 /* Must use 32-bit accesses (?) */ +#define RL_IDR2 0x0002 +#define RL_IDR3 0x0003 +#define RL_IDR4 0x0004 +#define RL_IDR5 0x0005 /* 0006-0007 reserved */ -#define RL_MAR0 0x0008 /* Multicast hash table */ -#define RL_MAR1 0x0009 -#define RL_MAR2 0x000A -#define RL_MAR3 0x000B -#define RL_MAR4 0x000C -#define RL_MAR5 0x000D -#define RL_MAR6 0x000E -#define RL_MAR7 0x000F - -#define RL_TXSTAT0 0x0010 /* status of TX descriptor 0 */ -#define RL_TXSTAT1 0x0014 /* status of TX descriptor 1 */ -#define RL_TXSTAT2 0x0018 /* status of TX descriptor 2 */ -#define RL_TXSTAT3 0x001C /* status of TX descriptor 3 */ - -#define RL_TXADDR0 0x0020 /* address of TX descriptor 0 */ -#define RL_TXADDR1 0x0024 /* address of TX descriptor 1 */ -#define RL_TXADDR2 0x0028 /* address of TX descriptor 2 */ -#define RL_TXADDR3 0x002C /* address of TX descriptor 3 */ - -#define RL_RXADDR 0x0030 /* RX ring start address */ -#define RL_RX_EARLY_BYTES 0x0034 /* RX early byte count */ -#define RL_RX_EARLY_STAT 0x0036 /* RX early status */ -#define RL_COMMAND 0x0037 /* command register */ -#define RL_CURRXADDR 0x0038 /* current address of packet read */ -#define RL_CURRXBUF 0x003A /* current RX buffer address */ -#define RL_IMR 0x003C /* interrupt mask register */ -#define RL_ISR 0x003E /* interrupt status register */ -#define RL_TXCFG 0x0040 /* transmit config */ -#define RL_RXCFG 0x0044 /* receive config */ -#define RL_TIMERCNT 0x0048 /* timer count register */ -#define RL_MISSEDPKT 0x004C /* missed packet counter */ -#define RL_EECMD 0x0050 /* EEPROM command register */ -#define RL_CFG0 0x0051 /* config register #0 */ -#define RL_CFG1 0x0052 /* config register #1 */ +#define RL_MAR0 0x0008 /* Multicast hash table */ +#define RL_MAR1 0x0009 +#define RL_MAR2 0x000A +#define RL_MAR3 0x000B +#define RL_MAR4 0x000C +#define RL_MAR5 0x000D +#define RL_MAR6 0x000E +#define RL_MAR7 0x000F + +#define RL_TXSTAT0 0x0010 /* status of TX descriptor 0 */ +#define RL_TXSTAT1 0x0014 /* status of TX descriptor 1 */ +#define RL_TXSTAT2 0x0018 /* status of TX descriptor 2 */ +#define RL_TXSTAT3 0x001C /* status of TX descriptor 3 */ + +#define RL_TXADDR0 0x0020 /* address of TX descriptor 0 */ +#define RL_TXADDR1 0x0024 /* address of TX descriptor 1 */ +#define RL_TXADDR2 0x0028 /* address of TX descriptor 2 */ +#define RL_TXADDR3 0x002C /* address of TX descriptor 3 */ + +#define RL_RXADDR 0x0030 /* RX ring start address */ +#define RL_RX_EARLY_BYTES 0x0034 /* RX early byte count */ +#define RL_RX_EARLY_STAT 0x0036 /* RX early status */ +#define RL_COMMAND 0x0037 /* command register */ +#define RL_CURRXADDR 0x0038 /* current address of packet read */ +#define RL_CURRXBUF 0x003A /* current RX buffer address */ +#define RL_IMR 0x003C /* interrupt mask register */ +#define RL_ISR 0x003E /* interrupt status register */ +#define RL_TXCFG 0x0040 /* transmit config */ +#define RL_RXCFG 0x0044 /* receive config */ +#define RL_TIMERCNT 0x0048 /* timer count register */ +#define RL_MISSEDPKT 0x004C /* missed packet counter */ +#define RL_EECMD 0x0050 /* EEPROM command register */ +#define RL_CFG0 0x0051 /* config register #0 */ +#define RL_CFG1 0x0052 /* config register #1 */ #define RL_CFG2 0x0053 /* config register #2 */ #define RL_CFG3 0x0054 /* config register #3 */ #define RL_CFG4 0x0055 /* config register #4 */ #define RL_CFG5 0x0056 /* config register #5 */ /* 0057 reserved */ -#define RL_MEDIASTAT 0x0058 /* media status register (8139) */ +#define RL_MEDIASTAT 0x0058 /* media status register (8139) */ /* 0059-005A reserved */ -#define RL_MII 0x005A /* 8129 chip only */ -#define RL_HALTCLK 0x005B -#define RL_MULTIINTR 0x005C /* multiple interrupt */ -#define RL_PCIREV 0x005E /* PCI revision value */ +#define RL_MII 0x005A /* 8129 chip only */ +#define RL_HALTCLK 0x005B +#define RL_MULTIINTR 0x005C /* multiple interrupt */ +#define RL_PCIREV 0x005E /* PCI revision value */ /* 005F reserved */ -#define RL_TXSTAT_ALL 0x0060 /* TX status of all descriptors */ +#define RL_TXSTAT_ALL 0x0060 /* TX status of all descriptors */ /* Direct PHY access registers only available on 8139 */ -#define RL_BMCR 0x0062 /* PHY basic mode control */ -#define RL_BMSR 0x0064 /* PHY basic mode status */ -#define RL_ANAR 0x0066 /* PHY autoneg advert */ -#define RL_LPAR 0x0068 /* PHY link partner ability */ -#define RL_ANER 0x006A /* PHY autoneg expansion */ - -#define RL_DISCCNT 0x006C /* disconnect counter */ -#define RL_FALSECAR 0x006E /* false carrier counter */ -#define RL_NWAYTST 0x0070 /* NWAY test register */ -#define RL_RX_ER 0x0072 /* RX_ER counter */ -#define RL_CSCFG 0x0074 /* CS configuration register */ +#define RL_BMCR 0x0062 /* PHY basic mode control */ +#define RL_BMSR 0x0064 /* PHY basic mode status */ +#define RL_ANAR 0x0066 /* PHY autoneg advert */ +#define RL_LPAR 0x0068 /* PHY link partner ability */ +#define RL_ANER 0x006A /* PHY autoneg expansion */ + +#define RL_DISCCNT 0x006C /* disconnect counter */ +#define RL_FALSECAR 0x006E /* false carrier counter */ +#define RL_NWAYTST 0x0070 /* NWAY test register */ +#define RL_RX_ER 0x0072 /* RX_ER counter */ +#define RL_CSCFG 0x0074 /* CS configuration register */ /* * When operating in special C+ mode, some of the registers in an * 8139C+ chip have different definitions. These are also used for * the 8169 gigE chip. */ -#define RL_DUMPSTATS_LO 0x0010 /* counter dump command register */ -#define RL_DUMPSTATS_HI 0x0014 /* counter dump command register */ -#define RL_TXLIST_ADDR_LO 0x0020 /* 64 bits, 256 byte alignment */ -#define RL_TXLIST_ADDR_HI 0x0024 /* 64 bits, 256 byte alignment */ -#define RL_TXLIST_ADDR_HPRIO_LO 0x0028 /* 64 bits, 256 byte alignment */ -#define RL_TXLIST_ADDR_HPRIO_HI 0x002C /* 64 bits, 256 byte alignment */ -#define RL_CFG2 0x0053 -#define RL_TIMERINT 0x0054 /* interrupt on timer expire */ -#define RL_TXSTART 0x00D9 /* 8 bits */ -#define RL_CPLUS_CMD 0x00E0 /* 16 bits */ -#define RL_RXLIST_ADDR_LO 0x00E4 /* 64 bits, 256 byte alignment */ -#define RL_RXLIST_ADDR_HI 0x00E8 /* 64 bits, 256 byte alignment */ -#define RL_EARLY_TX_THRESH 0x00EC /* 8 bits */ +#define RL_DUMPSTATS_LO 0x0010 /* counter dump command register */ +#define RL_DUMPSTATS_HI 0x0014 /* counter dump command register */ +#define RL_TXLIST_ADDR_LO 0x0020 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HI 0x0024 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HPRIO_LO 0x0028 /* 64 bits, 256 byte alignment */ +#define RL_TXLIST_ADDR_HPRIO_HI 0x002C /* 64 bits, 256 byte alignment */ +#define RL_CFG2 0x0053 +#define RL_TIMERINT 0x0054 /* interrupt on timer expire */ +#define RL_TXSTART 0x00D9 /* 8 bits */ +#define RL_CPLUS_CMD 0x00E0 /* 16 bits */ +#define RL_RXLIST_ADDR_LO 0x00E4 /* 64 bits, 256 byte alignment */ +#define RL_RXLIST_ADDR_HI 0x00E8 /* 64 bits, 256 byte alignment */ +#define RL_EARLY_TX_THRESH 0x00EC /* 8 bits */ /* * Registers specific to the 8169 gigE chip */ -#define RL_GTXSTART 0x0038 /* 8 bits */ -#define RL_TIMERINT_8169 0x0058 /* different offset than 8139 */ -#define RL_PHYAR 0x0060 -#define RL_TBICSR 0x0064 -#define RL_TBI_ANAR 0x0068 -#define RL_TBI_LPAR 0x006A -#define RL_GMEDIASTAT 0x006C /* 8 bits */ -#define RL_MACDBG 0x006D /* 8 bits, 8168C SPIN2 only */ -#define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ -#define RL_PMCH 0x006F /* 8 bits */ -#define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ -#define RL_INTRMOD 0x00E2 /* 16 bits */ +#define RL_GTXSTART 0x0038 /* 8 bits */ +#define RL_TIMERINT_8169 0x0058 /* different offset than 8139 */ +#define RL_PHYAR 0x0060 +#define RL_TBICSR 0x0064 +#define RL_TBI_ANAR 0x0068 +#define RL_TBI_LPAR 0x006A +#define RL_GMEDIASTAT 0x006C /* 8 bits */ +#define RL_MACDBG 0x006D /* 8 bits, 8168C SPIN2 only */ +#define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ +#define RL_PMCH 0x006F /* 8 bits */ +#define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ +#define RL_INTRMOD 0x00E2 /* 16 bits */ /* * TX config register bits */ -#define RL_TXCFG_CLRABRT 0x00000001 /* retransmit aborted pkt */ -#define RL_TXCFG_MAXDMA 0x00000700 /* max DMA burst size */ -#define RL_TXCFG_CRCAPPEND 0x00010000 /* CRC append (0 = yes) */ -#define RL_TXCFG_LOOPBKTST 0x00060000 /* loopback test */ -#define RL_TXCFG_IFG2 0x00080000 /* 8169 only */ -#define RL_TXCFG_IFG 0x03000000 /* interframe gap */ -#define RL_TXCFG_HWREV 0x7CC00000 - -#define RL_LOOPTEST_OFF 0x00000000 -#define RL_LOOPTEST_ON 0x00020000 -#define RL_LOOPTEST_ON_CPLUS 0x00060000 +#define RL_TXCFG_CLRABRT 0x00000001 /* retransmit aborted pkt */ +#define RL_TXCFG_MAXDMA 0x00000700 /* max DMA burst size */ +#define RL_TXCFG_CRCAPPEND 0x00010000 /* CRC append (0 = yes) */ +#define RL_TXCFG_LOOPBKTST 0x00060000 /* loopback test */ +#define RL_TXCFG_IFG2 0x00080000 /* 8169 only */ +#define RL_TXCFG_IFG 0x03000000 /* interframe gap */ +#define RL_TXCFG_HWREV 0x7CC00000 + +#define RL_LOOPTEST_OFF 0x00000000 +#define RL_LOOPTEST_ON 0x00020000 +#define RL_LOOPTEST_ON_CPLUS 0x00060000 /* Known revision codes. */ -#define RL_HWREV_8169 0x00000000 -#define RL_HWREV_8169S 0x00800000 -#define RL_HWREV_8110S 0x04000000 -#define RL_HWREV_8169_8110SB 0x10000000 -#define RL_HWREV_8169_8110SC 0x18000000 -#define RL_HWREV_8102EL 0x24800000 -#define RL_HWREV_8102EL_SPIN1 0x24C00000 -#define RL_HWREV_8168D 0x28000000 -#define RL_HWREV_8168DP 0x28800000 -#define RL_HWREV_8168E 0x2C000000 -#define RL_HWREV_8168_SPIN1 0x30000000 -#define RL_HWREV_8100E 0x30800000 -#define RL_HWREV_8101E 0x34000000 -#define RL_HWREV_8102E 0x34800000 -#define RL_HWREV_8103E 0x34C00000 -#define RL_HWREV_8168_SPIN2 0x38000000 -#define RL_HWREV_8168_SPIN3 0x38400000 -#define RL_HWREV_8168C 0x3C000000 -#define RL_HWREV_8168C_SPIN2 0x3C400000 -#define RL_HWREV_8168CP 0x3C800000 -#define RL_HWREV_8139 0x60000000 -#define RL_HWREV_8139A 0x70000000 -#define RL_HWREV_8139AG 0x70800000 -#define RL_HWREV_8139B 0x78000000 -#define RL_HWREV_8130 0x7C000000 -#define RL_HWREV_8139C 0x74000000 -#define RL_HWREV_8139D 0x74400000 -#define RL_HWREV_8139CPLUS 0x74800000 -#define RL_HWREV_8101 0x74C00000 -#define RL_HWREV_8100 0x78800000 -#define RL_HWREV_8169_8110SBL 0x7CC00000 -#define RL_HWREV_8169_8110SCE 0x98000000 - -#define RL_TXDMA_16BYTES 0x00000000 -#define RL_TXDMA_32BYTES 0x00000100 -#define RL_TXDMA_64BYTES 0x00000200 -#define RL_TXDMA_128BYTES 0x00000300 -#define RL_TXDMA_256BYTES 0x00000400 -#define RL_TXDMA_512BYTES 0x00000500 -#define RL_TXDMA_1024BYTES 0x00000600 -#define RL_TXDMA_2048BYTES 0x00000700 +#define RL_HWREV_8169 0x00000000 +#define RL_HWREV_8169S 0x00800000 +#define RL_HWREV_8110S 0x04000000 +#define RL_HWREV_8169_8110SB 0x10000000 +#define RL_HWREV_8169_8110SC 0x18000000 +#define RL_HWREV_8102EL 0x24800000 +#define RL_HWREV_8102EL_SPIN1 0x24C00000 +#define RL_HWREV_8168D 0x28000000 +#define RL_HWREV_8168DP 0x28800000 +#define RL_HWREV_8168E 0x2C000000 +#define RL_HWREV_8168_SPIN1 0x30000000 +#define RL_HWREV_8100E 0x30800000 +#define RL_HWREV_8101E 0x34000000 +#define RL_HWREV_8102E 0x34800000 +#define RL_HWREV_8103E 0x34C00000 +#define RL_HWREV_8168_SPIN2 0x38000000 +#define RL_HWREV_8168_SPIN3 0x38400000 +#define RL_HWREV_8168C 0x3C000000 +#define RL_HWREV_8168C_SPIN2 0x3C400000 +#define RL_HWREV_8168CP 0x3C800000 +#define RL_HWREV_8139 0x60000000 +#define RL_HWREV_8139A 0x70000000 +#define RL_HWREV_8139AG 0x70800000 +#define RL_HWREV_8139B 0x78000000 +#define RL_HWREV_8130 0x7C000000 +#define RL_HWREV_8139C 0x74000000 +#define RL_HWREV_8139D 0x74400000 +#define RL_HWREV_8139CPLUS 0x74800000 +#define RL_HWREV_8101 0x74C00000 +#define RL_HWREV_8100 0x78800000 +#define RL_HWREV_8169_8110SBL 0x7CC00000 +#define RL_HWREV_8169_8110SCE 0x98000000 + +#define RL_TXDMA_16BYTES 0x00000000 +#define RL_TXDMA_32BYTES 0x00000100 +#define RL_TXDMA_64BYTES 0x00000200 +#define RL_TXDMA_128BYTES 0x00000300 +#define RL_TXDMA_256BYTES 0x00000400 +#define RL_TXDMA_512BYTES 0x00000500 +#define RL_TXDMA_1024BYTES 0x00000600 +#define RL_TXDMA_2048BYTES 0x00000700 /* * Transmit descriptor status register bits. */ -#define RL_TXSTAT_LENMASK 0x00001FFF -#define RL_TXSTAT_OWN 0x00002000 -#define RL_TXSTAT_TX_UNDERRUN 0x00004000 -#define RL_TXSTAT_TX_OK 0x00008000 -#define RL_TXSTAT_EARLY_THRESH 0x003F0000 -#define RL_TXSTAT_COLLCNT 0x0F000000 -#define RL_TXSTAT_CARR_HBEAT 0x10000000 -#define RL_TXSTAT_OUTOFWIN 0x20000000 -#define RL_TXSTAT_TXABRT 0x40000000 -#define RL_TXSTAT_CARRLOSS 0x80000000 +#define RL_TXSTAT_LENMASK 0x00001FFF +#define RL_TXSTAT_OWN 0x00002000 +#define RL_TXSTAT_TX_UNDERRUN 0x00004000 +#define RL_TXSTAT_TX_OK 0x00008000 +#define RL_TXSTAT_EARLY_THRESH 0x003F0000 +#define RL_TXSTAT_COLLCNT 0x0F000000 +#define RL_TXSTAT_CARR_HBEAT 0x10000000 +#define RL_TXSTAT_OUTOFWIN 0x20000000 +#define RL_TXSTAT_TXABRT 0x40000000 +#define RL_TXSTAT_CARRLOSS 0x80000000 /* * Interrupt status register bits. */ -#define RL_ISR_RX_OK 0x0001 -#define RL_ISR_RX_ERR 0x0002 -#define RL_ISR_TX_OK 0x0004 -#define RL_ISR_TX_ERR 0x0008 -#define RL_ISR_RX_OVERRUN 0x0010 -#define RL_ISR_PKT_UNDERRUN 0x0020 -#define RL_ISR_LINKCHG 0x0020 /* 8169 only */ -#define RL_ISR_FIFO_OFLOW 0x0040 /* 8139 only */ -#define RL_ISR_TX_DESC_UNAVAIL 0x0080 /* C+ only */ -#define RL_ISR_SWI 0x0100 /* C+ only */ -#define RL_ISR_CABLE_LEN_CHGD 0x2000 -#define RL_ISR_PCS_TIMEOUT 0x4000 /* 8129 only */ -#define RL_ISR_TIMEOUT_EXPIRED 0x4000 -#define RL_ISR_SYSTEM_ERR 0x8000 +#define RL_ISR_RX_OK 0x0001 +#define RL_ISR_RX_ERR 0x0002 +#define RL_ISR_TX_OK 0x0004 +#define RL_ISR_TX_ERR 0x0008 +#define RL_ISR_RX_OVERRUN 0x0010 +#define RL_ISR_PKT_UNDERRUN 0x0020 +#define RL_ISR_LINKCHG 0x0020 /* 8169 only */ +#define RL_ISR_FIFO_OFLOW 0x0040 /* 8139 only */ +#define RL_ISR_TX_DESC_UNAVAIL 0x0080 /* C+ only */ +#define RL_ISR_SWI 0x0100 /* C+ only */ +#define RL_ISR_CABLE_LEN_CHGD 0x2000 +#define RL_ISR_PCS_TIMEOUT 0x4000 /* 8129 only */ +#define RL_ISR_TIMEOUT_EXPIRED 0x4000 +#define RL_ISR_SYSTEM_ERR 0x8000 -#define RL_INTRS \ +#define RL_INTRS \ (RL_ISR_TX_OK|RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR| \ RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR) #ifdef RE_TX_MODERATION -#define RL_INTRS_CPLUS \ +#define RL_INTRS_CPLUS \ (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR| \ RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR|RL_ISR_TIMEOUT_EXPIRED) #else -#define RL_INTRS_CPLUS \ +#define RL_INTRS_CPLUS \ (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR|RL_ISR_TX_OK| \ RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW| \ RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR|RL_ISR_TIMEOUT_EXPIRED) @@ -249,169 +249,169 @@ /* * Media status register. (8139 only) */ -#define RL_MEDIASTAT_RXPAUSE 0x01 -#define RL_MEDIASTAT_TXPAUSE 0x02 -#define RL_MEDIASTAT_LINK 0x04 -#define RL_MEDIASTAT_SPEED10 0x08 -#define RL_MEDIASTAT_RXFLOWCTL 0x40 /* duplex mode */ -#define RL_MEDIASTAT_TXFLOWCTL 0x80 /* duplex mode */ +#define RL_MEDIASTAT_RXPAUSE 0x01 +#define RL_MEDIASTAT_TXPAUSE 0x02 +#define RL_MEDIASTAT_LINK 0x04 +#define RL_MEDIASTAT_SPEED10 0x08 +#define RL_MEDIASTAT_RXFLOWCTL 0x40 /* duplex mode */ +#define RL_MEDIASTAT_TXFLOWCTL 0x80 /* duplex mode */ /* * Receive config register. */ -#define RL_RXCFG_RX_ALLPHYS 0x00000001 /* accept all nodes */ -#define RL_RXCFG_RX_INDIV 0x00000002 /* match filter */ -#define RL_RXCFG_RX_MULTI 0x00000004 /* accept all multicast */ -#define RL_RXCFG_RX_BROAD 0x00000008 /* accept all broadcast */ -#define RL_RXCFG_RX_RUNT 0x00000010 -#define RL_RXCFG_RX_ERRPKT 0x00000020 -#define RL_RXCFG_WRAP 0x00000080 -#define RL_RXCFG_MAXDMA 0x00000700 -#define RL_RXCFG_BUFSZ 0x00001800 -#define RL_RXCFG_FIFOTHRESH 0x0000E000 -#define RL_RXCFG_EARLYTHRESH 0x07000000 - -#define RL_RXDMA_16BYTES 0x00000000 -#define RL_RXDMA_32BYTES 0x00000100 -#define RL_RXDMA_64BYTES 0x00000200 -#define RL_RXDMA_128BYTES 0x00000300 -#define RL_RXDMA_256BYTES 0x00000400 -#define RL_RXDMA_512BYTES 0x00000500 -#define RL_RXDMA_1024BYTES 0x00000600 -#define RL_RXDMA_UNLIMITED 0x00000700 - -#define RL_RXBUF_8 0x00000000 -#define RL_RXBUF_16 0x00000800 -#define RL_RXBUF_32 0x00001000 -#define RL_RXBUF_64 0x00001800 - -#define RL_RXFIFO_16BYTES 0x00000000 -#define RL_RXFIFO_32BYTES 0x00002000 -#define RL_RXFIFO_64BYTES 0x00004000 -#define RL_RXFIFO_128BYTES 0x00006000 -#define RL_RXFIFO_256BYTES 0x00008000 -#define RL_RXFIFO_512BYTES 0x0000A000 -#define RL_RXFIFO_1024BYTES 0x0000C000 -#define RL_RXFIFO_NOTHRESH 0x0000E000 +#define RL_RXCFG_RX_ALLPHYS 0x00000001 /* accept all nodes */ +#define RL_RXCFG_RX_INDIV 0x00000002 /* match filter */ +#define RL_RXCFG_RX_MULTI 0x00000004 /* accept all multicast */ +#define RL_RXCFG_RX_BROAD 0x00000008 /* accept all broadcast */ +#define RL_RXCFG_RX_RUNT 0x00000010 +#define RL_RXCFG_RX_ERRPKT 0x00000020 +#define RL_RXCFG_WRAP 0x00000080 +#define RL_RXCFG_MAXDMA 0x00000700 +#define RL_RXCFG_BUFSZ 0x00001800 +#define RL_RXCFG_FIFOTHRESH 0x0000E000 +#define RL_RXCFG_EARLYTHRESH 0x07000000 + +#define RL_RXDMA_16BYTES 0x00000000 +#define RL_RXDMA_32BYTES 0x00000100 +#define RL_RXDMA_64BYTES 0x00000200 +#define RL_RXDMA_128BYTES 0x00000300 +#define RL_RXDMA_256BYTES 0x00000400 +#define RL_RXDMA_512BYTES 0x00000500 +#define RL_RXDMA_1024BYTES 0x00000600 +#define RL_RXDMA_UNLIMITED 0x00000700 + +#define RL_RXBUF_8 0x00000000 +#define RL_RXBUF_16 0x00000800 +#define RL_RXBUF_32 0x00001000 +#define RL_RXBUF_64 0x00001800 + +#define RL_RXFIFO_16BYTES 0x00000000 +#define RL_RXFIFO_32BYTES 0x00002000 +#define RL_RXFIFO_64BYTES 0x00004000 +#define RL_RXFIFO_128BYTES 0x00006000 +#define RL_RXFIFO_256BYTES 0x00008000 +#define RL_RXFIFO_512BYTES 0x0000A000 +#define RL_RXFIFO_1024BYTES 0x0000C000 +#define RL_RXFIFO_NOTHRESH 0x0000E000 /* * Bits in RX status header (included with RX'ed packet * in ring buffer). */ -#define RL_RXSTAT_RXOK 0x00000001 -#define RL_RXSTAT_ALIGNERR 0x00000002 -#define RL_RXSTAT_CRCERR 0x00000004 -#define RL_RXSTAT_GIANT 0x00000008 -#define RL_RXSTAT_RUNT 0x00000010 -#define RL_RXSTAT_BADSYM 0x00000020 -#define RL_RXSTAT_BROAD 0x00002000 -#define RL_RXSTAT_INDIV 0x00004000 -#define RL_RXSTAT_MULTI 0x00008000 -#define RL_RXSTAT_LENMASK 0xFFFF0000 +#define RL_RXSTAT_RXOK 0x00000001 +#define RL_RXSTAT_ALIGNERR 0x00000002 +#define RL_RXSTAT_CRCERR 0x00000004 +#define RL_RXSTAT_GIANT 0x00000008 +#define RL_RXSTAT_RUNT 0x00000010 +#define RL_RXSTAT_BADSYM 0x00000020 +#define RL_RXSTAT_BROAD 0x00002000 +#define RL_RXSTAT_INDIV 0x00004000 +#define RL_RXSTAT_MULTI 0x00008000 +#define RL_RXSTAT_LENMASK 0xFFFF0000 -#define RL_RXSTAT_UNFINISHED 0xFFF0 /* DMA still in progress */ +#define RL_RXSTAT_UNFINISHED 0xFFF0 /* DMA still in progress */ /* * Command register. */ -#define RL_CMD_EMPTY_RXBUF 0x0001 -#define RL_CMD_TX_ENB 0x0004 -#define RL_CMD_RX_ENB 0x0008 -#define RL_CMD_RESET 0x0010 -#define RL_CMD_STOPREQ 0x0080 +#define RL_CMD_EMPTY_RXBUF 0x0001 +#define RL_CMD_TX_ENB 0x0004 +#define RL_CMD_RX_ENB 0x0008 +#define RL_CMD_RESET 0x0010 +#define RL_CMD_STOPREQ 0x0080 /* * Twister register values. These are completely undocumented and derived * from public sources. */ -#define RL_CSCFG_LINK_OK 0x0400 -#define RL_CSCFG_CHANGE 0x0800 -#define RL_CSCFG_STATUS 0xf000 -#define RL_CSCFG_ROW3 0x7000 -#define RL_CSCFG_ROW2 0x3000 -#define RL_CSCFG_ROW1 0x1000 -#define RL_CSCFG_LINK_DOWN_OFF_CMD 0x03c0 -#define RL_CSCFG_LINK_DOWN_CMD 0xf3c0 - -#define RL_NWAYTST_RESET 0 -#define RL_NWAYTST_CBL_TEST 0x20 - -#define RL_PARA78 0x78 -#define RL_PARA78_DEF 0x78fa8388 -#define RL_PARA7C 0x7C -#define RL_PARA7C_DEF 0xcb38de43 -#define RL_PARA7C_RETUNE 0xfb38de03 +#define RL_CSCFG_LINK_OK 0x0400 +#define RL_CSCFG_CHANGE 0x0800 +#define RL_CSCFG_STATUS 0xf000 +#define RL_CSCFG_ROW3 0x7000 +#define RL_CSCFG_ROW2 0x3000 +#define RL_CSCFG_ROW1 0x1000 +#define RL_CSCFG_LINK_DOWN_OFF_CMD 0x03c0 +#define RL_CSCFG_LINK_DOWN_CMD 0xf3c0 + +#define RL_NWAYTST_RESET 0 +#define RL_NWAYTST_CBL_TEST 0x20 + +#define RL_PARA78 0x78 +#define RL_PARA78_DEF 0x78fa8388 +#define RL_PARA7C 0x7C +#define RL_PARA7C_DEF 0xcb38de43 +#define RL_PARA7C_RETUNE 0xfb38de03 /* * EEPROM control register */ -#define RL_EE_DATAOUT 0x01 /* Data out */ -#define RL_EE_DATAIN 0x02 /* Data in */ -#define RL_EE_CLK 0x04 /* clock */ -#define RL_EE_SEL 0x08 /* chip select */ -#define RL_EE_MODE (0x40|0x80) - -#define RL_EEMODE_OFF 0x00 -#define RL_EEMODE_AUTOLOAD 0x40 -#define RL_EEMODE_PROGRAM 0x80 -#define RL_EEMODE_WRITECFG (0x80|0x40) +#define RL_EE_DATAOUT 0x01 /* Data out */ +#define RL_EE_DATAIN 0x02 /* Data in */ +#define RL_EE_CLK 0x04 /* clock */ +#define RL_EE_SEL 0x08 /* chip select */ +#define RL_EE_MODE (0x40|0x80) + +#define RL_EEMODE_OFF 0x00 +#define RL_EEMODE_AUTOLOAD 0x40 +#define RL_EEMODE_PROGRAM 0x80 +#define RL_EEMODE_WRITECFG (0x80|0x40) /* 9346 EEPROM commands */ -#define RL_9346_ADDR_LEN 6 /* 93C46 1K: 128x16 */ -#define RL_9356_ADDR_LEN 8 /* 93C56 2K: 256x16 */ +#define RL_9346_ADDR_LEN 6 /* 93C46 1K: 128x16 */ +#define RL_9356_ADDR_LEN 8 /* 93C56 2K: 256x16 */ -#define RL_9346_WRITE 0x5 -#define RL_9346_READ 0x6 -#define RL_9346_ERASE 0x7 -#define RL_9346_EWEN 0x4 -#define RL_9346_EWEN_ADDR 0x30 -#define RL_9456_EWDS 0x4 -#define RL_9346_EWDS_ADDR 0x00 - -#define RL_EECMD_WRITE 0x140 -#define RL_EECMD_READ_6BIT 0x180 -#define RL_EECMD_READ_8BIT 0x600 -#define RL_EECMD_ERASE 0x1c0 - -#define RL_EE_ID 0x00 -#define RL_EE_PCI_VID 0x01 -#define RL_EE_PCI_DID 0x02 +#define RL_9346_WRITE 0x5 +#define RL_9346_READ 0x6 +#define RL_9346_ERASE 0x7 +#define RL_9346_EWEN 0x4 +#define RL_9346_EWEN_ADDR 0x30 +#define RL_9456_EWDS 0x4 +#define RL_9346_EWDS_ADDR 0x00 + +#define RL_EECMD_WRITE 0x140 +#define RL_EECMD_READ_6BIT 0x180 +#define RL_EECMD_READ_8BIT 0x600 +#define RL_EECMD_ERASE 0x1c0 + +#define RL_EE_ID 0x00 +#define RL_EE_PCI_VID 0x01 +#define RL_EE_PCI_DID 0x02 /* Location of station address inside EEPROM */ -#define RL_EE_EADDR 0x07 +#define RL_EE_EADDR 0x07 /* * MII register (8129 only) */ -#define RL_MII_CLK 0x01 -#define RL_MII_DATAIN 0x02 -#define RL_MII_DATAOUT 0x04 -#define RL_MII_DIR 0x80 /* 0 == input, 1 == output */ +#define RL_MII_CLK 0x01 +#define RL_MII_DATAIN 0x02 +#define RL_MII_DATAOUT 0x04 +#define RL_MII_DIR 0x80 /* 0 == input, 1 == output */ /* * Config 0 register */ -#define RL_CFG0_ROM0 0x01 -#define RL_CFG0_ROM1 0x02 -#define RL_CFG0_ROM2 0x04 -#define RL_CFG0_PL0 0x08 -#define RL_CFG0_PL1 0x10 -#define RL_CFG0_10MBPS 0x20 /* 10 Mbps internal mode */ -#define RL_CFG0_PCS 0x40 -#define RL_CFG0_SCR 0x80 +#define RL_CFG0_ROM0 0x01 +#define RL_CFG0_ROM1 0x02 +#define RL_CFG0_ROM2 0x04 +#define RL_CFG0_PL0 0x08 +#define RL_CFG0_PL1 0x10 +#define RL_CFG0_10MBPS 0x20 /* 10 Mbps internal mode */ +#define RL_CFG0_PCS 0x40 +#define RL_CFG0_SCR 0x80 /* * Config 1 register */ -#define RL_CFG1_PWRDWN 0x01 -#define RL_CFG1_PME 0x01 -#define RL_CFG1_SLEEP 0x02 -#define RL_CFG1_VPDEN 0x02 -#define RL_CFG1_IOMAP 0x04 -#define RL_CFG1_MEMMAP 0x08 -#define RL_CFG1_RSVD 0x10 +#define RL_CFG1_PWRDWN 0x01 +#define RL_CFG1_PME 0x01 +#define RL_CFG1_SLEEP 0x02 +#define RL_CFG1_VPDEN 0x02 +#define RL_CFG1_IOMAP 0x04 +#define RL_CFG1_MEMMAP 0x08 +#define RL_CFG1_RSVD 0x10 #define RL_CFG1_LWACT 0x10 -#define RL_CFG1_DRVLOAD 0x20 -#define RL_CFG1_LED0 0x40 -#define RL_CFG1_FULLDUPLEX 0x40 /* 8129 only */ -#define RL_CFG1_LED1 0x80 +#define RL_CFG1_DRVLOAD 0x20 +#define RL_CFG1_LED0 0x40 +#define RL_CFG1_FULLDUPLEX 0x40 /* 8129 only */ +#define RL_CFG1_LED1 0x80 /* * Config 2 register @@ -451,35 +451,35 @@ /* RL_DUMPSTATS_LO register */ -#define RL_DUMPSTATS_START 0x00000008 +#define RL_DUMPSTATS_START 0x00000008 /* Transmit start register */ -#define RL_TXSTART_SWI 0x01 /* generate TX interrupt */ -#define RL_TXSTART_START 0x40 /* start normal queue transmit */ -#define RL_TXSTART_HPRIO_START 0x80 /* start hi prio queue transmit */ +#define RL_TXSTART_SWI 0x01 /* generate TX interrupt */ +#define RL_TXSTART_START 0x40 /* start normal queue transmit */ +#define RL_TXSTART_HPRIO_START 0x80 /* start hi prio queue transmit */ /* * Config 2 register, 8139C+/8169/8169S/8110S only */ -#define RL_CFG2_BUSFREQ 0x07 -#define RL_CFG2_BUSWIDTH 0x08 -#define RL_CFG2_AUXPWRSTS 0x10 +#define RL_CFG2_BUSFREQ 0x07 +#define RL_CFG2_BUSWIDTH 0x08 +#define RL_CFG2_AUXPWRSTS 0x10 -#define RL_BUSFREQ_33MHZ 0x00 -#define RL_BUSFREQ_66MHZ 0x01 +#define RL_BUSFREQ_33MHZ 0x00 +#define RL_BUSFREQ_66MHZ 0x01 -#define RL_BUSWIDTH_32BITS 0x00 -#define RL_BUSWIDTH_64BITS 0x08 +#define RL_BUSWIDTH_32BITS 0x00 +#define RL_BUSWIDTH_64BITS 0x08 /* C+ mode command register */ -#define RL_CPLUSCMD_TXENB 0x0001 /* enable C+ transmit mode */ -#define RL_CPLUSCMD_RXENB 0x0002 /* enable C+ receive mode */ -#define RL_CPLUSCMD_PCI_MRW 0x0008 /* enable PCI multi-read/write */ -#define RL_CPLUSCMD_PCI_DAC 0x0010 /* PCI dual-address cycle only */ -#define RL_CPLUSCMD_RXCSUM_ENB 0x0020 /* enable RX checksum offload */ -#define RL_CPLUSCMD_VLANSTRIP 0x0040 /* enable VLAN tag stripping */ +#define RL_CPLUSCMD_TXENB 0x0001 /* enable C+ transmit mode */ +#define RL_CPLUSCMD_RXENB 0x0002 /* enable C+ receive mode */ +#define RL_CPLUSCMD_PCI_MRW 0x0008 /* enable PCI multi-read/write */ +#define RL_CPLUSCMD_PCI_DAC 0x0010 /* PCI dual-address cycle only */ +#define RL_CPLUSCMD_RXCSUM_ENB 0x0020 /* enable RX checksum offload */ +#define RL_CPLUSCMD_VLANSTRIP 0x0040 /* enable VLAN tag stripping */ #define RL_CPLUSCMD_MACSTAT_DIS 0x0080 /* 8168B/C/CP */ #define RL_CPLUSCMD_ASF 0x0100 /* 8168C/CP */ #define RL_CPLUSCMD_DBG_SEL 0x0200 /* 8168C/CP */ @@ -492,27 +492,27 @@ /* C+ early transmit threshold */ -#define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ +#define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ /* * Gigabit PHY access register (8169 only) */ -#define RL_PHYAR_PHYDATA 0x0000FFFF -#define RL_PHYAR_PHYREG 0x001F0000 -#define RL_PHYAR_BUSY 0x80000000 +#define RL_PHYAR_PHYDATA 0x0000FFFF +#define RL_PHYAR_PHYREG 0x001F0000 +#define RL_PHYAR_BUSY 0x80000000 /* * Gigabit media status (8169 only) */ -#define RL_GMEDIASTAT_FDX 0x01 /* full duplex */ -#define RL_GMEDIASTAT_LINK 0x02 /* link up */ -#define RL_GMEDIASTAT_10MBPS 0x04 /* 10mps link */ -#define RL_GMEDIASTAT_100MBPS 0x08 /* 100mbps link */ -#define RL_GMEDIASTAT_1000MBPS 0x10 /* gigE link */ -#define RL_GMEDIASTAT_RXFLOW 0x20 /* RX flow control on */ -#define RL_GMEDIASTAT_TXFLOW 0x40 /* TX flow control on */ -#define RL_GMEDIASTAT_TBI 0x80 /* TBI enabled */ +#define RL_GMEDIASTAT_FDX 0x01 /* full duplex */ +#define RL_GMEDIASTAT_LINK 0x02 /* link up */ +#define RL_GMEDIASTAT_10MBPS 0x04 /* 10mps link */ +#define RL_GMEDIASTAT_100MBPS 0x08 /* 100mbps link */ +#define RL_GMEDIASTAT_1000MBPS 0x10 /* gigE link */ +#define RL_GMEDIASTAT_RXFLOW 0x20 /* RX flow control on */ +#define RL_GMEDIASTAT_TXFLOW 0x40 /* TX flow control on */ +#define RL_GMEDIASTAT_TBI 0x80 /* TBI enabled */ /* * The RealTek doesn't use a fragment-based descriptor mechanism. @@ -529,25 +529,25 @@ * all received packets. */ -#define RL_RX_BUF_SZ RL_RXBUF_64 -#define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) -#define RL_TX_LIST_CNT 4 -#define RL_MIN_FRAMELEN 60 +#define RL_RX_BUF_SZ RL_RXBUF_64 +#define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) +#define RL_TX_LIST_CNT 4 +#define RL_MIN_FRAMELEN 60 #define RL_TX_8139_BUF_ALIGN 4 #define RL_RX_8139_BUF_ALIGN 8 #define RL_RX_8139_BUF_RESERVE sizeof(int64_t) #define RL_RX_8139_BUF_GUARD_SZ \ (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) -#define RL_TXTHRESH(x) ((x) << 11) -#define RL_TX_THRESH_INIT 96 -#define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH -#define RL_RX_MAXDMA RL_RXDMA_UNLIMITED -#define RL_TX_MAXDMA RL_TXDMA_2048BYTES +#define RL_TXTHRESH(x) ((x) << 11) +#define RL_TX_THRESH_INIT 96 +#define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH +#define RL_RX_MAXDMA RL_RXDMA_UNLIMITED +#define RL_TX_MAXDMA RL_TXDMA_2048BYTES -#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_MAXDMA|RL_RX_BUF_SZ) -#define RL_TXCFG_CONFIG (RL_TXCFG_IFG|RL_TX_MAXDMA) +#define RL_RXCFG_CONFIG (RL_RX_FIFOTHRESH|RL_RX_MAXDMA|RL_RX_BUF_SZ) +#define RL_TXCFG_CONFIG (RL_TXCFG_IFG|RL_TX_MAXDMA) -#define RL_ETHER_ALIGN 2 +#define RL_ETHER_ALIGN 2 /* * re(4) hardware ip4csum-tx could be mangled with 28 bytes or less IP packets. @@ -570,15 +570,15 @@ struct rl_chain_data { uint8_t cur_tx; }; -#define RL_INC(x) (x = (x + 1) % RL_TX_LIST_CNT) -#define RL_CUR_TXADDR(x) ((x->rl_cdata.cur_tx * 4) + RL_TXADDR0) -#define RL_CUR_TXSTAT(x) ((x->rl_cdata.cur_tx * 4) + RL_TXSTAT0) -#define RL_CUR_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.cur_tx]) -#define RL_CUR_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.cur_tx]) -#define RL_LAST_TXADDR(x) ((x->rl_cdata.last_tx * 4) + RL_TXADDR0) -#define RL_LAST_TXSTAT(x) ((x->rl_cdata.last_tx * 4) + RL_TXSTAT0) -#define RL_LAST_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.last_tx]) -#define RL_LAST_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.last_tx]) +#define RL_INC(x) (x = (x + 1) % RL_TX_LIST_CNT) +#define RL_CUR_TXADDR(x) ((x->rl_cdata.cur_tx * 4) + RL_TXADDR0) +#define RL_CUR_TXSTAT(x) ((x->rl_cdata.cur_tx * 4) + RL_TXSTAT0) +#define RL_CUR_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.cur_tx]) +#define RL_CUR_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.cur_tx]) +#define RL_LAST_TXADDR(x) ((x->rl_cdata.last_tx * 4) + RL_TXADDR0) +#define RL_LAST_TXSTAT(x) ((x->rl_cdata.last_tx * 4) + RL_TXSTAT0) +#define RL_LAST_TXMBUF(x) (x->rl_cdata.rl_tx_chain[x->rl_cdata.last_tx]) +#define RL_LAST_DMAMAP(x) (x->rl_cdata.rl_tx_dmamap[x->rl_cdata.last_tx]) struct rl_type { uint16_t rl_vid; @@ -605,17 +605,17 @@ struct rl_mii_frame { /* * MII constants */ -#define RL_MII_STARTDELIM 0x01 -#define RL_MII_READOP 0x02 -#define RL_MII_WRITEOP 0x01 -#define RL_MII_TURNAROUND 0x02 - -#define RL_8129 1 -#define RL_8139 2 -#define RL_8139CPLUS 3 -#define RL_8169 4 +#define RL_MII_STARTDELIM 0x01 +#define RL_MII_READOP 0x02 +#define RL_MII_WRITEOP 0x01 +#define RL_MII_TURNAROUND 0x02 + +#define RL_8129 1 +#define RL_8139 2 +#define RL_8139CPLUS 3 +#define RL_8169 4 -#define RL_ISCPLUS(x) ((x)->rl_type == RL_8139CPLUS || \ +#define RL_ISCPLUS(x) ((x)->rl_type == RL_8139CPLUS || \ (x)->rl_type == RL_8169) /* @@ -639,20 +639,20 @@ struct rl_desc { uint32_t rl_bufaddr_hi; }; -#define RL_TDESC_CMD_FRAGLEN 0x0000FFFF -#define RL_TDESC_CMD_TCPCSUM 0x00010000 /* TCP checksum enable */ -#define RL_TDESC_CMD_UDPCSUM 0x00020000 /* UDP checksum enable */ -#define RL_TDESC_CMD_IPCSUM 0x00040000 /* IP header checksum enable */ -#define RL_TDESC_CMD_MSSVAL 0x07FF0000 /* Large send MSS value */ -#define RL_TDESC_CMD_MSSVAL_SHIFT 16 /* Large send MSS value shift */ -#define RL_TDESC_CMD_LGSEND 0x08000000 /* TCP large send enb */ -#define RL_TDESC_CMD_EOF 0x10000000 /* end of frame marker */ -#define RL_TDESC_CMD_SOF 0x20000000 /* start of frame marker */ -#define RL_TDESC_CMD_EOR 0x40000000 /* end of ring marker */ -#define RL_TDESC_CMD_OWN 0x80000000 /* chip owns descriptor */ +#define RL_TDESC_CMD_FRAGLEN 0x0000FFFF +#define RL_TDESC_CMD_TCPCSUM 0x00010000 /* TCP checksum enable */ +#define RL_TDESC_CMD_UDPCSUM 0x00020000 /* UDP checksum enable */ +#define RL_TDESC_CMD_IPCSUM 0x00040000 /* IP header checksum enable */ +#define RL_TDESC_CMD_MSSVAL 0x07FF0000 /* Large send MSS value */ +#define RL_TDESC_CMD_MSSVAL_SHIFT 16 /* Large send MSS value shift */ +#define RL_TDESC_CMD_LGSEND 0x08000000 /* TCP large send enb */ +#define RL_TDESC_CMD_EOF 0x10000000 /* end of frame marker */ +#define RL_TDESC_CMD_SOF 0x20000000 /* start of frame marker */ +#define RL_TDESC_CMD_EOR 0x40000000 /* end of ring marker */ +#define RL_TDESC_CMD_OWN 0x80000000 /* chip owns descriptor */ -#define RL_TDESC_VLANCTL_TAG 0x00020000 /* Insert VLAN tag */ -#define RL_TDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ +#define RL_TDESC_VLANCTL_TAG 0x00020000 /* Insert VLAN tag */ +#define RL_TDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ /* RTL8168C/RTL8168CP/RTL8111C/RTL8111CP */ #define RL_TDESC_CMD_UDPCSUMV2 0x80000000 #define RL_TDESC_CMD_TCPCSUMV2 0x40000000 @@ -663,61 +663,61 @@ struct rl_desc { * (i.e. RL_TDESC_CMD_EOF == 1) */ -#define RL_TDESC_STAT_COLCNT 0x000F0000 /* collision count */ -#define RL_TDESC_STAT_EXCESSCOL 0x00100000 /* excessive collisions */ -#define RL_TDESC_STAT_LINKFAIL 0x00200000 /* link faulure */ -#define RL_TDESC_STAT_OWINCOL 0x00400000 /* out-of-window collision */ -#define RL_TDESC_STAT_TXERRSUM 0x00800000 /* transmit error summary */ -#define RL_TDESC_STAT_UNDERRUN 0x02000000 /* TX underrun occured */ -#define RL_TDESC_STAT_OWN 0x80000000 +#define RL_TDESC_STAT_COLCNT 0x000F0000 /* collision count */ +#define RL_TDESC_STAT_EXCESSCOL 0x00100000 /* excessive collisions */ +#define RL_TDESC_STAT_LINKFAIL 0x00200000 /* link faulure */ +#define RL_TDESC_STAT_OWINCOL 0x00400000 /* out-of-window collision */ +#define RL_TDESC_STAT_TXERRSUM 0x00800000 /* transmit error summary */ +#define RL_TDESC_STAT_UNDERRUN 0x02000000 /* TX underrun occured */ +#define RL_TDESC_STAT_OWN 0x80000000 /* * RX descriptor cmd/vlan definitions */ -#define RL_RDESC_CMD_EOR 0x40000000 -#define RL_RDESC_CMD_OWN 0x80000000 -#define RL_RDESC_CMD_BUFLEN 0x00001FFF - -#define RL_RDESC_STAT_OWN 0x80000000 -#define RL_RDESC_STAT_EOR 0x40000000 -#define RL_RDESC_STAT_SOF 0x20000000 -#define RL_RDESC_STAT_EOF 0x10000000 -#define RL_RDESC_STAT_FRALIGN 0x08000000 /* frame alignment error */ -#define RL_RDESC_STAT_MCAST 0x04000000 /* multicast pkt received */ -#define RL_RDESC_STAT_UCAST 0x02000000 /* unicast pkt received */ -#define RL_RDESC_STAT_BCAST 0x01000000 /* broadcast pkt received */ -#define RL_RDESC_STAT_BUFOFLOW 0x00800000 /* out of buffer space */ -#define RL_RDESC_STAT_FIFOOFLOW 0x00400000 /* FIFO overrun */ -#define RL_RDESC_STAT_GIANT 0x00200000 /* pkt > 4096 bytes */ -#define RL_RDESC_STAT_RXERRSUM 0x00100000 /* RX error summary */ -#define RL_RDESC_STAT_RUNT 0x00080000 /* runt packet received */ -#define RL_RDESC_STAT_CRCERR 0x00040000 /* CRC error */ -#define RL_RDESC_STAT_PROTOID 0x00030000 /* Protocol type */ +#define RL_RDESC_CMD_EOR 0x40000000 +#define RL_RDESC_CMD_OWN 0x80000000 +#define RL_RDESC_CMD_BUFLEN 0x00001FFF + +#define RL_RDESC_STAT_OWN 0x80000000 +#define RL_RDESC_STAT_EOR 0x40000000 +#define RL_RDESC_STAT_SOF 0x20000000 +#define RL_RDESC_STAT_EOF 0x10000000 +#define RL_RDESC_STAT_FRALIGN 0x08000000 /* frame alignment error */ +#define RL_RDESC_STAT_MCAST 0x04000000 /* multicast pkt received */ +#define RL_RDESC_STAT_UCAST 0x02000000 /* unicast pkt received */ +#define RL_RDESC_STAT_BCAST 0x01000000 /* broadcast pkt received */ +#define RL_RDESC_STAT_BUFOFLOW 0x00800000 /* out of buffer space */ +#define RL_RDESC_STAT_FIFOOFLOW 0x00400000 /* FIFO overrun */ +#define RL_RDESC_STAT_GIANT 0x00200000 /* pkt > 4096 bytes */ +#define RL_RDESC_STAT_RXERRSUM 0x00100000 /* RX error summary */ +#define RL_RDESC_STAT_RUNT 0x00080000 /* runt packet received */ +#define RL_RDESC_STAT_CRCERR 0x00040000 /* CRC error */ +#define RL_RDESC_STAT_PROTOID 0x00030000 /* Protocol type */ #define RL_RDESC_STAT_UDP 0x00020000 /* UDP, 8168C/CP, 8111C/CP */ #define RL_RDESC_STAT_TCP 0x00010000 /* TCP, 8168C/CP, 8111C/CP */ -#define RL_RDESC_STAT_IPSUMBAD 0x00008000 /* IP header checksum bad */ -#define RL_RDESC_STAT_UDPSUMBAD 0x00004000 /* UDP checksum bad */ -#define RL_RDESC_STAT_TCPSUMBAD 0x00002000 /* TCP checksum bad */ -#define RL_RDESC_STAT_FRAGLEN 0x00001FFF /* RX'ed frame/frag len */ -#define RL_RDESC_STAT_GFRAGLEN 0x00003FFF /* RX'ed frame/frag len */ -#define RL_RDESC_STAT_ERRS (RL_RDESC_STAT_GIANT|RL_RDESC_STAT_RUNT| \ +#define RL_RDESC_STAT_IPSUMBAD 0x00008000 /* IP header checksum bad */ +#define RL_RDESC_STAT_UDPSUMBAD 0x00004000 /* UDP checksum bad */ +#define RL_RDESC_STAT_TCPSUMBAD 0x00002000 /* TCP checksum bad */ +#define RL_RDESC_STAT_FRAGLEN 0x00001FFF /* RX'ed frame/frag len */ +#define RL_RDESC_STAT_GFRAGLEN 0x00003FFF /* RX'ed frame/frag len */ +#define RL_RDESC_STAT_ERRS (RL_RDESC_STAT_GIANT|RL_RDESC_STAT_RUNT| \ RL_RDESC_STAT_CRCERR) -#define RL_RDESC_VLANCTL_TAG 0x00010000 /* VLAN tag available +#define RL_RDESC_VLANCTL_TAG 0x00010000 /* VLAN tag available (rl_vlandata valid)*/ -#define RL_RDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ +#define RL_RDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ /* RTL8168C/RTL8168CP/RTL8111C/RTL8111CP */ #define RL_RDESC_IPV6 0x80000000 #define RL_RDESC_IPV4 0x40000000 -#define RL_PROTOID_NONIP 0x00000000 -#define RL_PROTOID_TCPIP 0x00010000 -#define RL_PROTOID_UDPIP 0x00020000 -#define RL_PROTOID_IP 0x00030000 -#define RL_TCPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ +#define RL_PROTOID_NONIP 0x00000000 +#define RL_PROTOID_TCPIP 0x00010000 +#define RL_PROTOID_UDPIP 0x00020000 +#define RL_PROTOID_IP 0x00030000 +#define RL_TCPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ RL_PROTOID_TCPIP) -#define RL_UDPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ +#define RL_UDPPKT(x) (((x) & RL_RDESC_STAT_PROTOID) == \ RL_PROTOID_UDPIP) /* @@ -755,38 +755,38 @@ struct rl_stats { * Rx buffer : At least 8 bytes in length and 8 bytes alignment required. */ #ifndef __NO_STRICT_ALIGNMENT -#define RE_FIXUP_RX 1 +#define RE_FIXUP_RX 1 #endif -#define RL_8169_TX_DESC_CNT 256 -#define RL_8169_RX_DESC_CNT 256 -#define RL_8139_TX_DESC_CNT 64 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 22:05:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A64E1065694; Mon, 8 Nov 2010 22:05: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 1F0B58FC2C; Mon, 8 Nov 2010 22:05:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8M5Cau056636; Mon, 8 Nov 2010 22:05:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8M5CWS056634; Mon, 8 Nov 2010 22:05:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011082205.oA8M5CWS056634@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 22:05: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: r215019 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 22:05:12 -0000 Author: yongari Date: Mon Nov 8 22:05:11 2010 New Revision: 215019 URL: http://svn.freebsd.org/changeset/base/215019 Log: Remove trailing white spaces. Modified: head/sys/pci/if_rlreg.h Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Nov 8 22:03:40 2010 (r215018) +++ head/sys/pci/if_rlreg.h Mon Nov 8 22:05:11 2010 (r215019) @@ -401,7 +401,7 @@ * Config 1 register */ #define RL_CFG1_PWRDWN 0x01 -#define RL_CFG1_PME 0x01 +#define RL_CFG1_PME 0x01 #define RL_CFG1_SLEEP 0x02 #define RL_CFG1_VPDEN 0x02 #define RL_CFG1_IOMAP 0x04 @@ -468,7 +468,7 @@ #define RL_BUSFREQ_33MHZ 0x00 #define RL_BUSFREQ_66MHZ 0x01 - + #define RL_BUSWIDTH_32BITS 0x00 #define RL_BUSWIDTH_64BITS 0x08 @@ -492,7 +492,7 @@ /* C+ early transmit threshold */ -#define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ +#define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ /* * Gigabit PHY access register (8169 only) @@ -537,7 +537,7 @@ #define RL_RX_8139_BUF_ALIGN 8 #define RL_RX_8139_BUF_RESERVE sizeof(int64_t) #define RL_RX_8139_BUF_GUARD_SZ \ - (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) + (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) #define RL_TXTHRESH(x) ((x) << 11) #define RL_TX_THRESH_INIT 96 #define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH @@ -655,8 +655,8 @@ struct rl_desc { #define RL_TDESC_VLANCTL_DATA 0x0000FFFF /* TAG data */ /* RTL8168C/RTL8168CP/RTL8111C/RTL8111CP */ #define RL_TDESC_CMD_UDPCSUMV2 0x80000000 -#define RL_TDESC_CMD_TCPCSUMV2 0x40000000 -#define RL_TDESC_CMD_IPCSUMV2 0x20000000 +#define RL_TDESC_CMD_TCPCSUMV2 0x40000000 +#define RL_TDESC_CMD_IPCSUMV2 0x20000000 /* * Error bits are valid only on the last descriptor of a frame @@ -747,7 +747,7 @@ struct rl_stats { * Descriptor alignment : 256 bytes * Tx buffer : At least 4 bytes in length. * Rx buffer : At least 8 bytes in length and 8 bytes alignment required. - * + * * 8169 * Number of descriptors supported : up to 1024 * Descriptor alignment : 256 bytes From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 22:10:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB39C1065672; Mon, 8 Nov 2010 22:10:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA1148FC13; Mon, 8 Nov 2010 22:10:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8MAptg056914; Mon, 8 Nov 2010 22:10:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8MApwf056912; Mon, 8 Nov 2010 22:10:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011082210.oA8MApwf056912@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 8 Nov 2010 22:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215020 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 22:10:52 -0000 Author: yongari Date: Mon Nov 8 22:10:51 2010 New Revision: 215020 URL: http://svn.freebsd.org/changeset/base/215020 Log: Remove standard PCI configuration space register definitions. Modified: head/sys/pci/if_rlreg.h Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Nov 8 22:05:11 2010 (r215019) +++ head/sys/pci/if_rlreg.h Mon Nov 8 22:10:51 2010 (r215020) @@ -1113,38 +1113,3 @@ struct rl_softc { /* US Robotics 997902 device ID */ #define USR_DEVICEID_997902 0x0116 - -/* - * PCI low memory base and low I/O base register, and - * other PCI registers. - */ - -#define RL_PCI_VENDOR_ID 0x00 -#define RL_PCI_DEVICE_ID 0x02 -#define RL_PCI_COMMAND 0x04 -#define RL_PCI_STATUS 0x06 -#define RL_PCI_CLASSCODE 0x09 -#define RL_PCI_LATENCY_TIMER 0x0D -#define RL_PCI_HEADER_TYPE 0x0E -#define RL_PCI_LOIO 0x10 -#define RL_PCI_LOMEM 0x14 -#define RL_PCI_BIOSROM 0x30 -#define RL_PCI_INTLINE 0x3C -#define RL_PCI_INTPIN 0x3D -#define RL_PCI_MINGNT 0x3E -#define RL_PCI_MINLAT 0x0F -#define RL_PCI_RESETOPT 0x48 -#define RL_PCI_EEPROM_DATA 0x4C - -#define RL_PCI_CAPID 0x50 /* 8 bits */ -#define RL_PCI_NEXTPTR 0x51 /* 8 bits */ -#define RL_PCI_PWRMGMTCAP 0x52 /* 16 bits */ -#define RL_PCI_PWRMGMTCTRL 0x54 /* 16 bits */ - -#define RL_PSTATE_MASK 0x0003 -#define RL_PSTATE_D0 0x0000 -#define RL_PSTATE_D1 0x0002 -#define RL_PSTATE_D2 0x0002 -#define RL_PSTATE_D3 0x0003 -#define RL_PME_EN 0x0010 -#define RL_PME_STATUS 0x8000 From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 22:12:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D9C2106566B; Mon, 8 Nov 2010 22:12:25 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C75C8FC17; Mon, 8 Nov 2010 22:12:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8MCPvZ057035; Mon, 8 Nov 2010 22:12:25 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8MCPwQ057033; Mon, 8 Nov 2010 22:12:25 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011082212.oA8MCPwQ057033@svn.freebsd.org> From: Juli Mallett Date: Mon, 8 Nov 2010 22:12: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: r215021 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 22:12:25 -0000 Author: jmallett Date: Mon Nov 8 22:12:25 2010 New Revision: 215021 URL: http://svn.freebsd.org/changeset/base/215021 Log: Use macros rather than inline functions to lock and unlock mutexes, so that line number information is preserved in witness. Reviewed by: jhb Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Mon Nov 8 22:10:51 2010 (r215020) +++ head/sys/kern/subr_taskqueue.c Mon Nov 8 22:12:25 2010 (r215021) @@ -68,23 +68,21 @@ struct taskqueue { #define TQ_FLAGS_BLOCKED (1 << 1) #define TQ_FLAGS_PENDING (1 << 2) -static __inline void -TQ_LOCK(struct taskqueue *tq) -{ - if (tq->tq_spin) - mtx_lock_spin(&tq->tq_mutex); - else - mtx_lock(&tq->tq_mutex); -} - -static __inline void -TQ_UNLOCK(struct taskqueue *tq) -{ - if (tq->tq_spin) - mtx_unlock_spin(&tq->tq_mutex); - else - mtx_unlock(&tq->tq_mutex); -} +#define TQ_LOCK(tq) \ + do { \ + if ((tq)->tq_spin) \ + mtx_lock_spin(&(tq)->tq_mutex); \ + else \ + mtx_lock(&(tq)->tq_mutex); \ + } while (0) + +#define TQ_UNLOCK(tq) \ + do { \ + if ((tq)->tq_spin) \ + mtx_unlock_spin(&(tq)->tq_mutex); \ + else \ + mtx_unlock(&(tq)->tq_mutex); \ + } while (0) static __inline int TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, From owner-svn-src-all@FreeBSD.ORG Mon Nov 8 23:15:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2862C106564A; Mon, 8 Nov 2010 23:15:11 +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 15D8E8FC33; Mon, 8 Nov 2010 23:15:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA8NFAxX060649; Mon, 8 Nov 2010 23:15:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA8NFAhl060644; Mon, 8 Nov 2010 23:15:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011082315.oA8NFAhl060644@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 8 Nov 2010 23:15: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: r215022 - in head: bin/test tools/regression/bin tools/regression/bin/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 23:15:11 -0000 Author: jilles Date: Mon Nov 8 23:15:10 2010 New Revision: 215022 URL: http://svn.freebsd.org/changeset/base/215022 Log: test: Move tests to tools/regression/bin/test. Convert the tests to the perl prove format. Remove obsolete TEST.README (results of an old TEST.sh for some old Unices) and TEST.csh (old tests without correct values, far less complete than TEST.sh). MFC after: 1 week Added: head/tools/regression/bin/test/ head/tools/regression/bin/test/Makefile (contents, props changed) head/tools/regression/bin/test/regress.sh - copied, changed from r214813, head/bin/test/TEST.sh head/tools/regression/bin/test/regress.t (contents, props changed) Deleted: head/bin/test/TEST.README head/bin/test/TEST.csh head/bin/test/TEST.sh Modified: head/tools/regression/bin/Makefile Modified: head/tools/regression/bin/Makefile ============================================================================== --- head/tools/regression/bin/Makefile Mon Nov 8 22:12:25 2010 (r215021) +++ head/tools/regression/bin/Makefile Mon Nov 8 23:15:10 2010 (r215022) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= date mv pax sh +SUBDIR= date mv pax sh test .include Added: head/tools/regression/bin/test/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/test/Makefile Mon Nov 8 23:15:10 2010 (r215022) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + sh regress.sh Copied and modified: head/tools/regression/bin/test/regress.sh (from r214813, head/bin/test/TEST.sh) ============================================================================== --- head/bin/test/TEST.sh Thu Nov 4 22:05:50 2010 (r214813, copy source) +++ head/tools/regression/bin/test/regress.sh Mon Nov 8 23:15:10 2010 (r215022) @@ -30,44 +30,29 @@ # # $FreeBSD$ -# force a specified test program, e.g. `env test=/bin/test sh TEST.sh' +# force a specified test program, e.g. `env test=/bin/test sh regress.sh' : ${test=test} -ERROR=0 FAILED=0 - t () { # $1 -> exit code # $2 -> $test expression - echo -n "$1: $test $2 " - + count=$((count+1)) # check for syntax errors syntax="`eval $test $2 2>&1`" - if test -z "$syntax"; then - - case $1 in - 0) if eval $test $2; then echo " OK"; else failed;fi;; - 1) if eval $test $2; then failed; else echo " OK";fi;; - esac - + ret=$? + if test -n "$syntax"; then + printf "not ok %s - (syntax error)\n" "$count $2" + elif [ "$ret" != "$1" ]; then + printf "not ok %s - (got $ret, expected $1)\n" "$count $2" else - error + printf "ok %s\n" "$count $2" fi } -error () -{ - echo ""; echo " $syntax" - ERROR=`expr $ERROR + 1` -} - -failed () -{ - echo ""; echo " failed" - FAILED=`expr $FAILED + 1` -} - +count=0 +echo "1..94" t 0 'b = b' t 1 'b != b' @@ -172,6 +157,3 @@ t 1 '-z y -o y = "#" -o y = x' t 0 '0 -ne 0 -o ! -f /' t 0 '1 -ne 0 -o ! -f /etc/passwd' t 1 '0 -ne 0 -o ! -f /etc/passwd' - -echo "" -echo "Syntax errors: $ERROR Failed: $FAILED" Added: head/tools/regression/bin/test/regress.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/test/regress.t Mon Nov 8 23:15:10 2010 (r215022) @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +sh regress.sh From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 00:01:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F1BE61065672; Tue, 9 Nov 2010 00:01:55 +0000 (UTC) Date: Tue, 9 Nov 2010 00:01:55 +0000 From: Alexander Best To: Dag-Erling Smorgrav Message-ID: <20101109000155.GA76051@freebsd.org> References: <201011081204.oA8C4fE5030467@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011081204.oA8C4fE5030467@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214982 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 00:01:56 -0000 On Mon Nov 8 10, Dag-Erling Smorgrav wrote: > Author: des > Date: Mon Nov 8 12:04:41 2010 > New Revision: 214982 > URL: http://svn.freebsd.org/changeset/base/214982 > > Log: > Fix CPU ID in /proc/cpuinfo. thanks a lot. maybe it would also be a good idea to find out where "class" and "cpu" are being defined and completely remove chose varaibles. i think the CPUID_* macros are being used in most places in the src tree (boot messages e.g.). plus there's no point really to have variables around which are being set to wrong values. > > PR: kern/56451 > Submitted by: arundel@ > MFC after: 3 weeks > > Modified: > head/sys/compat/linprocfs/linprocfs.c > > Modified: head/sys/compat/linprocfs/linprocfs.c > ============================================================================== > --- head/sys/compat/linprocfs/linprocfs.c Mon Nov 8 11:22:55 2010 (r214981) > +++ head/sys/compat/linprocfs/linprocfs.c Mon Nov 8 12:04:41 2010 (r214982) > @@ -276,11 +276,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) > sbuf_printf(sb, > "processor\t: %d\n" > "vendor_id\t: %.20s\n" > - "cpu family\t: %d\n" > - "model\t\t: %d\n" > + "cpu family\t: %u\n" > + "model\t\t: %u\n" > "model name\t: %s\n" > - "stepping\t: %d\n\n", > - i, cpu_vendor, class, cpu, model, cpu_id & 0xf); > + "stepping\t: %u\n\n", > + i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING); > /* XXX per-cpu vendor / class / model / id? */ > } > -- a13x From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 00:04:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 3F9DB1065675; Tue, 9 Nov 2010 00:04:31 +0000 (UTC) Date: Tue, 9 Nov 2010 00:04:31 +0000 From: Alexander Best To: "David E. O'Brien" Message-ID: <20101109000431.GB76051@freebsd.org> References: <201011072344.oA7Nifh9094328@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011072344.oA7Nifh9094328@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214964 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 00:04:31 -0000 On Sun Nov 7 10, David E. O'Brien wrote: > Author: obrien > Date: Sun Nov 7 23:44:40 2010 > New Revision: 214964 > URL: http://svn.freebsd.org/changeset/base/214964 > > Log: > Add '-y' for bison compatibility. > > Obtained from: http://invisible-island.net could you take a look at PR 140309? it's a simple one line fix to prevent yacc from segfaulting in certain cases. cheers. alex > > Modified: > head/usr.bin/yacc/main.c > head/usr.bin/yacc/yacc.1 > > Modified: head/usr.bin/yacc/main.c > ============================================================================== > --- head/usr.bin/yacc/main.c Sun Nov 7 23:34:05 2010 (r214963) > +++ head/usr.bin/yacc/main.c Sun Nov 7 23:44:40 2010 (r214964) > @@ -166,7 +166,7 @@ getargs(int argc, char *argv[]) > { > int ch; > > - while ((ch = getopt(argc, argv, "b:dlo:p:rtv")) != -1) > + while ((ch = getopt(argc, argv, "b:dlo:p:rtvy")) != -1) > { > switch (ch) > { > @@ -202,6 +202,10 @@ getargs(int argc, char *argv[]) > vflag = 1; > break; > > + case 'y': > + /* for bison compatibility -- byacc is already POSIX compatible */ > + break; > + > default: > usage(); > } > > Modified: head/usr.bin/yacc/yacc.1 > ============================================================================== > --- head/usr.bin/yacc/yacc.1 Sun Nov 7 23:34:05 2010 (r214963) > +++ head/usr.bin/yacc/yacc.1 Sun Nov 7 23:44:40 2010 (r214964) > @@ -44,7 +44,7 @@ > .Nd an LALR(1) parser generator > .Sh SYNOPSIS > .Nm > -.Op Fl dlrtv > +.Op Fl dlrtvy > .Op Fl b Ar file_prefix > .Op Fl o Ar output_filename > .Op Fl p Ar symbol_prefix > @@ -118,6 +118,10 @@ so that debugging statements will be inc > Cause a human-readable description of the generated parser to > be written to the file > .Pa y.output . > +.It Fl y > +NOOP for bison compatibility. > +.Nm > +is already designed to be POSIX yacc compatible. > .El > .Sh ENVIRONMENT > .Bl -tag -width ".Ev TMPDIR" -- a13x From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 00:06:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id A1676106566B; Tue, 9 Nov 2010 00:06:00 +0000 (UTC) Date: Tue, 9 Nov 2010 00:06:00 +0000 From: Alexander Best To: "David E. O'Brien" Message-ID: <20101109000600.GA78920@freebsd.org> References: <201011072344.oA7Nifh9094328@svn.freebsd.org> <20101109000431.GB76051@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101109000431.GB76051@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214964 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 00:06:00 -0000 On Tue Nov 9 10, Alexander Best wrote: > On Sun Nov 7 10, David E. O'Brien wrote: > > Author: obrien > > Date: Sun Nov 7 23:44:40 2010 > > New Revision: 214964 > > URL: http://svn.freebsd.org/changeset/base/214964 > > > > Log: > > Add '-y' for bison compatibility. > > > > Obtained from: http://invisible-island.net > > could you take a look at PR 140309? it's a simple one line fix to prevent yacc > from segfaulting in certain cases. fixing PR 23254 also doesn't seem too complicated. cheers. alex > > cheers. > alex > > > > > Modified: > > head/usr.bin/yacc/main.c > > head/usr.bin/yacc/yacc.1 > > > > Modified: head/usr.bin/yacc/main.c > > ============================================================================== > > --- head/usr.bin/yacc/main.c Sun Nov 7 23:34:05 2010 (r214963) > > +++ head/usr.bin/yacc/main.c Sun Nov 7 23:44:40 2010 (r214964) > > @@ -166,7 +166,7 @@ getargs(int argc, char *argv[]) > > { > > int ch; > > > > - while ((ch = getopt(argc, argv, "b:dlo:p:rtv")) != -1) > > + while ((ch = getopt(argc, argv, "b:dlo:p:rtvy")) != -1) > > { > > switch (ch) > > { > > @@ -202,6 +202,10 @@ getargs(int argc, char *argv[]) > > vflag = 1; > > break; > > > > + case 'y': > > + /* for bison compatibility -- byacc is already POSIX compatible */ > > + break; > > + > > default: > > usage(); > > } > > > > Modified: head/usr.bin/yacc/yacc.1 > > ============================================================================== > > --- head/usr.bin/yacc/yacc.1 Sun Nov 7 23:34:05 2010 (r214963) > > +++ head/usr.bin/yacc/yacc.1 Sun Nov 7 23:44:40 2010 (r214964) > > @@ -44,7 +44,7 @@ > > .Nd an LALR(1) parser generator > > .Sh SYNOPSIS > > .Nm > > -.Op Fl dlrtv > > +.Op Fl dlrtvy > > .Op Fl b Ar file_prefix > > .Op Fl o Ar output_filename > > .Op Fl p Ar symbol_prefix > > @@ -118,6 +118,10 @@ so that debugging statements will be inc > > Cause a human-readable description of the generated parser to > > be written to the file > > .Pa y.output . > > +.It Fl y > > +NOOP for bison compatibility. > > +.Nm > > +is already designed to be POSIX yacc compatible. > > .El > > .Sh ENVIRONMENT > > .Bl -tag -width ".Ev TMPDIR" > > -- > a13x -- a13x From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 00:14:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFFA3106566C; Tue, 9 Nov 2010 00:14:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92B9E8FC14; Tue, 9 Nov 2010 00:14:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA90Edrr064841; Tue, 9 Nov 2010 00:14:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA90EdKh064837; Tue, 9 Nov 2010 00:14:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011090014.oA90EdKh064837@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 9 Nov 2010 00:14: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: r215023 - in head/sys: amd64/acpica i386/acpica ia64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 00:14:39 -0000 Author: jkim Date: Tue Nov 9 00:14:39 2010 New Revision: 215023 URL: http://svn.freebsd.org/changeset/base/215023 Log: Reduce diff between platforms and fix style(9) bugs. Modified: head/sys/amd64/acpica/OsdEnvironment.c head/sys/i386/acpica/OsdEnvironment.c head/sys/ia64/acpica/OsdEnvironment.c Modified: head/sys/amd64/acpica/OsdEnvironment.c ============================================================================== --- head/sys/amd64/acpica/OsdEnvironment.c Mon Nov 8 23:15:10 2010 (r215022) +++ head/sys/amd64/acpica/OsdEnvironment.c Tue Nov 9 00:14:39 2010 (r215023) @@ -28,9 +28,6 @@ #include __FBSDID("$FreeBSD$"); -/* - * 6.1 : Environmental support - */ #include #include #include @@ -39,33 +36,56 @@ __FBSDID("$FreeBSD$"); #include #include -static u_long amd64_acpi_root; +static u_long acpi_root_phys; -SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &amd64_acpi_root, 0, - "The physical address of the RSDP"); +SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &acpi_root_phys, 0, + "The physical address of the RSDP"); ACPI_STATUS AcpiOsInitialize(void) { - return(0); + + return (AE_OK); } ACPI_STATUS AcpiOsTerminate(void) { - return(0); + + return (AE_OK); +} + +static u_long +acpi_get_root_from_loader(void) +{ + long acpi_root; + + if (resource_long_value("acpi", 0, "rsdp", &acpi_root) == 0) + return (acpi_root); + + return (0); +} + +static u_long +acpi_get_root_from_memory(void) +{ + ACPI_SIZE acpi_root; + + if (ACPI_SUCCESS(AcpiFindRootPointer(&acpi_root))) + return (acpi_root); + + return (0); } ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer(void) { - u_long ptr; - if (amd64_acpi_root == 0 && - (resource_long_value("acpi", 0, "rsdp", (long *)&ptr) == 0 || - AcpiFindRootPointer((ACPI_SIZE *)&ptr) == AE_OK) && - ptr != 0) - amd64_acpi_root = ptr; + if (acpi_root_phys == 0) { + acpi_root_phys = acpi_get_root_from_loader(); + if (acpi_root_phys == 0) + acpi_root_phys = acpi_get_root_from_memory(); + } - return (amd64_acpi_root); + return (acpi_root_phys); } Modified: head/sys/i386/acpica/OsdEnvironment.c ============================================================================== --- head/sys/i386/acpica/OsdEnvironment.c Mon Nov 8 23:15:10 2010 (r215022) +++ head/sys/i386/acpica/OsdEnvironment.c Tue Nov 9 00:14:39 2010 (r215023) @@ -28,9 +28,6 @@ #include __FBSDID("$FreeBSD$"); -/* - * 6.1 : Environmental support - */ #include #include #include @@ -39,33 +36,56 @@ __FBSDID("$FreeBSD$"); #include #include -static u_long i386_acpi_root; +static u_long acpi_root_phys; -SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &i386_acpi_root, 0, - "The physical address of the RSDP"); +SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &acpi_root_phys, 0, + "The physical address of the RSDP"); ACPI_STATUS AcpiOsInitialize(void) { - return(0); + + return (AE_OK); } ACPI_STATUS AcpiOsTerminate(void) { - return(0); + + return (AE_OK); +} + +static u_long +acpi_get_root_from_loader(void) +{ + long acpi_root; + + if (resource_long_value("acpi", 0, "rsdp", &acpi_root) == 0) + return (acpi_root); + + return (0); +} + +static u_long +acpi_get_root_from_memory(void) +{ + ACPI_SIZE acpi_root; + + if (ACPI_SUCCESS(AcpiFindRootPointer(&acpi_root))) + return (acpi_root); + + return (0); } ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer(void) { - u_long ptr; - if (i386_acpi_root == 0 && - (resource_long_value("acpi", 0, "rsdp", (long *)&ptr) == 0 || - AcpiFindRootPointer((ACPI_SIZE *)&ptr) == AE_OK) && - ptr != 0) - i386_acpi_root = ptr; + if (acpi_root_phys == 0) { + acpi_root_phys = acpi_get_root_from_loader(); + if (acpi_root_phys == 0) + acpi_root_phys = acpi_get_root_from_memory(); + } - return (i386_acpi_root); + return (acpi_root_phys); } Modified: head/sys/ia64/acpica/OsdEnvironment.c ============================================================================== --- head/sys/ia64/acpica/OsdEnvironment.c Mon Nov 8 23:15:10 2010 (r215022) +++ head/sys/ia64/acpica/OsdEnvironment.c Tue Nov 9 00:14:39 2010 (r215023) @@ -35,8 +35,6 @@ __FBSDID("$FreeBSD$"); #include -static struct uuid acpi_root_uuid = EFI_TABLE_ACPI20; - static u_long acpi_root_phys; SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &acpi_root_phys, 0, @@ -46,27 +44,35 @@ ACPI_STATUS AcpiOsInitialize(void) { - return(AE_OK); + return (AE_OK); } ACPI_STATUS AcpiOsTerminate(void) { - return(AE_OK); + return (AE_OK); +} + +static u_long +acpi_get_root_from_efi(void) +{ + static struct uuid acpi_root_uuid = EFI_TABLE_ACPI20; + void *acpi_root; + + acpi_root = efi_get_table(&acpi_root_uuid); + if (acpi_root != NULL) + return (IA64_RR_MASK((uintptr_t)acpi_root)); + + return (0); } ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer(void) { - void *acpi_root; - if (acpi_root_phys == 0) { - acpi_root = efi_get_table(&acpi_root_uuid); - if (acpi_root == NULL) - return (0); - acpi_root_phys = IA64_RR_MASK((u_long)acpi_root); - } + if (acpi_root_phys == 0) + acpi_root_phys = acpi_get_root_from_efi(); return (acpi_root_phys); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 00:27:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A90C71065672; Tue, 9 Nov 2010 00:27:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D55D8FC1F; Tue, 9 Nov 2010 00:27:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA90RIZU066017; Tue, 9 Nov 2010 00:27:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA90RIh8066013; Tue, 9 Nov 2010 00:27:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011090027.oA90RIh8066013@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 9 Nov 2010 00:27: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: r215024 - in head/sys: amd64/acpica conf i386/acpica x86/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 00:27:18 -0000 Author: jkim Date: Tue Nov 9 00:27:18 2010 New Revision: 215024 URL: http://svn.freebsd.org/changeset/base/215024 Log: Now OsdEnvironment.c is identical on amd64 and i386. Move it to a new home. Added: head/sys/x86/acpica/OsdEnvironment.c - copied unchanged from r215023, head/sys/amd64/acpica/OsdEnvironment.c Deleted: head/sys/amd64/acpica/OsdEnvironment.c head/sys/i386/acpica/OsdEnvironment.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Nov 9 00:14:39 2010 (r215023) +++ head/sys/conf/files.amd64 Tue Nov 9 00:27:18 2010 (r215024) @@ -67,7 +67,6 @@ hptrr_lib.o optional hptrr \ compile-with "uudecode < $S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \ no-implicit-rule # -amd64/acpica/OsdEnvironment.c optional acpi amd64/acpica/acpi_machdep.c optional acpi amd64/acpica/acpi_switch.S optional acpi acpi_wakecode.o optional acpi \ @@ -300,6 +299,7 @@ contrib/x86emu/x86emu.c optional x86bio # # x86 shared code between IA32, AMD64 and PC98 architectures # +x86/acpica/OsdEnvironment.c optional acpi x86/acpica/madt.c optional acpi x86/acpica/srat.c optional acpi x86/bios/smbios.c optional smbios Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Nov 9 00:14:39 2010 (r215023) +++ head/sys/conf/files.i386 Tue Nov 9 00:27:18 2010 (r215024) @@ -238,7 +238,6 @@ dev/uart/uart_cpu_i386.c optional uart dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/wpi/if_wpi.c optional wpi -i386/acpica/OsdEnvironment.c optional acpi i386/acpica/acpi_machdep.c optional acpi i386/acpica/acpi_wakeup.c optional acpi acpi_wakecode.h optional acpi \ @@ -373,6 +372,7 @@ compat/x86bios/x86bios.c optional x86bio # # x86 shared code between IA32, AMD64 and PC98 architectures # +x86/acpica/OsdEnvironment.c optional acpi x86/acpica/madt.c optional acpi apic x86/acpica/srat.c optional acpi x86/bios/smbios.c optional smbios Copied: head/sys/x86/acpica/OsdEnvironment.c (from r215023, head/sys/amd64/acpica/OsdEnvironment.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/acpica/OsdEnvironment.c Tue Nov 9 00:27:18 2010 (r215024, copy of r215023, head/sys/amd64/acpica/OsdEnvironment.c) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2000,2001 Michael Smith + * Copyright (c) 2000 BSDi + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +static u_long acpi_root_phys; + +SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &acpi_root_phys, 0, + "The physical address of the RSDP"); + +ACPI_STATUS +AcpiOsInitialize(void) +{ + + return (AE_OK); +} + +ACPI_STATUS +AcpiOsTerminate(void) +{ + + return (AE_OK); +} + +static u_long +acpi_get_root_from_loader(void) +{ + long acpi_root; + + if (resource_long_value("acpi", 0, "rsdp", &acpi_root) == 0) + return (acpi_root); + + return (0); +} + +static u_long +acpi_get_root_from_memory(void) +{ + ACPI_SIZE acpi_root; + + if (ACPI_SUCCESS(AcpiFindRootPointer(&acpi_root))) + return (acpi_root); + + return (0); +} + +ACPI_PHYSICAL_ADDRESS +AcpiOsGetRootPointer(void) +{ + + if (acpi_root_phys == 0) { + acpi_root_phys = acpi_get_root_from_loader(); + if (acpi_root_phys == 0) + acpi_root_phys = acpi_get_root_from_memory(); + } + + return (acpi_root_phys); +} From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 01:52:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67D84106564A; Tue, 9 Nov 2010 01:52:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56B3E8FC12; Tue, 9 Nov 2010 01:52:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA91q9Zk071248; Tue, 9 Nov 2010 01:52:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA91q926071246; Tue, 9 Nov 2010 01:52:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011090152.oA91q926071246@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 9 Nov 2010 01:52: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: r215025 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 01:52:09 -0000 Author: yongari Date: Tue Nov 9 01:52:09 2010 New Revision: 215025 URL: http://svn.freebsd.org/changeset/base/215025 Log: Only moderate TX completion interrupts. Relying on taskqueue to suppress RX interrupts seems to give better RX performance than RX interrupt moderation. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Nov 9 00:27:18 2010 (r215024) +++ head/sys/dev/re/if_re.c Tue Nov 9 01:52:09 2010 (r215025) @@ -2728,7 +2728,7 @@ re_init_locked(struct rl_softc *sc) break; default: /* Magic from vendor. */ - CSR_WRITE_2(sc, RL_INTRMOD, 0x5151); + CSR_WRITE_2(sc, RL_INTRMOD, 0x5100); break; } } From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 01:57:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90600106566C; Tue, 9 Nov 2010 01:57:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79A3A8FC12; Tue, 9 Nov 2010 01:57:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA91vu7N071645; Tue, 9 Nov 2010 01:57:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA91vuux071630; Tue, 9 Nov 2010 01:57:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011090157.oA91vuux071630@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Nov 2010 01:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215026 - in stable/8/sys: amd64/amd64 amd64/isa conf i386/bios i386/cpufreq i386/i386 i386/isa isa modules/bios/smbios modules/bios/vpd modules/cpufreq x86/bios x86/cpufreq x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 01:57:56 -0000 Author: attilio Date: Tue Nov 9 01:57:56 2010 New Revision: 215026 URL: http://svn.freebsd.org/changeset/base/215026 Log: MFC r204309, r204313 and r204319 by nyan: Introduce the x86 subtree for code shared between amd64, i386 and pc98. Differently from the HEAD version, the headers are not moved around, in order to avoid breaking the KPI but it can be eventually done once the core mechanism of r214629 is MFCed. MFCing this patch does allow for simpler MFCs handling on i386/amd64 specific code. Sponsored by: Sandvine Incorporated Added: stable/8/sys/amd64/amd64/atpic_vector.S - copied unchanged from r214988, stable/8/sys/amd64/isa/atpic_vector.S stable/8/sys/i386/i386/atpic_vector.s - copied unchanged from r214988, stable/8/sys/i386/isa/atpic_vector.s stable/8/sys/x86/bios/ stable/8/sys/x86/bios/smbios.c - copied unchanged from r214988, stable/8/sys/i386/bios/smbios.c stable/8/sys/x86/bios/vpd.c - copied unchanged from r214988, stable/8/sys/i386/bios/vpd.c stable/8/sys/x86/cpufreq/ stable/8/sys/x86/cpufreq/est.c - copied unchanged from r214988, stable/8/sys/i386/cpufreq/est.c stable/8/sys/x86/cpufreq/hwpstate.c - copied unchanged from r214988, stable/8/sys/i386/cpufreq/hwpstate.c stable/8/sys/x86/cpufreq/p4tcc.c - copied unchanged from r214988, stable/8/sys/i386/cpufreq/p4tcc.c stable/8/sys/x86/cpufreq/powernow.c - copied unchanged from r214988, stable/8/sys/i386/cpufreq/powernow.c stable/8/sys/x86/cpufreq/smist.c - copied unchanged from r214988, stable/8/sys/i386/cpufreq/smist.c stable/8/sys/x86/isa/ stable/8/sys/x86/isa/atpic.c - copied, changed from r214988, stable/8/sys/i386/isa/atpic.c stable/8/sys/x86/isa/atrtc.c - copied unchanged from r214988, stable/8/sys/isa/atrtc.c stable/8/sys/x86/isa/clock.c - copied, changed from r214988, stable/8/sys/i386/isa/clock.c stable/8/sys/x86/isa/elcr.c - copied unchanged from r214988, stable/8/sys/i386/isa/elcr.c stable/8/sys/x86/isa/isa.c - copied, changed from r214988, stable/8/sys/i386/isa/isa.c stable/8/sys/x86/isa/isa_dma.c - copied, changed from r214988, stable/8/sys/i386/isa/isa_dma.c stable/8/sys/x86/isa/nmi.c - copied unchanged from r214988, stable/8/sys/i386/isa/nmi.c Deleted: stable/8/sys/amd64/isa/atpic.c stable/8/sys/amd64/isa/atpic_vector.S stable/8/sys/amd64/isa/clock.c stable/8/sys/amd64/isa/elcr.c stable/8/sys/amd64/isa/isa.c stable/8/sys/amd64/isa/isa_dma.c stable/8/sys/amd64/isa/nmi.c stable/8/sys/i386/bios/smbios.c stable/8/sys/i386/bios/vpd.c stable/8/sys/i386/cpufreq/ stable/8/sys/i386/isa/atpic.c stable/8/sys/i386/isa/atpic_vector.s stable/8/sys/i386/isa/clock.c stable/8/sys/i386/isa/elcr.c stable/8/sys/i386/isa/isa.c stable/8/sys/i386/isa/isa_dma.c stable/8/sys/i386/isa/nmi.c stable/8/sys/isa/atrtc.c Modified: stable/8/sys/amd64/amd64/exception.S stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/files.pc98 stable/8/sys/i386/i386/exception.s stable/8/sys/modules/bios/smbios/Makefile stable/8/sys/modules/bios/vpd/Makefile stable/8/sys/modules/cpufreq/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Copied: stable/8/sys/amd64/amd64/atpic_vector.S (from r214988, stable/8/sys/amd64/isa/atpic_vector.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/amd64/amd64/atpic_vector.S Tue Nov 9 01:57:56 2010 (r215026, copy of r214988, stable/8/sys/amd64/isa/atpic_vector.S) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 1989, 1990 William F. Jolitz. + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: vector.s, 386BSD 0.1 unknown origin + * $FreeBSD$ + */ + +/* + * Interrupt entry points for external interrupts triggered by the 8259A + * master and slave interrupt controllers. + */ + +#include + +#include "assym.s" + +/* + * Macros for interrupt entry, call to handler, and exit. + */ +#define INTR(irq_num, vec_name) \ + .text ; \ + SUPERALIGN_TEXT ; \ +IDTVEC(vec_name) ; \ + PUSH_FRAME ; \ + FAKE_MCOUNT(TF_RIP(%rsp)) ; \ + movq %rsp, %rsi ; \ + movl $irq_num, %edi; /* pass the IRQ */ \ + call atpic_handle_intr ; \ + MEXITCOUNT ; \ + jmp doreti + + INTR(0, atpic_intr0) + INTR(1, atpic_intr1) + INTR(2, atpic_intr2) + INTR(3, atpic_intr3) + INTR(4, atpic_intr4) + INTR(5, atpic_intr5) + INTR(6, atpic_intr6) + INTR(7, atpic_intr7) + INTR(8, atpic_intr8) + INTR(9, atpic_intr9) + INTR(10, atpic_intr10) + INTR(11, atpic_intr11) + INTR(12, atpic_intr12) + INTR(13, atpic_intr13) + INTR(14, atpic_intr14) + INTR(15, atpic_intr15) Modified: stable/8/sys/amd64/amd64/exception.S ============================================================================== --- stable/8/sys/amd64/amd64/exception.S Tue Nov 9 01:52:09 2010 (r215025) +++ stable/8/sys/amd64/amd64/exception.S Tue Nov 9 01:57:56 2010 (r215026) @@ -600,7 +600,7 @@ MCOUNT_LABEL(bintr) .text SUPERALIGN_TEXT -#include +#include #endif .text Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Nov 9 01:52:09 2010 (r215025) +++ stable/8/sys/conf/files.amd64 Tue Nov 9 01:57:56 2010 (r215026) @@ -140,13 +140,6 @@ amd64/amd64/tsc.c standard amd64/amd64/uio_machdep.c standard amd64/amd64/uma_machdep.c standard amd64/amd64/vm_machdep.c standard -amd64/isa/atpic.c optional atpic isa -#amd64/isa/atpic_vector.S optional atpic isa -amd64/isa/clock.c standard -amd64/isa/elcr.c standard -amd64/isa/isa.c standard -amd64/isa/isa_dma.c standard -amd64/isa/nmi.c standard amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci crypto/blowfish/bf_enc.c optional crypto | ipsec @@ -239,7 +232,6 @@ dev/syscons/scvtb.c optional sc dev/syscons/teken/teken.c optional sc dev/uart/uart_cpu_amd64.c optional uart dev/wpi/if_wpi.c optional wpi -isa/atrtc.c standard isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/link_elf_obj.c standard @@ -299,12 +291,6 @@ compat/ndis/subr_ntoskrnl.c optional ndi compat/ndis/subr_pe.c optional ndisapi pci compat/ndis/subr_usbd.c optional ndisapi pci compat/ndis/winx64_wrap.S optional ndisapi pci -i386/bios/smbios.c optional smbios -i386/bios/vpd.c optional vpd -i386/cpufreq/powernow.c optional cpufreq -i386/cpufreq/est.c optional cpufreq -i386/cpufreq/hwpstate.c optional cpufreq -i386/cpufreq/p4tcc.c optional cpufreq # libkern/memmove.c standard libkern/memset.c standard @@ -316,4 +302,17 @@ contrib/x86emu/x86emu.c optional x86bio # # x86 shared code between IA32, AMD64 and PC98 architectures # +x86/bios/smbios.c optional smbios +x86/bios/vpd.c optional vpd +x86/cpufreq/powernow.c optional cpufreq +x86/cpufreq/est.c optional cpufreq +x86/cpufreq/hwpstate.c optional cpufreq +x86/cpufreq/p4tcc.c optional cpufreq +x86/isa/atpic.c optional atpic isa +x86/isa/atrtc.c standard +x86/isa/clock.c standard +x86/isa/elcr.c standard +x86/isa/isa.c standard +x86/isa/isa_dma.c standard +x86/isa/nmi.c standard x86/pci/qpi.c standard Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Nov 9 01:52:09 2010 (r215025) +++ stable/8/sys/conf/files.i386 Tue Nov 9 01:57:56 2010 (r215026) @@ -246,13 +246,6 @@ i386/bios/apm.c optional apm i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi i386/bios/smapi_bios.S optional smapi -i386/bios/smbios.c optional smbios -i386/bios/vpd.c optional vpd -i386/cpufreq/est.c optional cpufreq -i386/cpufreq/hwpstate.c optional cpufreq -i386/cpufreq/p4tcc.c optional cpufreq -i386/cpufreq/powernow.c optional cpufreq -i386/cpufreq/smist.c optional cpufreq #i386/i386/apic_vector.s optional apic i386/i386/atomic.c standard \ compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}" @@ -331,17 +324,10 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/atpic.c optional atpic -#i386/isa/atpic_vector.s standard -i386/isa/clock.c optional native i386/xen/clock.c optional xen i386/xen/xen_clock_util.c optional xen i386/xen/xen_rtc.c optional xen -i386/isa/elcr.c standard i386/isa/elink.c optional ep | ie -i386/isa/isa.c optional isa -i386/isa/isa_dma.c optional isa -i386/isa/nmi.c standard i386/isa/npx.c optional npx i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine @@ -364,7 +350,6 @@ i386/svr4/svr4_locore.s optional compat warning "COMPAT_SVR4 is broken and should be avoided" i386/svr4/svr4_machdep.c optional compat_svr4 # -isa/atrtc.c optional atpic isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/imgact_aout.c optional compat_aout @@ -391,4 +376,18 @@ contrib/x86emu/x86emu.c optional x86bio # # x86 shared code between IA32, AMD64 and PC98 architectures # +x86/bios/smbios.c optional smbios +x86/bios/vpd.c optional vpd +x86/cpufreq/est.c optional cpufreq +x86/cpufreq/hwpstate.c optional cpufreq +x86/cpufreq/p4tcc.c optional cpufreq +x86/cpufreq/powernow.c optional cpufreq +x86/cpufreq/smist.c optional cpufreq +x86/isa/atpic.c optional atpic +x86/isa/atrtc.c optional atpic +x86/isa/clock.c optional native +x86/isa/elcr.c standard +x86/isa/isa.c optional isa +x86/isa/isa_dma.c optional isa +x86/isa/nmi.c standard x86/pci/qpi.c standard Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Tue Nov 9 01:52:09 2010 (r215025) +++ stable/8/sys/conf/files.pc98 Tue Nov 9 01:57:56 2010 (r215026) @@ -195,10 +195,7 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/atpic.c optional atpic -#i386/isa/atpic_vector.s standard i386/isa/elink.c optional ep | ie -i386/isa/isa.c optional isa i386/isa/npx.c optional npx i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine @@ -256,3 +253,8 @@ pc98/pc98/canbus.c optional canbus pc98/pc98/canbus_if.m optional canbus pc98/pc98/machdep.c standard pc98/pc98/pc98_machdep.c standard +# +# x86 shared code between IA32, AMD64 and PC98 architectures +# +x86/isa/atpic.c optional atpic +x86/isa/isa.c optional isa Copied: stable/8/sys/i386/i386/atpic_vector.s (from r214988, stable/8/sys/i386/isa/atpic_vector.s) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/i386/i386/atpic_vector.s Tue Nov 9 01:57:56 2010 (r215026, copy of r214988, stable/8/sys/i386/isa/atpic_vector.s) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 1989, 1990 William F. Jolitz. + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: vector.s, 386BSD 0.1 unknown origin + * $FreeBSD$ + */ + +/* + * Interrupt entry points for external interrupts triggered by the 8259A + * master and slave interrupt controllers. + */ + +#include + +#include "assym.s" + +/* + * Macros for interrupt entry, call to handler, and exit. + */ +#define INTR(irq_num, vec_name) \ + .text ; \ + SUPERALIGN_TEXT ; \ +IDTVEC(vec_name) ; \ + PUSH_FRAME ; \ + SET_KERNEL_SREGS ; \ + cld ; \ +; \ + FAKE_MCOUNT(TF_EIP(%esp)) ; \ + pushl %esp ; \ + pushl $irq_num; /* pass the IRQ */ \ + call atpic_handle_intr ; \ + addl $8, %esp ; /* discard the parameters */ \ +; \ + MEXITCOUNT ; \ + jmp doreti + + INTR(0, atpic_intr0) + INTR(1, atpic_intr1) + INTR(2, atpic_intr2) + INTR(3, atpic_intr3) + INTR(4, atpic_intr4) + INTR(5, atpic_intr5) + INTR(6, atpic_intr6) + INTR(7, atpic_intr7) + INTR(8, atpic_intr8) + INTR(9, atpic_intr9) + INTR(10, atpic_intr10) + INTR(11, atpic_intr11) + INTR(12, atpic_intr12) + INTR(13, atpic_intr13) + INTR(14, atpic_intr14) + INTR(15, atpic_intr15) Modified: stable/8/sys/i386/i386/exception.s ============================================================================== --- stable/8/sys/i386/i386/exception.s Tue Nov 9 01:52:09 2010 (r215025) +++ stable/8/sys/i386/i386/exception.s Tue Nov 9 01:57:56 2010 (r215026) @@ -297,7 +297,7 @@ ENTRY(fork_trampoline) SUPERALIGN_TEXT MCOUNT_LABEL(bintr) -#include +#include #ifdef DEV_APIC .data Modified: stable/8/sys/modules/bios/smbios/Makefile ============================================================================== --- stable/8/sys/modules/bios/smbios/Makefile Tue Nov 9 01:52:09 2010 (r215025) +++ stable/8/sys/modules/bios/smbios/Makefile Tue Nov 9 01:57:56 2010 (r215026) @@ -1,7 +1,7 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/../../../i386/bios +.PATH: ${.CURDIR}/../../../x86/bios KMOD= smbios SRCS= smbios.c \ Modified: stable/8/sys/modules/bios/vpd/Makefile ============================================================================== --- stable/8/sys/modules/bios/vpd/Makefile Tue Nov 9 01:52:09 2010 (r215025) +++ stable/8/sys/modules/bios/vpd/Makefile Tue Nov 9 01:57:56 2010 (r215026) @@ -1,7 +1,7 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/../../../i386/bios +.PATH: ${.CURDIR}/../../../x86/bios KMOD= vpd SRCS= vpd.c \ Modified: stable/8/sys/modules/cpufreq/Makefile ============================================================================== --- stable/8/sys/modules/cpufreq/Makefile Tue Nov 9 01:52:09 2010 (r215025) +++ stable/8/sys/modules/cpufreq/Makefile Tue Nov 9 01:57:56 2010 (r215026) @@ -8,7 +8,7 @@ SRCS= ichss.c SRCS+= bus_if.h cpufreq_if.h device_if.h pci_if.h .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" -.PATH: ${.CURDIR}/../../i386/cpufreq +.PATH: ${.CURDIR}/../../x86/cpufreq SRCS+= acpi_if.h opt_acpi.h SRCS+= est.c hwpstate.c p4tcc.c powernow.c Copied: stable/8/sys/x86/bios/smbios.c (from r214988, stable/8/sys/i386/bios/smbios.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/x86/bios/smbios.c Tue Nov 9 01:57:56 2010 (r215026, copy of r214988, stable/8/sys/i386/bios/smbios.c) @@ -0,0 +1,277 @@ +/*- + * Copyright (c) 2003 Matthew N. Dodd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * System Management BIOS Reference Specification, v2.4 Final + * http://www.dmtf.org/standards/published_documents/DSP0134.pdf + */ + +/* + * SMBIOS Entry Point Structure + */ +struct smbios_eps { + u_int8_t Anchor[4]; /* '_SM_' */ + u_int8_t Checksum; + u_int8_t Length; + + u_int8_t SMBIOS_Major; + u_int8_t SMBIOS_Minor; + u_int16_t Max_Size; + u_int8_t Revision; + u_int8_t Formatted_Area[5]; + + u_int8_t Intermediate_Anchor[5]; /* '_DMI_' */ + u_int8_t Intermediate_Checksum; + + u_int16_t Structure_Table_Length; + u_int32_t Structure_Table_Address; + u_int16_t Structure_Count; + + u_int8_t SMBIOS_BCD_Revision; +} __packed; + +struct smbios_softc { + device_t dev; + struct resource * res; + int rid; + + struct smbios_eps * eps; +}; + +#define SMBIOS_START 0xf0000 +#define SMBIOS_STEP 0x10 +#define SMBIOS_OFF 0 +#define SMBIOS_LEN 4 +#define SMBIOS_SIG "_SM_" + +#define RES2EPS(res) ((struct smbios_eps *)rman_get_virtual(res)) +#define ADDR2EPS(addr) ((struct smbios_eps *)BIOS_PADDRTOVADDR(addr)) + +static devclass_t smbios_devclass; + +static void smbios_identify (driver_t *, device_t); +static int smbios_probe (device_t); +static int smbios_attach (device_t); +static int smbios_detach (device_t); +static int smbios_modevent (module_t, int, void *); + +static int smbios_cksum (struct smbios_eps *); + +static void +smbios_identify (driver_t *driver, device_t parent) +{ + device_t child; + u_int32_t addr; + int length; + int rid; + + if (!device_is_alive(parent)) + return; + + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, + SMBIOS_STEP, SMBIOS_OFF); + if (addr != 0) { + rid = 0; + length = ADDR2EPS(addr)->Length; + + if (length != 0x1f) { + u_int8_t major, minor; + + major = ADDR2EPS(addr)->SMBIOS_Major; + minor = ADDR2EPS(addr)->SMBIOS_Minor; + + /* SMBIOS v2.1 implementation might use 0x1e. */ + if (length == 0x1e && major == 2 && minor == 1) + length = 0x1f; + else + return; + } + + child = BUS_ADD_CHILD(parent, 5, "smbios", -1); + device_set_driver(child, driver); + bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length); + device_set_desc(child, "System Management BIOS"); + } + + return; +} + +static int +smbios_probe (device_t dev) +{ + struct resource *res; + int rid; + int error; + + error = 0; + rid = 0; + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "Unable to allocate memory resource.\n"); + error = ENOMEM; + goto bad; + } + + if (smbios_cksum(RES2EPS(res))) { + device_printf(dev, "SMBIOS checksum failed.\n"); + error = ENXIO; + goto bad; + } + +bad: + if (res) + bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + return (error); +} + +static int +smbios_attach (device_t dev) +{ + struct smbios_softc *sc; + int error; + + sc = device_get_softc(dev); + error = 0; + + sc->dev = dev; + sc->rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "Unable to allocate memory resource.\n"); + error = ENOMEM; + goto bad; + } + sc->eps = RES2EPS(sc->res); + + device_printf(dev, "Version: %u.%u", + sc->eps->SMBIOS_Major, sc->eps->SMBIOS_Minor); + if (bcd2bin(sc->eps->SMBIOS_BCD_Revision)) + printf(", BCD Revision: %u.%u", + bcd2bin(sc->eps->SMBIOS_BCD_Revision >> 4), + bcd2bin(sc->eps->SMBIOS_BCD_Revision & 0x0f)); + printf("\n"); + + return (0); +bad: + if (sc->res) + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); + return (error); +} + +static int +smbios_detach (device_t dev) +{ + struct smbios_softc *sc; + + sc = device_get_softc(dev); + + if (sc->res) + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); + + return (0); +} + +static int +smbios_modevent (mod, what, arg) + module_t mod; + int what; + void * arg; +{ + device_t * devs; + int count; + int i; + + switch (what) { + case MOD_LOAD: + break; + case MOD_UNLOAD: + devclass_get_devices(smbios_devclass, &devs, &count); + for (i = 0; i < count; i++) { + device_delete_child(device_get_parent(devs[i]), devs[i]); + } + break; + default: + break; + } + + return (0); +} + +static device_method_t smbios_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, smbios_identify), + DEVMETHOD(device_probe, smbios_probe), + DEVMETHOD(device_attach, smbios_attach), + DEVMETHOD(device_detach, smbios_detach), + { 0, 0 } +}; + +static driver_t smbios_driver = { + "smbios", + smbios_methods, + sizeof(struct smbios_softc), +}; + +DRIVER_MODULE(smbios, nexus, smbios_driver, smbios_devclass, smbios_modevent, 0); +MODULE_VERSION(smbios, 1); + +static int +smbios_cksum (struct smbios_eps *e) +{ + u_int8_t *ptr; + u_int8_t cksum; + int i; + + ptr = (u_int8_t *)e; + cksum = 0; + for (i = 0; i < e->Length; i++) { + cksum += ptr[i]; + } + + return (cksum); +} Copied: stable/8/sys/x86/bios/vpd.c (from r214988, stable/8/sys/i386/bios/vpd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/x86/bios/vpd.c Tue Nov 9 01:57:56 2010 (r215026, copy of r214988, stable/8/sys/i386/bios/vpd.c) @@ -0,0 +1,297 @@ +/*- + * Copyright (c) 2003 Matthew N. Dodd + * 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$"); + +/* + * VPD decoder for IBM systems (Thinkpads) + * http://www-1.ibm.com/support/docview.wss?uid=psg1MIGR-45120 + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * Vital Product Data + */ +struct vpd { + u_int16_t Header; /* 0x55AA */ + u_int8_t Signature[3]; /* Always 'VPD' */ + u_int8_t Length; /* Sructure Length */ + + u_int8_t Reserved[7]; /* Reserved */ + + u_int8_t BuildID[9]; /* BIOS Build ID */ + u_int8_t BoxSerial[7]; /* Box Serial Number */ + u_int8_t PlanarSerial[11]; /* Motherboard Serial Number */ + u_int8_t MachType[7]; /* Machine Type/Model */ + u_int8_t Checksum; /* Checksum */ +} __packed; + +struct vpd_softc { + device_t dev; + struct resource * res; + int rid; + + struct vpd * vpd; + + struct sysctl_ctx_list ctx; + + char BuildID[10]; + char BoxSerial[8]; + char PlanarSerial[12]; + char MachineType[5]; + char MachineModel[4]; +}; + +#define VPD_START 0xf0000 +#define VPD_STEP 0x10 +#define VPD_OFF 2 +#define VPD_LEN 3 +#define VPD_SIG "VPD" + +#define RES2VPD(res) ((struct vpd *)rman_get_virtual(res)) +#define ADDR2VPD(addr) ((struct vpd *)BIOS_PADDRTOVADDR(addr)) + +static devclass_t vpd_devclass; + +static void vpd_identify (driver_t *, device_t); +static int vpd_probe (device_t); +static int vpd_attach (device_t); +static int vpd_detach (device_t); +static int vpd_modevent (module_t, int, void *); + +static int vpd_cksum (struct vpd *); + +SYSCTL_NODE(_hw, OID_AUTO, vpd, CTLFLAG_RD, NULL, NULL); +SYSCTL_NODE(_hw_vpd, OID_AUTO, machine, CTLFLAG_RD, NULL, NULL); +SYSCTL_NODE(_hw_vpd_machine, OID_AUTO, type, CTLFLAG_RD, NULL, NULL); +SYSCTL_NODE(_hw_vpd_machine, OID_AUTO, model, CTLFLAG_RD, NULL, NULL); +SYSCTL_NODE(_hw_vpd, OID_AUTO, build_id, CTLFLAG_RD, NULL, NULL); +SYSCTL_NODE(_hw_vpd, OID_AUTO, serial, CTLFLAG_RD, NULL, NULL); +SYSCTL_NODE(_hw_vpd_serial, OID_AUTO, box, CTLFLAG_RD, NULL, NULL); +SYSCTL_NODE(_hw_vpd_serial, OID_AUTO, planar, CTLFLAG_RD, NULL, NULL); + +static void +vpd_identify (driver_t *driver, device_t parent) +{ + device_t child; + u_int32_t addr; + int length; + int rid; + + if (!device_is_alive(parent)) + return; + + addr = bios_sigsearch(VPD_START, VPD_SIG, VPD_LEN, VPD_STEP, VPD_OFF); + if (addr != 0) { + rid = 0; + length = ADDR2VPD(addr)->Length; + + child = BUS_ADD_CHILD(parent, 5, "vpd", -1); + device_set_driver(child, driver); + bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length); + device_set_desc(child, "Vital Product Data Area"); + } + + return; +} + +static int +vpd_probe (device_t dev) +{ + struct resource *res; + int rid; + int error; + + error = 0; + rid = 0; + res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "Unable to allocate memory resource.\n"); + error = ENOMEM; + goto bad; + } + + if (vpd_cksum(RES2VPD(res))) + device_printf(dev, "VPD checksum failed. BIOS update may be required.\n"); + +bad: + if (res) + bus_release_resource(dev, SYS_RES_MEMORY, rid, res); + return (error); +} + +static int +vpd_attach (device_t dev) +{ + struct vpd_softc *sc; + char unit[4]; + int error; + + sc = device_get_softc(dev); + error = 0; + + sc->dev = dev; + sc->rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "Unable to allocate memory resource.\n"); + error = ENOMEM; + goto bad; + } + sc->vpd = RES2VPD(sc->res); + + snprintf(unit, sizeof(unit), "%d", device_get_unit(sc->dev)); + snprintf(sc->MachineType, 5, "%.4s", sc->vpd->MachType); + snprintf(sc->MachineModel, 4, "%.3s", sc->vpd->MachType+4); + snprintf(sc->BuildID, 10, "%.9s", sc->vpd->BuildID); + snprintf(sc->BoxSerial, 8, "%.7s", sc->vpd->BoxSerial); + snprintf(sc->PlanarSerial, 12, "%.11s", sc->vpd->PlanarSerial); + + sysctl_ctx_init(&sc->ctx); + SYSCTL_ADD_STRING(&sc->ctx, + SYSCTL_STATIC_CHILDREN(_hw_vpd_machine_type), OID_AUTO, + unit, CTLFLAG_RD|CTLFLAG_DYN, sc->MachineType, 0, NULL); + SYSCTL_ADD_STRING(&sc->ctx, + SYSCTL_STATIC_CHILDREN(_hw_vpd_machine_model), OID_AUTO, + unit, CTLFLAG_RD|CTLFLAG_DYN, sc->MachineModel, 0, NULL); + SYSCTL_ADD_STRING(&sc->ctx, + SYSCTL_STATIC_CHILDREN(_hw_vpd_build_id), OID_AUTO, + unit, CTLFLAG_RD|CTLFLAG_DYN, sc->BuildID, 0, NULL); + SYSCTL_ADD_STRING(&sc->ctx, + SYSCTL_STATIC_CHILDREN(_hw_vpd_serial_box), OID_AUTO, + unit, CTLFLAG_RD|CTLFLAG_DYN, sc->BoxSerial, 0, NULL); + SYSCTL_ADD_STRING(&sc->ctx, + SYSCTL_STATIC_CHILDREN(_hw_vpd_serial_planar), OID_AUTO, + unit, CTLFLAG_RD|CTLFLAG_DYN, sc->PlanarSerial, 0, NULL); + + device_printf(dev, "Machine Type: %.4s, Model: %.3s, Build ID: %.9s\n", + sc->MachineType, sc->MachineModel, sc->BuildID); + device_printf(dev, "Box Serial: %.7s, Planar Serial: %.11s\n", + sc->BoxSerial, sc->PlanarSerial); + + return (0); +bad: + if (sc->res) + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); + return (error); +} + +static int +vpd_detach (device_t dev) +{ + struct vpd_softc *sc; + + sc = device_get_softc(dev); + + if (sc->res) + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); + + sysctl_ctx_free(&sc->ctx); + + return (0); +} + +static int +vpd_modevent (mod, what, arg) + module_t mod; + int what; + void * arg; +{ + device_t * devs; + int count; + int i; + + switch (what) { + case MOD_LOAD: + break; + case MOD_UNLOAD: + devclass_get_devices(vpd_devclass, &devs, &count); + for (i = 0; i < count; i++) { + device_delete_child(device_get_parent(devs[i]), devs[i]); + } + break; + default: + break; + } + + return (0); +} + +static device_method_t vpd_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, vpd_identify), + DEVMETHOD(device_probe, vpd_probe), + DEVMETHOD(device_attach, vpd_attach), + DEVMETHOD(device_detach, vpd_detach), + { 0, 0 } +}; + +static driver_t vpd_driver = { + "vpd", + vpd_methods, + sizeof(struct vpd_softc), +}; + +DRIVER_MODULE(vpd, nexus, vpd_driver, vpd_devclass, vpd_modevent, 0); +MODULE_VERSION(vpd, 1); + +/* + * Perform a checksum over the VPD structure, starting with + * the BuildID. (Jean Delvare ) + */ +static int +vpd_cksum (struct vpd *v) +{ + u_int8_t *ptr; + u_int8_t cksum; + int i; + + ptr = (u_int8_t *)v; + cksum = 0; + for (i = offsetof(struct vpd, BuildID); i < v->Length ; i++) + cksum += ptr[i]; + return (cksum); +} Copied: stable/8/sys/x86/cpufreq/est.c (from r214988, stable/8/sys/i386/cpufreq/est.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/x86/cpufreq/est.c Tue Nov 9 01:57:56 2010 (r215026, copy of r214988, stable/8/sys/i386/cpufreq/est.c) @@ -0,0 +1,1401 @@ +/*- + * Copyright (c) 2004 Colin Percival + * Copyright (c) 2005 Nate Lawson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted providing 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 "cpufreq_if.h" +#include +#include +#include +#include + +#include + +#include +#include "acpi_if.h" + +/* Status/control registers (from the IA-32 System Programming Guide). */ +#define MSR_PERF_STATUS 0x198 +#define MSR_PERF_CTL 0x199 + +/* Register and bit for enabling SpeedStep. */ +#define MSR_MISC_ENABLE 0x1a0 +#define MSR_SS_ENABLE (1<<16) + +/* Frequency and MSR control values. */ +typedef struct { + uint16_t freq; + uint16_t volts; + uint16_t id16; + int power; +} freq_info; + +/* Identifying characteristics of a processor and supported frequencies. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 02:51:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0564106564A; Tue, 9 Nov 2010 02:51:38 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F4818FC1A; Tue, 9 Nov 2010 02:51:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA92pcMa075168; Tue, 9 Nov 2010 02:51:38 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA92pcWY075166; Tue, 9 Nov 2010 02:51:38 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011090251.oA92pcWY075166@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 9 Nov 2010 02:51: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: r215027 - head/usr.bin/yacc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 02:51:38 -0000 Author: obrien Date: Tue Nov 9 02:51:38 2010 New Revision: 215027 URL: http://svn.freebsd.org/changeset/base/215027 Log: Fix the build on 64-bit hosts. WARNS=6 fails on them. Modified: head/usr.bin/yacc/reader.c Modified: head/usr.bin/yacc/reader.c ============================================================================== --- head/usr.bin/yacc/reader.c Tue Nov 9 01:57:56 2010 (r215026) +++ head/usr.bin/yacc/reader.c Tue Nov 9 02:51:38 2010 (r215027) @@ -719,7 +719,7 @@ get_literal(void) ++cptr; } } - if (n > UCHAR_MAX) illegal_character(c_cptr); + if (n > (int)UCHAR_MAX) illegal_character(c_cptr); c = n; break; @@ -735,7 +735,7 @@ get_literal(void) if (i < 0 || i >= 16) break; ++cptr; n = (n << 4) + i; - if (n > UCHAR_MAX) illegal_character(c_cptr); + if (n > (int)UCHAR_MAX) illegal_character(c_cptr); } c = n; break; From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 03:13:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3D381065673; Tue, 9 Nov 2010 03:13:43 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9D7328FC21; Tue, 9 Nov 2010 03:13:43 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id oA93Dhv5097762; Mon, 8 Nov 2010 19:13:43 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id oA93Dgbf097732; Mon, 8 Nov 2010 19:13:42 -0800 (PST) (envelope-from obrien) Date: Mon, 8 Nov 2010 19:13:42 -0800 From: "David O'Brien" To: Jilles Tjoelker Message-ID: <20101109031342.GC62119@dragon.NUXI.org> References: <201010182310.o9INAWPU089616@svn.freebsd.org> <20101023212023.GA10891@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101023212023.GA10891@stack.nl> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r214045 - in stable/8/tools/regression/bin/sh: builtins errors execution expansion set-e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 03:13:43 -0000 On Sat, Oct 23, 2010 at 11:20:24PM +0200, Jilles Tjoelker wrote: > On Mon, Oct 18, 2010 at 11:10:32PM +0000, David E. O'Brien wrote: > > +++ stable/8/tools/regression/bin/sh/builtins/command10.0 Mon Oct 18 23:10:32 2010 (r214045, copy of r204802, head/tools/regression/bin/sh/builtins/command10.0) ... > > +++ stable/8/tools/regression/bin/sh/builtins/command9.0 Mon Oct 18 23:10:32 2010 (r214045, copy of r204801, head/tools/regression/bin/sh/builtins/command9.0) [..] > These work on stable/8, but for the wrong reason. In stable/8, 'command' > does not allow executing builtin utilities, and therefore 'eval' cannot > be found. This is a different error than the expected passing of a > non-number to 'shift', and does not allow testing for the bug this is > supposed to check for. [..] > Because this does not cause any extra failures, I don't think it is > necessary to revert it. However, it seems unusual to MFC a test for a > bugfix without also MFCing the bugfix. I MFCed all passing test cases. If the test case passes when it should not, it seems to me the test case isn't providing sufficient coverage. That said, I would like to MFC the various ash bug fixes that are missing from 8.1. I know you've MFC'ed some of the ones in HEAD, but are ones not MFCed that you feel should be? Or ones that should not be? Are the missing fixes just due to lack of time to MFC? thanks, -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 09:34:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33769106564A; Tue, 9 Nov 2010 09:34: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 22C038FC14; Tue, 9 Nov 2010 09:34:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA99YMQD098625; Tue, 9 Nov 2010 09:34:22 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA99YMHM098623; Tue, 9 Nov 2010 09:34:22 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201011090934.oA99YMHM098623@svn.freebsd.org> From: Kevin Lo Date: Tue, 9 Nov 2010 09:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215031 - head/sys/arm/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 09:34:22 -0000 Author: kevlo Date: Tue Nov 9 09:34:21 2010 New Revision: 215031 URL: http://svn.freebsd.org/changeset/base/215031 Log: Minor cosmetic changes Modified: head/sys/arm/include/cpuconf.h Modified: head/sys/arm/include/cpuconf.h ============================================================================== --- head/sys/arm/include/cpuconf.h Tue Nov 9 06:23:06 2010 (r215030) +++ head/sys/arm/include/cpuconf.h Tue Nov 9 09:34:21 2010 (r215031) @@ -142,9 +142,9 @@ #define ARM_MMU_SA1 0 #endif -#if(defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ - defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ - defined(CPU_XSCALE_80219)) || defined(CPU_XSCALE_81342) +#if (defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ + defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ + defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342)) #define ARM_MMU_XSCALE 1 #else #define ARM_MMU_XSCALE 0 @@ -163,7 +163,7 @@ */ #if (defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ - defined(CPU_XSCALE_80219)) || defined(CPU_XSCALE_81342) + defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342)) #define ARM_XSCALE_PMU 1 #else #define ARM_XSCALE_PMU 0 From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 10:28:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 019EB1065670; Tue, 9 Nov 2010 10:28:03 +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 E48AB8FC14; Tue, 9 Nov 2010 10:28:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9AS2Bo002918; Tue, 9 Nov 2010 10:28:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9AS2Mm002916; Tue, 9 Nov 2010 10:28:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011091028.oA9AS2Mm002916@svn.freebsd.org> From: Alexander Motin Date: Tue, 9 Nov 2010 10:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215032 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 10:28:03 -0000 Author: mav Date: Tue Nov 9 10:28:02 2010 New Revision: 215032 URL: http://svn.freebsd.org/changeset/base/215032 Log: MFC r205999: ng_gif depends on gif. Modified: stable/8/sys/conf/files Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Tue Nov 9 09:34:21 2010 (r215031) +++ stable/8/sys/conf/files Tue Nov 9 10:28:02 2010 (r215032) @@ -2337,7 +2337,7 @@ net/if_ethersubr.c optional ether \ net/if_faith.c optional faith net/if_fddisubr.c optional fddi net/if_fwsubr.c optional fwip -net/if_gif.c optional gif +net/if_gif.c optional gif | netgraph_gif net/if_gre.c optional gre inet net/if_iso88025subr.c optional token net/if_lagg.c optional lagg @@ -2503,7 +2503,7 @@ netinet/igmp.c optional inet netinet/in.c optional inet netinet/in_debug.c optional inet ddb netinet/ip_carp.c optional inet carp | inet6 carp -netinet/in_gif.c optional gif inet +netinet/in_gif.c optional gif inet | netgraph_gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet netinet/in_mcast.c optional inet @@ -2578,7 +2578,7 @@ netinet6/frag6.c optional inet6 netinet6/icmp6.c optional inet6 netinet6/in6.c optional inet6 netinet6/in6_cksum.c optional inet6 -netinet6/in6_gif.c optional gif inet6 +netinet6/in6_gif.c optional gif inet6 | netgraph_gif inet6 netinet6/in6_ifattach.c optional inet6 netinet6/in6_mcast.c optional inet6 netinet6/in6_pcb.c optional inet6 From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 10:59:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B540B106566C; Tue, 9 Nov 2010 10:59:09 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A084A8FC08; Tue, 9 Nov 2010 10:59:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9Ax9Im007485; Tue, 9 Nov 2010 10:59:09 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9Ax9id007463; Tue, 9 Nov 2010 10:59:09 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011091059.oA9Ax9id007463@svn.freebsd.org> From: Bruce Cran Date: Tue, 9 Nov 2010 10:59: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: r215034 - in head: libexec/tftpd sys/arm/xscale/ixp425 sys/boot/arm/ixp425/boot2 sys/dev/ata sys/dev/drm sys/dev/isp sys/dev/ixgbe sys/dev/msk sys/dev/pccard sys/dev/sound/sbus sys/dev/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 10:59:09 -0000 Author: brucec Date: Tue Nov 9 10:59:09 2010 New Revision: 215034 URL: http://svn.freebsd.org/changeset/base/215034 Log: Fix typos. PR: bin/148894 Submitted by: olgeni Modified: head/libexec/tftpd/tftp-utils.c head/sys/arm/xscale/ixp425/ixp425_qmgr.c head/sys/boot/arm/ixp425/boot2/ixp425_board.c head/sys/dev/ata/ata-disk.c head/sys/dev/drm/r300_reg.h head/sys/dev/isp/isp_freebsd.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/msk/if_msk.c head/sys/dev/pccard/pccardvar.h head/sys/dev/sound/sbus/cs4231.c head/sys/dev/syscons/schistory.c head/sys/dev/uart/uart_subr.c head/sys/kern/subr_lock.c head/sys/mips/mips/vm_machdep.c head/sys/netinet/sctp.h head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_uio.h head/sys/security/mac_portacl/mac_portacl.c head/usr.bin/seq/seq.c head/usr.sbin/config/configvers.h Modified: head/libexec/tftpd/tftp-utils.c ============================================================================== --- head/libexec/tftpd/tftp-utils.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/libexec/tftpd/tftp-utils.c Tue Nov 9 10:59:09 2010 (r215034) @@ -100,7 +100,7 @@ unmappedaddr(struct sockaddr_in6 *sin6) sin4->sin_len = sizeof(struct sockaddr_in); } -/* Get a field from a \0 seperated string */ +/* Get a field from a \0 separated string */ ssize_t get_field(int peer, char *buffer, ssize_t size) { Modified: head/sys/arm/xscale/ixp425/ixp425_qmgr.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_qmgr.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/arm/xscale/ixp425/ixp425_qmgr.c Tue Nov 9 10:59:09 2010 (r215034) @@ -317,7 +317,7 @@ ixpqmgr_attach(device_t dev) sc->aqmFreeSramAddress = 0x100; /* Q buffer space starts at 0x2100 */ - ixpqmgr_rebuild(sc); /* build inital priority table */ + ixpqmgr_rebuild(sc); /* build initial priority table */ aqm_reset(sc); /* reset h/w */ return (0); } @@ -775,7 +775,7 @@ ixpqmgr_intr(void *arg) * * The search will end when all the bits of the interrupt * register are cleared. There is no need to maintain - * a seperate value and test it at each iteration. + * a separate value and test it at each iteration. */ if (intRegVal & sc->lowPriorityTableFirstHalfMask) { priorityTableIndex = 0; Modified: head/sys/boot/arm/ixp425/boot2/ixp425_board.c ============================================================================== --- head/sys/boot/arm/ixp425/boot2/ixp425_board.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/boot/arm/ixp425/boot2/ixp425_board.c Tue Nov 9 10:59:09 2010 (r215034) @@ -88,7 +88,7 @@ board_init(void) /* * This should be called just before starting the kernel. This is so - * that one can undo incompatable hardware settings. + * that one can undo incompatible hardware settings. */ void clr_board(void) @@ -504,7 +504,7 @@ cfaltwait(u_int8_t mask) while (tout <= 5000000) { status = cfaltread8(CF_ALT_STATUS); if (status == 0xff) { - printf("cfaltwait: master: no status, reselectin\n"); + printf("cfaltwait: master: no status, reselecting\n"); cfwrite8(CF_DRV_HEAD, CF_D_IBM); DELAY(1); status = cfread8(CF_STATUS); Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/ata/ata-disk.c Tue Nov 9 10:59:09 2010 (r215034) @@ -188,13 +188,13 @@ ad_detach(device_t dev) free(children, M_TEMP); } - /* detroy disk from the system so we dont get any further requests */ + /* destroy disk from the system so we don't get any further requests */ disk_destroy(adp->disk); - /* fail requests on the queue and any thats "in flight" for this device */ + /* fail requests on the queue and any that's "in flight" for this device */ ata_fail_requests(dev); - /* dont leave anything behind */ + /* don't leave anything behind */ device_set_ivars(dev, NULL); free(adp, M_AD); return 0; @@ -536,7 +536,7 @@ ad_describe(device_t dev) struct ad_softc *adp = device_get_ivars(dev); u_int8_t *marker, vendor[64], product[64]; - /* try to seperate the ATA model string into vendor and model parts */ + /* try to separate the ATA model string into vendor and model parts */ if ((marker = index(atadev->param.model, ' ')) || (marker = index(atadev->param.model, '-'))) { int len = (marker - atadev->param.model); Modified: head/sys/dev/drm/r300_reg.h ============================================================================== --- head/sys/dev/drm/r300_reg.h Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/drm/r300_reg.h Tue Nov 9 10:59:09 2010 (r215034) @@ -345,7 +345,7 @@ __FBSDID("$FreeBSD$"); * position takes place. * * Most likely this is used to ignore rest of the program in cases - * where group of verts arent visible. For some reason this "section" + * where group of verts aren't visible. For some reason this "section" * is sometimes accepted other instruction that have no relationship with * position calculations. */ @@ -590,7 +590,7 @@ __FBSDID("$FreeBSD$"); #define R300_RE_FOG_START 0x4298 /* Not sure why there are duplicate of factor and constant values. - * My best guess so far is that there are seperate zbiases for test and write. + * My best guess so far is that there are separate zbiases for test and write. * Ordering might be wrong. * Some of the tests indicate that fgl has a fallback implementation of zbias * via pixel shaders. @@ -608,7 +608,7 @@ __FBSDID("$FreeBSD$"); * My guess is that there are two bits for each zbias primitive * (FILL, LINE, POINT). * One to enable depth test and one for depth write. - * Yet this doesnt explain why depth writes work ... + * Yet this doesn't explain why depth writes work ... */ #define R300_RE_OCCLUSION_CNTL 0x42B4 # define R300_OCCLUSION_ON (1<<1) @@ -693,7 +693,7 @@ __FBSDID("$FreeBSD$"); * the ROUTE_0_COLOR bit is set and ROUTE_0_COLOR_DEST contains the * color register index. * - * Apperently you may set the R300_RS_ROUTE_0_COLOR bit, but not provide any + * Apparently you may set the R300_RS_ROUTE_0_COLOR bit, but not provide any * R300_RS_ROUTE_0_COLOR_DEST value; this setup is used for clearing the state. * See r300_ioctl.c:r300EmitClearState. I'm not sure if this setup is strictly * correct or not. - Oliver. @@ -817,8 +817,8 @@ __FBSDID("$FreeBSD$"); # define R300_TX_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 11) # define R300_TX_MIN_FILTER_LINEAR_MIP_LINEAR (10 << 11) -/* NOTE: NEAREST doesnt seem to exist. - * Im not seting MAG_FILTER_MASK and (3 << 11) on for all +/* NOTE: NEAREST doesn't seem to exist. + * I'm not setting MAG_FILTER_MASK and (3 << 11) on for all * anisotropy modes because that would void selected mag filter */ # define R300_TX_MIN_FILTER_ANISO_NEAREST (0 << 13) Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/isp/isp_freebsd.c Tue Nov 9 10:59:09 2010 (r215034) @@ -1790,7 +1790,7 @@ isp_handle_platform_atio(ispsoftc_t *isp * The firmware status (except for the QLTM_SVALID bit) * indicates why this ATIO was sent to us. * - * If QLTM_SVALID is set, the firware has recommended Sense Data. + * If QLTM_SVALID is set, the firmware has recommended Sense Data. * * If the DISCONNECTS DISABLED bit is set in the flags field, * we're still connected on the SCSI bus. @@ -1917,7 +1917,7 @@ isp_handle_platform_atio2(ispsoftc_t *is * The firmware status (except for the QLTM_SVALID bit) * indicates why this ATIO was sent to us. * - * If QLTM_SVALID is set, the firware has recommended Sense Data. + * If QLTM_SVALID is set, the firmware has recommended Sense Data. */ if ((aep->at_status & ~QLTM_SVALID) != AT_CDB) { isp_prt(isp, ISP_LOGWARN, "bogus atio (0x%x) leaked to platform", aep->at_status); @@ -2581,7 +2581,7 @@ isp_handle_platform_notify_24xx(ispsoftc /* * Note that we're just getting notification that an ELS was received - * (possibly with some associcated information sent upstream). This is + * (possibly with some associated information sent upstream). This is * *not* the same as being given the ELS frame to accept or reject. */ switch (inot->in_status_subcode) { @@ -2784,7 +2784,7 @@ isp_handle_platform_target_notify_ack(is } /* - * Handle task managment functions. + * Handle task management functions. * * We show up here with a notify structure filled out. * @@ -2894,7 +2894,7 @@ bad: } /* - * Find the associated private data and makr it as dead so + * Find the associated private data and mark it as dead so * we don't try to work on it any further. */ static void @@ -5368,7 +5368,7 @@ isp_default_wwn(ispsoftc_t * isp, int ch /* - * For channel zero just return what we have. For either ACIIVE or + * For channel zero just return what we have. For either ACTIVE or * DEFAULT cases, we depend on default override of NVRAM values for * channel zero. */ @@ -5404,7 +5404,7 @@ isp_default_wwn(ispsoftc_t * isp, int ch * physical port on dual-port chips (23XX/24XX) * * This is somewhat nutty, particularly since bit 48 is - * irrelevant as they assign seperate serial numbers to + * irrelevant as they assign separate serial numbers to * different physical ports anyway. * * We'll stick our channel number plus one first into bits Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/ixgbe/ixgbe.c Tue Nov 9 10:59:09 2010 (r215034) @@ -257,7 +257,7 @@ TUNABLE_INT("hw.ixgbe.enable_msix", &ixg /* * Header split: this causes the hardware to DMA - * the header into a seperate mbuf from the payload, + * the header into a separate mbuf from the payload, * it can be a performance win in some workloads, but * in others it actually hurts, its off by default. */ @@ -3661,7 +3661,7 @@ ixgbe_setup_receive_ring(struct rx_ring rxbuf = &rxr->rx_buffers[j]; /* - ** Dont allocate mbufs if not + ** Don't allocate mbufs if not ** doing header split, its wasteful */ if (rxr->hdr_split == FALSE) @@ -4129,7 +4129,7 @@ ixgbe_rxeof(struct ix_queue *que, int co ** not be fragmented across sequential ** descriptors, rather the next descriptor ** is indicated in bits of the descriptor. - ** This also means that we might proceses + ** This also means that we might process ** more than one packet at a time, something ** that has never been true before, it ** required eliminating global chain pointers @@ -4478,14 +4478,14 @@ ixgbe_enable_intr(struct adapter *adapte /* With RSS we use auto clear */ if (adapter->msix_mem) { mask = IXGBE_EIMS_ENABLE_MASK; - /* Dont autoclear Link */ + /* Don't autoclear Link */ mask &= ~IXGBE_EIMS_OTHER; mask &= ~IXGBE_EIMS_LSC; IXGBE_WRITE_REG(hw, IXGBE_EIAC, mask); } /* - ** Now enable all queues, this is done seperately to + ** Now enable all queues, this is done separately to ** allow for handling the extended (beyond 32) MSIX ** vectors that can be used by 82599 */ Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/msk/if_msk.c Tue Nov 9 10:59:09 2010 (r215034) @@ -1157,7 +1157,7 @@ mskc_setup_rambuffer(struct msk_softc *s sc->msk_pflags |= MSK_FLAG_RAMBUF; /* * Give receiver 2/3 of memory and round down to the multiple - * of 1024. Tx/Rx RAM buffer size of Yukon II shoud be multiple + * of 1024. Tx/Rx RAM buffer size of Yukon II should be multiple * of 1024. */ sc->msk_rxqsize = rounddown((sc->msk_ramsize * 1024 * 2) / 3, 1024); @@ -1621,7 +1621,7 @@ msk_attach(device_t dev) */ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO; /* - * Enable Rx checksum offloading for VLAN taggedd frames + * Enable Rx checksum offloading for VLAN tagged frames * if controller support new descriptor format. */ if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && @@ -1809,7 +1809,7 @@ mskc_attach(device_t dev) * does not rely on status word of received frame * in msk_rxeof() which in turn disables all * hardware assistance bits reported by the status - * word as well as validity of the recevied frame. + * word as well as validity of the received frame. * Just pass received frames to upper stack with * minimal test and let upper stack handle them. */ @@ -2143,10 +2143,10 @@ msk_txrx_dma_alloc(struct msk_if_softc * * what DMA address is used and chain another descriptor for the * 64bits DMA operation. This also means descriptor ring size is * variable. Limiting DMA address to be in 32bit address space greatly - * simplyfies descriptor handling and possibly would increase + * simplifies descriptor handling and possibly would increase * performance a bit due to efficient handling of descriptors. * Apart from harassing checksum offloading mechanisms, it seems - * it's really bad idea to use a seperate descriptor for 64bit + * it's really bad idea to use a separate descriptor for 64bit * DMA operation to save small descriptor memory. Anyway, I've * never seen these exotic scheme on ethernet interface hardware. */ @@ -2643,7 +2643,7 @@ msk_encap(struct msk_if_softc *sc_if, st * Short UDP packets appear to be handled correctly by * Yukon II. Also I assume this bug does not happen on * controllers that use newer descriptor format or - * automatic Tx checksum calaulcation. + * automatic Tx checksum calculation. */ m = m_pullup(m, offset + sizeof(struct tcphdr)); if (m == NULL) { @@ -2780,7 +2780,7 @@ msk_encap(struct msk_if_softc *sc_if, st /* Update producer index. */ sc_if->msk_cdata.msk_tx_prod = prod; - /* Set EOP on the last desciptor. */ + /* Set EOP on the last descriptor. */ prod = (prod + MSK_TX_RING_CNT - 1) % MSK_TX_RING_CNT; tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; tx_le->msk_control |= htole32(EOP); @@ -3321,7 +3321,7 @@ msk_intr_gmac(struct msk_if_softc *sc_if * XXX * In case of Tx underrun, we may need to flush/reset * Tx MAC but that would also require resynchronization - * with status LEs. Reintializing status LEs would + * with status LEs. Reinitializing status LEs would * affect other port in dual MAC configuration so it * should be avoided as possible as we can. * Due to lack of documentation it's all vague guess but @@ -3833,7 +3833,7 @@ msk_init_locked(struct msk_if_softc *sc_ msk_setvlan(sc_if, ifp); if ((sc_if->msk_flags & MSK_FLAG_RAMBUF) == 0) { - /* Set Rx Pause threshould. */ + /* Set Rx Pause threshold. */ CSR_WRITE_2(sc, MR_ADDR(sc_if->msk_port, RX_GMF_LP_THR), MSK_ECU_LLPP); CSR_WRITE_2(sc, MR_ADDR(sc_if->msk_port, RX_GMF_UP_THR), Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/pccard/pccardvar.h Tue Nov 9 10:59:09 2010 (r215034) @@ -31,7 +31,7 @@ */ /* - * PCCARD_API_LEVEL. When set to 5, we provide a 5.x compatable API + * PCCARD_API_LEVEL. When set to 5, we provide a 5.x compatible API * for driver writers that have to share their code between 5.x and 6.x. * The 5.x compatibility interfaces will be unsupported in 7.0, at which * point we'll only support 6 and newer, etc. @@ -191,7 +191,7 @@ enum { PCCARD_IVAR_PRODEXT, PCCARD_IVAR_FUNCTION_NUMBER, PCCARD_IVAR_VENDOR_STR, /* CIS string for "Manufacturer" */ - PCCARD_IVAR_PRODUCT_STR,/* CIS strnig for "Product" */ + PCCARD_IVAR_PRODUCT_STR,/* CIS string for "Product" */ PCCARD_IVAR_CIS3_STR, PCCARD_IVAR_CIS4_STR, PCCARD_IVAR_FUNCTION, @@ -254,7 +254,7 @@ enum { #endif /* - * Defines to decoe the get_funce_disk return value. See the PCMCIA standard + * Defines to decode the get_funce_disk return value. See the PCMCIA standard * for all the details of what these bits mean. */ #define PFD_I_V_MASK 0x3 Modified: head/sys/dev/sound/sbus/cs4231.c ============================================================================== --- head/sys/dev/sound/sbus/cs4231.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/sound/sbus/cs4231.c Tue Nov 9 10:59:09 2010 (r215034) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); * for playback/capture. * Since I couldn't find any documentation for APCDMA programming * information, I guessed the usage of APCDMA from that of OpenBSD's - * driver. The EBDMA infomation of PCIO can be obtained from + * driver. The EBDMA information of PCIO can be obtained from * http://solutions.sun.com/embedded/databook/web/microprocessors/pcio.html * And CS4231A datasheet can also be obtained from * ftp://ftp.alsa-project.org/pub/manuals/cirrus/4231a.pdf @@ -1198,7 +1198,7 @@ cs4231_chan_fs(struct cs4231_softc *sc, /* * capture channel - * cs4231 doesn't allow seperate fs setup for playback/capture. + * cs4231 doesn't allow separate fs setup for playback/capture. * I believe this will break full-duplex operation. */ if (dir == PCMDIR_REC) { Modified: head/sys/dev/syscons/schistory.c ============================================================================== --- head/sys/dev/syscons/schistory.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/syscons/schistory.c Tue Nov 9 10:59:09 2010 (r215034) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); /* * XXX Placeholder. - * This calculations should be dynamically scaled by number of seperate sc + * This calculations should be dynamically scaled by number of separate sc * devices. A base value of 'extra_history_size' should be defined for * each syscons unit, and added and subtracted from the dynamic * 'extra_history_size' as units are added and removed. This way, each time @@ -86,7 +86,7 @@ int sc_alloc_history_buffer(scr_stat *scp, int lines, int prev_ysize, int wait) { /* - * syscons unconditionally allocates buffers upto + * syscons unconditionally allocates buffers up to * SC_HISTORY_SIZE lines or scp->ysize lines, whichever * is larger. A value greater than that is allowed, * subject to extra_history_size. @@ -116,7 +116,7 @@ sc_alloc_history_buffer(scr_stat *scp, i delta = cur_lines - min_lines; } - /* lines upto min_lines are always allowed. */ + /* lines up to min_lines are always allowed. */ min_lines = imax(SC_HISTORY_SIZE, scp->ysize); if (lines > min_lines) { if (lines - min_lines > extra_history_size + delta) { Modified: head/sys/dev/uart/uart_subr.c ============================================================================== --- head/sys/dev/uart/uart_subr.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/dev/uart/uart_subr.c Tue Nov 9 10:59:09 2010 (r215034) @@ -172,8 +172,8 @@ out: /* * Parse a device specification. The specification is a list of attributes - * seperated by commas. Each attribute is a tag-value pair with the tag and - * value seperated by a colon. Supported tags are: + * separated by commas. Each attribute is a tag-value pair with the tag and + * value separated by a colon. Supported tags are: * * br = Baudrate * ch = Channel Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/kern/subr_lock.c Tue Nov 9 10:59:09 2010 (r215034) @@ -170,7 +170,7 @@ SLIST_HEAD(lphead, lock_prof); /* * Array of objects and profs for each type of object for each cpu. Spinlocks - * are handled seperately because a thread may be preempted and acquire a + * are handled separately because a thread may be preempted and acquire a * spinlock while in the lock profiling code of a non-spinlock. In this way * we only need a critical section to protect the per-cpu lists. */ Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/mips/mips/vm_machdep.c Tue Nov 9 10:59:09 2010 (r215034) @@ -121,8 +121,8 @@ cpu_fork(register struct thread *td1,reg /* Copy p1's pcb, note that in this case * our pcb also includes the td_frame being copied * too. The older mips2 code did an additional copy - * of the td_frame, for us thats not needed any - * longer (this copy does them both + * of the td_frame, for us that's not needed any + * longer (this copy does them both) */ bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); @@ -312,7 +312,7 @@ cpu_set_syscall_retval(struct thread *td * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources + * Address and stack, along with those from upcalls that are from other sources * such as those generated in thread_userret() itself. */ void @@ -334,7 +334,7 @@ cpu_set_upcall(struct thread *td, struct * at this time (see the matching comment below for * more analysis) (need a good safe default). * In MIPS, the trapframe is the first element of the PCB - * and gets copied when we copy the PCB. No seperate copy + * and gets copied when we copy the PCB. No separate copy * is needed. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/netinet/sctp.h Tue Nov 9 10:59:09 2010 (r215034) @@ -108,7 +108,7 @@ struct sctp_paramhdr { #define SCTP_MAX_BURST 0x00000019 /* rw */ /* assoc level context */ #define SCTP_CONTEXT 0x0000001a /* rw */ -/* explict EOR signalling */ +/* explicit EOR signalling */ #define SCTP_EXPLICIT_EOR 0x0000001b #define SCTP_REUSE_PORT 0x0000001c /* rw */ #define SCTP_AUTH_DEACTIVATE_KEY 0x0000001d @@ -131,9 +131,9 @@ struct sctp_paramhdr { * Blocking I/O is enabled on any TCP type socket by default. For the UDP * model if this is turned on then the socket buffer is shared for send * resources amongst all associations. The default for the UDP model is that - * is SS_NBIO is set. Which means all associations have a seperate send + * is SS_NBIO is set. Which means all associations have a separate send * limit BUT they will NOT ever BLOCK instead you will get an error back - * EAGAIN if you try to send to much. If you want the blocking symantics you + * EAGAIN if you try to send too much. If you want the blocking semantics you * set this option at the cost of sharing one socket send buffer size amongst * all associations. Peeled off sockets turn this option off and block. But * since both TCP and peeled off sockets have only one assoc per socket this @@ -141,7 +141,7 @@ struct sctp_paramhdr { * model OR peeled off UDP model, but we do allow you to do so. You just use * the normal syscall to toggle SS_NBIO the way you want. * - * Blocking I/O is controled by the SS_NBIO flag on the socket state so_state + * Blocking I/O is controlled by the SS_NBIO flag on the socket state so_state * field. */ @@ -166,7 +166,7 @@ struct sctp_paramhdr { /* Special hook for dynamically setting primary for all assoc's, - * this is a write only option that requires root privledge. + * this is a write only option that requires root privilege. */ #define SCTP_SET_DYNAMIC_PRIMARY 0x00002001 @@ -181,7 +181,7 @@ struct sctp_paramhdr { * to. The endpoint, before binding, may select * the "default" VRF it is in by using a set socket * option with SCTP_VRF_ID. This will also - * get propegated to the default VRF. Once the + * get propagated to the default VRF. Once the * endpoint binds an address then it CANNOT add * additional VRF's to become a Multi-VRF endpoint. * @@ -308,7 +308,7 @@ struct sctp_paramhdr { #define SCTP_CAUSE_UNSUPPORTED_HMACID 0x0105 /* - * error cause parameters (user visisble) + * error cause parameters (user visible) */ struct sctp_error_cause { uint16_t code; Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/netinet/sctp_os_bsd.h Tue Nov 9 10:59:09 2010 (r215034) @@ -316,7 +316,7 @@ typedef struct callout sctp_os_timer_t; } /* We make it so if you have up to 4 threads - * writting based on the default size of + * writing based on the default size of * the packet log 65 k, that would be * 4 16k packets before we would hit * a problem. @@ -353,7 +353,7 @@ typedef struct callout sctp_os_timer_t; /* For BSD this just accesses the M_PKTHDR length * so it operates on an mbuf with hdr flag. Other - * O/S's may have seperate packet header and mbuf + * O/S's may have separate packet header and mbuf * chain pointers.. thus the macro. */ #define SCTP_HEADER_TO_CHAIN(m) (m) Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/netinet/sctp_pcb.c Tue Nov 9 10:59:09 2010 (r215034) @@ -107,7 +107,7 @@ sctp_fill_pcbinfo(struct sctp_pcbinfo *s * ... +--ifa-> ifa -> ifa * vrf * - * We keep these seperate lists since the SCTP subsystem will + * We keep these separate lists since the SCTP subsystem will * point to these from its source address selection nets structure. * When an address is deleted it does not happen right away on * the SCTP side, it gets scheduled. What we do when a @@ -191,7 +191,7 @@ sctp_find_ifn(void *ifn, uint32_t ifn_in struct sctp_ifnlist *hash_ifn_head; /* - * We assume the lock is held for the addresses if thats wrong + * We assume the lock is held for the addresses if that's wrong * problems could occur :-) */ hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; @@ -327,7 +327,7 @@ sctp_mark_ifa_addr_down(uint32_t vrf_id, len1 = strlen(if_name); len2 = strlen(sctp_ifap->ifn_p->ifn_name); if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different lenght %d vs %d - ignored\n", + SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", len1, len2); goto out; } @@ -380,7 +380,7 @@ sctp_mark_ifa_addr_up(uint32_t vrf_id, s len1 = strlen(if_name); len2 = strlen(sctp_ifap->ifn_p->ifn_name); if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different lenght %d vs %d - ignored\n", + SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", len1, len2); goto out; } @@ -567,7 +567,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo } else { if (sctp_ifap->ifn_p) { /* - * The last IFN gets the address, removee + * The last IFN gets the address, remove * the old one */ SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", @@ -1515,7 +1515,7 @@ sctp_endpoint_probe(struct sockaddr *nam int fnd; /* - * Endpoing probe expects that the INP_INFO is locked. + * Endpoint probe expects that the INP_INFO is locked. */ sin = NULL; #ifdef INET6 @@ -1800,7 +1800,7 @@ sctp_pcb_findep(struct sockaddr *nam, in * endpoint is gone but there exists a connected socket for this guy * yet. If so we can return the first one that we find. This may NOT * be the correct one so the caller should be wary on the return - * INP. Currently the onlyc caller that sets this flag is in bindx + * INP. Currently the only caller that sets this flag is in bindx * where we are verifying that a user CAN bind the address. He * either has bound it already, or someone else has, or its open to * bind, so this is good enough. @@ -2005,7 +2005,7 @@ sctp_findassoc_by_vtag(struct sockaddr * } if (remote_tag) { /* - * If we have both vtags thats all we match + * If we have both vtags that's all we match * on */ if (stcb->asoc.peer_vtag == remote_tag) { @@ -2183,7 +2183,7 @@ sctp_findassociation_addr(struct mbuf *m * association that is linked to an existing * association that is under the TCP pool (i.e. no * listener exists). The endpoint finding routine - * will always find a listner before examining the + * will always find a listener before examining the * TCP pool. */ if (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) { @@ -3554,7 +3554,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, SCTP_INP_INFO_WUNLOCK(); /* * Now we release all locks. Since this INP cannot be found anymore - * except possbily by the kill timer that might be running. We call + * except possibly by the kill timer that might be running. We call * the drain function here. It should hit the case were it sees the * ACTIVE flag cleared and exit out freeing us to proceed and * destroy everything. @@ -3716,7 +3716,7 @@ sctp_add_remote_addr(struct sctp_tcb *st { /* * The following is redundant to the same lines in the - * sctp_aloc_assoc() but is needed since other's call the add + * sctp_aloc_assoc() but is needed since others call the add * address function */ struct sctp_nets *net, *netfirst; @@ -4034,7 +4034,7 @@ sctp_add_remote_addr(struct sctp_tcb *st (stcb->asoc.primary_destination)) { /* * first one on the list is NOT the primary sctp_cmpaddr() - * is much more efficent if the primary is the first on the + * is much more efficient if the primary is the first on the * list, make it so. */ TAILQ_REMOVE(&stcb->asoc.nets, @@ -4176,7 +4176,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) { /* * If you have not performed a bind, then we need to do the - * ephemerial bind for you. + * ephemeral bind for you. */ if ((err = sctp_inpcb_bind(inp->sctp_socket, (struct sockaddr *)NULL, @@ -5159,7 +5159,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_INP_RUNLOCK(inp); /* * This will start the kill timer (if we are the - * lastone) since we hold an increment yet. But this + * last one) since we hold an increment yet. But this * is the only safe way to do this since otherwise * if the socket closes at the same time we are here * we might collide in the cleanup. @@ -6461,7 +6461,7 @@ sctp_set_primary_addr(struct sctp_tcb *s if (net != stcb->asoc.primary_destination) { /* * first one on the list is NOT the primary - * sctp_cmpaddr() is much more efficent if the + * sctp_cmpaddr() is much more efficient if the * primary is the first on the list, make it so. */ TAILQ_REMOVE(&stcb->asoc.nets, stcb->asoc.primary_destination, sctp_next); @@ -6676,7 +6676,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, } /* * Another issue, in un-setting the TSN's in the mapping array we - * DID NOT adjust the higest_tsn marker. This will cause one of two + * DID NOT adjust the highest_tsn marker. This will cause one of two * things to occur. It may cause us to do extra work in checking for * our mapping array movement. More importantly it may cause us to * SACK every datagram. This may not be a bad thing though since we Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/netinet/sctp_uio.h Tue Nov 9 10:59:09 2010 (r215034) @@ -80,7 +80,7 @@ struct sctp_initmsg { /* We add 96 bytes to the size of sctp_sndrcvinfo. * This makes the current structure 128 bytes long * which is nicely 64 bit aligned but also has room - * for us to add more and keep ABI compatability. + * for us to add more and keep ABI compatibility. * For example, already we have the sctp_extrcvinfo * when enabled which is 48 bytes. */ @@ -304,7 +304,7 @@ struct sctp_setadaptation { uint32_t ssb_adaptation_ind; }; -/* compatable old spelling */ +/* compatible old spelling */ struct sctp_adaption_event { uint16_t sai_type; uint16_t sai_flags; @@ -396,7 +396,7 @@ union sctp_notification { struct sctp_send_failed sn_send_failed; struct sctp_shutdown_event sn_shutdown_event; struct sctp_adaptation_event sn_adaptation_event; - /* compatability same as above */ + /* compatibility same as above */ struct sctp_adaption_event sn_adaption_event; struct sctp_pdapi_event sn_pdapi_event; struct sctp_authkey_event sn_auth_event; @@ -417,7 +417,7 @@ union sctp_notification { #define SCTP_AUTHENTICATION_EVENT 0x0008 #define SCTP_STREAM_RESET_EVENT 0x0009 #define SCTP_SENDER_DRY_EVENT 0x000a -#define SCTP__NOTIFICATIONS_STOPPED_EVENT 0x000b /* we dont send this */ +#define SCTP__NOTIFICATIONS_STOPPED_EVENT 0x000b /* we don't send this */ /* * socket option structs */ @@ -893,7 +893,7 @@ struct sctpstat { uint32_t sctps_earlyfrstrid; uint32_t sctps_earlyfrstrout; uint32_t sctps_earlyfrstrtmr; - /* otheres */ + /* others */ uint32_t sctps_hdrops; /* packet shorter than header */ uint32_t sctps_badsum; /* checksum error */ uint32_t sctps_noport; /* no endpoint for port */ @@ -904,8 +904,8 @@ struct sctpstat { * RTT window */ uint32_t sctps_markedretrans; uint32_t sctps_naglesent; /* nagle allowed sending */ - uint32_t sctps_naglequeued; /* nagle does't allow sending */ - uint32_t sctps_maxburstqueued; /* max burst dosn't allow sending */ + uint32_t sctps_naglequeued; /* nagle doesn't allow sending */ + uint32_t sctps_maxburstqueued; /* max burst doesn't allow sending */ uint32_t sctps_ifnomemqueued; /* look ahead tells us no memory in * interface ring buffer OR we had a * send error and are queuing one @@ -931,7 +931,7 @@ struct sctpstat { uint32_t sctps_wu_sacks_sent; /* Window Update only sacks sent */ uint32_t sctps_sends_with_flags; /* number of sends with * sinfo_flags !=0 */ - uint32_t sctps_sends_with_unord /* number of undordered sends */ ; + uint32_t sctps_sends_with_unord; /* number of unordered sends */ uint32_t sctps_sends_with_eof; /* number of sends with EOF flag set */ uint32_t sctps_sends_with_abort; /* number of sends with ABORT * flag set */ @@ -943,7 +943,7 @@ struct sctpstat { * with peek */ uint32_t sctps_cached_chk; /* Number of cached chunks used */ uint32_t sctps_cached_strmoq; /* Number of cached stream oq's used */ - uint32_t sctps_left_abandon; /* Number of unread message abandonded + uint32_t sctps_left_abandon; /* Number of unread messages abandoned * by close */ uint32_t sctps_send_burst_avoid; /* Unused */ uint32_t sctps_send_cwnd_avoid; /* Send cwnd full avoidance, already Modified: head/sys/security/mac_portacl/mac_portacl.c ============================================================================== --- head/sys/security/mac_portacl/mac_portacl.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/sys/security/mac_portacl/mac_portacl.c Tue Nov 9 10:59:09 2010 (r215034) @@ -133,7 +133,7 @@ struct rule { /* * Text format for the rule string is that a rule consists of a - * comma-seperated list of elements. Each element is in the form + * comma-separated list of elements. Each element is in the form * idtype:id:protocol:portnumber, and constitutes granting of permission * for the specified binding. */ Modified: head/usr.bin/seq/seq.c ============================================================================== --- head/usr.bin/seq/seq.c Tue Nov 9 10:58:19 2010 (r215033) +++ head/usr.bin/seq/seq.c Tue Nov 9 10:59:09 2010 (r215034) @@ -251,7 +251,7 @@ valid_format(const char *fmt) fmt++; break; } - /* flags, width and precsision */ + /* flags, width and precision */ if (isdigit((unsigned char)*fmt) || strchr("+- 0#.", *fmt)) continue; @@ -329,7 +329,7 @@ unescape(char *orig) *orig = c; --cp; continue; - case 'x': /* hexidecimal number */ + case 'x': /* hexadecimal number */ cp++; /* skip 'x' */ for (i = 0, c = 0; isxdigit((unsigned char)*cp) && i < 2; @@ -402,7 +402,7 @@ decimal_places(const char *number) /* * generate_format - create a format string * - * XXX to be bug for bug compatable with Plan9 and GNU return "%g" + * XXX to be bug for bug compatible with Plan9 and GNU return "%g" * when "%g" prints as "%e" (this way no width adjustments are made) */ char * Modified: head/usr.sbin/config/configvers.h ============================================================================== --- head/usr.sbin/config/configvers.h Tue Nov 9 10:58:19 2010 (r215033) +++ head/usr.sbin/config/configvers.h Tue Nov 9 10:59:09 2010 (r215034) @@ -26,7 +26,7 @@ * was a huge problem for 'make buildkernel' which was run with the installed * /usr/sbin/config, not a cross built one. We started bumping the version * number as a way to trap cases where the previous installworld was not - * compatable with the new buildkernel. The buildtools phase and much more + * compatible with the new buildkernel. The buildtools phase and much more * comprehensive error code returns solved this original problem. * * Most end-users will use buildkernel and the build tools from buildworld. From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 12:00:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0102B10656C3; Tue, 9 Nov 2010 12:00:40 +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 E4D7A8FC1E; Tue, 9 Nov 2010 12:00:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9C0d8k010934; Tue, 9 Nov 2010 12:00:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9C0dW6010932; Tue, 9 Nov 2010 12:00:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011091200.oA9C0dW6010932@svn.freebsd.org> From: Michael Tuexen Date: Tue, 9 Nov 2010 12:00: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: r215035 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 12:00:40 -0000 Author: tuexen Date: Tue Nov 9 12:00:39 2010 New Revision: 215035 URL: http://svn.freebsd.org/changeset/base/215035 Log: Fix a bug which resulted in kevent() reporting an event twice on 1-to-1 style sockets when an ABORT was received. MFC after: 3 days. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Nov 9 10:59:09 2010 (r215034) +++ head/sys/netinet/sctputil.c Tue Nov 9 12:00:39 2010 (r215035) @@ -2826,6 +2826,7 @@ sctp_notify_assoc_change(uint32_t event, } } #endif + socantrcvmore(stcb->sctp_socket); sorwakeup(stcb->sctp_socket); sowwakeup(stcb->sctp_socket); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 13:39:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A3CF106566C; Tue, 9 Nov 2010 13:39:18 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 457578FC14; Tue, 9 Nov 2010 13:39:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9DdIbU017494; Tue, 9 Nov 2010 13:39:18 GMT (envelope-from nork@svn.freebsd.org) Received: (from nork@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9DdIB3017484; Tue, 9 Nov 2010 13:39:18 GMT (envelope-from nork@svn.freebsd.org) Message-Id: <201011091339.oA9DdIB3017484@svn.freebsd.org> From: Norikatsu Shigemura Date: Tue, 9 Nov 2010 13:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215036 - in stable/8: . contrib/top etc/periodic/daily gnu/usr.bin lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/sched share/man/man4 sys/amd64/conf sys/boot/forth sys/co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 13:39:18 -0000 Author: nork Date: Tue Nov 9 13:39:17 2010 New Revision: 215036 URL: http://svn.freebsd.org/changeset/base/215036 Log: MFC 211201 Add tpm(4) driver for Trusted Platform Module. You may want to look at http://bsssd.sourceforge.net/ . Submitted by: Hans-Joerg Hoexer MFC 211204 Fix copyright information. MFC 211270 Cosmetic change for splitting bus frontend file and core file. MFC 211271 Hook tpm.4 manual to hook. MFC 212861 Add support 'device tpm' for amd64. Add tpm(4)'s default setting to /boot/defaults/loader.conf. Add 'device tpm' to NOTES for amd64 and i386. Reviewed by: takawata Discussed with: takawata Approved by: imp (mentor) Added: stable/8/share/man/man4/tpm.4 - copied, changed from r211201, head/share/man/man4/tpm.4 stable/8/sys/dev/tpm/ - copied from r211201, head/sys/dev/tpm/ stable/8/sys/modules/tpm/ - copied from r211201, head/sys/modules/tpm/ Modified: stable/8/share/man/man4/Makefile stable/8/sys/amd64/conf/NOTES stable/8/sys/boot/forth/loader.conf stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/i386/conf/NOTES stable/8/sys/modules/Makefile stable/8/sys/modules/tpm/Makefile Directory Properties: stable/8/ (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/one-true-awk/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/etc/periodic/daily/ (props changed) stable/8/etc/periodic/daily/800.scrub-zfs (props changed) stable/8/etc/periodic/security/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/etc/ (props changed) stable/8/share/examples/kld/syscall/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/mk/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/cxgbtool/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Nov 9 12:00:39 2010 (r215035) +++ stable/8/share/man/man4/Makefile Tue Nov 9 13:39:17 2010 (r215036) @@ -414,6 +414,7 @@ MAN= aac.4 \ ti.4 \ tl.4 \ tnt4882.4 \ + ${_tpm.4} \ trm.4 \ tty.4 \ tun.4 \ @@ -664,6 +665,7 @@ _padlock.4= padlock.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 _spkr.4= spkr.4 +_tpm.4= tpm.4 _urtw.4= urtw.4 _wpi.4= wpi.4 Copied and modified: stable/8/share/man/man4/tpm.4 (from r211201, head/share/man/man4/tpm.4) ============================================================================== --- head/share/man/man4/tpm.4 Thu Aug 12 00:16:18 2010 (r211201, copy source) +++ stable/8/share/man/man4/tpm.4 Tue Nov 9 13:39:17 2010 (r215036) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2010 Hans-J +.\" Copyright (c) 2010 Hans-Joerg Hoexer .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Tue Nov 9 12:00:39 2010 (r215035) +++ stable/8/sys/amd64/conf/NOTES Tue Nov 9 13:39:17 2010 (r215036) @@ -424,6 +424,7 @@ options SAFE_RNDTEST # enable rndtest s # vpd: Vital Product Data kernel interface # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card +# tpm: Trusted Platform Module # Notes on the Specialix SI/XIO driver: # The host card is memory, not IO mapped. @@ -439,6 +440,7 @@ device smbios device vpd device asmc #device si +device tpm # # Laptop/Notebook options: Modified: stable/8/sys/boot/forth/loader.conf ============================================================================== --- stable/8/sys/boot/forth/loader.conf Tue Nov 9 12:00:39 2010 (r215035) +++ stable/8/sys/boot/forth/loader.conf Tue Nov 9 13:39:17 2010 (r215036) @@ -472,6 +472,7 @@ vkbd_load="NO" # Virtual AT keyboard i vpd_load="NO" # Vital Product Data kernel interface vpo_load="NO" # Parallel to SCSI interface driver amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor +tpm_load="NO" # Trusted Platform Module ############################################################## ### ACPI settings ########################################## Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Nov 9 12:00:39 2010 (r215035) +++ stable/8/sys/conf/files.amd64 Tue Nov 9 13:39:17 2010 (r215036) @@ -230,6 +230,9 @@ dev/syscons/scvesactl.c optional sc vga dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc dev/syscons/teken/teken.c optional sc +dev/tpm/tpm.c optional tpm +dev/tpm/tpm_acpi.c optional tpm acpi +dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart dev/wpi/if_wpi.c optional wpi isa/syscons_isa.c optional sc Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Nov 9 12:00:39 2010 (r215035) +++ stable/8/sys/conf/files.i386 Tue Nov 9 13:39:17 2010 (r215036) @@ -228,6 +228,9 @@ dev/syscons/scvesactl.c optional sc vga dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc dev/syscons/teken/teken.c optional sc +dev/tpm/tpm.c optional tpm +dev/tpm/tpm_acpi.c optional tpm acpi +dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_i386.c optional uart dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Tue Nov 9 12:00:39 2010 (r215035) +++ stable/8/sys/i386/conf/NOTES Tue Nov 9 13:39:17 2010 (r215036) @@ -770,6 +770,7 @@ device glxsb # AMD Geode LX Security B # spic: Sony Programmable I/O controller (VAIO notebooks) # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card driver +# tpm: Trusted Platform Module # Notes on APM # The flags takes the following meaning for apm0: @@ -808,6 +809,7 @@ hint.spic.0.at="isa" hint.spic.0.port="0x10a0" device asmc #device si +device tpm # # Laptop/Notebook options: Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Tue Nov 9 12:00:39 2010 (r215035) +++ stable/8/sys/modules/Makefile Tue Nov 9 13:39:17 2010 (r215036) @@ -281,6 +281,7 @@ SUBDIR= ${_3dfx} \ ti \ tl \ ${_tmpfs} \ + tpm \ trm \ ${_twa} \ twe \ Modified: stable/8/sys/modules/tpm/Makefile ============================================================================== --- head/sys/modules/tpm/Makefile Thu Aug 12 00:16:18 2010 (r211201) +++ stable/8/sys/modules/tpm/Makefile Tue Nov 9 13:39:17 2010 (r215036) @@ -3,7 +3,9 @@ .PATH: ${.CURDIR}/../../dev/tpm KMOD= tpm -SRCS= tpm.c tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h \ - bus_if.h device_if.h + +SRCS= tpm.c bus_if.h device_if.h +#Bus specific stuff. +SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h .include From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 14:00:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 114D01065672; Tue, 9 Nov 2010 14:00:09 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id C55CB8FC1F; Tue, 9 Nov 2010 14:00:08 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id E606A2A28CEA; Tue, 9 Nov 2010 15:00:07 +0100 (CET) Date: Tue, 9 Nov 2010 15:00:07 +0100 From: Ed Schouten To: Bruce Cran Message-ID: <20101109140007.GJ2054@hoeg.nl> References: <201011091059.oA9Ax9id007463@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Vz5TPh7/NmvP7r6G" Content-Disposition: inline In-Reply-To: <201011091059.oA9Ax9id007463@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: r215034 - in head: libexec/tftpd sys/arm/xscale/ixp425 sys/boot/arm/ixp425/boot2 sys/dev/ata sys/dev/drm sys/dev/isp sys/dev/ixgbe sys/dev/msk sys/dev/pccard sys/dev/sound/sbus sys/dev/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 14:00:13 -0000 --Vz5TPh7/NmvP7r6G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Bruce Cran , 20101109 11:59: > - /* fail requests on the queue and any thats "in flight" for this dev= ice */ > + /* fail requests on the queue and any that's "in flight" for this de= vice */ Shouldn't it be "that are"? --=20 Ed Schouten WWW: http://80386.nl/ --Vz5TPh7/NmvP7r6G Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkzZU+cACgkQ52SDGA2eCwXXlwCeITXIIIRqECIMbdEvbdp/aWTv k+AAn0M5gdcsyGdlFl11sHxNpCLHoTmi =uI6u -----END PGP SIGNATURE----- --Vz5TPh7/NmvP7r6G-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 14:11:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBD961065679; Tue, 9 Nov 2010 14:11:09 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 653A08FC0C; Tue, 9 Nov 2010 14:11:09 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id B866AE720C; Tue, 9 Nov 2010 14:11:08 +0000 (GMT) Received: from core.nessbank (client-82-26-212-122.pete.adsl.virginmedia.com [82.26.212.122]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA; Tue, 9 Nov 2010 14:11:07 +0000 (GMT) From: Bruce Cran To: Ed Schouten Date: Tue, 9 Nov 2010 14:11:06 +0000 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.2; amd64; ; ) References: <201011091059.oA9Ax9id007463@svn.freebsd.org> <20101109140007.GJ2054@hoeg.nl> In-Reply-To: <20101109140007.GJ2054@hoeg.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201011091411.06842.bruce@cran.org.uk> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Cran Subject: Re: svn commit: r215034 - in head: libexec/tftpd sys/arm/xscale/ixp425 sys/boot/arm/ixp425/boot2 sys/dev/ata sys/dev/drm sys/dev/isp sys/dev/ixgbe sys/dev/msk sys/dev/pccard sys/dev/sound/sbus sys/dev/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 14:11:09 -0000 On Tuesday 09 November 2010 14:00:07 Ed Schouten wrote: > * Bruce Cran , 20101109 11:59: > > - /* fail requests on the queue and any thats "in flight" for this > > device */ + /* fail requests on the queue and any that's "in flight" > > for this device */ > > Shouldn't it be "that are"? Possibly. If there can only ever be one request "in flight" at a time it could also be read as "fail requests on the queue and any request that is "in flight" for this device". I'm not sure which is correct. -- Bruce Cran From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 14:53:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC2A106566B; Tue, 9 Nov 2010 14:53: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 990788FC0C; Tue, 9 Nov 2010 14:53:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9ErnEg022271; Tue, 9 Nov 2010 14:53:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9Ernek022263; Tue, 9 Nov 2010 14:53:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011091453.oA9Ernek022263@svn.freebsd.org> From: Alexander Motin Date: Tue, 9 Nov 2010 14:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215037 - in stable/8/sys: amd64/amd64 cddl/dev/cyclic/amd64 cddl/dev/cyclic/i386 i386/i386 modules/cyclic pc98/cbus sys x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 14:53:49 -0000 Author: mav Date: Tue Nov 9 14:53:49 2010 New Revision: 215037 URL: http://svn.freebsd.org/changeset/base/215037 Log: MFC r206900,r206901,r206922,r206993 by rpaulo: Rename the cyclic global variable lapic_cyclic_clock_func to just cyclic_clock_func. Deleted: stable/8/sys/cddl/dev/cyclic/amd64/ Modified: stable/8/sys/amd64/amd64/local_apic.c stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c stable/8/sys/i386/i386/local_apic.c stable/8/sys/modules/cyclic/Makefile stable/8/sys/pc98/cbus/clock.c stable/8/sys/sys/dtrace_bsd.h stable/8/sys/x86/isa/clock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/local_apic.c ============================================================================== --- stable/8/sys/amd64/amd64/local_apic.c Tue Nov 9 13:39:17 2010 (r215036) +++ stable/8/sys/amd64/amd64/local_apic.c Tue Nov 9 14:53:49 2010 (r215037) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS #include -cyclic_clock_func_t lapic_cyclic_clock_func[MAXCPU]; +cyclic_clock_func_t cyclic_clock_func[MAXCPU]; #endif /* Sanity checks on IDT vectors. */ @@ -788,8 +788,8 @@ lapic_handle_timer(struct trapframe *fra * timers. */ int cpu = PCPU_GET(cpuid); - if (lapic_cyclic_clock_func[cpu] != NULL) - (*lapic_cyclic_clock_func[cpu])(frame); + if (cyclic_clock_func[cpu] != NULL) + (*cyclic_clock_func[cpu])(frame); #endif /* Fire hardclock at hz. */ Modified: stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c ============================================================================== --- stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Tue Nov 9 13:39:17 2010 (r215036) +++ stable/8/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Tue Nov 9 14:53:49 2010 (r215037) @@ -67,7 +67,7 @@ cyclic_machdep_uninit(void) for (i = 0; i <= mp_maxid; i++) /* Reset the cyclic clock callback hook. */ - lapic_cyclic_clock_func[i] = NULL; + cyclic_clock_func[i] = NULL; /* De-register the cyclic backend. */ cyclic_uninit(); @@ -105,13 +105,13 @@ cyclic_clock(struct trapframe *frame) static void enable(cyb_arg_t arg) { /* Register the cyclic clock callback function. */ - lapic_cyclic_clock_func[curcpu] = cyclic_clock; + cyclic_clock_func[curcpu] = cyclic_clock; } static void disable(cyb_arg_t arg) { /* Reset the cyclic clock callback function. */ - lapic_cyclic_clock_func[curcpu] = NULL; + cyclic_clock_func[curcpu] = NULL; } static void reprogram(cyb_arg_t arg, hrtime_t exp) Modified: stable/8/sys/i386/i386/local_apic.c ============================================================================== --- stable/8/sys/i386/i386/local_apic.c Tue Nov 9 13:39:17 2010 (r215036) +++ stable/8/sys/i386/i386/local_apic.c Tue Nov 9 14:53:49 2010 (r215037) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS #include -cyclic_clock_func_t lapic_cyclic_clock_func[MAXCPU]; +cyclic_clock_func_t cyclic_clock_func[MAXCPU]; #endif /* Sanity checks on IDT vectors. */ @@ -790,8 +790,8 @@ lapic_handle_timer(struct trapframe *fra * timers. */ int cpu = PCPU_GET(cpuid); - if (lapic_cyclic_clock_func[cpu] != NULL) - (*lapic_cyclic_clock_func[cpu])(frame); + if (cyclic_clock_func[cpu] != NULL) + (*cyclic_clock_func[cpu])(frame); #endif /* Fire hardclock at hz. */ Modified: stable/8/sys/modules/cyclic/Makefile ============================================================================== --- stable/8/sys/modules/cyclic/Makefile Tue Nov 9 13:39:17 2010 (r215036) +++ stable/8/sys/modules/cyclic/Makefile Tue Nov 9 14:53:49 2010 (r215037) @@ -10,7 +10,7 @@ SRCS+= vnode_if.h CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \ -I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \ -I${.CURDIR}/../.. \ - -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_ARCH} + -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_ARCH:S/amd64/i386/} CFLAGS+= -DDEBUG=1 Modified: stable/8/sys/pc98/cbus/clock.c ============================================================================== --- stable/8/sys/pc98/cbus/clock.c Tue Nov 9 13:39:17 2010 (r215036) +++ stable/8/sys/pc98/cbus/clock.c Tue Nov 9 14:53:49 2010 (r215037) @@ -175,8 +175,8 @@ clkintr(struct trapframe *frame) * timers. */ int cpu = PCPU_GET(cpuid); - if (lapic_cyclic_clock_func[cpu] != NULL) - (*lapic_cyclic_clock_func[cpu])(frame); + if (cyclic_clock_func[cpu] != NULL) + (*cyclic_clock_func[cpu])(frame); #endif #ifdef SMP Modified: stable/8/sys/sys/dtrace_bsd.h ============================================================================== --- stable/8/sys/sys/dtrace_bsd.h Tue Nov 9 13:39:17 2010 (r215036) +++ stable/8/sys/sys/dtrace_bsd.h Tue Nov 9 14:53:49 2010 (r215037) @@ -50,7 +50,7 @@ typedef void (*cyclic_clock_func_t)(stru * * Defining them here avoids a proliferation of header files. */ -extern cyclic_clock_func_t lapic_cyclic_clock_func[]; +extern cyclic_clock_func_t cyclic_clock_func[]; /* * The dtrace module handles traps that occur during a DTrace probe. Modified: stable/8/sys/x86/isa/clock.c ============================================================================== --- stable/8/sys/x86/isa/clock.c Tue Nov 9 13:39:17 2010 (r215036) +++ stable/8/sys/x86/isa/clock.c Tue Nov 9 14:53:49 2010 (r215037) @@ -186,8 +186,8 @@ clkintr(struct trapframe *frame) * timers. */ int cpu = PCPU_GET(cpuid); - if (lapic_cyclic_clock_func[cpu] != NULL) - (*lapic_cyclic_clock_func[cpu])(frame); + if (cyclic_clock_func[cpu] != NULL) + (*cyclic_clock_func[cpu])(frame); #endif if (using_atrtc_timer) { From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 15:14:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A2741065674; Tue, 9 Nov 2010 15:14:11 +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 EBD298FC23; Tue, 9 Nov 2010 15:14:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9FEAUh023386; Tue, 9 Nov 2010 15:14:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9FEAa8023382; Tue, 9 Nov 2010 15:14:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011091514.oA9FEAa8023382@svn.freebsd.org> From: Alexander Motin Date: Tue, 9 Nov 2010 15:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215038 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 15:14:11 -0000 Author: mav Date: Tue Nov 9 15:14:10 2010 New Revision: 215038 URL: http://svn.freebsd.org/changeset/base/215038 Log: MFC r208436, r208438: Make table-based HPET identification more clever. Before creating fake device, make sure we have no real HPET device entry with same ID. As side effect, it potentially allows several HPETs to be attached. Use first of them for timecounting, rest (if ever present) could later be used as event sources. Modified: stable/8/sys/dev/acpica/acpi.c stable/8/sys/dev/acpica/acpi_hpet.c stable/8/sys/dev/acpica/acpivar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Tue Nov 9 14:53:49 2010 (r215037) +++ stable/8/sys/dev/acpica/acpi.c Tue Nov 9 15:14:10 2010 (r215038) @@ -143,7 +143,6 @@ static void acpi_probe_children(device_t static void acpi_probe_order(ACPI_HANDLE handle, int *order); static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status); -static BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); static void acpi_sleep_enable(void *arg); static ACPI_STATUS acpi_sleep_disable(struct acpi_softc *sc); static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); @@ -1924,7 +1923,7 @@ acpi_BatteryIsPresent(device_t dev) /* * Match a HID string against a handle */ -static BOOLEAN +BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid) { ACPI_DEVICE_INFO *devinfo; Modified: stable/8/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_hpet.c Tue Nov 9 14:53:49 2010 (r215037) +++ stable/8/sys/dev/acpica/acpi_hpet.c Tue Nov 9 15:14:10 2010 (r215038) @@ -101,41 +101,60 @@ hpet_disable(struct acpi_hpet_softc *sc) bus_write_4(sc->mem_res, HPET_CONFIG, val); } +static ACPI_STATUS +acpi_hpet_find(ACPI_HANDLE handle, UINT32 level, void *context, + void **status) +{ + char **ids; + uint32_t id = (uint32_t)(uintptr_t)context; + uint32_t uid = 0; + + for (ids = hpet_ids; *ids != NULL; ids++) { + if (acpi_MatchHid(handle, *ids)) + break; + } + if (*ids == NULL) + return (AE_OK); + if (ACPI_FAILURE(acpi_GetInteger(handle, "_UID", &uid))) + uid = 0; + if (id == uid) + *((int *)status) = 1; + return (AE_OK); +} + /* Discover the HPET via the ACPI table of the same name. */ static void acpi_hpet_identify(driver_t *driver, device_t parent) { ACPI_TABLE_HPET *hpet; - ACPI_TABLE_HEADER *hdr; ACPI_STATUS status; device_t child; + int i, found; /* Only one HPET device can be added. */ if (devclass_get_device(acpi_hpet_devclass, 0)) return; - - /* Currently, ID and minimum clock tick info is unused. */ - - status = AcpiGetTable(ACPI_SIG_HPET, 1, (ACPI_TABLE_HEADER **)&hdr); - if (ACPI_FAILURE(status)) - return; - - /* - * The unit number could be derived from hdr->Sequence but we only - * support one HPET device. - */ - hpet = (ACPI_TABLE_HPET *)hdr; - if (hpet->Sequence != 0) - printf("ACPI HPET table warning: Sequence is non-zero (%d)\n", - hpet->Sequence); - child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "acpi_hpet", 0); - if (child == NULL) { - printf("%s: can't add child\n", __func__); - return; + for (i = 1; ; i++) { + /* Search for HPET table. */ + status = AcpiGetTable(ACPI_SIG_HPET, i, (ACPI_TABLE_HEADER **)&hpet); + if (ACPI_FAILURE(status)) + return; + /* Search for HPET device with same ID. */ + found = 0; + AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + 100, acpi_hpet_find, NULL, (void *)(uintptr_t)hpet->Sequence, (void *)&found); + /* If found - let it be probed in normal way. */ + if (found) + continue; + /* If not - create it from table info. */ + child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "acpi_hpet", 0); + if (child == NULL) { + printf("%s: can't add child\n", __func__); + continue; + } + bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address, + HPET_MEM_WIDTH); } - - bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address, - HPET_MEM_WIDTH); } static int @@ -146,8 +165,7 @@ acpi_hpet_probe(device_t dev) if (acpi_disabled("hpet")) return (ENXIO); if (acpi_get_handle(dev) != NULL && - (ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL || - device_get_unit(dev) != 0)) + ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL) return (ENXIO); device_set_desc(dev, "High Precision Event Timer"); @@ -233,11 +251,12 @@ acpi_hpet_attach(device_t dev) bus_free_resource(dev, SYS_RES_MEMORY, sc->mem_res); return (ENXIO); } - - hpet_timecounter.tc_frequency = freq; - hpet_timecounter.tc_priv = sc; - tc_init(&hpet_timecounter); - + /* Announce first HPET as timecounter. */ + if (device_get_unit(dev) == 0) { + hpet_timecounter.tc_frequency = freq; + hpet_timecounter.tc_priv = sc; + tc_init(&hpet_timecounter); + } return (0); } Modified: stable/8/sys/dev/acpica/acpivar.h ============================================================================== --- stable/8/sys/dev/acpica/acpivar.h Tue Nov 9 14:53:49 2010 (r215037) +++ stable/8/sys/dev/acpica/acpivar.h Tue Nov 9 15:14:10 2010 (r215038) @@ -344,6 +344,7 @@ int acpi_bus_alloc_gas(device_t dev, in u_int flags); void acpi_walk_subtables(void *first, void *end, acpi_subtable_handler *handler, void *arg); +BOOLEAN acpi_MatchHid(ACPI_HANDLE h, const char *hid); struct acpi_parse_resource_set { void (*set_init)(device_t dev, void *arg, void **context); From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 16:18:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B696106566B; Tue, 9 Nov 2010 16:18:33 +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 EDD608FC1C; Tue, 9 Nov 2010 16:18:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9GIWxX026948; Tue, 9 Nov 2010 16:18:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9GIWpp026946; Tue, 9 Nov 2010 16:18:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011091618.oA9GIWpp026946@svn.freebsd.org> From: Michael Tuexen Date: Tue, 9 Nov 2010 16:18: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: r215039 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 16:18:33 -0000 Author: tuexen Date: Tue Nov 9 16:18:32 2010 New Revision: 215039 URL: http://svn.freebsd.org/changeset/base/215039 Log: Improve the scalability by using the local and remote port when putting inps in the tcpephash. MFC after: 3 days. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Nov 9 15:14:10 2010 (r215038) +++ head/sys/netinet/sctp_pcb.c Tue Nov 9 16:18:32 2010 (r215039) @@ -567,8 +567,8 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo } else { if (sctp_ifap->ifn_p) { /* - * The last IFN gets the address, remove - * the old one + * The last IFN gets the address, remove the + * old one */ SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", sctp_ifap, sctp_ifap->ifn_p->ifn_name, @@ -849,7 +849,7 @@ sctp_tcb_special_locate(struct sctp_inpc } else { return NULL; } - ephead = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR((lport), SCTP_BASE_INFO(hashtcpmark))]; + ephead = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR((lport | rport), SCTP_BASE_INFO(hashtcpmark))]; /* * Ok now for each of the guys in this bucket we must look and see: * - Does the remote port match. - Does there single association's @@ -1771,6 +1771,7 @@ sctp_pcb_findep(struct sockaddr *nam, in struct sockaddr_in *sin; struct sockaddr_in6 *sin6; int lport; + unsigned int i; if (nam->sa_family == AF_INET) { sin = (struct sockaddr_in *)nam; @@ -1797,17 +1798,22 @@ sctp_pcb_findep(struct sockaddr *nam, in /* * If the TCP model exists it could be that the main listening - * endpoint is gone but there exists a connected socket for this guy - * yet. If so we can return the first one that we find. This may NOT - * be the correct one so the caller should be wary on the return - * INP. Currently the only caller that sets this flag is in bindx - * where we are verifying that a user CAN bind the address. He - * either has bound it already, or someone else has, or its open to - * bind, so this is good enough. + * endpoint is gone but there still exists a connected socket for + * this guy. If so we can return the first one that we find. This + * may NOT be the correct one so the caller should be wary on the + * returned INP. Currently the only caller that sets find_tcp_pool + * is in bindx where we are verifying that a user CAN bind the + * address. He either has bound it already, or someone else has, or + * its open to bind, so this is good enough. */ if (inp == NULL && find_tcp_pool) { - head = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR(lport, SCTP_BASE_INFO(hashtcpmark))]; - inp = sctp_endpoint_probe(nam, head, lport, vrf_id); + for (i = 0; i < SCTP_BASE_INFO(hashtcpmark) + 1; i++) { + head = &SCTP_BASE_INFO(sctp_tcpephash)[i]; + inp = sctp_endpoint_probe(nam, head, lport, vrf_id); + if (inp) { + break; + } + } } if (inp) { SCTP_INP_INCR_REF(inp); @@ -2603,8 +2609,7 @@ sctp_move_pcb_and_assoc(struct sctp_inpc LIST_REMOVE(stcb, sctp_tcbasocidhash); } /* Now insert the new_inp into the TCP connected hash */ - head = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR((lport), - SCTP_BASE_INFO(hashtcpmark))]; + head = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR((lport | rport), SCTP_BASE_INFO(hashtcpmark))]; LIST_INSERT_HEAD(head, new_inp, sctp_hash); /* Its safe to access */ @@ -3089,12 +3094,10 @@ continue_anyway: /* find the bucket */ if (port_reuse_active) { /* Put it into tcp 1-2-1 hash */ - head = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR((lport), - SCTP_BASE_INFO(hashtcpmark))]; + head = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR(lport, SCTP_BASE_INFO(hashtcpmark))]; inp->sctp_flags |= SCTP_PCB_FLAGS_IN_TCPPOOL; } else { - head = &SCTP_BASE_INFO(sctp_ephash)[SCTP_PCBHASH_ALLADDR(lport, - SCTP_BASE_INFO(hashmark))]; + head = &SCTP_BASE_INFO(sctp_ephash)[SCTP_PCBHASH_ALLADDR(lport, SCTP_BASE_INFO(hashmark))]; } /* put it in the bucket */ LIST_INSERT_HEAD(head, inp, sctp_hash); @@ -3716,8 +3719,8 @@ sctp_add_remote_addr(struct sctp_tcb *st { /* * The following is redundant to the same lines in the - * sctp_aloc_assoc() but is needed since others call the add - * address function + * sctp_aloc_assoc() but is needed since others call the add address + * function */ struct sctp_nets *net, *netfirst; int addr_inscope; @@ -5159,10 +5162,10 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_INP_RUNLOCK(inp); /* * This will start the kill timer (if we are the - * last one) since we hold an increment yet. But this - * is the only safe way to do this since otherwise - * if the socket closes at the same time we are here - * we might collide in the cleanup. + * last one) since we hold an increment yet. But + * this is the only safe way to do this since + * otherwise if the socket closes at the same time + * we are here we might collide in the cleanup. */ sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE, @@ -6676,12 +6679,12 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, } /* * Another issue, in un-setting the TSN's in the mapping array we - * DID NOT adjust the highest_tsn marker. This will cause one of two - * things to occur. It may cause us to do extra work in checking for - * our mapping array movement. More importantly it may cause us to - * SACK every datagram. This may not be a bad thing though since we - * will recover once we get our cum-ack above and all this stuff we - * dumped recovered. + * DID NOT adjust the highest_tsn marker. This will cause one of + * two things to occur. It may cause us to do extra work in checking + * for our mapping array movement. More importantly it may cause us + * to SACK every datagram. This may not be a bad thing though since + * we will recover once we get our cum-ack above and all this stuff + * we dumped recovered. */ } From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 18:28:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20F56106566C; Tue, 9 Nov 2010 18:28:12 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E51B8FC1E; Tue, 9 Nov 2010 18:28:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9ISCfn033684; Tue, 9 Nov 2010 18:28:12 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9ISC42033681; Tue, 9 Nov 2010 18:28:12 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201011091828.oA9ISC42033681@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 9 Nov 2010 18:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215040 - head/usr.bin/lex X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 18:28:12 -0000 Author: uqs Date: Tue Nov 9 18:28:11 2010 New Revision: 215040 URL: http://svn.freebsd.org/changeset/base/215040 Log: Unbreak the test target by re-generating the initial scanner using an updated flex(1) binary. Also ignore the changing $FreeBSD$ ID lines when doing the diff. This needs additional obfuscation, to not upset the svn precommit hooks :/ Modified: head/usr.bin/lex/Makefile head/usr.bin/lex/initscan.c Modified: head/usr.bin/lex/Makefile ============================================================================== --- head/usr.bin/lex/Makefile Tue Nov 9 16:18:32 2010 (r215039) +++ head/usr.bin/lex/Makefile Tue Nov 9 18:28:11 2010 (r215040) @@ -44,7 +44,7 @@ test: check check: $(PROG) ./$(PROG) $(LFLAGS) -t $(COMPRESSION) $(.CURDIR)/scan.l \ | sed s,\"$(.CURDIR)/scan.l",\"scan.l", \ - | diff $(.CURDIR)/initscan.c - + | diff -I '\$$FreeBS[D]:.*\$$' $(.CURDIR)/initscan.c - @echo "Check successful" .include Modified: head/usr.bin/lex/initscan.c ============================================================================== --- head/usr.bin/lex/initscan.c Tue Nov 9 16:18:32 2010 (r215039) +++ head/usr.bin/lex/initscan.c Tue Nov 9 18:28:11 2010 (r215040) @@ -3,9 +3,15 @@ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + * $FreeBSD$ */ + +#if defined(__FreeBSD__) #include -__FBSDID("$FreeBSD$"); +#else +#define __unused +#define __dead2 +#endif #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 @@ -243,7 +249,7 @@ YY_BUFFER_STATE yy_scan_string YY_PROTO( YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) __unused; static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer @@ -273,7 +279,7 @@ extern char *yytext; static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )) __dead2; /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -1273,11 +1279,7 @@ char *yytext; */ /* $Header: /home/daffy/u0/vern/flex/RCS/scan.l,v 2.56 95/04/24 12:17:19 vern Exp $ */ - -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +/* $FreeBSD$ */ #include "flexdef.h" #include "parse.h" @@ -1336,7 +1338,7 @@ static const char rcsid[] = #define OPTION 17 #define LINEDIR 18 -#line 1333 "scan.c" +#line 1342 "scan.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1490,7 +1492,7 @@ YY_DECL char *yy_cp, *yy_bp; int yy_act; -#line 94 "scan.l" +#line 95 "scan.l" static int bracelevel, didadef, indented_code; static int doing_rule_action = false; @@ -1501,7 +1503,7 @@ YY_DECL Char nmdef[MAXLINE], myesc(); -#line 1498 "scan.c" +#line 1507 "scan.c" if ( yy_init ) { @@ -1588,32 +1590,32 @@ do_action: /* This label is used only to case 1: YY_RULE_SETUP -#line 105 "scan.l" +#line 106 "scan.l" indented_code = true; BEGIN(CODEBLOCK); YY_BREAK case 2: YY_RULE_SETUP -#line 106 "scan.l" +#line 107 "scan.l" ACTION_ECHO; yy_push_state( COMMENT ); YY_BREAK case 3: YY_RULE_SETUP -#line 107 "scan.l" +#line 108 "scan.l" yy_push_state( LINEDIR ); YY_BREAK case 4: YY_RULE_SETUP -#line 108 "scan.l" +#line 109 "scan.l" return SCDECL; YY_BREAK case 5: YY_RULE_SETUP -#line 109 "scan.l" +#line 110 "scan.l" return XSCDECL; YY_BREAK case 6: YY_RULE_SETUP -#line 110 "scan.l" +#line 111 "scan.l" { ++linenum; line_directive_out( (FILE *) 0, 1 ); @@ -1623,12 +1625,12 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 117 "scan.l" +#line 118 "scan.l" /* discard */ YY_BREAK case 8: YY_RULE_SETUP -#line 119 "scan.l" +#line 120 "scan.l" { sectnum = 2; bracelevel = 0; @@ -1640,37 +1642,37 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 128 "scan.l" +#line 129 "scan.l" yytext_is_array = false; ++linenum; YY_BREAK case 10: YY_RULE_SETUP -#line 129 "scan.l" +#line 130 "scan.l" yytext_is_array = true; ++linenum; YY_BREAK case 11: YY_RULE_SETUP -#line 131 "scan.l" +#line 132 "scan.l" BEGIN(OPTION); return OPTION_OP; YY_BREAK case 12: YY_RULE_SETUP -#line 133 "scan.l" +#line 134 "scan.l" ++linenum; /* ignore */ YY_BREAK case 13: YY_RULE_SETUP -#line 134 "scan.l" +#line 135 "scan.l" ++linenum; /* ignore */ YY_BREAK case 14: YY_RULE_SETUP -#line 136 "scan.l" +#line 137 "scan.l" synerr( _( "unrecognized '%' directive" ) ); YY_BREAK case 15: YY_RULE_SETUP -#line 138 "scan.l" +#line 139 "scan.l" { strcpy( nmstr, yytext ); didadef = false; @@ -1679,56 +1681,56 @@ YY_RULE_SETUP YY_BREAK case 16: YY_RULE_SETUP -#line 144 "scan.l" +#line 145 "scan.l" RETURNNAME; YY_BREAK case 17: YY_RULE_SETUP -#line 145 "scan.l" +#line 146 "scan.l" ++linenum; /* allows blank lines in section 1 */ YY_BREAK case 18: YY_RULE_SETUP -#line 146 "scan.l" +#line 147 "scan.l" ACTION_ECHO; ++linenum; /* maybe end of comment line */ YY_BREAK case 19: YY_RULE_SETUP -#line 151 "scan.l" +#line 152 "scan.l" ACTION_ECHO; yy_pop_state(); YY_BREAK case 20: YY_RULE_SETUP -#line 152 "scan.l" +#line 153 "scan.l" ACTION_ECHO; YY_BREAK case 21: YY_RULE_SETUP -#line 153 "scan.l" +#line 154 "scan.l" ACTION_ECHO; YY_BREAK case 22: YY_RULE_SETUP -#line 154 "scan.l" +#line 155 "scan.l" ++linenum; ACTION_ECHO; YY_BREAK case 23: YY_RULE_SETUP -#line 158 "scan.l" +#line 159 "scan.l" yy_pop_state(); YY_BREAK case 24: YY_RULE_SETUP -#line 159 "scan.l" +#line 160 "scan.l" linenum = myctoi( yytext ); YY_BREAK case 25: YY_RULE_SETUP -#line 161 "scan.l" +#line 162 "scan.l" { flex_free( (void *) infilename ); infilename = copy_string( yytext + 1 ); @@ -1737,24 +1739,24 @@ YY_RULE_SETUP YY_BREAK case 26: YY_RULE_SETUP -#line 166 "scan.l" +#line 167 "scan.l" /* ignore spurious characters */ YY_BREAK case 27: YY_RULE_SETUP -#line 170 "scan.l" +#line 171 "scan.l" ++linenum; BEGIN(INITIAL); YY_BREAK case 28: YY_RULE_SETUP -#line 172 "scan.l" +#line 173 "scan.l" ACTION_ECHO; YY_BREAK case 29: YY_RULE_SETUP -#line 174 "scan.l" +#line 175 "scan.l" { ++linenum; ACTION_ECHO; @@ -1766,12 +1768,12 @@ YY_RULE_SETUP case 30: YY_RULE_SETUP -#line 184 "scan.l" +#line 185 "scan.l" /* separates name and definition */ YY_BREAK case 31: YY_RULE_SETUP -#line 186 "scan.l" +#line 187 "scan.l" { strcpy( (char *) nmdef, yytext ); @@ -1789,7 +1791,7 @@ YY_RULE_SETUP YY_BREAK case 32: YY_RULE_SETUP -#line 201 "scan.l" +#line 202 "scan.l" { if ( ! didadef ) synerr( _( "incomplete name definition" ) ); @@ -1801,94 +1803,94 @@ YY_RULE_SETUP case 33: YY_RULE_SETUP -#line 211 "scan.l" +#line 212 "scan.l" ++linenum; BEGIN(INITIAL); YY_BREAK case 34: YY_RULE_SETUP -#line 212 "scan.l" +#line 213 "scan.l" option_sense = true; YY_BREAK case 35: YY_RULE_SETUP -#line 214 "scan.l" +#line 215 "scan.l" return '='; YY_BREAK case 36: YY_RULE_SETUP -#line 216 "scan.l" +#line 217 "scan.l" option_sense = ! option_sense; YY_BREAK case 37: YY_RULE_SETUP -#line 218 "scan.l" +#line 219 "scan.l" csize = option_sense ? 128 : 256; YY_BREAK case 38: YY_RULE_SETUP -#line 219 "scan.l" +#line 220 "scan.l" csize = option_sense ? 256 : 128; YY_BREAK case 39: YY_RULE_SETUP -#line 221 "scan.l" +#line 222 "scan.l" long_align = option_sense; YY_BREAK case 40: YY_RULE_SETUP -#line 222 "scan.l" +#line 223 "scan.l" { action_define( "YY_ALWAYS_INTERACTIVE", option_sense ); } YY_BREAK case 41: YY_RULE_SETUP -#line 225 "scan.l" +#line 226 "scan.l" yytext_is_array = option_sense; YY_BREAK case 42: YY_RULE_SETUP -#line 226 "scan.l" +#line 227 "scan.l" backing_up_report = option_sense; YY_BREAK case 43: YY_RULE_SETUP -#line 227 "scan.l" +#line 228 "scan.l" interactive = ! option_sense; YY_BREAK case 44: YY_RULE_SETUP -#line 228 "scan.l" +#line 229 "scan.l" C_plus_plus = option_sense; YY_BREAK case 45: YY_RULE_SETUP -#line 229 "scan.l" +#line 230 "scan.l" caseins = ! option_sense; YY_BREAK case 46: YY_RULE_SETUP -#line 230 "scan.l" +#line 231 "scan.l" caseins = option_sense; YY_BREAK case 47: YY_RULE_SETUP -#line 231 "scan.l" +#line 232 "scan.l" ddebug = option_sense; YY_BREAK case 48: YY_RULE_SETUP -#line 232 "scan.l" +#line 233 "scan.l" spprdflt = ! option_sense; YY_BREAK case 49: YY_RULE_SETUP -#line 233 "scan.l" +#line 234 "scan.l" useecs = option_sense; YY_BREAK case 50: YY_RULE_SETUP -#line 234 "scan.l" +#line 235 "scan.l" { useecs = usemecs = false; use_read = fullspd = true; @@ -1896,7 +1898,7 @@ YY_RULE_SETUP YY_BREAK case 51: YY_RULE_SETUP -#line 238 "scan.l" +#line 239 "scan.l" { useecs = usemecs = false; use_read = fulltbl = true; @@ -1904,22 +1906,22 @@ YY_RULE_SETUP YY_BREAK case 52: YY_RULE_SETUP -#line 242 "scan.l" +#line 243 "scan.l" ACTION_IFDEF("YY_NO_INPUT", ! option_sense); YY_BREAK case 53: YY_RULE_SETUP -#line 243 "scan.l" +#line 244 "scan.l" interactive = option_sense; YY_BREAK case 54: YY_RULE_SETUP -#line 244 "scan.l" +#line 245 "scan.l" lex_compat = option_sense; YY_BREAK case 55: YY_RULE_SETUP -#line 245 "scan.l" +#line 246 "scan.l" { action_define( "YY_MAIN", option_sense ); do_yywrap = ! option_sense; @@ -1927,129 +1929,129 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 249 "scan.l" +#line 250 "scan.l" usemecs = option_sense; YY_BREAK case 57: YY_RULE_SETUP -#line 250 "scan.l" +#line 251 "scan.l" { action_define( "YY_NEVER_INTERACTIVE", option_sense ); } YY_BREAK case 58: YY_RULE_SETUP -#line 253 "scan.l" +#line 254 "scan.l" performance_report += option_sense ? 1 : -1; YY_BREAK case 59: YY_RULE_SETUP -#line 254 "scan.l" +#line 255 "scan.l" yytext_is_array = ! option_sense; YY_BREAK case 60: YY_RULE_SETUP -#line 255 "scan.l" +#line 256 "scan.l" use_read = option_sense; YY_BREAK case 61: YY_RULE_SETUP -#line 256 "scan.l" +#line 257 "scan.l" reject_really_used = option_sense; YY_BREAK case 62: YY_RULE_SETUP -#line 257 "scan.l" +#line 258 "scan.l" action_define( "YY_STACK_USED", option_sense ); YY_BREAK case 63: YY_RULE_SETUP -#line 258 "scan.l" +#line 259 "scan.l" do_stdinit = option_sense; YY_BREAK case 64: YY_RULE_SETUP -#line 259 "scan.l" +#line 260 "scan.l" use_stdout = option_sense; YY_BREAK case 65: YY_RULE_SETUP -#line 260 "scan.l" +#line 261 "scan.l" ACTION_IFDEF("YY_NO_UNPUT", ! option_sense); YY_BREAK case 66: YY_RULE_SETUP -#line 261 "scan.l" +#line 262 "scan.l" printstats = option_sense; YY_BREAK case 67: YY_RULE_SETUP -#line 262 "scan.l" +#line 263 "scan.l" nowarn = ! option_sense; YY_BREAK case 68: YY_RULE_SETUP -#line 263 "scan.l" +#line 264 "scan.l" do_yylineno = option_sense; YY_BREAK case 69: YY_RULE_SETUP -#line 264 "scan.l" +#line 265 "scan.l" yymore_really_used = option_sense; YY_BREAK case 70: YY_RULE_SETUP -#line 265 "scan.l" +#line 266 "scan.l" do_yywrap = option_sense; YY_BREAK case 71: YY_RULE_SETUP -#line 267 "scan.l" +#line 268 "scan.l" ACTION_IFDEF("YY_NO_PUSH_STATE", ! option_sense); YY_BREAK case 72: YY_RULE_SETUP -#line 268 "scan.l" +#line 269 "scan.l" ACTION_IFDEF("YY_NO_POP_STATE", ! option_sense); YY_BREAK case 73: YY_RULE_SETUP -#line 269 "scan.l" +#line 270 "scan.l" ACTION_IFDEF("YY_NO_TOP_STATE", ! option_sense); YY_BREAK case 74: YY_RULE_SETUP -#line 271 "scan.l" +#line 272 "scan.l" ACTION_IFDEF("YY_NO_SCAN_BUFFER", ! option_sense); YY_BREAK case 75: YY_RULE_SETUP -#line 272 "scan.l" +#line 273 "scan.l" ACTION_IFDEF("YY_NO_SCAN_BYTES", ! option_sense); YY_BREAK case 76: YY_RULE_SETUP -#line 273 "scan.l" +#line 274 "scan.l" ACTION_IFDEF("YY_NO_SCAN_STRING", ! option_sense); YY_BREAK case 77: YY_RULE_SETUP -#line 275 "scan.l" +#line 276 "scan.l" return OPT_OUTFILE; YY_BREAK case 78: YY_RULE_SETUP -#line 276 "scan.l" +#line 277 "scan.l" return OPT_PREFIX; YY_BREAK case 79: YY_RULE_SETUP -#line 277 "scan.l" +#line 278 "scan.l" return OPT_YYCLASS; YY_BREAK case 80: YY_RULE_SETUP -#line 279 "scan.l" +#line 280 "scan.l" { strcpy( nmstr, yytext + 1 ); nmstr[strlen( nmstr ) - 1] = '\0'; @@ -2058,7 +2060,7 @@ YY_RULE_SETUP YY_BREAK case 81: YY_RULE_SETUP -#line 285 "scan.l" +#line 286 "scan.l" { format_synerr( _( "unrecognized %%option: %s" ), yytext ); @@ -2068,28 +2070,28 @@ YY_RULE_SETUP case 82: YY_RULE_SETUP -#line 292 "scan.l" +#line 293 "scan.l" ++linenum; BEGIN(INITIAL); YY_BREAK case 83: YY_RULE_SETUP -#line 296 "scan.l" +#line 297 "scan.l" ++bracelevel; yyless( 2 ); /* eat only %{ */ YY_BREAK case 84: YY_RULE_SETUP -#line 297 "scan.l" +#line 298 "scan.l" --bracelevel; yyless( 2 ); /* eat only %} */ YY_BREAK case 85: YY_RULE_SETUP -#line 299 "scan.l" +#line 300 "scan.l" ACTION_ECHO; /* indented code in prolog */ YY_BREAK case 86: YY_RULE_SETUP -#line 301 "scan.l" +#line 302 "scan.l" { /* non-indented code */ if ( bracelevel <= 0 ) { /* not in %{ ... %} */ @@ -2104,16 +2106,16 @@ YY_RULE_SETUP YY_BREAK case 87: YY_RULE_SETUP -#line 313 "scan.l" +#line 314 "scan.l" ACTION_ECHO; YY_BREAK case 88: YY_RULE_SETUP -#line 314 "scan.l" +#line 315 "scan.l" ++linenum; ACTION_ECHO; YY_BREAK case YY_STATE_EOF(SECT2PROLOG): -#line 316 "scan.l" +#line 317 "scan.l" { mark_prolog(); sectnum = 0; @@ -2124,12 +2126,12 @@ case YY_STATE_EOF(SECT2PROLOG): case 89: YY_RULE_SETUP -#line 324 "scan.l" +#line 325 "scan.l" ++linenum; /* allow blank lines in section 2 */ YY_BREAK case 90: YY_RULE_SETUP -#line 326 "scan.l" +#line 327 "scan.l" { indented_code = false; doing_codeblock = true; @@ -2139,17 +2141,17 @@ YY_RULE_SETUP YY_BREAK case 91: YY_RULE_SETUP -#line 333 "scan.l" +#line 334 "scan.l" BEGIN(SC); return '<'; YY_BREAK case 92: YY_RULE_SETUP -#line 334 "scan.l" +#line 335 "scan.l" return '^'; YY_BREAK case 93: YY_RULE_SETUP -#line 335 "scan.l" +#line 336 "scan.l" BEGIN(QUOTE); return '"'; YY_BREAK case 94: @@ -2157,7 +2159,7 @@ case 94: yy_c_buf_p = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 336 "scan.l" +#line 337 "scan.l" BEGIN(NUM); return '{'; YY_BREAK case 95: @@ -2165,12 +2167,12 @@ case 95: yy_c_buf_p = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 337 "scan.l" +#line 338 "scan.l" return '$'; YY_BREAK case 96: YY_RULE_SETUP -#line 339 "scan.l" +#line 340 "scan.l" { bracelevel = 1; BEGIN(PERCENT_BRACE_ACTION); @@ -2185,12 +2187,12 @@ YY_RULE_SETUP YY_BREAK case 97: YY_RULE_SETUP -#line 350 "scan.l" +#line 351 "scan.l" continued_action = true; ++linenum; return '\n'; YY_BREAK case 98: YY_RULE_SETUP -#line 352 "scan.l" +#line 353 "scan.l" { yyless( yyleng - 2 ); /* put back '/', '*' */ bracelevel = 0; @@ -2200,12 +2202,12 @@ YY_RULE_SETUP YY_BREAK case 99: YY_RULE_SETUP -#line 359 "scan.l" +#line 360 "scan.l" /* allow indented rules */ YY_BREAK case 100: YY_RULE_SETUP -#line 361 "scan.l" +#line 362 "scan.l" { /* This rule is separate from the one below because * otherwise we get variable trailing context, so @@ -2225,7 +2227,7 @@ YY_RULE_SETUP YY_BREAK case 101: YY_RULE_SETUP -#line 378 "scan.l" +#line 379 "scan.l" { bracelevel = 0; continued_action = false; @@ -2241,15 +2243,15 @@ YY_RULE_SETUP } YY_BREAK case 102: -#line 393 "scan.l" +#line 394 "scan.l" case 103: YY_RULE_SETUP -#line 393 "scan.l" +#line 394 "scan.l" return EOF_OP; YY_BREAK case 104: YY_RULE_SETUP -#line 395 "scan.l" +#line 396 "scan.l" { sectnum = 3; BEGIN(SECT3); @@ -2258,7 +2260,7 @@ YY_RULE_SETUP YY_BREAK case 105: YY_RULE_SETUP -#line 401 "scan.l" +#line 402 "scan.l" { int cclval; @@ -2295,7 +2297,7 @@ YY_RULE_SETUP YY_BREAK case 106: YY_RULE_SETUP -#line 435 "scan.l" +#line 436 "scan.l" { Char *nmdefptr; Char *ndlookup(); @@ -2332,24 +2334,24 @@ YY_RULE_SETUP YY_BREAK case 107: YY_RULE_SETUP -#line 469 "scan.l" +#line 470 "scan.l" return (unsigned char) yytext[0]; YY_BREAK case 108: YY_RULE_SETUP -#line 470 "scan.l" +#line 471 "scan.l" RETURNCHAR; YY_BREAK case 109: YY_RULE_SETUP -#line 475 "scan.l" +#line 476 "scan.l" return (unsigned char) yytext[0]; YY_BREAK case 110: YY_RULE_SETUP -#line 476 "scan.l" +#line 477 "scan.l" BEGIN(SECT2); return '>'; YY_BREAK case 111: @@ -2357,17 +2359,17 @@ case 111: yy_c_buf_p = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 477 "scan.l" +#line 478 "scan.l" BEGIN(CARETISBOL); return '>'; YY_BREAK case 112: YY_RULE_SETUP -#line 478 "scan.l" +#line 479 "scan.l" RETURNNAME; YY_BREAK case 113: YY_RULE_SETUP -#line 479 "scan.l" +#line 480 "scan.l" { format_synerr( _( "bad : %s" ), yytext ); @@ -2376,23 +2378,23 @@ YY_RULE_SETUP case 114: YY_RULE_SETUP -#line 485 "scan.l" +#line 486 "scan.l" BEGIN(SECT2); return '^'; YY_BREAK case 115: YY_RULE_SETUP -#line 489 "scan.l" +#line 490 "scan.l" RETURNCHAR; YY_BREAK case 116: YY_RULE_SETUP -#line 490 "scan.l" +#line 491 "scan.l" BEGIN(SECT2); return '"'; YY_BREAK case 117: YY_RULE_SETUP -#line 492 "scan.l" +#line 493 "scan.l" { synerr( _( "missing quote" ) ); BEGIN(SECT2); @@ -2407,7 +2409,7 @@ case 118: yy_c_buf_p = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 502 "scan.l" +#line 503 "scan.l" BEGIN(CCL); return '^'; YY_BREAK case 119: @@ -2415,12 +2417,12 @@ case 119: yy_c_buf_p = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 503 "scan.l" +#line 504 "scan.l" return '^'; YY_BREAK case 120: YY_RULE_SETUP -#line 504 "scan.l" +#line 505 "scan.l" BEGIN(CCL); RETURNCHAR; YY_BREAK @@ -2430,22 +2432,22 @@ case 121: yy_c_buf_p = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 508 "scan.l" +#line 509 "scan.l" return '-'; YY_BREAK case 122: YY_RULE_SETUP -#line 509 "scan.l" +#line 510 "scan.l" RETURNCHAR; YY_BREAK case 123: YY_RULE_SETUP -#line 510 "scan.l" +#line 511 "scan.l" BEGIN(SECT2); return ']'; YY_BREAK case 124: YY_RULE_SETUP -#line 511 "scan.l" +#line 512 "scan.l" { synerr( _( "bad character class" ) ); BEGIN(SECT2); @@ -2456,67 +2458,67 @@ YY_RULE_SETUP case 125: YY_RULE_SETUP -#line 519 "scan.l" +#line 520 "scan.l" BEGIN(CCL); return CCE_ALNUM; YY_BREAK case 126: YY_RULE_SETUP -#line 520 "scan.l" +#line 521 "scan.l" BEGIN(CCL); return CCE_ALPHA; YY_BREAK case 127: YY_RULE_SETUP -#line 521 "scan.l" +#line 522 "scan.l" BEGIN(CCL); return CCE_BLANK; YY_BREAK case 128: YY_RULE_SETUP -#line 522 "scan.l" +#line 523 "scan.l" BEGIN(CCL); return CCE_CNTRL; YY_BREAK case 129: YY_RULE_SETUP -#line 523 "scan.l" +#line 524 "scan.l" BEGIN(CCL); return CCE_DIGIT; YY_BREAK case 130: YY_RULE_SETUP -#line 524 "scan.l" +#line 525 "scan.l" BEGIN(CCL); return CCE_GRAPH; YY_BREAK case 131: YY_RULE_SETUP -#line 525 "scan.l" +#line 526 "scan.l" BEGIN(CCL); return CCE_LOWER; YY_BREAK case 132: YY_RULE_SETUP -#line 526 "scan.l" +#line 527 "scan.l" BEGIN(CCL); return CCE_PRINT; YY_BREAK case 133: YY_RULE_SETUP -#line 527 "scan.l" +#line 528 "scan.l" BEGIN(CCL); return CCE_PUNCT; YY_BREAK case 134: YY_RULE_SETUP -#line 528 "scan.l" +#line 529 "scan.l" BEGIN(CCL); return CCE_SPACE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 18:32:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 902F1106564A; Tue, 9 Nov 2010 18:32:57 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CAE18FC26; Tue, 9 Nov 2010 18:32:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9IWv3U034113; Tue, 9 Nov 2010 18:32:57 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9IWvCo034092; Tue, 9 Nov 2010 18:32:57 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201011091832.oA9IWvCo034092@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 9 Nov 2010 18:32: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: r215041 - head/contrib/bzip2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 18:32:57 -0000 Author: obrien Date: Tue Nov 9 18:32:57 2010 New Revision: 215041 URL: http://svn.freebsd.org/changeset/base/215041 Log: Upgrade to Bzip2 version 1.0.6. Reviewed by: SO (cperciva) Modified: head/contrib/bzip2/CHANGES head/contrib/bzip2/LICENSE head/contrib/bzip2/Makefile head/contrib/bzip2/Makefile-libbz2_so head/contrib/bzip2/README head/contrib/bzip2/README.COMPILATION.PROBLEMS head/contrib/bzip2/blocksort.c head/contrib/bzip2/bzip2.1 head/contrib/bzip2/bzip2.c head/contrib/bzip2/bzip2recover.c head/contrib/bzip2/bzlib.c head/contrib/bzip2/bzlib.h head/contrib/bzip2/bzlib_private.h head/contrib/bzip2/compress.c head/contrib/bzip2/crctable.c head/contrib/bzip2/decompress.c head/contrib/bzip2/huffman.c head/contrib/bzip2/randtable.c head/contrib/bzip2/spewG.c head/contrib/bzip2/unzcrash.c Directory Properties: head/contrib/bzip2/ (props changed) Modified: head/contrib/bzip2/CHANGES ============================================================================== --- head/contrib/bzip2/CHANGES Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/CHANGES Tue Nov 9 18:32:57 2010 (r215041) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -317,3 +317,11 @@ Fixes some minor bugs since the last ver ~~~~~~~~~~~~~~~~~ Security fix only. Fixes CERT-FI 20469 as it applies to bzip2. + +1.0.6 (6 Sept 10) +~~~~~~~~~~~~~~~~~ + +* Security fix for CVE-2010-0405. This was reported by Mikolaj + Izdebski. + +* Make the documentation build on Ubuntu 10.04 Modified: head/contrib/bzip2/LICENSE ============================================================================== --- head/contrib/bzip2/LICENSE Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/LICENSE Tue Nov 9 18:32:57 2010 (r215041) @@ -2,7 +2,7 @@ -------------------------------------------------------------------------- This program, "bzip2", the associated library "libbzip2", and all -documentation, are copyright (C) 1996-2007 Julian R Seward. All +documentation, are copyright (C) 1996-2010 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -37,6 +37,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.5 of 10 December 2007 +bzip2/libbzip2 version 1.0.6 of 6 September 2010 -------------------------------------------------------------------------- Modified: head/contrib/bzip2/Makefile ============================================================================== --- head/contrib/bzip2/Makefile Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/Makefile Tue Nov 9 18:32:57 2010 (r215041) @@ -2,8 +2,8 @@ # This file is part of bzip2/libbzip2, a program and library for # lossless, block-sorting data compression. # -# bzip2/libbzip2 version 1.0.5 of 10 December 2007 -# Copyright (C) 1996-2007 Julian Seward +# bzip2/libbzip2 version 1.0.6 of 6 September 2010 +# Copyright (C) 1996-2010 Julian Seward # # Please read the WARNING, DISCLAIMER and PATENTS sections in the # README file. @@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c distclean: clean rm -f manual.ps manual.html manual.pdf -DISTNAME=bzip2-1.0.5 +DISTNAME=bzip2-1.0.6 dist: check manual rm -f $(DISTNAME) ln -s -f . $(DISTNAME) Modified: head/contrib/bzip2/Makefile-libbz2_so ============================================================================== --- head/contrib/bzip2/Makefile-libbz2_so Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/Makefile-libbz2_so Tue Nov 9 18:32:57 2010 (r215041) @@ -1,6 +1,6 @@ # This Makefile builds a shared version of the library, -# libbz2.so.1.0.4, with soname libbz2.so.1.0, +# libbz2.so.1.0.6, with soname libbz2.so.1.0, # at least on x86-Linux (RedHat 7.2), # with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98). # Please see the README file for some important info @@ -10,8 +10,8 @@ # This file is part of bzip2/libbzip2, a program and library for # lossless, block-sorting data compression. # -# bzip2/libbzip2 version 1.0.5 of 10 December 2007 -# Copyright (C) 1996-2007 Julian Seward +# bzip2/libbzip2 version 1.0.6 of 6 September 2010 +# Copyright (C) 1996-2010 Julian Seward # # Please read the WARNING, DISCLAIMER and PATENTS sections in the # README file. @@ -35,13 +35,13 @@ OBJS= blocksort.o \ bzlib.o all: $(OBJS) - $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.4 $(OBJS) - $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.4 + $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS) + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 rm -f libbz2.so.1.0 - ln -s libbz2.so.1.0.4 libbz2.so.1.0 + ln -s libbz2.so.1.0.6 libbz2.so.1.0 clean: - rm -f $(OBJS) bzip2.o libbz2.so.1.0.4 libbz2.so.1.0 bzip2-shared + rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared blocksort.o: blocksort.c $(CC) $(CFLAGS) -c blocksort.c Modified: head/contrib/bzip2/README ============================================================================== --- head/contrib/bzip2/README Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/README Tue Nov 9 18:32:57 2010 (r215041) @@ -6,8 +6,8 @@ This version is fully compatible with th This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.5 of 10 December 2007 -Copyright (C) 1996-2007 Julian Seward +bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in this file. @@ -181,6 +181,10 @@ WHAT'S NEW IN 1.0.5 ? See the CHANGES file. +WHAT'S NEW IN 1.0.6 ? + + See the CHANGES file. + I hope you find bzip2 useful. Feel free to contact me at jseward@bzip.org @@ -208,3 +212,4 @@ Cambridge, UK. 15 February 2005 (bzip2, version 1.0.3) 20 December 2006 (bzip2, version 1.0.4) 10 December 2007 (bzip2, version 1.0.5) + 6 Sept 2010 (bzip2, version 1.0.6) Modified: head/contrib/bzip2/README.COMPILATION.PROBLEMS ============================================================================== --- head/contrib/bzip2/README.COMPILATION.PROBLEMS Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/README.COMPILATION.PROBLEMS Tue Nov 9 18:32:57 2010 (r215041) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.5 of 10 December 2007 -Copyright (C) 1996-2007 Julian Seward +bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -12,7 +12,7 @@ This program is released under the terms in the file LICENSE. ------------------------------------------------------------------ -bzip2-1.0.5 should compile without problems on the vast majority of +bzip2-1.0.6 should compile without problems on the vast majority of platforms. Using the supplied Makefile, I've built and tested it myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ 6.0 and nmake, you can build a native Win32 version too. Large file Modified: head/contrib/bzip2/blocksort.c ============================================================================== --- head/contrib/bzip2/blocksort.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/blocksort.c Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/bzip2.1 ============================================================================== --- head/contrib/bzip2/bzip2.1 Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/bzip2.1 Tue Nov 9 18:32:57 2010 (r215041) @@ -1,7 +1,7 @@ .PU .TH bzip2 1 .SH NAME -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.4 +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6 .br bzcat \- decompresses files to stdout .br @@ -405,11 +405,11 @@ I/O error messages are not as helpful as tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading. -This manual page pertains to version 1.0.4 of +This manual page pertains to version 1.0.6 of .I bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions -0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, but with the following +0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and above, but with the following exception: 0.9.0 and above can correctly decompress multiple concatenated compressed files. 0.1pl2 cannot do this; it will stop after decompressing just the first file in the stream. Modified: head/contrib/bzip2/bzip2.c ============================================================================== --- head/contrib/bzip2/bzip2.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/bzip2.c Tue Nov 9 18:32:57 2010 (r215041) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -1605,11 +1605,11 @@ void license ( void ) "bzip2, a block-sorting file compressor. " "Version %s.\n" " \n" - " Copyright (C) 1996-2007 by Julian Seward.\n" + " Copyright (C) 1996-2010 by Julian Seward.\n" " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" - " in the bzip2-1.0.5 source distribution.\n" + " in the bzip2-1.0.6 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" Modified: head/contrib/bzip2/bzip2recover.c ============================================================================== --- head/contrib/bzip2/bzip2recover.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/bzip2recover.c Tue Nov 9 18:32:57 2010 (r215041) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -313,7 +313,7 @@ Int32 main ( Int32 argc, Char** argv ) inFileName[0] = outFileName[0] = 0; fprintf ( stderr, - "bzip2recover 1.0.5: extracts blocks from damaged .bz2 files.\n" ); + "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" ); if (argc != 2) { fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", Modified: head/contrib/bzip2/bzlib.c ============================================================================== --- head/contrib/bzip2/bzlib.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/bzlib.c Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/bzlib.h ============================================================================== --- head/contrib/bzip2/bzlib.h Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/bzlib.h Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/bzlib_private.h ============================================================================== --- head/contrib/bzip2/bzlib_private.h Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/bzlib_private.h Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -36,7 +36,7 @@ /*-- General stuff. --*/ -#define BZ_VERSION "1.0.5, 10-Dec-2007" +#define BZ_VERSION "1.0.6, 6-Sept-2010" typedef char Char; typedef unsigned char Bool; Modified: head/contrib/bzip2/compress.c ============================================================================== --- head/contrib/bzip2/compress.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/compress.c Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/crctable.c ============================================================================== --- head/contrib/bzip2/crctable.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/crctable.c Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/decompress.c ============================================================================== --- head/contrib/bzip2/decompress.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/decompress.c Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -492,15 +492,28 @@ Int32 BZ2_decompress ( DState* s ) RETURN(BZ_DATA_ERROR); /*-- Set up cftab to facilitate generation of T^(-1) --*/ + /* Check: unzftab entries in range. */ + for (i = 0; i <= 255; i++) { + if (s->unzftab[i] < 0 || s->unzftab[i] > nblock) + RETURN(BZ_DATA_ERROR); + } + /* Actually generate cftab. */ s->cftab[0] = 0; for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; + /* Check: cftab entries in range. */ for (i = 0; i <= 256; i++) { if (s->cftab[i] < 0 || s->cftab[i] > nblock) { /* s->cftab[i] can legitimately be == nblock */ RETURN(BZ_DATA_ERROR); } } + /* Check: cftab entries non-descending. */ + for (i = 1; i <= 256; i++) { + if (s->cftab[i-1] > s->cftab[i]) { + RETURN(BZ_DATA_ERROR); + } + } s->state_out_len = 0; s->state_out_ch = 0; Modified: head/contrib/bzip2/huffman.c ============================================================================== --- head/contrib/bzip2/huffman.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/huffman.c Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/randtable.c ============================================================================== --- head/contrib/bzip2/randtable.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/randtable.c Tue Nov 9 18:32:57 2010 (r215041) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/spewG.c ============================================================================== --- head/contrib/bzip2/spewG.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/spewG.c Tue Nov 9 18:32:57 2010 (r215041) @@ -13,8 +13,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: head/contrib/bzip2/unzcrash.c ============================================================================== --- head/contrib/bzip2/unzcrash.c Tue Nov 9 18:28:11 2010 (r215040) +++ head/contrib/bzip2/unzcrash.c Tue Nov 9 18:32:57 2010 (r215041) @@ -17,8 +17,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.5 of 10 December 2007 - Copyright (C) 1996-2007 Julian Seward + bzip2/libbzip2 version 1.0.6 of 6 September 2010 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 18:42:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F28EF106566C; Tue, 9 Nov 2010 18:42:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF5538FC08; Tue, 9 Nov 2010 18:42:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9IgZQ8034856; Tue, 9 Nov 2010 18:42:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9IgZDS034851; Tue, 9 Nov 2010 18:42:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011091842.oA9IgZDS034851@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Nov 2010 18:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215042 - in stable/8/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 18:42:36 -0000 Author: attilio Date: Tue Nov 9 18:42:35 2010 New Revision: 215042 URL: http://svn.freebsd.org/changeset/base/215042 Log: MFC r208921 by jhb: Move mca.c under x86. Sponsored by: Sandvine Incorporated Approved by: jhb Added: stable/8/sys/x86/x86/ stable/8/sys/x86/x86/mca.c - copied, changed from r215039, stable/8/sys/i386/i386/mca.c Deleted: stable/8/sys/amd64/amd64/mca.c stable/8/sys/i386/i386/mca.c Modified: stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/files.pc98 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Nov 9 18:32:57 2010 (r215041) +++ stable/8/sys/conf/files.amd64 Tue Nov 9 18:42:35 2010 (r215042) @@ -119,7 +119,6 @@ amd64/amd64/legacy.c standard amd64/amd64/local_apic.c standard amd64/amd64/locore.S standard no-obj amd64/amd64/machdep.c standard -amd64/amd64/mca.c standard amd64/amd64/mem.c optional mem amd64/amd64/minidump_machdep.c standard amd64/amd64/mp_machdep.c optional smp @@ -319,3 +318,4 @@ x86/isa/isa.c standard x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/pci/qpi.c standard +x86/x86/mca.c standard Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Nov 9 18:32:57 2010 (r215041) +++ stable/8/sys/conf/files.i386 Tue Nov 9 18:42:35 2010 (r215042) @@ -282,7 +282,6 @@ i386/xen/locore.s optional xen no-obj i386/i386/longrun.c optional cpu_enable_longrun i386/i386/machdep.c standard i386/xen/xen_machdep.c optional xen -i386/i386/mca.c standard i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp @@ -394,3 +393,4 @@ x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/pci/qpi.c standard +x86/x86/mca.c standard Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Tue Nov 9 18:32:57 2010 (r215041) +++ stable/8/sys/conf/files.pc98 Tue Nov 9 18:42:35 2010 (r215042) @@ -153,7 +153,6 @@ i386/i386/k6_mem.c optional mem i386/i386/legacy.c standard i386/i386/local_apic.c optional apic i386/i386/locore.s standard no-obj -i386/i386/mca.c standard i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp @@ -258,3 +257,4 @@ pc98/pc98/pc98_machdep.c standard # x86/isa/atpic.c optional atpic x86/isa/isa.c optional isa +x86/x86/mca.c standard Copied and modified: stable/8/sys/x86/x86/mca.c (from r215039, stable/8/sys/i386/i386/mca.c) ============================================================================== --- stable/8/sys/i386/i386/mca.c Tue Nov 9 16:18:32 2010 (r215039, copy source) +++ stable/8/sys/x86/x86/mca.c Tue Nov 9 18:42:35 2010 (r215042) @@ -32,7 +32,11 @@ #include __FBSDID("$FreeBSD$"); +#ifdef __amd64__ +#define DEV_APIC +#else #include "opt_apic.h" +#endif #include #include @@ -884,8 +888,9 @@ mca_intr(void) * Just print the values of the old Pentium registers * and panic. */ - printf("MC Type: 0x%llx Address: 0x%llx\n", - rdmsr(MSR_P5_MC_TYPE), rdmsr(MSR_P5_MC_ADDR)); + printf("MC Type: 0x%jx Address: 0x%jx\n", + (uintmax_t)rdmsr(MSR_P5_MC_TYPE), + (uintmax_t)rdmsr(MSR_P5_MC_ADDR)); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 18:43:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CBCD1065674; Tue, 9 Nov 2010 18:43:59 +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 896838FC1E; Tue, 9 Nov 2010 18:43:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9IhxHI035023; Tue, 9 Nov 2010 18:43:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9Ihxwr035016; Tue, 9 Nov 2010 18:43:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011091843.oA9Ihxwr035016@svn.freebsd.org> From: John Baldwin Date: Tue, 9 Nov 2010 18:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215043 - in stable/8/sys: amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 18:43:59 -0000 Author: jhb Date: Tue Nov 9 18:43:59 2010 New Revision: 215043 URL: http://svn.freebsd.org/changeset/base/215043 Log: MFC 214346: Use intr_disable() and intr_restore() instead of frobbing the flags register directly to disable interrupts. Modified: stable/8/sys/amd64/include/profile.h stable/8/sys/i386/i386/elan-mmcr.c stable/8/sys/i386/i386/identcpu.c stable/8/sys/i386/i386/initcpu.c stable/8/sys/i386/i386/longrun.c stable/8/sys/i386/include/profile.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/include/profile.h ============================================================================== --- stable/8/sys/amd64/include/profile.h Tue Nov 9 18:42:35 2010 (r215042) +++ stable/8/sys/amd64/include/profile.h Tue Nov 9 18:43:59 2010 (r215043) @@ -77,17 +77,17 @@ #error this file needs to be ported to your compiler #endif /* !__GNUCLIKE_ASM */ #else /* !GUPROF */ -#define MCOUNT_DECL(s) u_long s; +#define MCOUNT_DECL(s) register_t s; #ifdef SMP extern int mcount_lock; -#define MCOUNT_ENTER(s) { s = read_rflags(); disable_intr(); \ +#define MCOUNT_ENTER(s) { s = intr_disable(); \ while (!atomic_cmpset_acq_int(&mcount_lock, 0, 1)) \ /* nothing */ ; } #define MCOUNT_EXIT(s) { atomic_store_rel_int(&mcount_lock, 0); \ - write_rflags(s); } + intr_restore(s); } #else -#define MCOUNT_ENTER(s) { s = read_rflags(); disable_intr(); } -#define MCOUNT_EXIT(s) (write_rflags(s)) +#define MCOUNT_ENTER(s) { s = intr_disable(); } +#define MCOUNT_EXIT(s) (intr_restore(s)) #endif #endif /* GUPROF */ Modified: stable/8/sys/i386/i386/elan-mmcr.c ============================================================================== --- stable/8/sys/i386/i386/elan-mmcr.c Tue Nov 9 18:42:35 2010 (r215042) +++ stable/8/sys/i386/i386/elan-mmcr.c Tue Nov 9 18:43:59 2010 (r215043) @@ -228,19 +228,18 @@ elan_poll_pps(struct timecounter *tc) static int state; int i; uint16_t u, x, y, z; - u_long eflags; + register_t saveintr; /* * Grab the HW state as quickly and compactly as we can. Disable * interrupts to avoid measuring our interrupt service time on * hw with quality clock sources. */ - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); x = *pps_ap[0]; /* state, must be first, see below */ y = *pps_ap[1]; /* timer2 */ z = *pps_ap[2]; /* timer1 */ - write_eflags(eflags); + intr_restore(saveintr); /* * Order is important here. We need to check the state of the GPIO Modified: stable/8/sys/i386/i386/identcpu.c ============================================================================== --- stable/8/sys/i386/i386/identcpu.c Tue Nov 9 18:42:35 2010 (r215042) +++ stable/8/sys/i386/i386/identcpu.c Tue Nov 9 18:43:59 2010 (r215043) @@ -1038,12 +1038,11 @@ identblue(void) static void identifycyrix(void) { - u_int eflags; + register_t saveintr; int ccr2_test = 0, dir_test = 0; u_char ccr2, ccr3; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); ccr2 = read_cyrix_reg(CCR2); write_cyrix_reg(CCR2, ccr2 ^ CCR2_LOCK_NW); @@ -1068,7 +1067,7 @@ identifycyrix(void) else cyrix_did = 0x00ff; /* Old 486SLC/DLC and TI486SXLC/SXL */ - write_eflags(eflags); + intr_restore(saveintr); } /* Update TSC freq with the value indicated by the caller. */ Modified: stable/8/sys/i386/i386/initcpu.c ============================================================================== --- stable/8/sys/i386/i386/initcpu.c Tue Nov 9 18:42:35 2010 (r215042) +++ stable/8/sys/i386/i386/initcpu.c Tue Nov 9 18:43:59 2010 (r215043) @@ -116,14 +116,13 @@ u_int cpu_mxcsr_mask; /* valid bits in static void init_bluelightning(void) { - u_long eflags; + register_t saveintr; #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) need_post_dma_flush = 1; #endif - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); invd(); @@ -144,7 +143,7 @@ init_bluelightning(void) /* Enable caching in CR0. */ load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); /* CD = 0 and NW = 0 */ invd(); - write_eflags(eflags); + intr_restore(saveintr); } /* @@ -153,11 +152,10 @@ init_bluelightning(void) static void init_486dlc(void) { - u_long eflags; + register_t saveintr; u_char ccr0; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); invd(); ccr0 = read_cyrix_reg(CCR0); @@ -189,7 +187,7 @@ init_486dlc(void) load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); /* CD = 0 and NW = 0 */ invd(); #endif /* !CYRIX_CACHE_WORKS */ - write_eflags(eflags); + intr_restore(saveintr); } @@ -199,11 +197,10 @@ init_486dlc(void) static void init_cy486dx(void) { - u_long eflags; + register_t saveintr; u_char ccr2; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); invd(); ccr2 = read_cyrix_reg(CCR2); @@ -220,7 +217,7 @@ init_cy486dx(void) #endif write_cyrix_reg(CCR2, ccr2); - write_eflags(eflags); + intr_restore(saveintr); } @@ -230,11 +227,10 @@ init_cy486dx(void) static void init_5x86(void) { - u_long eflags; + register_t saveintr; u_char ccr2, ccr3, ccr4, pcr0; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); wbinvd(); @@ -320,29 +316,28 @@ init_5x86(void) /* Lock NW bit in CR0. */ write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) | CCR2_LOCK_NW); - write_eflags(eflags); + intr_restore(saveintr); } #ifdef CPU_I486_ON_386 /* * There are i486 based upgrade products for i386 machines. - * In this case, BIOS doesn't enables CPU cache. + * In this case, BIOS doesn't enable CPU cache. */ static void init_i486_on_386(void) { - u_long eflags; + register_t saveintr; #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) need_post_dma_flush = 1; #endif - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); /* CD = 0, NW = 0 */ - write_eflags(eflags); + intr_restore(saveintr); } #endif @@ -354,11 +349,10 @@ init_i486_on_386(void) static void init_6x86(void) { - u_long eflags; + register_t saveintr; u_char ccr3, ccr4; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); wbinvd(); @@ -422,7 +416,7 @@ init_6x86(void) /* Lock NW bit in CR0. */ write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) | CCR2_LOCK_NW); - write_eflags(eflags); + intr_restore(saveintr); } #endif /* I486_CPU */ @@ -435,11 +429,10 @@ init_6x86(void) static void init_6x86MX(void) { - u_long eflags; + register_t saveintr; u_char ccr3, ccr4; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); wbinvd(); @@ -489,7 +482,7 @@ init_6x86MX(void) /* Lock NW bit in CR0. */ write_cyrix_reg(CCR2, read_cyrix_reg(CCR2) | CCR2_LOCK_NW); - write_eflags(eflags); + intr_restore(saveintr); } static void @@ -513,11 +506,10 @@ static void init_mendocino(void) { #ifdef CPU_PPRO2CELERON - u_long eflags; + register_t saveintr; u_int64_t bbl_cr_ctl3; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); load_cr0(rcr0() | CR0_CD | CR0_NW); wbinvd(); @@ -541,7 +533,7 @@ init_mendocino(void) } load_cr0(rcr0() & ~(CR0_CD | CR0_NW)); - write_eflags(eflags); + intr_restore(saveintr); #endif /* CPU_PPRO2CELERON */ } @@ -842,10 +834,9 @@ enable_K6_wt_alloc(void) { quad_t size; u_int64_t whcr; - u_long eflags; + register_t saveintr; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); wbinvd(); #ifdef CPU_DISABLE_CACHE @@ -895,7 +886,7 @@ enable_K6_wt_alloc(void) #endif wrmsr(0x0c0000082, whcr); - write_eflags(eflags); + intr_restore(saveintr); } void @@ -903,10 +894,9 @@ enable_K6_2_wt_alloc(void) { quad_t size; u_int64_t whcr; - u_long eflags; + register_t saveintr; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); wbinvd(); #ifdef CPU_DISABLE_CACHE @@ -956,7 +946,7 @@ enable_K6_2_wt_alloc(void) #endif wrmsr(0x0c0000082, whcr); - write_eflags(eflags); + intr_restore(saveintr); } #endif /* I585_CPU && CPU_WT_ALLOC */ @@ -966,15 +956,14 @@ enable_K6_2_wt_alloc(void) DB_SHOW_COMMAND(cyrixreg, cyrixreg) { - u_long eflags; + register_t saveintr; u_int cr0; u_char ccr1, ccr2, ccr3; u_char ccr0 = 0, ccr4 = 0, ccr5 = 0, pcr0 = 0; cr0 = rcr0(); if (cpu_vendor_id == CPU_VENDOR_CYRIX) { - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); if ((cpu != CPU_M1SC) && (cpu != CPU_CY486DX)) { @@ -992,7 +981,7 @@ DB_SHOW_COMMAND(cyrixreg, cyrixreg) pcr0 = read_cyrix_reg(PCR0); write_cyrix_reg(CCR3, ccr3); /* Restore CCR3. */ } - write_eflags(eflags); + intr_restore(saveintr); if ((cpu != CPU_M1SC) && (cpu != CPU_CY486DX)) printf("CCR0=%x, ", (u_int)ccr0); Modified: stable/8/sys/i386/i386/longrun.c ============================================================================== --- stable/8/sys/i386/i386/longrun.c Tue Nov 9 18:42:35 2010 (r215042) +++ stable/8/sys/i386/i386/longrun.c Tue Nov 9 18:43:59 2010 (r215043) @@ -84,12 +84,11 @@ static u_int32_t longrun_modes[LONGRUN_M static u_int tmx86_get_longrun_mode(void) { - u_long eflags; + register_t saveintr; union msrinfo msrinfo; u_int low, high, flags, mode; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); msrinfo.msr = rdmsr(MSR_TMx86_LONGRUN); low = LONGRUN_MODE_MASK(msrinfo.regs[0]); @@ -105,40 +104,38 @@ tmx86_get_longrun_mode(void) } mode = LONGRUN_MODE_UNKNOWN; out: - write_eflags(eflags); + intr_restore(saveintr); return (mode); } static u_int tmx86_get_longrun_status(u_int * frequency, u_int * voltage, u_int * percentage) { - u_long eflags; + register_t saveintr; u_int regs[4]; - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); do_cpuid(0x80860007, regs); *frequency = regs[0]; *voltage = regs[1]; *percentage = regs[2]; - write_eflags(eflags); + intr_restore(saveintr); return (1); } static u_int tmx86_set_longrun_mode(u_int mode) { - u_long eflags; + register_t saveintr; union msrinfo msrinfo; if (mode >= LONGRUN_MODE_UNKNOWN) { return (0); } - eflags = read_eflags(); - disable_intr(); + saveintr = intr_disable(); /* Write LongRun mode values to Model Specific Register. */ msrinfo.msr = rdmsr(MSR_TMx86_LONGRUN); @@ -153,7 +150,7 @@ tmx86_set_longrun_mode(u_int mode) msrinfo.regs[0] = (msrinfo.regs[0] & ~0x01) | longrun_modes[mode][2]; wrmsr(MSR_TMx86_LONGRUN_FLAGS, msrinfo.msr); - write_eflags(eflags); + intr_restore(saveintr); return (1); } Modified: stable/8/sys/i386/include/profile.h ============================================================================== --- stable/8/sys/i386/include/profile.h Tue Nov 9 18:42:35 2010 (r215042) +++ stable/8/sys/i386/include/profile.h Tue Nov 9 18:43:59 2010 (r215043) @@ -77,17 +77,17 @@ #error #endif /* !__GNUCLIKE_ASM */ #else /* !GUPROF */ -#define MCOUNT_DECL(s) u_long s; +#define MCOUNT_DECL(s) register_t s; #ifdef SMP extern int mcount_lock; -#define MCOUNT_ENTER(s) { s = read_eflags(); disable_intr(); \ +#define MCOUNT_ENTER(s) { s = intr_disable(); \ while (!atomic_cmpset_acq_int(&mcount_lock, 0, 1)) \ /* nothing */ ; } #define MCOUNT_EXIT(s) { atomic_store_rel_int(&mcount_lock, 0); \ - write_eflags(s); } + intr_restore(s); } #else -#define MCOUNT_ENTER(s) { s = read_eflags(); disable_intr(); } -#define MCOUNT_EXIT(s) (write_eflags(s)) +#define MCOUNT_ENTER(s) { s = intr_disable(); } +#define MCOUNT_EXIT(s) (intr_restore(s)) #endif #endif /* GUPROF */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 18:46:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C95810656A7; Tue, 9 Nov 2010 18:46:10 +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 EEEAE8FC18; Tue, 9 Nov 2010 18:46:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9Ik95n035232; Tue, 9 Nov 2010 18:46:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9Ik96m035230; Tue, 9 Nov 2010 18:46:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011091846.oA9Ik96m035230@svn.freebsd.org> From: John Baldwin Date: Tue, 9 Nov 2010 18:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215044 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 18:46:10 -0000 Author: jhb Date: Tue Nov 9 18:46:09 2010 New Revision: 215044 URL: http://svn.freebsd.org/changeset/base/215044 Log: MFC 214682: Tweak the waitchannel messages for the dead lock detection kthread. Use a shorter message (userland generally only sees the first 6 to 8 characters) when waiting for the allproc lock. Use "-" when idle to match the behavior of other kthreads. Modified: stable/8/sys/kern/kern_clock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_clock.c ============================================================================== --- stable/8/sys/kern/kern_clock.c Tue Nov 9 18:43:59 2010 (r215043) +++ stable/8/sys/kern/kern_clock.c Tue Nov 9 18:46:09 2010 (r215044) @@ -195,7 +195,7 @@ deadlkres(void) panic("%s: possible deadlock detected on allproc_lock\n", __func__); tryl++; - pause("allproc_lock deadlkres", sleepfreq * hz); + pause("allproc", sleepfreq * hz); continue; } tryl = 0; @@ -288,7 +288,7 @@ deadlkres(void) sx_sunlock(&allproc_lock); /* Sleep for sleepfreq seconds. */ - pause("deadlkres", sleepfreq * hz); + pause("-", sleepfreq * hz); } } From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 18:46:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E5941065670; Tue, 9 Nov 2010 18:46:45 +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 1C83A8FC19; Tue, 9 Nov 2010 18:46:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9IkjvH035305; Tue, 9 Nov 2010 18:46:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9Ikijg035302; Tue, 9 Nov 2010 18:46:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011091846.oA9Ikijg035302@svn.freebsd.org> From: Xin LI Date: Tue, 9 Nov 2010 18:46: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: r215045 - in head: etc/periodic/security tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 18:46:45 -0000 Author: delphij Date: Tue Nov 9 18:46:44 2010 New Revision: 215045 URL: http://svn.freebsd.org/changeset/base/215045 Log: Hide 460.chkportsum in MK_PKGTOOLS != no case. Submitted by: Alex Kozlov MFC after: 2 weeks Modified: head/etc/periodic/security/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/periodic/security/Makefile ============================================================================== --- head/etc/periodic/security/Makefile Tue Nov 9 18:46:09 2010 (r215044) +++ head/etc/periodic/security/Makefile Tue Nov 9 18:46:44 2010 (r215045) @@ -7,7 +7,6 @@ FILES= 100.chksetuid \ 300.chkuid0 \ 400.passwdless \ 410.logincheck \ - 460.chkportsum \ 700.kernelmsg \ 800.loginfail \ 900.tcpwrap \ @@ -28,4 +27,8 @@ FILES+= 500.ipfwdenied \ FILES+= 520.pfdenied .endif +.if ${MK_PKGTOOLS} != "no" +FILES+= 460.chkportsum +.endif + .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Nov 9 18:46:09 2010 (r215044) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Nov 9 18:46:44 2010 (r215045) @@ -1790,6 +1790,7 @@ OLD_FILES+=usr/share/man/man8/tftp-proxy .if ${MK_PKGTOOLS} == no OLD_FILES+=etc/periodic/daily/490.status-pkg-changes +OLD_FILES+=etc/periodic/security/460.chkportsum OLD_FILES+=etc/periodic/weekly/400.status-pkg OLD_FILES+=usr/include/pkg.h OLD_FILES+=usr/lib/libpkg.a From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 19:28:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDC37106566C; Tue, 9 Nov 2010 19:28:06 +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 CAC038FC08; Tue, 9 Nov 2010 19:28:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9JS6RR038384; Tue, 9 Nov 2010 19:28:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9JS6lR038377; Tue, 9 Nov 2010 19:28:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011091928.oA9JS6lR038377@svn.freebsd.org> From: John Baldwin Date: Tue, 9 Nov 2010 19:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215046 - head/usr.sbin/mptutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 19:28:07 -0000 Author: jhb Date: Tue Nov 9 19:28:06 2010 New Revision: 215046 URL: http://svn.freebsd.org/changeset/base/215046 Log: - Save errno values before calling warn(3) so that errors are correctly reported. - Check for malloc() failures. Submitted by: gcooper MFC after: 1 week Modified: head/usr.sbin/mptutil/mpt_cam.c head/usr.sbin/mptutil/mpt_cmd.c head/usr.sbin/mptutil/mpt_config.c head/usr.sbin/mptutil/mpt_drive.c head/usr.sbin/mptutil/mpt_evt.c head/usr.sbin/mptutil/mpt_show.c head/usr.sbin/mptutil/mpt_volume.c Modified: head/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- head/usr.sbin/mptutil/mpt_cam.c Tue Nov 9 18:46:44 2010 (r215045) +++ head/usr.sbin/mptutil/mpt_cam.c Tue Nov 9 19:28:06 2010 (r215046) @@ -63,6 +63,7 @@ fetch_path_id(path_id_t *path_id) struct bus_match_pattern *b; union ccb ccb; size_t bufsize; + int error; if (xpt_open() < 0) return (ENXIO); @@ -91,9 +92,10 @@ fetch_path_id(path_id_t *path_id) b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { + error = errno; free(ccb.cdm.matches); free(ccb.cdm.patterns); - return (errno); + return (error); } free(ccb.cdm.patterns); @@ -124,7 +126,7 @@ mpt_query_disk(U8 VolumeBus, U8 VolumeID union ccb ccb; path_id_t path_id; size_t bufsize; - int error, i; + int error; /* mpt(4) only handles devices on bus 0. */ if (VolumeBus != 0) @@ -164,10 +166,10 @@ mpt_query_disk(U8 VolumeBus, U8 VolumeID p->flags = PERIPH_MATCH_PATH | PERIPH_MATCH_NAME | PERIPH_MATCH_TARGET; if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { - i = errno; + error = errno; free(ccb.cdm.matches); free(ccb.cdm.patterns); - return (i); + return (error); } free(ccb.cdm.patterns); @@ -397,8 +399,8 @@ mpt_fetch_disks(int fd, int *ndisks, str union ccb ccb; path_id_t path_id; size_t bufsize; - u_int i; int count, error; + uint32_t i; if (xpt_open() < 0) return (ENXIO); @@ -431,10 +433,10 @@ mpt_fetch_disks(int fd, int *ndisks, str p->flags = PERIPH_MATCH_PATH | PERIPH_MATCH_NAME; if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { - i = errno; + error = errno; free(ccb.cdm.matches); free(ccb.cdm.patterns); - return (i); + return (error); } free(ccb.cdm.patterns); @@ -481,6 +483,8 @@ mpt_fetch_disks(int fd, int *ndisks, str * exclude them from the list. */ ioc2 = mpt_read_ioc_page(fd, 2, NULL); + if (ioc2 == NULL) + return (errno); disks = calloc(ccb.cdm.num_matches, sizeof(*disks)); count = 0; for (i = 0; i < ccb.cdm.num_matches; i++) { Modified: head/usr.sbin/mptutil/mpt_cmd.c ============================================================================== --- head/usr.sbin/mptutil/mpt_cmd.c Tue Nov 9 18:46:44 2010 (r215045) +++ head/usr.sbin/mptutil/mpt_cmd.c Tue Nov 9 19:28:06 2010 (r215046) @@ -310,18 +310,15 @@ mpt_lookup_volume(int fd, const char *na id = strtol(cp + 1, &cp, 0); if (*cp == '\0') { if (bus < 0 || bus > 0xff || id < 0 || id > 0xff) { - errno = EINVAL; - return (-1); + return (EINVAL); } *VolumeBus = bus; *VolumeID = id; return (0); } } else if (*cp == '\0') { - if (bus < 0 || bus > 0xff) { - errno = EINVAL; - return (-1); - } + if (bus < 0 || bus > 0xff) + return (EINVAL); *VolumeBus = 0; *VolumeID = bus; return (0); @@ -329,7 +326,7 @@ mpt_lookup_volume(int fd, const char *na ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (ioc2 == NULL) - return (-1); + return (errno); vol = ioc2->RaidVolume; for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { @@ -343,8 +340,7 @@ mpt_lookup_volume(int fd, const char *na } } free(ioc2); - errno = EINVAL; - return (-1); + return (EINVAL); } int @@ -360,15 +356,14 @@ mpt_read_config_page_header(int fd, U8 P req.header.PageNumber = PageNumber; req.page_address = PageAddress; if (ioctl(fd, MPTIO_READ_CFG_HEADER, &req) < 0) - return (-1); + return (errno); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) *IOCStatus = req.ioc_status; else warnx("Reading config page header failed: %s", mpt_ioc_status(req.ioc_status)); - errno = EIO; - return (-1); + return (EIO); } *header = req.header; return (0); @@ -380,7 +375,7 @@ mpt_read_config_page(int fd, U8 PageType { struct mpt_cfg_page_req req; void *buf; - int save_errno; + int error; if (IOCStatus != NULL) *IOCStatus = MPI_IOCSTATUS_SUCCESS; @@ -404,9 +399,9 @@ mpt_read_config_page(int fd, U8 PageType req.buf = buf; bcopy(&req.header, buf, sizeof(req.header)); if (ioctl(fd, MPTIO_READ_CFG_PAGE, &req) < 0) { - save_errno = errno; + error = errno; free(buf); - errno = save_errno; + errno = error; return (NULL); } if (!IOC_STATUS_SUCCESS(req.ioc_status)) { @@ -428,7 +423,7 @@ mpt_read_extended_config_page(int fd, U8 { struct mpt_ext_cfg_page_req req; void *buf; - int save_errno; + int error; if (IOCStatus != NULL) *IOCStatus = MPI_IOCSTATUS_SUCCESS; @@ -453,9 +448,9 @@ mpt_read_extended_config_page(int fd, U8 req.buf = buf; bcopy(&req.header, buf, sizeof(req.header)); if (ioctl(fd, MPTIO_READ_EXT_CFG_PAGE, &req) < 0) { - save_errno = errno; + error = errno; free(buf); - errno = save_errno; + errno = error; return (NULL); } if (!IOC_STATUS_SUCCESS(req.ioc_status)) { @@ -484,7 +479,7 @@ mpt_write_config_page(int fd, void *buf, hdr = buf; req.len = hdr->PageLength * 4; if (ioctl(fd, MPTIO_WRITE_CFG_PAGE, &req) < 0) - return (-1); + return (errno); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) { *IOCStatus = req.ioc_status; @@ -492,8 +487,7 @@ mpt_write_config_page(int fd, void *buf, } warnx("Writing config page failed: %s", mpt_ioc_status(req.ioc_status)); - errno = EIO; - return (-1); + return (EIO); } return (0); } @@ -507,10 +501,8 @@ mpt_raid_action(int fd, U8 Action, U8 Vo if (IOCStatus != NULL) *IOCStatus = MPI_IOCSTATUS_SUCCESS; - if (datalen < 0 || (unsigned)datalen > sizeof(raid_act.action_data)) { - errno = EINVAL; - return (-1); - } + if (datalen < 0 || (unsigned)datalen > sizeof(raid_act.action_data)) + return (EINVAL); bzero(&raid_act, sizeof(raid_act)); raid_act.action = Action; raid_act.volume_bus = VolumeBus; @@ -524,7 +516,7 @@ mpt_raid_action(int fd, U8 Action, U8 Vo } if (ioctl(fd, MPTIO_RAID_ACTION, &raid_act) < 0) - return (-1); + return (errno); if (!IOC_STATUS_SUCCESS(raid_act.ioc_status)) { if (IOCStatus != NULL) { @@ -533,8 +525,7 @@ mpt_raid_action(int fd, U8 Action, U8 Vo } warnx("RAID action failed: %s", mpt_ioc_status(raid_act.ioc_status)); - errno = EIO; - return (-1); + return (EIO); } if (ActionStatus != NULL) @@ -544,8 +535,7 @@ mpt_raid_action(int fd, U8 Action, U8 Vo return (0); warnx("RAID action failed: %s", mpt_raid_status(raid_act.action_status)); - errno = EIO; - return (-1); + return (EIO); } if (VolumeStatus != NULL) Modified: head/usr.sbin/mptutil/mpt_config.c ============================================================================== --- head/usr.sbin/mptutil/mpt_config.c Tue Nov 9 18:46:44 2010 (r215045) +++ head/usr.sbin/mptutil/mpt_config.c Tue Nov 9 19:28:06 2010 (r215046) @@ -102,15 +102,15 @@ mpt_lock_volume(U8 VolumeBus, U8 VolumeI */ return (0); if (error) { - errno = error; - warn("Unable to lookup volume device name"); - return (-1); + warnc(error, "Unable to lookup volume device name"); + return (error); } snprintf(path, sizeof(path), "%s%s", _PATH_DEV, qd.devname); vfd = open(path, O_RDWR); if (vfd < 0) { + error = errno; warn("Unable to lock volume %s", qd.devname); - return (-1); + return (error); } return (0); } @@ -119,13 +119,14 @@ static int mpt_lock_physdisk(struct mpt_standalone_disk *disk) { char path[MAXPATHLEN]; - int dfd; + int dfd, error; snprintf(path, sizeof(path), "%s%s", _PATH_DEV, disk->devname); dfd = open(path, O_RDWR); if (dfd < 0) { + error = errno; warn("Unable to lock disk %s", disk->devname); - return (-1); + return (error); } return (0); } @@ -144,8 +145,7 @@ mpt_lookup_standalone_disk(const char *n id = strtol(cp + 1, &cp, 0); if (*cp == '\0') { if (bus < 0 || bus > 0xff || id < 0 || id > 0xff) { - errno = EINVAL; - return (-1); + return (EINVAL); } for (i = 0; i < ndisks; i++) { if (disks[i].bus == (U8)bus && @@ -154,8 +154,7 @@ mpt_lookup_standalone_disk(const char *n return (0); } } - errno = ENOENT; - return (-1); + return (ENOENT); } } @@ -166,12 +165,10 @@ mpt_lookup_standalone_disk(const char *n return (0); } } - errno = ENOENT; - return (-1); + return (ENOENT); } - errno = EINVAL; - return (-1); + return (EINVAL); } /* @@ -182,16 +179,17 @@ mpt_create_physdisk(int fd, struct mpt_s { CONFIG_PAGE_HEADER header; CONFIG_PAGE_RAID_PHYS_DISK_0 *config_page; + int error; U32 ActionData; - if (mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_PHYSDISK, - 0, 0, &header, NULL) < 0) - return (-1); + error = mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_PHYSDISK, + 0, 0, &header, NULL); + if (error) + return (error); if (header.PageVersion > MPI_RAIDPHYSDISKPAGE0_PAGEVERSION) { warnx("Unsupported RAID physdisk page 0 version %d", header.PageVersion); - errno = EOPNOTSUPP; - return (-1); + return (EOPNOTSUPP); } config_page = calloc(1, sizeof(CONFIG_PAGE_RAID_PHYS_DISK_0)); config_page->Header.PageType = MPI_CONFIG_PAGETYPE_RAID_PHYSDISK; @@ -203,10 +201,11 @@ mpt_create_physdisk(int fd, struct mpt_s config_page->PhysDiskID = disk->target; /* XXX: Enclosure info for PhysDiskSettings? */ - if (mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_PHYSDISK, 0, 0, 0, 0, + error = mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_PHYSDISK, 0, 0, 0, 0, config_page, sizeof(CONFIG_PAGE_RAID_PHYS_DISK_0), NULL, - &ActionData, sizeof(ActionData), NULL, NULL, 1) < 0) - return (-1); + &ActionData, sizeof(ActionData), NULL, NULL, 1); + if (error) + return (error); *PhysDiskNum = ActionData & 0xff; return (0); } @@ -232,18 +231,20 @@ clear_config(int ac, char **av) IOC_3_PHYS_DISK *disk; CONFIG_PAGE_IOC_5 *ioc5; IOC_5_HOT_SPARE *spare; - int ch, fd, i; + int ch, error, fd, i; fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (ioc2 == NULL) { + error = errno; warn("Failed to fetch volume list"); - return (errno); + return (error); } /* Lock all the volumes first. */ @@ -267,14 +268,16 @@ clear_config(int ac, char **av) /* Delete all the volumes. */ vol = ioc2->RaidVolume; - for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) - if (mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, + for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { + error = mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, vol->VolumeBus, vol->VolumeID, 0, MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS | MPI_RAID_ACTION_ADATA_ZERO_LBA0, NULL, 0, NULL, NULL, 0, - NULL, NULL, 0) < 0) - warn("Failed to delete volume %s", + NULL, NULL, 0); + if (error) + warnc(error, "Failed to delete volume %s", mpt_volume_name(vol->VolumeBus, vol->VolumeID)); + } free(ioc2); /* Delete all the spares. */ @@ -411,8 +414,9 @@ parse_volume(int fd, int raid_type, stru /* See if it is a standalone disk. */ if (mpt_lookup_standalone_disk(cp, state->sdisks, state->nsdisks, &i) < 0) { + error = errno; warn("Unable to lookup drive %s", cp); - return (errno); + return (error); } dinfo->sdisk = &state->sdisks[i]; @@ -433,17 +437,18 @@ add_drives(int fd, struct volume_info *i { struct drive_info *dinfo; U8 PhysDiskNum; - int i; + int error, i; for (i = 0, dinfo = info->drives; i < info->drive_count; i++, dinfo++) { if (dinfo->info == NULL) { if (mpt_create_physdisk(fd, dinfo->sdisk, &PhysDiskNum) < 0) { + error = errno; warn( "Failed to create physical disk page for %s", dinfo->sdisk->devname); - return (errno); + return (error); } if (verbose) printf("Added drive %s with PhysDiskNum %u\n", @@ -500,11 +505,14 @@ build_volume(int fd, struct volume_info U32 MinLBA; uint64_t MaxLBA; size_t page_size; - int i; + int error, i; - if (mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_VOLUME, - 0, 0, &header, NULL) < 0) + error = mpt_read_config_page_header(fd, MPI_CONFIG_PAGETYPE_RAID_VOLUME, + 0, 0, &header, NULL); + if (error) { + errno = error; return (NULL); + } if (header.PageVersion > MPI_RAIDVOLPAGE0_PAGEVERSION) { warnx("Unsupported RAID volume page 0 version %d", header.PageVersion); @@ -514,6 +522,8 @@ build_volume(int fd, struct volume_info page_size = sizeof(CONFIG_PAGE_RAID_VOL_0) + sizeof(RAID_VOL0_PHYS_DISK) * (info->drive_count - 1); vol = calloc(1, page_size); + if (vol == NULL) + return (NULL); /* Header */ vol->Header.PageType = MPI_CONFIG_PAGETYPE_RAID_VOLUME; @@ -607,8 +617,8 @@ create_volume(int ac, char **av) CONFIG_PAGE_RAID_VOL_0 *vol; struct config_id_state state; struct volume_info *info; - int ch, error, fd, i, raid_type, verbose, quick; long stripe_size; + int ch, error, fd, i, quick, raid_type, verbose; #ifdef DEBUG int dump; #endif @@ -620,8 +630,9 @@ create_volume(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } /* Lookup the RAID type first. */ @@ -677,8 +688,9 @@ create_volume(int ac, char **av) /* Fetch existing config data. */ state.ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (state.ioc2 == NULL) { + error = errno; warn("Failed to read volume list"); - return (errno); + return (error); } state.list = mpt_pd_list(fd); if (state.list == NULL) @@ -696,6 +708,8 @@ create_volume(int ac, char **av) return (EINVAL); } info = calloc(1, sizeof(*info)); + if (info == NULL) + return (ENOMEM); error = parse_volume(fd, raid_type, &state, av[0], info); if (error) return (error); @@ -707,6 +721,8 @@ create_volume(int ac, char **av) /* Build the volume. */ vol = build_volume(fd, info, raid_type, stripe_size, &state, verbose); + if (vol == NULL) + return (errno); #ifdef DEBUG if (dump) { @@ -716,12 +732,13 @@ create_volume(int ac, char **av) #endif /* Send the new volume to the controller. */ - if (mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_VOLUME, vol->VolumeBus, + error = mpt_raid_action(fd, MPI_RAID_ACTION_CREATE_VOLUME, vol->VolumeBus, vol->VolumeID, 0, quick ? MPI_RAID_ACTION_ADATA_DO_NOT_SYNC : 0, - vol, vol->Header.PageLength * 4, NULL, NULL, 0, NULL, NULL, 1) < - 0) { + vol, vol->Header.PageLength * 4, NULL, NULL, 0, NULL, NULL, 1); + if (error) { + errno = error; warn("Failed to add volume"); - return (errno); + return (error); } #ifdef DEBUG @@ -745,7 +762,7 @@ static int delete_volume(int ac, char **av) { U8 VolumeBus, VolumeID; - int fd; + int error, fd; if (ac != 2) { warnx("delete: volume required"); @@ -754,24 +771,27 @@ delete_volume(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } - if (mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID) < 0) { - warn("Invalid volume %s", av[1]); - return (errno); + error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID); + if (error) { + warnc(error, "Invalid volume %s", av[1]); + return (error); } if (mpt_lock_volume(VolumeBus, VolumeID) < 0) return (errno); - if (mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, VolumeBus, + error = mpt_raid_action(fd, MPI_RAID_ACTION_DELETE_VOLUME, VolumeBus, VolumeID, 0, MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS | MPI_RAID_ACTION_ADATA_ZERO_LBA0, NULL, 0, NULL, NULL, 0, NULL, - NULL, 0) < 0) { - warn("Failed to delete volume"); - return (errno); + NULL, 0); + if (error) { + warnc(error, "Failed to delete volume"); + return (error); } mpt_rescan_bus(-1, -1); @@ -788,16 +808,17 @@ find_volume_spare_pool(int fd, const cha CONFIG_PAGE_IOC_2 *ioc2; CONFIG_PAGE_IOC_2_RAID_VOL *vol; U8 VolumeBus, VolumeID; - int i, j, new_pool, pool_count[7]; + int error, i, j, new_pool, pool_count[7]; - if (mpt_lookup_volume(fd, name, &VolumeBus, &VolumeID) < 0) { - warn("Invalid volume %s", name); - return (-1); + error = mpt_lookup_volume(fd, name, &VolumeBus, &VolumeID); + if (error) { + warnc(error, "Invalid volume %s", name); + return (error); } info = mpt_vol_info(fd, VolumeBus, VolumeID, NULL); if (info == NULL) - return (-1); + return (errno); /* * Check for an existing pool other than pool 0 (used for @@ -817,15 +838,16 @@ find_volume_spare_pool(int fd, const cha */ ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (ioc2 == NULL) { + error = errno; warn("Failed to fetch volume list"); - return (-1); + return (error); } bzero(pool_count, sizeof(pool_count)); vol = ioc2->RaidVolume; for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { info = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, NULL); if (info == NULL) - return (-1); + return (errno); for (j = 0; j < 7; j++) if (info->VolumeSettings.HotSparePool & (1 << (j + 1))) pool_count[j]++; @@ -843,14 +865,15 @@ find_volume_spare_pool(int fd, const cha /* Add this pool to the volume. */ info = mpt_vol_info(fd, VolumeBus, VolumeID, NULL); if (info == NULL) - return (-1); + return (error); info->VolumeSettings.HotSparePool |= (1 << new_pool); - if (mpt_raid_action(fd, MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS, + error = mpt_raid_action(fd, MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS, VolumeBus, VolumeID, 0, *(U32 *)&info->VolumeSettings, NULL, 0, - NULL, NULL, 0, NULL, NULL, 0) < 0) { + NULL, NULL, 0, NULL, NULL, 0); + if (error) { warnx("Failed to add spare pool %d to %s", new_pool, mpt_volume_name(VolumeBus, VolumeID)); - return (-1); + return (error); } free(info); @@ -878,13 +901,15 @@ add_spare(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } if (ac == 3) { - if (find_volume_spare_pool(fd, av[2], &pool) < 0) - return (errno); + error = find_volume_spare_pool(fd, av[2], &pool); + if (error) + return (error); } else pool = MPI_RAID_HOT_SPARE_POOL_0; @@ -902,16 +927,18 @@ add_spare(int ac, char **av) if (mpt_lookup_standalone_disk(av[1], sdisks, nsdisks, &i) < 0) { + error = errno; warn("Unable to lookup drive %s", av[1]); - return (errno); + return (error); } if (mpt_lock_physdisk(&sdisks[i]) < 0) return (errno); if (mpt_create_physdisk(fd, &sdisks[i], &PhysDiskNum) < 0) { + error = errno; warn("Failed to create physical disk page"); - return (errno); + return (error); } free(sdisks); } @@ -919,8 +946,9 @@ add_spare(int ac, char **av) info = mpt_pd_info(fd, PhysDiskNum, NULL); if (info == NULL) { + error = errno; warn("Failed to fetch drive info"); - return (errno); + return (error); } info->PhysDiskSettings.HotSparePool = pool; @@ -928,8 +956,8 @@ add_spare(int ac, char **av) 0, PhysDiskNum, *(U32 *)&info->PhysDiskSettings, NULL, 0, NULL, NULL, 0, NULL, NULL, 0); if (error) { - warn("Failed to assign spare"); - return (errno); + warnc(error, "Failed to assign spare"); + return (error); } free(info); @@ -954,8 +982,9 @@ remove_spare(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } list = mpt_pd_list(fd); @@ -972,8 +1001,9 @@ remove_spare(int ac, char **av) info = mpt_pd_info(fd, PhysDiskNum, NULL); if (info == NULL) { + error = errno; warn("Failed to fetch drive info"); - return (errno); + return (error); } if (info->PhysDiskSettings.HotSparePool == 0) { @@ -982,8 +1012,9 @@ remove_spare(int ac, char **av) } if (mpt_delete_physdisk(fd, PhysDiskNum) < 0) { + error = errno; warn("Failed to delete physical disk page"); - return (errno); + return (error); } mpt_rescan_bus(info->PhysDiskBus, info->PhysDiskID); @@ -1011,8 +1042,9 @@ pd_create(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } error = mpt_fetch_disks(fd, &ndisks, &disks); @@ -1022,16 +1054,18 @@ pd_create(int ac, char **av) } if (mpt_lookup_standalone_disk(av[1], disks, ndisks, &i) < 0) { + error = errno; warn("Unable to lookup drive"); - return (errno); + return (error); } if (mpt_lock_physdisk(&disks[i]) < 0) return (errno); if (mpt_create_physdisk(fd, &disks[i], &PhysDiskNum) < 0) { + error = errno; warn("Failed to create physical disk page"); - return (errno); + return (error); } free(disks); @@ -1048,7 +1082,7 @@ pd_delete(int ac, char **av) { CONFIG_PAGE_RAID_PHYS_DISK_0 *info; struct mpt_drive_list *list; - int fd; + int error, fd; U8 PhysDiskNum; if (ac != 2) { @@ -1058,8 +1092,9 @@ pd_delete(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } list = mpt_pd_list(fd); @@ -1067,20 +1102,23 @@ pd_delete(int ac, char **av) return (errno); if (mpt_lookup_drive(list, av[1], &PhysDiskNum) < 0) { + error = errno; warn("Failed to find drive %s", av[1]); - return (errno); + return (error); } mpt_free_pd_list(list); info = mpt_pd_info(fd, PhysDiskNum, NULL); if (info == NULL) { + error = errno; warn("Failed to fetch drive info"); - return (errno); + return (error); } if (mpt_delete_physdisk(fd, PhysDiskNum) < 0) { + error = errno; warn("Failed to delete physical disk page"); - return (errno); + return (error); } mpt_rescan_bus(info->PhysDiskBus, info->PhysDiskID); @@ -1126,7 +1164,7 @@ debug_config(int ac, char **av) { CONFIG_PAGE_RAID_VOL_0 *vol; U8 VolumeBus, VolumeID; - int fd; + int error, fd; if (ac != 2) { warnx("debug: volume required"); @@ -1135,19 +1173,22 @@ debug_config(int ac, char **av) fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } - if (mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID) < 0) { - warn("Invalid volume: %s", av[1]); - return (errno); + error = mpt_lookup_volume(fd, av[1], &VolumeBus, &VolumeID); + if (error) { + warnc(error, "Invalid volume: %s", av[1]); + return (error); } vol = mpt_vol_info(fd, VolumeBus, VolumeID, NULL); if (vol == NULL) { + error = errno; warn("Failed to get volume info"); - return (errno); + return (error); } dump_config(vol); Modified: head/usr.sbin/mptutil/mpt_drive.c ============================================================================== --- head/usr.sbin/mptutil/mpt_drive.c Tue Nov 9 18:46:44 2010 (r215045) +++ head/usr.sbin/mptutil/mpt_drive.c Tue Nov 9 19:28:06 2010 (r215046) @@ -129,7 +129,7 @@ mpt_pd_insert(int fd, struct mpt_drive_l list->drives[j + 1] = list->drives[j]; list->drives[i] = mpt_pd_info(fd, PhysDiskNum, NULL); if (list->drives[i] == NULL) - return (-1); + return (errno); list->ndrives++; return (0); } @@ -146,26 +146,32 @@ mpt_pd_list(int fd) CONFIG_PAGE_IOC_5 *ioc5; IOC_5_HOT_SPARE *spare; struct mpt_drive_list *list; - int count, i, j; + int count, error, i, j; ioc2 = mpt_read_ioc_page(fd, 2, NULL); if (ioc2 == NULL) { + error = errno; warn("Failed to fetch volume list"); + errno = error; return (NULL); } ioc3 = mpt_read_ioc_page(fd, 3, NULL); if (ioc3 == NULL) { + error = errno; warn("Failed to fetch drive list"); free(ioc2); + errno = error; return (NULL); } ioc5 = mpt_read_ioc_page(fd, 5, NULL); if (ioc5 == NULL) { + error = errno; warn("Failed to fetch spare list"); free(ioc3); free(ioc2); + errno = error; return (NULL); } @@ -180,7 +186,9 @@ mpt_pd_list(int fd) volumes[i] = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, NULL); if (volumes[i] == NULL) { + error = errno; warn("Failed to read volume info"); + errno = error; return (NULL); } count += volumes[i]->NumPhysDisks; @@ -264,13 +272,11 @@ mpt_lookup_drive(struct mpt_drive_list * return (0); } } - errno = ENOENT; - return (-1); + return (ENOENT); } bad: - errno = EINVAL; - return (-1); + return (EINVAL); } /* Borrowed heavily from scsi_all.c:scsi_print_inquiry(). */ @@ -306,12 +312,13 @@ drive_set_state(char *drive, U8 Action, CONFIG_PAGE_RAID_PHYS_DISK_0 *info; struct mpt_drive_list *list; U8 PhysDiskNum; - int fd; + int error, fd; fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } list = mpt_pd_list(fd); @@ -319,16 +326,18 @@ drive_set_state(char *drive, U8 Action, return (errno); if (mpt_lookup_drive(list, drive, &PhysDiskNum) < 0) { + error = errno; warn("Failed to find drive %s", drive); - return (errno); + return (error); } mpt_free_pd_list(list); /* Get the info for this drive. */ info = mpt_pd_info(fd, PhysDiskNum, NULL); if (info == NULL) { + error = errno; warn("Failed to fetch info for drive %u", PhysDiskNum); - return (errno); + return (error); } /* Try to change the state. */ @@ -337,10 +346,11 @@ drive_set_state(char *drive, U8 Action, return (EINVAL); } - if (mpt_raid_action(fd, Action, 0, 0, PhysDiskNum, 0, NULL, 0, NULL, - NULL, 0, NULL, NULL, 0) < 0) { - warn("Failed to set drive %u to %s", PhysDiskNum, name); - return (errno); + error = mpt_raid_action(fd, Action, 0, 0, PhysDiskNum, 0, NULL, 0, NULL, + NULL, 0, NULL, NULL, 0); + if (error) { + warnc(error, "Failed to set drive %u to %s", PhysDiskNum, name); + return (error); } free(info); Modified: head/usr.sbin/mptutil/mpt_evt.c ============================================================================== --- head/usr.sbin/mptutil/mpt_evt.c Tue Nov 9 18:46:44 2010 (r215045) +++ head/usr.sbin/mptutil/mpt_evt.c Tue Nov 9 19:28:06 2010 (r215046) @@ -94,18 +94,20 @@ show_events(int ac, char **av) { CONFIG_PAGE_LOG_0 *log; MPI_LOG_0_ENTRY **entries; - int ch, fd, i, num_events, verbose; + int ch, error, fd, i, num_events, verbose; fd = mpt_open(mpt_unit); if (fd < 0) { + error = errno; warn("mpt_open"); - return (errno); + return (error); } log = mpt_get_events(fd, NULL); if (log == NULL) { + error = errno; warn("Failed to get event log info"); - return (errno); + return (error); } /* Default settings. */ @@ -128,6 +130,8 @@ show_events(int ac, char **av) /* Build a list of valid entries and sort them by sequence. */ entries = malloc(sizeof(MPI_LOG_0_ENTRY *) * log->NumLogEntries); + if (entries == NULL) + return (ENOMEM); num_events = 0; for (i = 0; i < log->NumLogEntries; i++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 19:29:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5668106566C; Tue, 9 Nov 2010 19:29:29 +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 B954C8FC15; Tue, 9 Nov 2010 19:29:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9JTTSb038471; Tue, 9 Nov 2010 19:29:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9JTTTw038466; Tue, 9 Nov 2010 19:29:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011091929.oA9JTTTw038466@svn.freebsd.org> From: Alexander Motin Date: Tue, 9 Nov 2010 19:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215047 - in stable/8/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 19:29:29 -0000 Author: mav Date: Tue Nov 9 19:29:29 2010 New Revision: 215047 URL: http://svn.freebsd.org/changeset/base/215047 Log: MFC r208452, r208479: Unify local_apic.c for x86 archs, Added: stable/8/sys/x86/x86/local_apic.c - copied, changed from r215045, stable/8/sys/i386/i386/local_apic.c Deleted: stable/8/sys/amd64/amd64/local_apic.c stable/8/sys/i386/i386/local_apic.c Modified: stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/files.pc98 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Nov 9 19:28:06 2010 (r215046) +++ stable/8/sys/conf/files.amd64 Tue Nov 9 19:29:29 2010 (r215047) @@ -116,7 +116,7 @@ amd64/amd64/intr_machdep.c standard amd64/amd64/io.c optional io amd64/amd64/io_apic.c standard amd64/amd64/legacy.c standard -amd64/amd64/local_apic.c standard +x86/x86/local_apic.c standard amd64/amd64/locore.S standard no-obj amd64/amd64/machdep.c standard amd64/amd64/mem.c optional mem Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Nov 9 19:28:06 2010 (r215046) +++ stable/8/sys/conf/files.i386 Tue Nov 9 19:29:29 2010 (r215047) @@ -276,7 +276,7 @@ i386/i386/io.c optional io i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem i386/i386/legacy.c optional native -i386/i386/local_apic.c optional apic +x86/x86/local_apic.c optional apic i386/i386/locore.s optional native no-obj i386/xen/locore.s optional xen no-obj i386/i386/longrun.c optional cpu_enable_longrun Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Tue Nov 9 19:28:06 2010 (r215046) +++ stable/8/sys/conf/files.pc98 Tue Nov 9 19:29:29 2010 (r215047) @@ -151,7 +151,7 @@ i386/i386/io.c optional io i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem i386/i386/legacy.c standard -i386/i386/local_apic.c optional apic +x86/x86/local_apic.c optional apic i386/i386/locore.s standard no-obj i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard Copied and modified: stable/8/sys/x86/x86/local_apic.c (from r215045, stable/8/sys/i386/i386/local_apic.c) ============================================================================== --- stable/8/sys/i386/i386/local_apic.c Tue Nov 9 18:46:44 2010 (r215045, copy source) +++ stable/8/sys/x86/x86/local_apic.c Tue Nov 9 19:29:29 2010 (r215047) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_atpic.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" @@ -70,6 +69,16 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __amd64__ +#define SDT_APIC SDT_SYSIGT +#define SDT_APICT SDT_SYSIGT +#define GSEL_APIC 0 +#else +#define SDT_APIC SDT_SYS386IGT +#define SDT_APICT SDT_SYS386TGT +#define GSEL_APIC GSEL(GCODE_SEL, SEL_KPL) +#endif + #ifdef KDTRACE_HOOKS #include cyclic_clock_func_t cyclic_clock_func[MAXCPU]; @@ -215,8 +224,8 @@ lapic_init(vm_paddr_t addr) ("local APIC not aligned on a page boundary")); lapic = pmap_mapdev(addr, sizeof(lapic_t)); lapic_paddr = addr; - setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(APIC_SPURIOUS_INT, IDTVEC(spuriousint), SDT_APIC, SEL_KPL, + GSEL_APIC); /* Perform basic initialization of the BSP's local APIC. */ lapic_enable(); @@ -225,17 +234,15 @@ lapic_init(vm_paddr_t addr) PCPU_SET(apic_id, lapic_id()); /* Local APIC timer interrupt. */ - setidt(APIC_TIMER_INT, IDTVEC(timerint), SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(APIC_TIMER_INT, IDTVEC(timerint), SDT_APIC, SEL_KPL, GSEL_APIC); /* Local APIC error interrupt. */ - setidt(APIC_ERROR_INT, IDTVEC(errorint), SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(APIC_ERROR_INT, IDTVEC(errorint), SDT_APIC, SEL_KPL, GSEL_APIC); /* XXX: Thermal interrupt */ /* Local APIC CMCI. */ - setidt(APIC_CMC_INT, IDTVEC(cmcint), SDT_SYS386TGT, SEL_KPL, + setidt(APIC_CMC_INT, IDTVEC(cmcint), SDT_APICT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); } @@ -1021,8 +1028,8 @@ apic_enable_vector(u_int apic_id, u_int KASSERT(vector != IDT_SYSCALL, ("Attempt to overwrite syscall entry")); KASSERT(ioint_handlers[vector / 32] != NULL, ("No ISR handler for vector %u", vector)); - setidt(vector, ioint_handlers[vector / 32], SDT_SYS386IGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(vector, ioint_handlers[vector / 32], SDT_APIC, SEL_KPL, + GSEL_APIC); } void @@ -1037,8 +1044,7 @@ apic_disable_vector(u_int apic_id, u_int * We can not currently clear the idt entry because other cpus * may have a valid vector at this offset. */ - setidt(vector, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, - GSEL(GCODE_SEL, SEL_KPL)); + setidt(vector, &IDTVEC(rsvd), SDT_APICT, SEL_KPL, GSEL_APIC); #endif } @@ -1228,14 +1234,17 @@ apic_register_enumerator(struct apic_enu } /* - * Probe the APIC enumerators, enumerate CPUs, and initialize the - * local APIC. + * We have to look for CPU's very, very early because certain subsystems + * want to know how many CPU's we have extremely early on in the boot + * process. */ static void apic_init(void *dummy __unused) { struct apic_enumerator *enumerator; +#ifndef __amd64__ uint64_t apic_base; +#endif int retval, best; /* We only support built in local APICs. */ @@ -1268,6 +1277,7 @@ apic_init(void *dummy __unused) printf("APIC: Using the %s enumerator.\n", best_enum->apic_name); +#ifndef __amd64__ /* * To work around an errata, we disable the local APIC on some * CPUs during early startup. We need to turn the local APIC back @@ -1279,6 +1289,7 @@ apic_init(void *dummy __unused) apic_base |= APICBASE_ENABLED; wrmsr(MSR_APICBASE, apic_base); } +#endif /* Second, probe the CPU's in the system. */ retval = best_enum->apic_probe_cpus(); @@ -1286,13 +1297,34 @@ apic_init(void *dummy __unused) printf("%s: Failed to probe CPUs: returned %d\n", best_enum->apic_name, retval); +#ifdef __amd64__ +} +SYSINIT(apic_init, SI_SUB_TUNABLES - 1, SI_ORDER_SECOND, apic_init, NULL); + +/* + * Setup the local APIC. We have to do this prior to starting up the APs + * in the SMP case. + */ +static void +apic_setup_local(void *dummy __unused) +{ + int retval; + + if (best_enum == NULL) + return; +#endif /* Third, initialize the local APIC. */ retval = best_enum->apic_setup_local(); if (retval != 0) printf("%s: Failed to setup the local APIC: returned %d\n", best_enum->apic_name, retval); } +#ifdef __amd64__ +SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local, + NULL); +#else SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_SECOND, apic_init, NULL); +#endif /* * Setup the I/O APICs. @@ -1329,7 +1361,7 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O #ifdef SMP /* * Inter Processor Interrupt functions. The lapic_ipi_*() functions are - * private to the sys/i386 code. The public interface for the rest of the + * private to the MD code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ int From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 19:43:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07174106566B; Tue, 9 Nov 2010 19:43:46 +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 E7F068FC16; Tue, 9 Nov 2010 19:43:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9Jhjcp039346; Tue, 9 Nov 2010 19:43:45 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9JhjoD039341; Tue, 9 Nov 2010 19:43:45 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201011091943.oA9JhjoD039341@svn.freebsd.org> From: Martin Matuska Date: Tue, 9 Nov 2010 19:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215048 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 19:43:46 -0000 Author: mm Date: Tue Nov 9 19:43:45 2010 New Revision: 215048 URL: http://svn.freebsd.org/changeset/base/215048 Log: MFC r214378: Bugfix merge from OpenSolaris: OpenSolaris onnv-revision: 10209:91f47f0e7728 6830541 zfs_get_data_trips on a verify 6696242 multiple zfs_fillpage() zfs: accessing past end of object panics 6785914 zfs fails to drop dn_struct_rwlock in recovery code path Approved by: delphij (mentor) Obtained from: OpenSolaris (Bug ID 6830541, 6696242, 6785914) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Nov 9 19:29:29 2010 (r215047) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Nov 9 19:43:45 2010 (r215048) @@ -192,7 +192,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, ASSERT(length <= DMU_MAX_ACCESS); - dbuf_flags = DB_RF_CANFAIL | DB_RF_NEVERWAIT; + dbuf_flags = DB_RF_CANFAIL | DB_RF_NEVERWAIT | DB_RF_HAVESTRUCT; if (flags & DMU_READ_NO_PREFETCH || length > zfetch_array_rd_sz) dbuf_flags |= DB_RF_NOPREFETCH; @@ -209,6 +209,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, os_dsl_dataset->ds_object, (longlong_t)dn->dn_object, dn->dn_datablksz, (longlong_t)offset, (longlong_t)length); + rw_exit(&dn->dn_struct_rwlock); return (EIO); } nblks = 1; @@ -231,9 +232,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, } /* initiate async i/o */ if (read) { - rw_exit(&dn->dn_struct_rwlock); (void) dbuf_read(db, zio, dbuf_flags); - rw_enter(&dn->dn_struct_rwlock, RW_READER); } dbp[i] = &db->db; } @@ -540,7 +539,7 @@ dmu_read(objset_t *os, uint64_t object, { dnode_t *dn; dmu_buf_t **dbp; - int numbufs, i, err; + int numbufs, err; err = dnode_hold(os->os, object, FTAG, &dn); if (err) @@ -551,7 +550,7 @@ dmu_read(objset_t *os, uint64_t object, * block. If we ever do the tail block optimization, we will need to * handle that here as well. */ - if (dn->dn_datablkshift == 0) { + if (dn->dn_maxblkid == 0) { int newsz = offset > dn->dn_datablksz ? 0 : MIN(size, dn->dn_datablksz - offset); bzero((char *)buf + newsz, size - newsz); @@ -560,6 +559,7 @@ dmu_read(objset_t *os, uint64_t object, while (size > 0) { uint64_t mylen = MIN(size, DMU_MAX_ACCESS / 2); + int i; /* * NB: we could do this block-at-a-time, but it's nice Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 9 19:29:29 2010 (r215047) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 9 19:43:45 2010 (r215048) @@ -1005,6 +1005,10 @@ zfs_get_done(dmu_buf_t *db, void *vzgd) VFS_UNLOCK_GIANT(vfslocked); } +#ifdef DEBUG +static int zil_fault_io = 0; +#endif + /* * Get data to generate a TX_WRITE intent log record. */ @@ -1086,7 +1090,21 @@ zfs_get_data(void *arg, lr_write_t *lr, zgd->zgd_rl = rl; zgd->zgd_zilog = zfsvfs->z_log; zgd->zgd_bp = &lr->lr_blkptr; - VERIFY(0 == dmu_buf_hold(os, lr->lr_foid, boff, zgd, &db)); +#ifdef DEBUG + if (zil_fault_io) { + error = EIO; + zil_fault_io = 0; + } else { + error = dmu_buf_hold(os, lr->lr_foid, boff, zgd, &db); + } +#else + error = dmu_buf_hold(os, lr->lr_foid, boff, zgd, &db); +#endif + if (error != 0) { + kmem_free(zgd, sizeof (zgd_t)); + goto out; + } + ASSERT(boff == db->db_offset); lr->lr_blkoff = off - boff; error = dmu_sync(zio, db, &lr->lr_blkptr, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Nov 9 19:29:29 2010 (r215047) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Tue Nov 9 19:43:45 2010 (r215048) @@ -933,6 +933,10 @@ zil_lwb_commit(zilog_t *zilog, itx_t *it } error = zilog->zl_get_data( itx->itx_private, lr, dbuf, lwb->lwb_zio); + if (error == EIO) { + txg_wait_synced(zilog->zl_dmu_pool, txg); + return (lwb); + } if (error) { ASSERT(error == ENOENT || error == EEXIST || error == EALREADY); From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 19:45:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 524601065672; Tue, 9 Nov 2010 19:45:30 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC8D8FC1C; Tue, 9 Nov 2010 19:45:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9JjUAs039504; Tue, 9 Nov 2010 19:45:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9JjUL7039502; Tue, 9 Nov 2010 19:45:30 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011091945.oA9JjUL7039502@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 9 Nov 2010 19:45: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: r215049 - head/sys/dev/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 19:45:30 -0000 Author: nwhitehorn Date: Tue Nov 9 19:45:29 2010 New Revision: 215049 URL: http://svn.freebsd.org/changeset/base/215049 Log: Make all OF client interface calls return the maximum kind of does-not-exist error when no client interface module is installed instead of dereferencing NULL pointers. This eases implementation of platforms that may or may not have Open Firmware. Modified: head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Tue Nov 9 19:43:45 2010 (r215048) +++ head/sys/dev/ofw/openfirm.c Tue Nov 9 19:45:29 2010 (r215049) @@ -76,7 +76,7 @@ MALLOC_DEFINE(M_OFWPROP, "openfirm", "Op static ihandle_t stdout; -static ofw_def_t *ofw_def_impl; +static ofw_def_t *ofw_def_impl = NULL; static ofw_t ofw_obj; static struct ofw_kobj ofw_kernel_obj; static struct kobj_ops ofw_kernel_kops; @@ -118,6 +118,9 @@ OF_init(void *cookie) phandle_t chosen; int rv; + if (ofw_def_impl == NULL) + return (-1); + ofw_obj = &ofw_kernel_obj; /* * Take care of compiling the selected class, and @@ -135,7 +138,6 @@ OF_init(void *cookie) return (rv); } -#ifndef FDT void OF_printf(const char *fmt, ...) { @@ -157,9 +159,11 @@ int OF_test(const char *name) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_TEST(ofw_obj, name)); } -#endif int OF_interpret(const char *cmd, int nreturns, ...) @@ -169,6 +173,9 @@ OF_interpret(const char *cmd, int nretur int i = 0; int status; + if (ofw_def_impl == NULL) + return (-1); + status = OFW_INTERPRET(ofw_obj, cmd, nreturns, slots); if (status == -1) return (status); @@ -190,6 +197,9 @@ phandle_t OF_peer(phandle_t node) { + if (ofw_def_impl == NULL) + return (0); + return (OFW_PEER(ofw_obj, node)); } @@ -198,6 +208,9 @@ phandle_t OF_child(phandle_t node) { + if (ofw_def_impl == NULL) + return (0); + return (OFW_CHILD(ofw_obj, node)); } @@ -206,6 +219,9 @@ phandle_t OF_parent(phandle_t node) { + if (ofw_def_impl == NULL) + return (0); + return (OFW_PARENT(ofw_obj, node)); } @@ -214,6 +230,9 @@ phandle_t OF_instance_to_package(ihandle_t instance) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_INSTANCE_TO_PACKAGE(ofw_obj, instance)); } @@ -222,6 +241,9 @@ ssize_t OF_getproplen(phandle_t package, const char *propname) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_GETPROPLEN(ofw_obj, package, propname)); } @@ -230,6 +252,9 @@ ssize_t OF_getprop(phandle_t package, const char *propname, void *buf, size_t buflen) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_GETPROP(ofw_obj, package, propname, buf, buflen)); } @@ -278,6 +303,9 @@ int OF_nextprop(phandle_t package, const char *previous, char *buf, size_t size) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_NEXTPROP(ofw_obj, package, previous, buf, size)); } @@ -286,6 +314,9 @@ int OF_setprop(phandle_t package, const char *propname, const void *buf, size_t len) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_SETPROP(ofw_obj, package, propname, buf,len)); } @@ -294,6 +325,9 @@ ssize_t OF_canon(const char *device, char *buf, size_t len) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_CANON(ofw_obj, device, buf, len)); } @@ -302,6 +336,9 @@ phandle_t OF_finddevice(const char *device) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_FINDDEVICE(ofw_obj, device)); } @@ -310,6 +347,9 @@ ssize_t OF_instance_to_path(ihandle_t instance, char *buf, size_t len) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_INSTANCE_TO_PATH(ofw_obj, instance, buf, len)); } @@ -318,10 +358,12 @@ ssize_t OF_package_to_path(phandle_t package, char *buf, size_t len) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_PACKAGE_TO_PATH(ofw_obj, package, buf, len)); } -#ifndef FDT /* Call the method in the scope of a given instance. */ int OF_call_method(const char *method, ihandle_t instance, int nargs, int nreturns, @@ -331,7 +373,7 @@ OF_call_method(const char *method, ihand cell_t args_n_results[12]; int n, status; - if (nargs > 6) + if (nargs > 6 || ofw_def_impl == NULL) return (-1); va_start(ap, nreturns); for (n = 0; n < nargs; n++) @@ -357,6 +399,9 @@ ihandle_t OF_open(const char *device) { + if (ofw_def_impl == NULL) + return (0); + return (OFW_OPEN(ofw_obj, device)); } @@ -365,6 +410,9 @@ void OF_close(ihandle_t instance) { + if (ofw_def_impl == NULL) + return; + OFW_CLOSE(ofw_obj, instance); } @@ -373,6 +421,9 @@ ssize_t OF_read(ihandle_t instance, void *addr, size_t len) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_READ(ofw_obj, instance, addr, len)); } @@ -381,6 +432,9 @@ ssize_t OF_write(ihandle_t instance, const void *addr, size_t len) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_WRITE(ofw_obj, instance, addr, len)); } @@ -389,6 +443,9 @@ int OF_seek(ihandle_t instance, uint64_t pos) { + if (ofw_def_impl == NULL) + return (-1); + return (OFW_SEEK(ofw_obj, instance, pos)); } @@ -401,6 +458,9 @@ void * OF_claim(void *virt, size_t size, u_int align) { + if (ofw_def_impl == NULL) + return ((void *)-1); + return (OFW_CLAIM(ofw_obj, virt, size, align)); } @@ -409,6 +469,9 @@ void OF_release(void *virt, size_t size) { + if (ofw_def_impl == NULL) + return; + OFW_RELEASE(ofw_obj, virt, size); } @@ -421,6 +484,9 @@ void OF_enter() { + if (ofw_def_impl == NULL) + return; + OFW_ENTER(ofw_obj); } @@ -429,10 +495,12 @@ void OF_exit() { + if (ofw_def_impl == NULL) + panic("OF_exit: Open Firmware not available"); + /* Should not return */ OFW_EXIT(ofw_obj); for (;;) /* just in case */ ; } -#endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 20:00:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A1941065679; Tue, 9 Nov 2010 20:00:23 +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 640218FC25; Tue, 9 Nov 2010 20:00:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9K0NSA040407; Tue, 9 Nov 2010 20:00:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9K0NA8040391; Tue, 9 Nov 2010 20:00:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011092000.oA9K0NA8040391@svn.freebsd.org> From: John Baldwin Date: Tue, 9 Nov 2010 20:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215050 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include i386/xen ia64/ia64 ia64/include kern powerpc/include powerpc/powerpc sparc64/include sun4v/include sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 20:00:23 -0000 Author: jhb Date: Tue Nov 9 20:00:23 2010 New Revision: 215050 URL: http://svn.freebsd.org/changeset/base/215050 Log: MFC 210939: Add a new ipi_cpu() function to the MI IPI API that can be used to send an IPI to a specific CPU by its cpuid. Replace calls to ipi_selected() that constructed a mask for a single CPU with calls to ipi_cpu() instead. Modified: stable/8/sys/amd64/amd64/mp_machdep.c stable/8/sys/amd64/include/smp.h stable/8/sys/i386/i386/mp_machdep.c stable/8/sys/i386/include/smp.h stable/8/sys/i386/xen/mp_machdep.c stable/8/sys/ia64/ia64/mp_machdep.c stable/8/sys/ia64/include/smp.h stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c stable/8/sys/kern/subr_smp.c stable/8/sys/powerpc/include/smp.h stable/8/sys/powerpc/powerpc/mp_machdep.c stable/8/sys/sparc64/include/smp.h stable/8/sys/sun4v/include/smp.h stable/8/sys/sun4v/sun4v/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/mp_machdep.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/amd64/amd64/mp_machdep.c Tue Nov 9 20:00:23 2010 (r215050) @@ -1201,15 +1201,51 @@ ipi_selected(cpumask_t cpus, u_int ipi) do { old_pending = cpu_ipi_pending[cpu]; new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],old_pending, new_pending)); - + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); if (old_pending) continue; } - lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); } +} + +/* + * send an IPI to a specific CPU. + */ +void +ipi_cpu(int cpu, u_int ipi) +{ + u_int bitmap = 0; + u_int old_pending; + u_int new_pending; + + if (IPI_IS_BITMAPED(ipi)) { + bitmap = 1 << ipi; + ipi = IPI_BITMAP_VECTOR; + } + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, 1 << cpu); + + CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); + KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); + + if (bitmap) { + do { + old_pending = cpu_ipi_pending[cpu]; + new_pending = old_pending | bitmap; + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); + if (old_pending) + return; + } + lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); } /* Modified: stable/8/sys/amd64/include/smp.h ============================================================================== --- stable/8/sys/amd64/include/smp.h Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/amd64/include/smp.h Tue Nov 9 20:00:23 2010 (r215050) @@ -52,10 +52,11 @@ void cpu_add(u_int apic_id, char boot_cp void cpustop_handler(void); void cpususpend_handler(void); void init_secondary(void); -int ipi_nmi_handler(void); -void ipi_selected(cpumask_t cpus, u_int ipi); void ipi_all_but_self(u_int ipi); void ipi_bitmap_handler(struct trapframe frame); +void ipi_cpu(int cpu, u_int ipi); +int ipi_nmi_handler(void); +void ipi_selected(cpumask_t cpus, u_int ipi); u_int mp_bootaddress(u_int); int mp_grab_cpu_hlt(void); void smp_cache_flush(void); Modified: stable/8/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/8/sys/i386/i386/mp_machdep.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/i386/i386/mp_machdep.c Tue Nov 9 20:00:23 2010 (r215050) @@ -1362,15 +1362,51 @@ ipi_selected(cpumask_t cpus, u_int ipi) do { old_pending = cpu_ipi_pending[cpu]; new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],old_pending, new_pending)); - + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); if (old_pending) continue; } - lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); } +} + +/* + * send an IPI to a specific CPU. + */ +void +ipi_cpu(int cpu, u_int ipi) +{ + u_int bitmap = 0; + u_int old_pending; + u_int new_pending; + + if (IPI_IS_BITMAPED(ipi)) { + bitmap = 1 << ipi; + ipi = IPI_BITMAP_VECTOR; + } + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, 1 << cpu); + + CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); + KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); + + if (bitmap) { + do { + old_pending = cpu_ipi_pending[cpu]; + new_pending = old_pending | bitmap; + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); + if (old_pending) + return; + } + lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); } /* Modified: stable/8/sys/i386/include/smp.h ============================================================================== --- stable/8/sys/i386/include/smp.h Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/i386/include/smp.h Tue Nov 9 20:00:23 2010 (r215050) @@ -60,12 +60,13 @@ inthand_t void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); void init_secondary(void); -int ipi_nmi_handler(void); -void ipi_selected(cpumask_t cpus, u_int ipi); void ipi_all_but_self(u_int ipi); #ifndef XEN void ipi_bitmap_handler(struct trapframe frame); #endif +void ipi_cpu(int cpu, u_int ipi); +int ipi_nmi_handler(void); +void ipi_selected(cpumask_t cpus, u_int ipi); u_int mp_bootaddress(u_int); int mp_grab_cpu_hlt(void); void smp_cache_flush(void); Modified: stable/8/sys/i386/xen/mp_machdep.c ============================================================================== --- stable/8/sys/i386/xen/mp_machdep.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/i386/xen/mp_machdep.c Tue Nov 9 20:00:23 2010 (r215050) @@ -1124,19 +1124,14 @@ ipi_selected(cpumask_t cpus, u_int ipi) cpu--; cpus &= ~(1 << cpu); - KASSERT(cpu_apic_ids[cpu] != -1, - ("IPI to non-existent CPU %d", cpu)); - if (bitmap) { do { old_pending = cpu_ipi_pending[cpu]; new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],old_pending, new_pending)); - + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); if (!old_pending) ipi_pcpu(cpu, RESCHEDULE_VECTOR); - continue; - } else { KASSERT(call_data != NULL, ("call_data not set")); ipi_pcpu(cpu, CALL_FUNCTION_VECTOR); @@ -1145,6 +1140,45 @@ ipi_selected(cpumask_t cpus, u_int ipi) } /* + * send an IPI to a specific CPU. + */ +void +ipi_cpu(int cpu, u_int ipi) +{ + u_int bitmap = 0; + u_int old_pending; + u_int new_pending; + + if (IPI_IS_BITMAPED(ipi)) { + bitmap = 1 << ipi; + ipi = IPI_BITMAP_VECTOR; + } + + /* + * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit + * of help in order to understand what is the source. + * Set the mask of receiving CPUs for this purpose. + */ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, 1 << cpu); + + CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); + + if (bitmap) { + do { + old_pending = cpu_ipi_pending[cpu]; + new_pending = old_pending | bitmap; + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); + if (!old_pending) + ipi_pcpu(cpu, RESCHEDULE_VECTOR); + } else { + KASSERT(call_data != NULL, ("call_data not set")); + ipi_pcpu(cpu, CALL_FUNCTION_VECTOR); + } +} + +/* * send an IPI to all CPUs EXCEPT myself */ void Modified: stable/8/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/mp_machdep.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/ia64/ia64/mp_machdep.c Tue Nov 9 20:00:23 2010 (r215050) @@ -405,6 +405,16 @@ ipi_selected(cpumask_t cpus, int ipi) } /* + * send an IPI to a specific CPU. + */ +void +ipi_cpu(int cpu, u_int ipi) +{ + + ipi_send(cpuid_to_pcpu[cpu], ipi); +} + +/* * send an IPI to all CPUs EXCEPT myself. */ void Modified: stable/8/sys/ia64/include/smp.h ============================================================================== --- stable/8/sys/ia64/include/smp.h Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/ia64/include/smp.h Tue Nov 9 20:00:23 2010 (r215050) @@ -25,6 +25,7 @@ extern int ia64_ipi_stop; extern int ia64_ipi_wakeup; void ipi_all_but_self(int ipi); +void ipi_cpu(int cpu, u_int ipi); void ipi_selected(cpumask_t cpus, int ipi); void ipi_send(struct pcpu *, int ipi); Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/kern/sched_4bsd.c Tue Nov 9 20:00:23 2010 (r215050) @@ -1154,7 +1154,7 @@ kick_other_cpu(int pri, int cpuid) pcpu = pcpu_find(cpuid); if (idle_cpus_mask & pcpu->pc_cpumask) { forward_wakeups_delivered++; - ipi_selected(pcpu->pc_cpumask, IPI_AST); + ipi_cpu(cpuid, IPI_AST); return; } @@ -1167,13 +1167,13 @@ kick_other_cpu(int pri, int cpuid) if (pri <= PRI_MAX_ITHD) #endif /* ! FULL_PREEMPTION */ { - ipi_selected(pcpu->pc_cpumask, IPI_PREEMPT); + ipi_cpu(cpuid, IPI_PREEMPT); return; } #endif /* defined(IPI_PREEMPTION) && defined(PREEMPTION) */ pcpu->pc_curthread->td_flags |= TDF_NEEDRESCHED; - ipi_selected(pcpu->pc_cpumask, IPI_AST); + ipi_cpu(cpuid, IPI_AST); return; } #endif /* SMP */ @@ -1670,7 +1670,7 @@ sched_affinity(struct thread *td) td->td_flags |= TDF_NEEDRESCHED; if (td != curthread) - ipi_selected(1 << cpu, IPI_AST); + ipi_cpu(cpu, IPI_AST); break; default: break; Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/kern/sched_ule.c Tue Nov 9 20:00:23 2010 (r215050) @@ -851,7 +851,7 @@ sched_balance_pair(struct tdq *high, str * IPI the target cpu to force it to reschedule with the new * workload. */ - ipi_selected(1 << TDQ_ID(low), IPI_PREEMPT); + ipi_cpu(TDQ_ID(low), IPI_PREEMPT); } tdq_unlock_pair(high, low); return (moved); @@ -974,7 +974,7 @@ tdq_notify(struct tdq *tdq, struct threa return; } tdq->tdq_ipipending = 1; - ipi_selected(1 << cpu, IPI_PREEMPT); + ipi_cpu(cpu, IPI_PREEMPT); } /* @@ -2416,7 +2416,7 @@ sched_affinity(struct thread *td) */ td->td_flags |= TDF_NEEDRESCHED; if (td != curthread) - ipi_selected(1 << ts->ts_cpu, IPI_PREEMPT); + ipi_cpu(ts->ts_cpu, IPI_PREEMPT); #endif } Modified: stable/8/sys/kern/subr_smp.c ============================================================================== --- stable/8/sys/kern/subr_smp.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/kern/subr_smp.c Tue Nov 9 20:00:23 2010 (r215050) @@ -181,7 +181,7 @@ forward_signal(struct thread *td) id = td->td_oncpu; if (id == NOCPU) return; - ipi_selected(1 << id, IPI_AST); + ipi_cpu(id, IPI_AST); } /* Modified: stable/8/sys/powerpc/include/smp.h ============================================================================== --- stable/8/sys/powerpc/include/smp.h Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/powerpc/include/smp.h Tue Nov 9 20:00:23 2010 (r215050) @@ -40,6 +40,7 @@ #ifndef LOCORE void ipi_all_but_self(int ipi); +void ipi_cpu(int cpu, u_int ipi); void ipi_selected(cpumask_t cpus, int ipi); struct cpuref { Modified: stable/8/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/mp_machdep.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/powerpc/powerpc/mp_machdep.c Tue Nov 9 20:00:23 2010 (r215050) @@ -336,6 +336,14 @@ ipi_selected(cpumask_t cpus, int ipi) } } +/* Send an IPI to a specific CPU. */ +void +ipi_cpu(int cpu, u_int ipi) +{ + + ipi_send(cpuid_to_pcpu[cpu], ipi); +} + /* Send an IPI to all CPUs EXCEPT myself. */ void ipi_all_but_self(int ipi) Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/sparc64/include/smp.h Tue Nov 9 20:00:23 2010 (r215050) @@ -145,6 +145,13 @@ ipi_selected(u_int cpus, u_int ipi) cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi); } +static __inline void +ipi_cpu(int cpu, u_int ipi) +{ + + cpu_ipi_single(cpu, 0, (u_long)tl_ipi_level, ipi); +} + #if defined(_MACHINE_PMAP_H_) && defined(_SYS_MUTEX_H_) static __inline void * Modified: stable/8/sys/sun4v/include/smp.h ============================================================================== --- stable/8/sys/sun4v/include/smp.h Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/sun4v/include/smp.h Tue Nov 9 20:00:23 2010 (r215050) @@ -82,8 +82,9 @@ void cpu_ipi_ast(struct trapframe *tf); void cpu_ipi_stop(struct trapframe *tf); void cpu_ipi_preempt(struct trapframe *tf); -void ipi_selected(u_int cpus, u_int ipi); void ipi_all_but_self(u_int ipi); +void ipi_cpu(int cpu, u_int ipi); +void ipi_selected(u_int cpus, u_int ipi); vm_offset_t mp_tramp_alloc(void); void mp_set_tsb_desc_ra(vm_paddr_t); Modified: stable/8/sys/sun4v/sun4v/mp_machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/mp_machdep.c Tue Nov 9 19:45:29 2010 (r215049) +++ stable/8/sys/sun4v/sun4v/mp_machdep.c Tue Nov 9 20:00:23 2010 (r215050) @@ -518,7 +518,6 @@ retry: } } - void ipi_selected(u_int icpus, u_int ipi) { @@ -533,7 +532,6 @@ ipi_selected(u_int icpus, u_int ipi) * 4) handling 4-way threading vs 2-way threading should happen here * and not in forward wakeup */ - cpulist = PCPU_GET(cpulist); cpus = (icpus & ~PCPU_GET(cpumask)); @@ -545,8 +543,32 @@ ipi_selected(u_int icpus, u_int ipi) cpu_count++; } - cpu_ipi_selected(cpu_count, cpulist, (u_long)tl_ipi_level, ipi, 0, &ackmask); - + cpu_ipi_selected(cpu_count, cpulist, (u_long)tl_ipi_level, ipi, 0, + &ackmask); +} + +void +ipi_cpu(int cpu, u_int ipi) +{ + int cpu_count; + uint16_t *cpulist; + uint64_t ackmask; + + /* + * + * 3) forward_wakeup appears to abuse ASTs + * 4) handling 4-way threading vs 2-way threading should happen here + * and not in forward wakeup + */ + cpulist = PCPU_GET(cpulist); + if (PCPU_GET(cpumask) & (1 << cpu)) + cpu_count = 0; + else { + cpulist[0] = (uint16_t)cpu; + cpu_count = 1; + } + cpu_ipi_selected(cpu_count, cpulist, (u_long)tl_ipi_level, ipi, 0, + &ackmask); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 20:28:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CBCE106566B; Tue, 9 Nov 2010 20:28:10 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 488468FC13; Tue, 9 Nov 2010 20:28:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9KSAWj042125; Tue, 9 Nov 2010 20:28:10 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9KSAjK042119; Tue, 9 Nov 2010 20:28:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011092028.oA9KSAjK042119@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Nov 2010 20:28: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: r215051 - in head: . sys/amd64/include sys/i386/include sys/i386/xen sys/pc98/include sys/x86/include sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 20:28:10 -0000 Author: attilio Date: Tue Nov 9 20:28:09 2010 New Revision: 215051 URL: http://svn.freebsd.org/changeset/base/215051 Log: Move the mptable.h under x86/include/. Sponsored by: Sandvine Incorporated MFC after: 14 days Added: head/sys/x86/include/mptable.h - copied unchanged from r215045, head/sys/i386/include/mptable.h Deleted: head/sys/amd64/include/mptable.h head/sys/i386/include/mptable.h head/sys/pc98/include/mptable.h Modified: head/ObsoleteFiles.inc head/sys/i386/xen/mptable.c head/sys/x86/x86/mptable.c head/sys/x86/x86/mptable_pci.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 9 20:00:23 2010 (r215050) +++ head/ObsoleteFiles.inc Tue Nov 9 20:28:09 2010 (r215051) @@ -14,6 +14,10 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101109: headers moved to machine/ to x86/ +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/mptable.h +.endif # 20101101: headers moved to machine/ to x86/ .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/apicreg.h Modified: head/sys/i386/xen/mptable.c ============================================================================== --- head/sys/i386/xen/mptable.c Tue Nov 9 20:00:23 2010 (r215050) +++ head/sys/i386/xen/mptable.c Tue Nov 9 20:28:09 2010 (r215051) @@ -38,11 +38,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include #include #include Copied: head/sys/x86/include/mptable.h (from r215045, head/sys/i386/include/mptable.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/mptable.h Tue Nov 9 20:28:09 2010 (r215051, copy of r215045, head/sys/i386/include/mptable.h) @@ -0,0 +1,146 @@ +/*- + * Copyright (c) 1996, by Steve Passe + * 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. The name of the developer may NOT be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __MACHINE_MPTABLE_H__ +#define __MACHINE_MPTABLE_H__ + +enum busTypes { + NOBUS = 0, + EISA = 3, + ISA = 6, + MCA = 9, + PCI = 13, + MAX_BUSTYPE = 18, + UNKNOWN_BUSTYPE = 0xff +}; + +/* MP Floating Pointer Structure */ +typedef struct MPFPS { + char signature[4]; + u_int32_t pap; + u_char length; + u_char spec_rev; + u_char checksum; + u_char config_type; + u_char mpfb2; + u_char mpfb3; + u_char mpfb4; + u_char mpfb5; +} *mpfps_t; + +#define MPFB2_IMCR_PRESENT 0x80 +#define MPFB2_MUL_CLK_SRCS 0x40 + +/* MP Configuration Table Header */ +typedef struct MPCTH { + char signature[4]; + u_short base_table_length; + u_char spec_rev; + u_char checksum; + u_char oem_id[8]; + u_char product_id[12]; + u_int32_t oem_table_pointer; + u_short oem_table_size; + u_short entry_count; + u_int32_t apic_address; + u_short extended_table_length; + u_char extended_table_checksum; + u_char reserved; +} *mpcth_t; + +#define MPCT_ENTRY_PROCESSOR 0 +#define MPCT_ENTRY_BUS 1 +#define MPCT_ENTRY_IOAPIC 2 +#define MPCT_ENTRY_INT 3 +#define MPCT_ENTRY_LOCAL_INT 4 + +typedef struct PROCENTRY { + u_char type; + u_char apic_id; + u_char apic_version; + u_char cpu_flags; + u_long cpu_signature; + u_long feature_flags; + u_long reserved1; + u_long reserved2; +} *proc_entry_ptr; + +#define PROCENTRY_FLAG_EN 0x01 +#define PROCENTRY_FLAG_BP 0x02 + +typedef struct BUSENTRY { + u_char type; + u_char bus_id; + char bus_type[6]; +} *bus_entry_ptr; + +typedef struct IOAPICENTRY { + u_char type; + u_char apic_id; + u_char apic_version; + u_char apic_flags; + u_int32_t apic_address; +} *io_apic_entry_ptr; + +#define IOAPICENTRY_FLAG_EN 0x01 + +typedef struct INTENTRY { + u_char type; + u_char int_type; + u_short int_flags; + u_char src_bus_id; + u_char src_bus_irq; + u_char dst_apic_id; + u_char dst_apic_int; +} *int_entry_ptr; + +#define INTENTRY_TYPE_INT 0 +#define INTENTRY_TYPE_NMI 1 +#define INTENTRY_TYPE_SMI 2 +#define INTENTRY_TYPE_EXTINT 3 + +#define INTENTRY_FLAGS_POLARITY 0x3 +#define INTENTRY_FLAGS_POLARITY_CONFORM 0x0 +#define INTENTRY_FLAGS_POLARITY_ACTIVEHI 0x1 +#define INTENTRY_FLAGS_POLARITY_ACTIVELO 0x3 +#define INTENTRY_FLAGS_TRIGGER 0xc +#define INTENTRY_FLAGS_TRIGGER_CONFORM 0x0 +#define INTENTRY_FLAGS_TRIGGER_EDGE 0x4 +#define INTENTRY_FLAGS_TRIGGER_LEVEL 0xc + +/* descriptions of MP basetable entries */ +typedef struct BASETABLE_ENTRY { + u_char type; + u_char length; + char name[16]; +} basetable_entry; + +#ifdef _KERNEL +int mptable_pci_probe_table(int bus); +int mptable_pci_route_interrupt(device_t pcib, device_t dev, int pin); +#endif +#endif /* !__MACHINE_MPTABLE_H__ */ Modified: head/sys/x86/x86/mptable.c ============================================================================== --- head/sys/x86/x86/mptable.c Tue Nov 9 20:00:23 2010 (r215050) +++ head/sys/x86/x86/mptable.c Tue Nov 9 20:28:09 2010 (r215051) @@ -39,11 +39,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include #include #include Modified: head/sys/x86/x86/mptable_pci.c ============================================================================== --- head/sys/x86/x86/mptable_pci.c Tue Nov 9 20:00:23 2010 (r215050) +++ head/sys/x86/x86/mptable_pci.c Tue Nov 9 20:28:09 2010 (r215051) @@ -44,8 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include #include #include "pcib_if.h" From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 20:41:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC9E3106564A; Tue, 9 Nov 2010 20:41:10 +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 AEF3A8FC0A; Tue, 9 Nov 2010 20:41:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9KfAkO043074; Tue, 9 Nov 2010 20:41:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9KfAxw043066; Tue, 9 Nov 2010 20:41:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011092041.oA9KfAxw043066@svn.freebsd.org> From: John Baldwin Date: Tue, 9 Nov 2010 20:41: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: r215052 - in head/sys: fs/nwfs ia64/ia64 powerpc/booke ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 20:41:10 -0000 Author: jhb Date: Tue Nov 9 20:41:10 2010 New Revision: 215052 URL: http://svn.freebsd.org/changeset/base/215052 Log: Remove unused includes of and . Modified: head/sys/fs/nwfs/nwfs_vnops.c head/sys/ia64/ia64/db_machdep.c head/sys/ia64/ia64/genassym.c head/sys/ia64/ia64/machdep.c head/sys/powerpc/booke/locore.S head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/fs/nwfs/nwfs_vnops.c ============================================================================== --- head/sys/fs/nwfs/nwfs_vnops.c Tue Nov 9 20:28:09 2010 (r215051) +++ head/sys/fs/nwfs/nwfs_vnops.c Tue Nov 9 20:41:10 2010 (r215052) @@ -39,8 +39,6 @@ #include #include -#include - #include #include #include Modified: head/sys/ia64/ia64/db_machdep.c ============================================================================== --- head/sys/ia64/ia64/db_machdep.c Tue Nov 9 20:28:09 2010 (r215051) +++ head/sys/ia64/ia64/db_machdep.c Tue Nov 9 20:41:10 2010 (r215052) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/ia64/ia64/genassym.c ============================================================================== --- head/sys/ia64/ia64/genassym.c Tue Nov 9 20:28:09 2010 (r215051) +++ head/sys/ia64/ia64/genassym.c Tue Nov 9 20:41:10 2010 (r215052) @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Tue Nov 9 20:28:09 2010 (r215051) +++ head/sys/ia64/ia64/machdep.c Tue Nov 9 20:41:10 2010 (r215052) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Tue Nov 9 20:28:09 2010 (r215051) +++ head/sys/powerpc/booke/locore.S Tue Nov 9 20:41:10 2010 (r215052) @@ -28,8 +28,6 @@ #include "assym.s" -#include - #include #include #include Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Nov 9 20:28:09 2010 (r215051) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Nov 9 20:41:10 2010 (r215052) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include /* XXX */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 20:44:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 167E7106564A; Tue, 9 Nov 2010 20:44:56 +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 DD4098FC12; Tue, 9 Nov 2010 20:44:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9Kitnn043323; Tue, 9 Nov 2010 20:44:55 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9Kit08043321; Tue, 9 Nov 2010 20:44:55 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201011092044.oA9Kit08043321@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Tue, 9 Nov 2010 20:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215053 - stable/8/usr.bin/fold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 20:44:56 -0000 Author: dumbbell Date: Tue Nov 9 20:44:55 2010 New Revision: 215053 URL: http://svn.freebsd.org/changeset/base/215053 Log: MFC r214893: Fix a segmentation fault in argument processing. The crash was caused by a command line such as this one: # fold -b1 PR: bin/151592 Reporter by: Marcus Reid Tested by: Marcus Reid Modified: stable/8/usr.bin/fold/fold.c Directory Properties: stable/8/usr.bin/fold/ (props changed) Modified: stable/8/usr.bin/fold/fold.c ============================================================================== --- stable/8/usr.bin/fold/fold.c Tue Nov 9 20:41:10 2010 (r215052) +++ stable/8/usr.bin/fold/fold.c Tue Nov 9 20:44:55 2010 (r215053) @@ -71,14 +71,14 @@ int sflag; /* Split on word boundaries int main(int argc, char **argv) { - int ch; + int ch, previous_ch; int rval, width; - char *p; (void) setlocale(LC_CTYPE, ""); width = -1; - while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1) + previous_ch = 0; + while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1) { switch (ch) { case 'b': bflag = 1; @@ -93,17 +93,33 @@ main(int argc, char **argv) break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - if (width == -1) { - p = argv[optind - 1]; - if (p[0] == '-' && p[1] == ch && !p[2]) - width = atoi(++p); - else - width = atoi(argv[optind] + 1); + /* Accept a width as eg. -30. Note that a width + * specified using the -w option is always used prior + * to this undocumented option. */ + switch (previous_ch) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + /* The width is a number with multiple digits: + * add the last one. */ + width = width * 10 + (ch - '0'); + break; + default: + /* Set the width, unless it was previously + * set. For instance, the following options + * would all give a width of 5 and not 10: + * -10 -w5 + * -5b10 + * -5 -10b */ + if (width == -1) + width = ch - '0'; + break; } break; default: usage(); } + previous_ch = ch; + } argv += optind; argc -= optind; From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 20:46:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4B21065673; Tue, 9 Nov 2010 20:46:42 +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 06B818FC1B; Tue, 9 Nov 2010 20:46:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9KkfQ0043474; Tue, 9 Nov 2010 20:46:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9KkfC5043471; Tue, 9 Nov 2010 20:46:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011092046.oA9KkfC5043471@svn.freebsd.org> From: John Baldwin Date: Tue, 9 Nov 2010 20:46: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: r215054 - in head/sys: amd64/include arm/include i386/include ia64/include kern mips/include pc98/include powerpc/include sparc64/include sun4v/include sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 20:46:42 -0000 Author: jhb Date: Tue Nov 9 20:46:41 2010 New Revision: 215054 URL: http://svn.freebsd.org/changeset/base/215054 Log: - Remove . Most of the headers were empty, and the contents of the ones that were not empty were stale and unused. - Now that no longer exists, there is no need to allow it to override various helper macros in . - Rename various helper macros for low-level operations on mutexes to live in the _mtx_* or __mtx_* namespaces. While here, change the names to more closely match the real API functions they are backing. - Drop support for including in assembly source files. Suggested by: bde (1, 2) Deleted: head/sys/amd64/include/mutex.h head/sys/arm/include/mutex.h head/sys/i386/include/mutex.h head/sys/ia64/include/mutex.h head/sys/mips/include/mutex.h head/sys/pc98/include/mutex.h head/sys/powerpc/include/mutex.h head/sys/sparc64/include/mutex.h head/sys/sun4v/include/mutex.h Modified: head/sys/kern/kern_mutex.c head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Tue Nov 9 20:44:55 2010 (r215053) +++ head/sys/kern/kern_mutex.c Tue Nov 9 20:46:41 2010 (r215054) @@ -200,7 +200,7 @@ _mtx_lock_flags(struct mtx *m, int opts, WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); - _get_sleep_lock(m, curthread, opts, file, line); + __mtx_lock(m, curthread, opts, file, line); LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, line); WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); @@ -224,7 +224,7 @@ _mtx_unlock_flags(struct mtx *m, int opt if (m->mtx_recurse == 0) LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_UNLOCK_RELEASE, m); - _rel_sleep_lock(m, curthread, opts, file, line); + __mtx_unlock(m, curthread, opts, file, line); } void @@ -243,7 +243,7 @@ _mtx_lock_spin_flags(struct mtx *m, int m->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); - _get_spin_lock(m, curthread, opts, file, line); + __mtx_lock_spin(m, curthread, opts, file, line); LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, line); WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); @@ -264,7 +264,7 @@ _mtx_unlock_spin_flags(struct mtx *m, in line); mtx_assert(m, MA_OWNED); - _rel_spin_lock(m); + __mtx_unlock_spin(m); } /* @@ -293,7 +293,7 @@ _mtx_trylock(struct mtx *m, int opts, co atomic_set_ptr(&m->mtx_lock, MTX_RECURSED); rval = 1; } else - rval = _obtain_lock(m, (uintptr_t)curthread); + rval = _mtx_obtain_lock(m, (uintptr_t)curthread); LOCK_LOG_TRY("LOCK", &m->lock_object, opts, rval, file, line); if (rval) { @@ -355,7 +355,7 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t "_mtx_lock_sleep: %s contested (lock=%p) at %s:%d", m->lock_object.lo_name, (void *)m->mtx_lock, file, line); - while (!_obtain_lock(m, tid)) { + while (!_mtx_obtain_lock(m, tid)) { #ifdef KDTRACE_HOOKS spin_cnt++; #endif @@ -511,7 +511,7 @@ _mtx_lock_spin(struct mtx *m, uintptr_t CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); lock_profile_obtain_lock_failed(&m->lock_object, &contested, &waittime); - while (!_obtain_lock(m, tid)) { + while (!_mtx_obtain_lock(m, tid)) { /* Give interrupts a chance while we spin. */ spinlock_exit(); @@ -569,7 +569,7 @@ retry: m->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); - while (!_obtain_lock(m, tid)) { + while (!_mtx_obtain_lock(m, tid)) { #ifdef KDTRACE_HOOKS spin_cnt++; #endif @@ -597,7 +597,7 @@ retry: } if (m == td->td_lock) break; - _rel_spin_lock(m); /* does spinlock_exit() */ + __mtx_unlock_spin(m); /* does spinlock_exit() */ #ifdef KDTRACE_HOOKS spin_cnt++; #endif @@ -673,7 +673,7 @@ _mtx_unlock_sleep(struct mtx *m, int opt CTR1(KTR_LOCK, "_mtx_unlock_sleep: %p contested", m); MPASS(ts != NULL); turnstile_broadcast(ts, TS_EXCLUSIVE_QUEUE); - _release_lock_quick(m); + _mtx_release_lock_quick(m); /* * This turnstile is now no longer associated with the mutex. We can @@ -685,7 +685,7 @@ _mtx_unlock_sleep(struct mtx *m, int opt /* * All the unlocking of MTX_SPIN locks is done inline. - * See the _rel_spin_lock() macro for the details. + * See the __mtx_unlock_spin() macro for the details. */ /* Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Tue Nov 9 20:44:55 2010 (r215053) +++ head/sys/sys/mutex.h Tue Nov 9 20:46:41 2010 (r215054) @@ -32,7 +32,6 @@ #ifndef _SYS_MUTEX_H_ #define _SYS_MUTEX_H_ -#ifndef LOCORE #include #include #include @@ -43,12 +42,6 @@ #include #include #include -#endif /* _KERNEL_ */ -#endif /* !LOCORE */ - -#include - -#ifdef _KERNEL /* * Mutex types and options passed to mtx_init(). MTX_QUIET and MTX_DUPOK @@ -83,8 +76,6 @@ #endif /* _KERNEL */ -#ifndef LOCORE - /* * XXX: Friendly reminder to fix things in MP code that is presently being * XXX: worked on. @@ -137,68 +128,59 @@ void _thread_lock_flags(struct thread *, #define mtx_recurse lock_object.lo_data -/* - * We define our machine-independent (unoptimized) mutex micro-operations - * here, if they are not already defined in the machine-dependent mutex.h - */ +/* Very simple operations on mtx_lock. */ /* Try to obtain mtx_lock once. */ -#ifndef _obtain_lock -#define _obtain_lock(mp, tid) \ +#define _mtx_obtain_lock(mp, tid) \ atomic_cmpset_acq_ptr(&(mp)->mtx_lock, MTX_UNOWNED, (tid)) -#endif /* Try to release mtx_lock if it is unrecursed and uncontested. */ -#ifndef _release_lock -#define _release_lock(mp, tid) \ +#define _mtx_release_lock(mp, tid) \ atomic_cmpset_rel_ptr(&(mp)->mtx_lock, (tid), MTX_UNOWNED) -#endif /* Release mtx_lock quickly, assuming we own it. */ -#ifndef _release_lock_quick -#define _release_lock_quick(mp) \ +#define _mtx_release_lock_quick(mp) \ atomic_store_rel_ptr(&(mp)->mtx_lock, MTX_UNOWNED) -#endif /* - * Obtain a sleep lock inline, or call the "hard" function if we can't get it - * easy. + * Full lock operations that are suitable to be inlined in non-debug + * kernels. If the lock cannot be acquired or released trivially then + * the work is deferred to another function. */ -#ifndef _get_sleep_lock -#define _get_sleep_lock(mp, tid, opts, file, line) do { \ + +/* Lock a normal mutex. */ +#define __mtx_lock(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ - if (!_obtain_lock((mp), _tid)) \ + \ + if (!_mtx_obtain_lock((mp), _tid)) \ _mtx_lock_sleep((mp), _tid, (opts), (file), (line)); \ else \ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_LOCK_ACQUIRE, \ mp, 0, 0, (file), (line)); \ } while (0) -#endif /* - * Obtain a spin lock inline, or call the "hard" function if we can't get it - * easy. For spinlocks, we handle recursion inline (it turns out that function - * calls can be significantly expensive on some architectures). - * Since spin locks are not _too_ common, inlining this code is not too big - * a deal. + * Lock a spin mutex. For spinlocks, we handle recursion inline (it + * turns out that function calls can be significantly expensive on + * some architectures). Since spin locks are not _too_ common, + * inlining this code is not too big a deal. */ -#ifndef _get_spin_lock #ifdef SMP -#define _get_spin_lock(mp, tid, opts, file, line) do { \ +#define __mtx_lock_spin(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ + \ spinlock_enter(); \ - if (!_obtain_lock((mp), _tid)) { \ + if (!_mtx_obtain_lock((mp), _tid)) { \ if ((mp)->mtx_lock == _tid) \ (mp)->mtx_recurse++; \ - else { \ + else \ _mtx_lock_spin((mp), _tid, (opts), (file), (line)); \ - } \ } else \ LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, \ mp, 0, 0, (file), (line)); \ } while (0) #else /* SMP */ -#define _get_spin_lock(mp, tid, opts, file, line) do { \ +#define __mtx_lock_spin(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ \ spinlock_enter(); \ @@ -206,49 +188,42 @@ void _thread_lock_flags(struct thread *, (mp)->mtx_recurse++; \ else { \ KASSERT((mp)->mtx_lock == MTX_UNOWNED, ("corrupt spinlock")); \ - (mp)->mtx_lock = _tid; \ + (mp)->mtx_lock = _tid; \ } \ } while (0) #endif /* SMP */ -#endif -/* - * Release a sleep lock inline, or call the "hard" function if we can't do it - * easy. - */ -#ifndef _rel_sleep_lock -#define _rel_sleep_lock(mp, tid, opts, file, line) do { \ +/* Unlock a normal mutex. */ +#define __mtx_unlock(mp, tid, opts, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ \ - if (!_release_lock((mp), _tid)) \ + if (!_mtx_release_lock((mp), _tid)) \ _mtx_unlock_sleep((mp), (opts), (file), (line)); \ } while (0) -#endif /* - * For spinlocks, we can handle everything inline, as it's pretty simple and - * a function call would be too expensive (at least on some architectures). - * Since spin locks are not _too_ common, inlining this code is not too big - * a deal. + * Unlock a spin mutex. For spinlocks, we can handle everything + * inline, as it's pretty simple and a function call would be too + * expensive (at least on some architectures). Since spin locks are + * not _too_ common, inlining this code is not too big a deal. * * Since we always perform a spinlock_enter() when attempting to acquire a * spin lock, we need to always perform a matching spinlock_exit() when * releasing a spin lock. This includes the recursion cases. */ -#ifndef _rel_spin_lock #ifdef SMP -#define _rel_spin_lock(mp) do { \ +#define __mtx_unlock_spin(mp) do { \ if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ else { \ LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_SPIN_UNLOCK_RELEASE, \ mp); \ - _release_lock_quick((mp)); \ + _mtx_release_lock_quick((mp)); \ } \ spinlock_exit(); \ } while (0) #else /* SMP */ -#define _rel_spin_lock(mp) do { \ +#define __mtx_unlock_spin(mp) do { \ if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ else { \ @@ -259,7 +234,6 @@ void _thread_lock_flags(struct thread *, spinlock_exit(); \ } while (0) #endif /* SMP */ -#endif /* * Exported lock manipulation interface. @@ -336,13 +310,13 @@ extern struct mtx_pool *mtxpool_sleep; _mtx_unlock_spin_flags((m), (opts), LOCK_FILE, LOCK_LINE) #else /* LOCK_DEBUG == 0 && !MUTEX_NOINLINE */ #define mtx_lock_flags(m, opts) \ - _get_sleep_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + __mtx_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_flags(m, opts) \ - _rel_sleep_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + __mtx_unlock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) #define mtx_lock_spin_flags(m, opts) \ - _get_spin_lock((m), curthread, (opts), LOCK_FILE, LOCK_LINE) + __mtx_lock_spin((m), curthread, (opts), LOCK_FILE, LOCK_LINE) #define mtx_unlock_spin_flags(m, opts) \ - _rel_spin_lock((m)) + __mtx_unlock_spin((m)) #endif /* LOCK_DEBUG > 0 || MUTEX_NOINLINE */ #define mtx_trylock_flags(m, opts) \ @@ -451,5 +425,4 @@ struct mtx_args { #define MTX_NETWORK_LOCK "network driver" #endif /* _KERNEL */ -#endif /* !LOCORE */ #endif /* _SYS_MUTEX_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 20:56:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EEE61065674; Tue, 9 Nov 2010 20:56:56 +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 0BBFA8FC0A; Tue, 9 Nov 2010 20:56:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9Kutsq044438; Tue, 9 Nov 2010 20:56:55 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9KutqY044436; Tue, 9 Nov 2010 20:56:55 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201011092056.oA9KutqY044436@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Tue, 9 Nov 2010 20:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215055 - stable/7/usr.bin/fold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 20:56:56 -0000 Author: dumbbell Date: Tue Nov 9 20:56:55 2010 New Revision: 215055 URL: http://svn.freebsd.org/changeset/base/215055 Log: MFC r214893: Fix a segmentation fault in argument processing. The crash was caused by a command line such as this one: # fold -b1 PR: bin/151592 Reported by: Marcus Reid Tested by: Marcus Reid Modified: stable/7/usr.bin/fold/fold.c Directory Properties: stable/7/usr.bin/fold/ (props changed) Modified: stable/7/usr.bin/fold/fold.c ============================================================================== --- stable/7/usr.bin/fold/fold.c Tue Nov 9 20:46:41 2010 (r215054) +++ stable/7/usr.bin/fold/fold.c Tue Nov 9 20:56:55 2010 (r215055) @@ -71,14 +71,14 @@ int sflag; /* Split on word boundaries int main(int argc, char **argv) { - int ch; + int ch, previous_ch; int rval, width; - char *p; (void) setlocale(LC_CTYPE, ""); width = -1; - while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1) + previous_ch = 0; + while ((ch = getopt(argc, argv, "0123456789bsw:")) != -1) { switch (ch) { case 'b': bflag = 1; @@ -93,17 +93,33 @@ main(int argc, char **argv) break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - if (width == -1) { - p = argv[optind - 1]; - if (p[0] == '-' && p[1] == ch && !p[2]) - width = atoi(++p); - else - width = atoi(argv[optind] + 1); + /* Accept a width as eg. -30. Note that a width + * specified using the -w option is always used prior + * to this undocumented option. */ + switch (previous_ch) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + /* The width is a number with multiple digits: + * add the last one. */ + width = width * 10 + (ch - '0'); + break; + default: + /* Set the width, unless it was previously + * set. For instance, the following options + * would all give a width of 5 and not 10: + * -10 -w5 + * -5b10 + * -5 -10b */ + if (width == -1) + width = ch - '0'; + break; } break; default: usage(); } + previous_ch = ch; + } argv += optind; argc -= optind; From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 21:00:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9C0F106566C; Tue, 9 Nov 2010 21:00:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BB918FC0C; Tue, 9 Nov 2010 21:00:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9L0OkW044876; Tue, 9 Nov 2010 21:00:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9L0OTj044874; Tue, 9 Nov 2010 21:00:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011092100.oA9L0OTj044874@svn.freebsd.org> From: Marius Strobl Date: Tue, 9 Nov 2010 21:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215056 - stable/8/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 21:00:24 -0000 Author: marius Date: Tue Nov 9 21:00:24 2010 New Revision: 215056 URL: http://svn.freebsd.org/changeset/base/215056 Log: MFC: r214873 - Move Sun Fire V240 to the list of known working machines. - For the parallel stable/7 and stable/8 branches mention both releases that first supported a particular sparc64 machine and update the sparc64 hardware list regarding machines that will be supported beginning with 7.4-RELEASE. Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 9 20:56:55 2010 (r215055) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 9 21:00:24 2010 (r215056) @@ -530,7 +530,11 @@ - &sun.fire; V215 (support first appeared in 7.3-RELEASE) + &sun.fire; V215 (support first appeared in 7.3-RELEASE and 8.1-RELEASE) + + + + &sun.fire; V240 @@ -539,12 +543,12 @@ &sun.fire; V440 (support for the on-board NICs first - appeared in 8.0-RELEASE) + appeared in 7.3-RELEASE and 8.0-RELEASE) &sun.fire; V480 (501-6780 and 501-6790 centerplanes only, for - which support first appeared in 7.3-RELEASE) + which support first appeared in 7.3-RELEASE and 8.1-RELEASE) @@ -552,7 +556,7 @@ - &sun.fire; V890 (support first appeared in 8.1-RELEASE, + &sun.fire; V890 (support first appeared in 7.4-RELEASE and 8.1-RELEASE, non-mixed &ultrasparc; IV/IV+ CPU-configurations only) @@ -570,20 +574,16 @@ - &sun.fire; V240 - - - - &sun.fire; V245 (support first appeared in 7.3-RELEASE) + &sun.fire; V245 (support first appeared in 7.3-RELEASE and 8.1-RELEASE) - &sun.fire; V490 (support first appeared in 8.1-RELEASE, + &sun.fire; V490 (support first appeared in 7.4-RELEASE and 8.1-RELEASE, non-mixed &ultrasparc; IV/IV+ CPU-configurations only) - Starting with 8.1-RELEASE, &arch.sparc64; systems based on + Starting with 7.4-RELEASE and 8.1-RELEASE, &arch.sparc64; systems based on Fujitsu &sparc64; V are also supported by &os;, which includes the following known working systems: From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 21:00:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBBC3106564A; Tue, 9 Nov 2010 21:00:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D79758FC0A; Tue, 9 Nov 2010 21:00:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9L0p1b044960; Tue, 9 Nov 2010 21:00:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9L0pOl044958; Tue, 9 Nov 2010 21:00:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011092100.oA9L0pOl044958@svn.freebsd.org> From: Marius Strobl Date: Tue, 9 Nov 2010 21:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215057 - stable/7/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 21:00:52 -0000 Author: marius Date: Tue Nov 9 21:00:51 2010 New Revision: 215057 URL: http://svn.freebsd.org/changeset/base/215057 Log: MFC: r208459, r208511, r214873 - Move Sun Fire V240 to the list of known working machines. - For the parallel stable/7 and stable/8 branches mention both releases that first supported a particular sparc64 machine and update the sparc64 hardware list regarding machines that were supported beginning with 8.1-RELEASE and will be supported beginning with 8.1-RELEASE. Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 9 21:00:24 2010 (r215056) +++ stable/7/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 9 21:00:51 2010 (r215057) @@ -37,6 +37,7 @@ &tm-attrib.freebsd; &tm-attrib.amd; + &tm-attrib.fujitsu; &tm-attrib.ibm; &tm-attrib.intel; &tm-attrib.sparc; @@ -321,15 +322,15 @@ sparc64 This section describes the systems currently known to be supported - by &os; on the &ultrasparc; platform. For background information on the + by &os; on the Fujitsu &sparc64; and Sun &ultrasparc; platforms. For background information on the various hardware designs see the Sun System Handbook. SMP is supported on all systems with more than 1 processor. When using the GENERIC kernel, &os;/&arch.sparc64; systems not equipped with a framebuffer - supported by the &man.creator.4; (&sun; Creator, &sun; Creator3D - and &sun; Elite3D) or &man.machfb.4; (&sun; PGX and &sun; PGX64 + supported by the &man.creator.4; (Sun Creator, Sun Creator3D + and Sun Elite3D) or &man.machfb.4; (Sun PGX and Sun PGX64 as well as the ATI Mach64 chips found onboard in for example &sun.blade; 100, &sun.blade; 150, &sun.ultra; 5 and &sun.ultra; 10) driver must use the serial console. @@ -343,13 +344,16 @@ + Naturetech GENIALstation 777S + + &sun.blade; 100 &sun.blade; 150 - &sun.enterprise; 100 + &sun.enterprise; 150 &sun.enterprise; 220R @@ -364,46 +368,53 @@ &sun.enterprise; 450 + &sun.fire; B100s (support for the on-board NICs first + appeared in 7.2-RELEASE and 8.1-RELEASE) + + &sun.fire; V100 &sun.fire; V120 - &netra; t1 105 + Sun &netra; t1 100/105 - &netra; T1 AC200/DC200 + Sun &netra; T1 AC200/DC200 - &netra; t 1100 + Sun &netra; t 1100 - &netra; t 1120 + Sun &netra; t 1120 - &netra; t 1125 + Sun &netra; t 1125 - &netra; t 1400/1405 + Sun &netra; t 1400/1405 - &netra; 120 + Sun &netra; 120 - &netra; X1 + Sun &netra; X1 - &sparcengine; Ultra AX1105 + Sun &sparcengine; Ultra AX1105 - &sparcengine; Ultra AXe + Sun &sparcengine; Ultra AXe - &sparcengine; Ultra AXi + Sun &sparcengine; Ultra AXi - &sparcengine; Ultra AXmp + Sun &sparcengine; Ultra AXmp + + + Sun &sparcengine; CP1500 &sun.ultra; 1 @@ -437,8 +448,8 @@ The following systems are partially supported by &os;. In particular the fibre channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller - supported by the &man.esp.4 driver (&sun; ESP SCSI, &sun; FAS Fast-SCSI - and &sun; FAS366 Fast-Wide SCSI controllers). + supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI + and Sun FAS366 Fast-Wide SCSI controllers). @@ -449,7 +460,7 @@ - Starting with 7.2-RELEASE, &arch.sparc64; systems based on + Starting with 7.2-RELEASE, &arch.sparc64; systems based on Sun &ultrasparc; III and beyond are also supported by &os;, which includes the following known working systems: @@ -473,8 +484,12 @@ &sun.fire; V210 - &sun.fire; V215 (support first appeared in 7.3-RELEASE) + &sun.fire; V215 (support first appeared in 7.3-RELEASE and 8.1-RELEASE) + + + &sun.fire; V240 + &sun.fire; V250 @@ -484,17 +499,21 @@ &sun.fire; V480 (501-6780 and 501-6790 centerplanes only, for - which support first appeared in 7.3-RELEASE) + which support first appeared in 7.3-RELEASE and 8.1-RELEASE) &sun.fire; V880 + &sun.fire; V890 (support first appeared in 7.4-RELEASE and 8.1-RELEASE, + non-mixed &ultrasparc; IV/IV+ CPU-configurations only) + + &netra; 20/&netra; T4 - The following &ultrasparc; IIIi systems are not tested but + The following Sun &ultrasparc; systems are not tested but believed to be also supported by &os;: @@ -502,12 +521,39 @@ &sun.fire; V125 - &sun.fire; V240 + &sun.fire; V245 (support first appeared in 7.3-RELEASE and 8.1-RELEASE) - &sun.fire; V245 (support first appeared in 7.3-RELEASE) + &sun.fire; V490 (support first appeared in 7.4-RELEASE and 8.1-RELEASE, + non-mixed &ultrasparc; IV/IV+ CPU-configurations only) + + Starting with 7.4-RELEASE and 8.1-RELEASE, &arch.sparc64; systems based on + Fujitsu &sparc64; V are also supported by &os;, which + includes the following known working systems: + + + + Fujitsu &primepower; 250 + + + + The following Fujitsu &primepower; systems are not tested but + believed to be also supported by &os;: + + + + Fujitsu &primepower; 450 + + + Fujitsu &primepower; 650 + + + Fujitsu &primepower; 850 + + + From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 21:06:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA76E1065674; Tue, 9 Nov 2010 21:06:26 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B683A8FC1C; Tue, 9 Nov 2010 21:06:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9L6Quq045595; Tue, 9 Nov 2010 21:06:26 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9L6QUA045590; Tue, 9 Nov 2010 21:06:26 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011092106.oA9L6QUA045590@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Nov 2010 21:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215058 - in stable/8/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 21:06:26 -0000 Author: attilio Date: Tue Nov 9 21:06:26 2010 New Revision: 215058 URL: http://svn.freebsd.org/changeset/base/215058 Log: MFC r214373, r214380, r214386: Move dump_machdep.c into x86/ for amd64, i386 and pc98. Sponsored by: Sandvine Incorporated Added: stable/8/sys/x86/x86/dump_machdep.c - copied, changed from r215054, stable/8/sys/i386/i386/dump_machdep.c Deleted: stable/8/sys/amd64/amd64/dump_machdep.c stable/8/sys/i386/i386/dump_machdep.c Modified: stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/files.pc98 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Nov 9 21:00:51 2010 (r215057) +++ stable/8/sys/conf/files.amd64 Tue Nov 9 21:06:26 2010 (r215058) @@ -104,7 +104,6 @@ amd64/amd64/cpu_switch.S standard amd64/amd64/db_disasm.c optional ddb amd64/amd64/db_interface.c optional ddb amd64/amd64/db_trace.c optional ddb -amd64/amd64/dump_machdep.c standard amd64/amd64/elf_machdep.c standard amd64/amd64/exception.S standard amd64/amd64/fpu.c standard @@ -318,4 +317,5 @@ x86/isa/isa.c standard x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/pci/qpi.c standard +x86/x86/dump_machdep.c standard x86/x86/mca.c standard Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Nov 9 21:00:51 2010 (r215057) +++ stable/8/sys/conf/files.i386 Tue Nov 9 21:06:26 2010 (r215058) @@ -260,7 +260,6 @@ i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb -i386/i386/dump_machdep.c standard i386/i386/elan-mmcr.c optional cpu_elan | cpu_soekris i386/i386/elf_machdep.c standard i386/i386/exception.s optional native @@ -393,4 +392,5 @@ x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/pci/qpi.c standard +x86/x86/dump_machdep.c standard x86/x86/mca.c standard Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Tue Nov 9 21:00:51 2010 (r215057) +++ stable/8/sys/conf/files.pc98 Tue Nov 9 21:06:26 2010 (r215058) @@ -138,7 +138,6 @@ i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb -i386/i386/dump_machdep.c standard i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb @@ -257,4 +256,5 @@ pc98/pc98/pc98_machdep.c standard # x86/isa/atpic.c optional atpic x86/isa/isa.c optional isa +x86/x86/dump_machdep.c standard x86/x86/mca.c standard Copied and modified: stable/8/sys/x86/x86/dump_machdep.c (from r215054, stable/8/sys/i386/i386/dump_machdep.c) ============================================================================== --- stable/8/sys/i386/i386/dump_machdep.c Tue Nov 9 20:46:41 2010 (r215054, copy source) +++ stable/8/sys/x86/x86/dump_machdep.c Tue Nov 9 21:06:26 2010 (r215058) @@ -39,6 +39,14 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __amd64__ +#define KERNELDUMP_VERSION KERNELDUMP_AMD64_VERSION +#define EM_VALUE EM_X86_64 +#else +#define KERNELDUMP_VERSION KERNELDUMP_I386_VERSION +#define EM_VALUE EM_386 +#endif + CTASSERT(sizeof(struct kerneldumpheader) == 512); int do_minidump = 1; @@ -168,7 +176,8 @@ cb_dumpdata(struct md_pa *mdp, int seqnr if (maxdumppgs == 0) /* seatbelt */ maxdumppgs = 1; - printf(" chunk %d: %lldMB (%lld pages)", seqnr, PG2MB(pgs), pgs); + printf(" chunk %d: %juMB (%ju pages)", seqnr, (uintmax_t)PG2MB(pgs), + (uintmax_t)pgs); while (pgs) { chunk = pgs; @@ -177,7 +186,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr sz = chunk << PAGE_SHIFT; counter += sz; if (counter >> 24) { - printf(" %lld", PG2MB(pgs)); + printf(" %ju", (uintmax_t)PG2MB(pgs)); counter &= (1<<24) - 1; } for (i = 0; i < chunk; i++) { @@ -279,7 +288,7 @@ dumpsys(struct dumperinfo *di) ehdr.e_ident[EI_VERSION] = EV_CURRENT; ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; - ehdr.e_machine = EM_386; + ehdr.e_machine = EM_VALUE; ehdr.e_phoff = sizeof(ehdr); ehdr.e_flags = 0; ehdr.e_ehsize = sizeof(ehdr); @@ -304,7 +313,8 @@ dumpsys(struct dumperinfo *di) dumplo = di->mediaoffset + di->mediasize - dumpsize; dumplo -= sizeof(kdh) * 2; - mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION, dumpsize, di->blocksize); + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_VERSION, dumpsize, + di->blocksize); printf("Dumping %llu MB (%d chunks)\n", (long long)dumpsize >> 20, ehdr.e_phnum); From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 21:18:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE3F5106566B; Tue, 9 Nov 2010 21:18:32 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C94498FC08; Tue, 9 Nov 2010 21:18:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9LIW44046805; Tue, 9 Nov 2010 21:18:32 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9LIWqR046797; Tue, 9 Nov 2010 21:18:32 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011092118.oA9LIWqR046797@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Nov 2010 21:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215059 - in stable/8/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 21:18:33 -0000 Author: attilio Date: Tue Nov 9 21:18:32 2010 New Revision: 215059 URL: http://svn.freebsd.org/changeset/base/215059 Log: MFC r214446, r214516: Move mptable support to x86/ subtree. Sponsored by: Sandvine Incorporated Added: stable/8/sys/x86/x86/mptable.c - copied, changed from r215054, stable/8/sys/i386/i386/mptable.c stable/8/sys/x86/x86/mptable_pci.c - copied unchanged from r215054, stable/8/sys/i386/i386/mptable_pci.c Deleted: stable/8/sys/amd64/amd64/mptable.c stable/8/sys/amd64/amd64/mptable_pci.c stable/8/sys/i386/i386/mptable.c stable/8/sys/i386/i386/mptable_pci.c Modified: stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/files.pc98 stable/8/sys/conf/options.amd64 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Nov 9 21:06:26 2010 (r215058) +++ stable/8/sys/conf/files.amd64 Tue Nov 9 21:18:32 2010 (r215059) @@ -123,8 +123,6 @@ amd64/amd64/minidump_machdep.c standard amd64/amd64/mp_machdep.c optional smp amd64/amd64/mp_watchdog.c optional mp_watchdog smp amd64/amd64/mpboot.S optional smp -amd64/amd64/mptable.c optional mptable -amd64/amd64/mptable_pci.c optional mptable pci amd64/amd64/msi.c optional pci amd64/amd64/nexus.c standard amd64/amd64/pmap.c standard @@ -319,3 +317,5 @@ x86/isa/nmi.c standard x86/pci/qpi.c standard x86/x86/dump_machdep.c standard x86/x86/mca.c standard +x86/x86/mptable.c optional mptable +x86/x86/mptable_pci.c optional mptable pci Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Nov 9 21:06:26 2010 (r215058) +++ stable/8/sys/conf/files.i386 Tue Nov 9 21:18:32 2010 (r215059) @@ -288,9 +288,7 @@ i386/i386/mp_machdep.c optional native i386/xen/mp_machdep.c optional xen smp i386/i386/mp_watchdog.c optional mp_watchdog smp i386/i386/mpboot.s optional smp native -i386/i386/mptable.c optional apic native i386/xen/mptable.c optional apic xen -i386/i386/mptable_pci.c optional apic pci i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon @@ -394,3 +392,5 @@ x86/isa/nmi.c standard x86/pci/qpi.c standard x86/x86/dump_machdep.c standard x86/x86/mca.c standard +x86/x86/mptable.c optional apic native +x86/x86/mptable_pci.c optional apic pci Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Tue Nov 9 21:06:26 2010 (r215058) +++ stable/8/sys/conf/files.pc98 Tue Nov 9 21:18:32 2010 (r215059) @@ -158,8 +158,6 @@ i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mp_watchdog.c optional mp_watchdog smp i386/i386/mpboot.s optional smp -i386/i386/mptable.c optional apic -i386/i386/mptable_pci.c optional apic pci i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon @@ -258,3 +256,5 @@ x86/isa/atpic.c optional atpic x86/isa/isa.c optional isa x86/x86/dump_machdep.c standard x86/x86/mca.c standard +x86/x86/mptable.c optional apic +x86/x86/mptable_pci.c optional apic pci Modified: stable/8/sys/conf/options.amd64 ============================================================================== --- stable/8/sys/conf/options.amd64 Tue Nov 9 21:06:26 2010 (r215058) +++ stable/8/sys/conf/options.amd64 Tue Nov 9 21:18:32 2010 (r215059) @@ -6,6 +6,7 @@ AUTO_EOI_2 opt_auto_eoi.h MAXMEM PERFMON PMAP_SHPGPERPROC opt_pmap.h +MPTABLE_FORCE_HTT MP_WATCHDOG # Options for emulators. These should only be used at config time, so Copied and modified: stable/8/sys/x86/x86/mptable.c (from r215054, stable/8/sys/i386/i386/mptable.c) ============================================================================== --- stable/8/sys/i386/i386/mptable.c Tue Nov 9 20:46:41 2010 (r215054, copy source) +++ stable/8/sys/x86/x86/mptable.c Tue Nov 9 21:18:32 2010 (r215059) @@ -51,7 +51,11 @@ __FBSDID("$FreeBSD$"); /* string defined by the Intel MP Spec as identifying the MP table */ #define MP_SIG 0x5f504d5f /* _MP_ */ +#ifdef __amd64__ +#define MAX_LAPIC_ID 63 /* Max local APIC ID for HTT fixup */ +#else #define MAX_LAPIC_ID 31 /* Max local APIC ID for HTT fixup */ +#endif #ifdef PC98 #define BIOS_BASE (0xe8000) Copied: stable/8/sys/x86/x86/mptable_pci.c (from r215054, stable/8/sys/i386/i386/mptable_pci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/x86/x86/mptable_pci.c Tue Nov 9 21:18:32 2010 (r215059, copy of r215054, stable/8/sys/i386/i386/mptable_pci.c) @@ -0,0 +1,200 @@ +/*- + * Copyright (c) 2003 John Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Host to PCI and PCI to PCI bridge drivers that use the MP Table to route + * interrupts from PCI devices to I/O APICs. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "pcib_if.h" + +/* Host to PCI bridge driver. */ + +static int +mptable_hostb_probe(device_t dev) +{ + + if (pci_cfgregopen() == 0) + return (ENXIO); + if (mptable_pci_probe_table(pcib_get_bus(dev)) != 0) + return (ENXIO); + device_set_desc(dev, "MPTable Host-PCI bridge"); + return (0); +} + +static int +mptable_hostb_attach(device_t dev) +{ + + device_add_child(dev, "pci", pcib_get_bus(dev)); + return (bus_generic_attach(dev)); +} + +/* Pass MSI requests up to the nexus. */ +static int +mptable_hostb_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, + int *irqs) +{ + device_t bus; + + bus = device_get_parent(pcib); + return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount, + irqs)); +} + +static int +mptable_hostb_alloc_msix(device_t pcib, device_t dev, int *irq) +{ + device_t bus; + + bus = device_get_parent(pcib); + return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq)); +} + +static int +mptable_hostb_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, + uint32_t *data) +{ + device_t bus; + + bus = device_get_parent(pcib); + return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); +} + +static device_method_t mptable_hostb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mptable_hostb_probe), + DEVMETHOD(device_attach, mptable_hostb_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), + DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), + DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + + /* pcib interface */ + DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots), + DEVMETHOD(pcib_read_config, legacy_pcib_read_config), + DEVMETHOD(pcib_write_config, legacy_pcib_write_config), + DEVMETHOD(pcib_route_interrupt, mptable_pci_route_interrupt), + DEVMETHOD(pcib_alloc_msi, mptable_hostb_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, mptable_hostb_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), + DEVMETHOD(pcib_map_msi, mptable_hostb_map_msi), + + { 0, 0 } +}; + +static devclass_t hostb_devclass; + +DEFINE_CLASS_0(pcib, mptable_hostb_driver, mptable_hostb_methods, 1); +DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, hostb_devclass, 0, 0); + +/* PCI to PCI bridge driver. */ + +static int +mptable_pcib_probe(device_t dev) +{ + int bus; + + if ((pci_get_class(dev) != PCIC_BRIDGE) || + (pci_get_subclass(dev) != PCIS_BRIDGE_PCI)) + return (ENXIO); + bus = pci_read_config(dev, PCIR_SECBUS_1, 1); + if (bus == 0) + return (ENXIO); + if (mptable_pci_probe_table(bus) != 0) + return (ENXIO); + device_set_desc(dev, "MPTable PCI-PCI bridge"); + return (-1000); +} + +static device_method_t mptable_pcib_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mptable_pcib_probe), + DEVMETHOD(device_attach, pcib_attach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, pcib_read_ivar), + DEVMETHOD(bus_write_ivar, pcib_write_ivar), + DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + + /* pcib interface */ + DEVMETHOD(pcib_maxslots, pcib_maxslots), + DEVMETHOD(pcib_read_config, pcib_read_config), + DEVMETHOD(pcib_write_config, pcib_write_config), + DEVMETHOD(pcib_route_interrupt, mptable_pci_route_interrupt), + DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, pcib_release_msix), + DEVMETHOD(pcib_map_msi, pcib_map_msi), + + {0, 0} +}; + +static devclass_t pcib_devclass; + +DEFINE_CLASS_0(pcib, mptable_pcib_driver, mptable_pcib_pci_methods, + sizeof(struct pcib_softc)); +DRIVER_MODULE(mptable_pcib, pci, mptable_pcib_driver, pcib_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 21:23:58 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 505611065670; Tue, 9 Nov 2010 21:23:58 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id D43D78FC17; Tue, 9 Nov 2010 21:23:57 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id oA9LNuHu060251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Nov 2010 22:23:57 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1289337837; bh=mXshK+kKdilgGyrPRv+gD2bypOqmkktRvJXtPGS+j9A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=n02P9ZNT33kbykeyb2/BzfGMOyBGHLIsa1mKUhzoAUSmF7hEe3fORZ/dxwatKq9xR iWbNLdc1qZBhFHOOciVP/zxFlqX30II37EgOteL6i5f6tfUxoiDpRZWElxFOWTKf8w WdY8ug/OT2u9sBApRhKNcGvBmtCcTIowOyRpceTc= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id oA9LNui1060250; Tue, 9 Nov 2010 22:23:56 +0100 (CET) (envelope-from uqs@spoerlein.net) Date: Tue, 9 Nov 2010 22:23:56 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: "David E. O'Brien" Message-ID: <20101109212356.GC85693@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , "David E. O'Brien" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201011091832.oA9IWvCo034092@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011091832.oA9IWvCo034092@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: r215041 - head/contrib/bzip2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 21:23:58 -0000 On Tue, 09.11.2010 at 18:32:57 +0000, David E. O'Brien wrote: > Author: obrien > Date: Tue Nov 9 18:32:57 2010 > New Revision: 215041 > URL: http://svn.freebsd.org/changeset/base/215041 > > Log: > Upgrade to Bzip2 version 1.0.6. > > Reviewed by: SO (cperciva) > > Modified: > head/contrib/bzip2/CHANGES > head/contrib/bzip2/LICENSE > head/contrib/bzip2/Makefile > head/contrib/bzip2/Makefile-libbz2_so > head/contrib/bzip2/README > head/contrib/bzip2/README.COMPILATION.PROBLEMS > head/contrib/bzip2/blocksort.c > head/contrib/bzip2/bzip2.1 > head/contrib/bzip2/bzip2.c > head/contrib/bzip2/bzip2recover.c > head/contrib/bzip2/bzlib.c > head/contrib/bzip2/bzlib.h > head/contrib/bzip2/bzlib_private.h > head/contrib/bzip2/compress.c > head/contrib/bzip2/crctable.c > head/contrib/bzip2/decompress.c > head/contrib/bzip2/huffman.c > head/contrib/bzip2/randtable.c > head/contrib/bzip2/spewG.c > head/contrib/bzip2/unzcrash.c > Directory Properties: > head/contrib/bzip2/ (props changed) Perhaps I'm reading this wrong, but shouldn't those files have been copied/merged from vendor/bzip2/dist? Uli From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:03:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 173191065672; Tue, 9 Nov 2010 22:03:25 +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 D8EF28FC13; Tue, 9 Nov 2010 22:03:24 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 87A7F46B2E; Tue, 9 Nov 2010 17:03:24 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AC6138A01D; Tue, 9 Nov 2010 17:03:23 -0500 (EST) From: John Baldwin To: Attilio Rao Date: Tue, 9 Nov 2010 17:03:20 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201011092118.oA9LIWqR046797@svn.freebsd.org> In-Reply-To: <201011092118.oA9LIWqR046797@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201011091703.20965.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 09 Nov 2010 17:03:23 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r215059 - in stable/8/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:03:25 -0000 On Tuesday, November 09, 2010 4:18:32 pm Attilio Rao wrote: > Author: attilio > Date: Tue Nov 9 21:18:32 2010 > New Revision: 215059 > URL: http://svn.freebsd.org/changeset/base/215059 > > Log: > MFC r214446, r214516: > Move mptable support to x86/ subtree. > > Sponsored by: Sandvine Incorporated You need to fix the SYSINIT that registers the MP Table APIC enumerator for amd64 to use SI_SUB_TUNABLES - 1 instead of SI_SUB_CPU - 1. It should stay at SI_SUB_CPU - 1 for i386. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:03:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3926106564A; Tue, 9 Nov 2010 22:03:39 +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 BE6728FC0C; Tue, 9 Nov 2010 22:03:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9M3d6V052615; Tue, 9 Nov 2010 22:03:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9M3dkQ052610; Tue, 9 Nov 2010 22:03:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011092203.oA9M3dkQ052610@svn.freebsd.org> From: Alexander Motin Date: Tue, 9 Nov 2010 22:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215060 - in stable/8/sys: amd64/amd64 conf i386/i386 x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:03:39 -0000 Author: mav Date: Tue Nov 9 22:03:39 2010 New Revision: 215060 URL: http://svn.freebsd.org/changeset/base/215060 Log: MFC r208922 by jhb: Move the MD support for PCI message signalled interrupts to the x86 tree as it is identical for i386 and amd64. Added: stable/8/sys/x86/x86/msi.c - copied unchanged from r208922, head/sys/x86/x86/msi.c Deleted: stable/8/sys/amd64/amd64/msi.c stable/8/sys/i386/i386/msi.c Modified: stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/files.pc98 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Nov 9 21:18:32 2010 (r215059) +++ stable/8/sys/conf/files.amd64 Tue Nov 9 22:03:39 2010 (r215060) @@ -123,7 +123,6 @@ amd64/amd64/minidump_machdep.c standard amd64/amd64/mp_machdep.c optional smp amd64/amd64/mp_watchdog.c optional mp_watchdog smp amd64/amd64/mpboot.S optional smp -amd64/amd64/msi.c optional pci amd64/amd64/nexus.c standard amd64/amd64/pmap.c standard amd64/amd64/prof_machdep.c optional profiling-routine @@ -319,3 +318,4 @@ x86/x86/dump_machdep.c standard x86/x86/mca.c standard x86/x86/mptable.c optional mptable x86/x86/mptable_pci.c optional mptable pci +x86/x86/msi.c optional pci Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Nov 9 21:18:32 2010 (r215059) +++ stable/8/sys/conf/files.i386 Tue Nov 9 22:03:39 2010 (r215060) @@ -289,7 +289,6 @@ i386/xen/mp_machdep.c optional xen smp i386/i386/mp_watchdog.c optional mp_watchdog smp i386/i386/mpboot.s optional smp native i386/xen/mptable.c optional apic xen -i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap.c optional native @@ -394,3 +393,4 @@ x86/x86/dump_machdep.c standard x86/x86/mca.c standard x86/x86/mptable.c optional apic native x86/x86/mptable_pci.c optional apic pci +x86/x86/msi.c optional apic pci Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Tue Nov 9 21:18:32 2010 (r215059) +++ stable/8/sys/conf/files.pc98 Tue Nov 9 22:03:39 2010 (r215060) @@ -158,7 +158,6 @@ i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mp_watchdog.c optional mp_watchdog smp i386/i386/mpboot.s optional smp -i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard @@ -258,3 +257,4 @@ x86/x86/dump_machdep.c standard x86/x86/mca.c standard x86/x86/mptable.c optional apic x86/x86/mptable_pci.c optional apic pci +x86/x86/msi.c optional apic pci Copied: stable/8/sys/x86/x86/msi.c (from r208922, head/sys/x86/x86/msi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/x86/x86/msi.c Tue Nov 9 22:03:39 2010 (r215060, copy of r208922, head/sys/x86/x86/msi.c) @@ -0,0 +1,602 @@ +/*- + * Copyright (c) 2006 Yahoo!, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Support for PCI Message Signalled Interrupts (MSI). MSI interrupts on + * x86 are basically APIC messages that the northbridge delivers directly + * to the local APICs as if they had come from an I/O APIC. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Fields in address for Intel MSI messages. */ +#define MSI_INTEL_ADDR_DEST 0x000ff000 +#define MSI_INTEL_ADDR_RH 0x00000008 +# define MSI_INTEL_ADDR_RH_ON 0x00000008 +# define MSI_INTEL_ADDR_RH_OFF 0x00000000 +#define MSI_INTEL_ADDR_DM 0x00000004 +# define MSI_INTEL_ADDR_DM_PHYSICAL 0x00000000 +# define MSI_INTEL_ADDR_DM_LOGICAL 0x00000004 + +/* Fields in data for Intel MSI messages. */ +#define MSI_INTEL_DATA_TRGRMOD IOART_TRGRMOD /* Trigger mode. */ +# define MSI_INTEL_DATA_TRGREDG IOART_TRGREDG +# define MSI_INTEL_DATA_TRGRLVL IOART_TRGRLVL +#define MSI_INTEL_DATA_LEVEL 0x00004000 /* Polarity. */ +# define MSI_INTEL_DATA_DEASSERT 0x00000000 +# define MSI_INTEL_DATA_ASSERT 0x00004000 +#define MSI_INTEL_DATA_DELMOD IOART_DELMOD /* Delivery mode. */ +# define MSI_INTEL_DATA_DELFIXED IOART_DELFIXED +# define MSI_INTEL_DATA_DELLOPRI IOART_DELLOPRI +# define MSI_INTEL_DATA_DELSMI IOART_DELSMI +# define MSI_INTEL_DATA_DELNMI IOART_DELNMI +# define MSI_INTEL_DATA_DELINIT IOART_DELINIT +# define MSI_INTEL_DATA_DELEXINT IOART_DELEXINT +#define MSI_INTEL_DATA_INTVEC IOART_INTVEC /* Interrupt vector. */ + +/* + * Build Intel MSI message and data values from a source. AMD64 systems + * seem to be compatible, so we use the same function for both. + */ +#define INTEL_ADDR(msi) \ + (MSI_INTEL_ADDR_BASE | (msi)->msi_cpu << 12 | \ + MSI_INTEL_ADDR_RH_OFF | MSI_INTEL_ADDR_DM_PHYSICAL) +#define INTEL_DATA(msi) \ + (MSI_INTEL_DATA_TRGREDG | MSI_INTEL_DATA_DELFIXED | (msi)->msi_vector) + +static MALLOC_DEFINE(M_MSI, "msi", "PCI MSI"); + +/* + * MSI sources are bunched into groups. This is because MSI forces + * all of the messages to share the address and data registers and + * thus certain properties (such as the local APIC ID target on x86). + * Each group has a 'first' source that contains information global to + * the group. These fields are marked with (g) below. + * + * Note that local APIC ID is kind of special. Each message will be + * assigned an ID by the system; however, a group will use the ID from + * the first message. + * + * For MSI-X, each message is isolated. + */ +struct msi_intsrc { + struct intsrc msi_intsrc; + device_t msi_dev; /* Owning device. (g) */ + struct msi_intsrc *msi_first; /* First source in group. */ + u_int msi_irq; /* IRQ cookie. */ + u_int msi_msix; /* MSI-X message. */ + u_int msi_vector:8; /* IDT vector. */ + u_int msi_cpu:8; /* Local APIC ID. (g) */ + u_int msi_count:8; /* Messages in this group. (g) */ + u_int msi_maxcount:8; /* Alignment for this group. (g) */ + int *msi_irqs; /* Group's IRQ list. (g) */ +}; + +static void msi_create_source(void); +static void msi_enable_source(struct intsrc *isrc); +static void msi_disable_source(struct intsrc *isrc, int eoi); +static void msi_eoi_source(struct intsrc *isrc); +static void msi_enable_intr(struct intsrc *isrc); +static void msi_disable_intr(struct intsrc *isrc); +static int msi_vector(struct intsrc *isrc); +static int msi_source_pending(struct intsrc *isrc); +static int msi_config_intr(struct intsrc *isrc, enum intr_trigger trig, + enum intr_polarity pol); +static int msi_assign_cpu(struct intsrc *isrc, u_int apic_id); + +struct pic msi_pic = { msi_enable_source, msi_disable_source, msi_eoi_source, + msi_enable_intr, msi_disable_intr, msi_vector, + msi_source_pending, NULL, NULL, msi_config_intr, + msi_assign_cpu }; + +static int msi_enabled; +static int msi_last_irq; +static struct mtx msi_lock; + +static void +msi_enable_source(struct intsrc *isrc) +{ +} + +static void +msi_disable_source(struct intsrc *isrc, int eoi) +{ + + if (eoi == PIC_EOI) + lapic_eoi(); +} + +static void +msi_eoi_source(struct intsrc *isrc) +{ + + lapic_eoi(); +} + +static void +msi_enable_intr(struct intsrc *isrc) +{ + struct msi_intsrc *msi = (struct msi_intsrc *)isrc; + + apic_enable_vector(msi->msi_cpu, msi->msi_vector); +} + +static void +msi_disable_intr(struct intsrc *isrc) +{ + struct msi_intsrc *msi = (struct msi_intsrc *)isrc; + + apic_disable_vector(msi->msi_cpu, msi->msi_vector); +} + +static int +msi_vector(struct intsrc *isrc) +{ + struct msi_intsrc *msi = (struct msi_intsrc *)isrc; + + return (msi->msi_irq); +} + +static int +msi_source_pending(struct intsrc *isrc) +{ + + return (0); +} + +static int +msi_config_intr(struct intsrc *isrc, enum intr_trigger trig, + enum intr_polarity pol) +{ + + return (ENODEV); +} + +static int +msi_assign_cpu(struct intsrc *isrc, u_int apic_id) +{ + struct msi_intsrc *sib, *msi = (struct msi_intsrc *)isrc; + int old_vector; + u_int old_id; + int i, vector; + + /* + * Only allow CPUs to be assigned to the first message for an + * MSI group. + */ + if (msi->msi_first != msi) + return (EINVAL); + + /* Store information to free existing irq. */ + old_vector = msi->msi_vector; + old_id = msi->msi_cpu; + if (old_id == apic_id) + return (0); + + /* Allocate IDT vectors on this cpu. */ + if (msi->msi_count > 1) { + KASSERT(msi->msi_msix == 0, ("MSI-X message group")); + vector = apic_alloc_vectors(apic_id, msi->msi_irqs, + msi->msi_count, msi->msi_maxcount); + } else + vector = apic_alloc_vector(apic_id, msi->msi_irq); + if (vector == 0) + return (ENOSPC); + + msi->msi_cpu = apic_id; + msi->msi_vector = vector; + if (msi->msi_intsrc.is_handlers > 0) + apic_enable_vector(msi->msi_cpu, msi->msi_vector); + if (bootverbose) + printf("msi: Assigning %s IRQ %d to local APIC %u vector %u\n", + msi->msi_msix ? "MSI-X" : "MSI", msi->msi_irq, + msi->msi_cpu, msi->msi_vector); + for (i = 1; i < msi->msi_count; i++) { + sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]); + sib->msi_cpu = apic_id; + sib->msi_vector = vector + i; + if (sib->msi_intsrc.is_handlers > 0) + apic_enable_vector(sib->msi_cpu, sib->msi_vector); + if (bootverbose) + printf( + "msi: Assigning MSI IRQ %d to local APIC %u vector %u\n", + sib->msi_irq, sib->msi_cpu, sib->msi_vector); + } + pci_remap_msi_irq(msi->msi_dev, msi->msi_irq); + + /* + * Free the old vector after the new one is established. This is done + * to prevent races where we could miss an interrupt. + */ + if (msi->msi_intsrc.is_handlers > 0) + apic_disable_vector(old_id, old_vector); + apic_free_vector(old_id, old_vector, msi->msi_irq); + for (i = 1; i < msi->msi_count; i++) { + sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]); + if (sib->msi_intsrc.is_handlers > 0) + apic_disable_vector(old_id, old_vector + i); + apic_free_vector(old_id, old_vector + i, msi->msi_irqs[i]); + } + return (0); +} + +void +msi_init(void) +{ + + /* Check if we have a supported CPU. */ + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf) + break; + /* FALLTHROUGH */ + default: + return; + } + + msi_enabled = 1; + intr_register_pic(&msi_pic); + mtx_init(&msi_lock, "msi", NULL, MTX_DEF); +} + +static void +msi_create_source(void) +{ + struct msi_intsrc *msi; + u_int irq; + + mtx_lock(&msi_lock); + if (msi_last_irq >= NUM_MSI_INTS) { + mtx_unlock(&msi_lock); + return; + } + irq = msi_last_irq + FIRST_MSI_INT; + msi_last_irq++; + mtx_unlock(&msi_lock); + + msi = malloc(sizeof(struct msi_intsrc), M_MSI, M_WAITOK | M_ZERO); + msi->msi_intsrc.is_pic = &msi_pic; + msi->msi_irq = irq; + intr_register_source(&msi->msi_intsrc); + nexus_add_irq(irq); +} + +/* + * Try to allocate 'count' interrupt sources with contiguous IDT values. + */ +int +msi_alloc(device_t dev, int count, int maxcount, int *irqs) +{ + struct msi_intsrc *msi, *fsrc; + u_int cpu; + int cnt, i, *mirqs, vector; + + if (!msi_enabled) + return (ENXIO); + + if (count > 1) + mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK); + else + mirqs = NULL; +again: + mtx_lock(&msi_lock); + + /* Try to find 'count' free IRQs. */ + cnt = 0; + for (i = FIRST_MSI_INT; i < FIRST_MSI_INT + NUM_MSI_INTS; i++) { + msi = (struct msi_intsrc *)intr_lookup_source(i); + + /* End of allocated sources, so break. */ + if (msi == NULL) + break; + + /* If this is a free one, save its IRQ in the array. */ + if (msi->msi_dev == NULL) { + irqs[cnt] = i; + cnt++; + if (cnt == count) + break; + } + } + + /* Do we need to create some new sources? */ + if (cnt < count) { + /* If we would exceed the max, give up. */ + if (i + (count - cnt) > FIRST_MSI_INT + NUM_MSI_INTS) { + mtx_unlock(&msi_lock); + free(mirqs, M_MSI); + return (ENXIO); + } + mtx_unlock(&msi_lock); + + /* We need count - cnt more sources. */ + while (cnt < count) { + msi_create_source(); + cnt++; + } + goto again; + } + + /* Ok, we now have the IRQs allocated. */ + KASSERT(cnt == count, ("count mismatch")); + + /* Allocate 'count' IDT vectors. */ + cpu = intr_next_cpu(); + vector = apic_alloc_vectors(cpu, irqs, count, maxcount); + if (vector == 0) { + mtx_unlock(&msi_lock); + free(mirqs, M_MSI); + return (ENOSPC); + } + + /* Assign IDT vectors and make these messages owned by 'dev'. */ + fsrc = (struct msi_intsrc *)intr_lookup_source(irqs[0]); + for (i = 0; i < count; i++) { + msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]); + msi->msi_cpu = cpu; + msi->msi_dev = dev; + msi->msi_vector = vector + i; + if (bootverbose) + printf( + "msi: routing MSI IRQ %d to local APIC %u vector %u\n", + msi->msi_irq, msi->msi_cpu, msi->msi_vector); + msi->msi_first = fsrc; + KASSERT(msi->msi_intsrc.is_handlers == 0, + ("dead MSI has handlers")); + } + fsrc->msi_count = count; + fsrc->msi_maxcount = maxcount; + if (count > 1) + bcopy(irqs, mirqs, count * sizeof(*mirqs)); + fsrc->msi_irqs = mirqs; + mtx_unlock(&msi_lock); + + return (0); +} + +int +msi_release(int *irqs, int count) +{ + struct msi_intsrc *msi, *first; + int i; + + mtx_lock(&msi_lock); + first = (struct msi_intsrc *)intr_lookup_source(irqs[0]); + if (first == NULL) { + mtx_unlock(&msi_lock); + return (ENOENT); + } + + /* Make sure this isn't an MSI-X message. */ + if (first->msi_msix) { + mtx_unlock(&msi_lock); + return (EINVAL); + } + + /* Make sure this message is allocated to a group. */ + if (first->msi_first == NULL) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + + /* + * Make sure this is the start of a group and that we are releasing + * the entire group. + */ + if (first->msi_first != first || first->msi_count != count) { + mtx_unlock(&msi_lock); + return (EINVAL); + } + KASSERT(first->msi_dev != NULL, ("unowned group")); + + /* Clear all the extra messages in the group. */ + for (i = 1; i < count; i++) { + msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]); + KASSERT(msi->msi_first == first, ("message not in group")); + KASSERT(msi->msi_dev == first->msi_dev, ("owner mismatch")); + msi->msi_first = NULL; + msi->msi_dev = NULL; + apic_free_vector(msi->msi_cpu, msi->msi_vector, msi->msi_irq); + msi->msi_vector = 0; + } + + /* Clear out the first message. */ + first->msi_first = NULL; + first->msi_dev = NULL; + apic_free_vector(first->msi_cpu, first->msi_vector, first->msi_irq); + first->msi_vector = 0; + first->msi_count = 0; + first->msi_maxcount = 0; + free(first->msi_irqs, M_MSI); + first->msi_irqs = NULL; + + mtx_unlock(&msi_lock); + return (0); +} + +int +msi_map(int irq, uint64_t *addr, uint32_t *data) +{ + struct msi_intsrc *msi; + + mtx_lock(&msi_lock); + msi = (struct msi_intsrc *)intr_lookup_source(irq); + if (msi == NULL) { + mtx_unlock(&msi_lock); + return (ENOENT); + } + + /* Make sure this message is allocated to a device. */ + if (msi->msi_dev == NULL) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + + /* + * If this message isn't an MSI-X message, make sure it's part + * of a group, and switch to the first message in the + * group. + */ + if (!msi->msi_msix) { + if (msi->msi_first == NULL) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + msi = msi->msi_first; + } + + *addr = INTEL_ADDR(msi); + *data = INTEL_DATA(msi); + mtx_unlock(&msi_lock); + return (0); +} + +int +msix_alloc(device_t dev, int *irq) +{ + struct msi_intsrc *msi; + u_int cpu; + int i, vector; + + if (!msi_enabled) + return (ENXIO); + +again: + mtx_lock(&msi_lock); + + /* Find a free IRQ. */ + for (i = FIRST_MSI_INT; i < FIRST_MSI_INT + NUM_MSI_INTS; i++) { + msi = (struct msi_intsrc *)intr_lookup_source(i); + + /* End of allocated sources, so break. */ + if (msi == NULL) + break; + + /* Stop at the first free source. */ + if (msi->msi_dev == NULL) + break; + } + + /* Do we need to create a new source? */ + if (msi == NULL) { + /* If we would exceed the max, give up. */ + if (i + 1 > FIRST_MSI_INT + NUM_MSI_INTS) { + mtx_unlock(&msi_lock); + return (ENXIO); + } + mtx_unlock(&msi_lock); + + /* Create a new source. */ + msi_create_source(); + goto again; + } + + /* Allocate an IDT vector. */ + cpu = intr_next_cpu(); + vector = apic_alloc_vector(cpu, i); + if (vector == 0) { + mtx_unlock(&msi_lock); + return (ENOSPC); + } + if (bootverbose) + printf("msi: routing MSI-X IRQ %d to local APIC %u vector %u\n", + msi->msi_irq, cpu, vector); + + /* Setup source. */ + msi->msi_cpu = cpu; + msi->msi_dev = dev; + msi->msi_first = msi; + msi->msi_vector = vector; + msi->msi_msix = 1; + msi->msi_count = 1; + msi->msi_maxcount = 1; + msi->msi_irqs = NULL; + + KASSERT(msi->msi_intsrc.is_handlers == 0, ("dead MSI-X has handlers")); + mtx_unlock(&msi_lock); + + *irq = i; + return (0); +} + +int +msix_release(int irq) +{ + struct msi_intsrc *msi; + + mtx_lock(&msi_lock); + msi = (struct msi_intsrc *)intr_lookup_source(irq); + if (msi == NULL) { + mtx_unlock(&msi_lock); + return (ENOENT); + } + + /* Make sure this is an MSI-X message. */ + if (!msi->msi_msix) { + mtx_unlock(&msi_lock); + return (EINVAL); + } + + KASSERT(msi->msi_dev != NULL, ("unowned message")); + + /* Clear out the message. */ + msi->msi_first = NULL; + msi->msi_dev = NULL; + apic_free_vector(msi->msi_cpu, msi->msi_vector, msi->msi_irq); + msi->msi_vector = 0; + msi->msi_msix = 0; + msi->msi_count = 0; + msi->msi_maxcount = 0; + + mtx_unlock(&msi_lock); + return (0); +} From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:05:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 187EE10656A9; Tue, 9 Nov 2010 22:05:19 +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 D7BC18FC26; Tue, 9 Nov 2010 22:05:18 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8E94546B32; Tue, 9 Nov 2010 17:05:18 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BE5518A009; Tue, 9 Nov 2010 17:05:17 -0500 (EST) From: John Baldwin To: Ulrich =?iso-8859-1?q?Sp=F6rlein?= Date: Tue, 9 Nov 2010 17:04:27 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201011091832.oA9IWvCo034092@svn.freebsd.org> <20101109212356.GC85693@acme.spoerlein.net> In-Reply-To: <20101109212356.GC85693@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201011091704.27846.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 09 Nov 2010 17:05:17 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r215041 - head/contrib/bzip2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:05:19 -0000 On Tuesday, November 09, 2010 4:23:56 pm Ulrich Sp=F6rlein wrote: > On Tue, 09.11.2010 at 18:32:57 +0000, David E. O'Brien wrote: > > Author: obrien > > Date: Tue Nov 9 18:32:57 2010 > > New Revision: 215041 > > URL: http://svn.freebsd.org/changeset/base/215041 > >=20 > > Log: > > Upgrade to Bzip2 version 1.0.6. > > =20 > > Reviewed by: SO (cperciva) > >=20 > > Modified: > > head/contrib/bzip2/CHANGES > > head/contrib/bzip2/LICENSE > > head/contrib/bzip2/Makefile > > head/contrib/bzip2/Makefile-libbz2_so > > head/contrib/bzip2/README > > head/contrib/bzip2/README.COMPILATION.PROBLEMS > > head/contrib/bzip2/blocksort.c > > head/contrib/bzip2/bzip2.1 > > head/contrib/bzip2/bzip2.c > > head/contrib/bzip2/bzip2recover.c > > head/contrib/bzip2/bzlib.c > > head/contrib/bzip2/bzlib.h > > head/contrib/bzip2/bzlib_private.h > > head/contrib/bzip2/compress.c > > head/contrib/bzip2/crctable.c > > head/contrib/bzip2/decompress.c > > head/contrib/bzip2/huffman.c > > head/contrib/bzip2/randtable.c > > head/contrib/bzip2/spewG.c > > head/contrib/bzip2/unzcrash.c > > Directory Properties: > > head/contrib/bzip2/ (props changed) >=20 > Perhaps I'm reading this wrong, but shouldn't those files have been > copied/merged from vendor/bzip2/dist? I think they were. Notice the prop change on the directory. Also, 1.0.6 w= as=20 imported into the vendor area a while ago. I think David was just now able= to=20 get review completed and commit the merge. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:08:26 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9A06106566B; Tue, 9 Nov 2010 22:08:26 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from eu1sys200aog118.obsmtp.com (eu1sys200aog118.obsmtp.com [207.126.144.145]) by mx1.freebsd.org (Postfix) with SMTP id E9A348FC08; Tue, 9 Nov 2010 22:08:14 +0000 (UTC) Received: from source ([63.174.175.251]) by eu1sys200aob118.postini.com ([207.126.147.11]) with SMTP ID DSNKTNnGTTbHYpsabpE7pP9ZuFJPREpLy8UR@postini.com; Tue, 09 Nov 2010 22:08:26 UTC Received: from [172.17.10.53] (unknown [172.17.10.53]) by bbbx3.usdmm.com (Postfix) with ESMTP id 9D65DFD020; Tue, 9 Nov 2010 21:50:24 +0000 (UTC) Message-ID: <4CD9C1EE.3070806@tomjudge.com> Date: Tue, 09 Nov 2010 15:49:34 -0600 From: Tom Judge User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= , "David E. O'Brien" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201011091832.oA9IWvCo034092@svn.freebsd.org> <20101109212356.GC85693@acme.spoerlein.net> In-Reply-To: <20101109212356.GC85693@acme.spoerlein.net> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r215041 - head/contrib/bzip2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:08:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/09/2010 03:23 PM, Ulrich Spörlein wrote: > On Tue, 09.11.2010 at 18:32:57 +0000, David E. O'Brien wrote: >> Author: obrien >> Date: Tue Nov 9 18:32:57 2010 >> New Revision: 215041 >> URL: http://svn.freebsd.org/changeset/base/215041 >> >> Log: >> Upgrade to Bzip2 version 1.0.6. >> >> Reviewed by: SO (cperciva) <> >> Directory Properties: >> head/contrib/bzip2/ (props changed) > > Perhaps I'm reading this wrong, but shouldn't those files have been > copied/merged from vendor/bzip2/dist? > It was: svn diff -c 215041 http://svn.freebsd.org/base/head/contrib/bzip2 Property changes on: . ___________________________________________________________________ Modified: svn:mergeinfo Merged /vendor/bzip2/dist:r213349-213356 Tom - -- TJU13-ARIN -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJM2cHtAAoJEMSwVS7lr0Odh/4H/iTlrVbfT3yx+Wpcnio1GxYm ZoXbpN1IbUnxg88n5QWjgOI5lqfWyMNZj4sAsDyXPb4k8cLWYsPg6IHOXxRuCnfd R7RW/uPWu5Ytp+Hn83tf2ZBH0Ra/9UNfWIpFPb49YhxVMiTEFDMQvICl5HLlSMdk u+5RcXtcv3wYh6bf3PrSXW4KIIbxU9gMdtTV3kjGGKEYovgk8bYgl7uGt9KW+UkC 9GXf4oN1jrnveO2fU9VQLc++SpWfeFWAdfwUJA3ACEa7gQHkheKx4tFp8OTgyBgC gzXheMfJfZymamX+KgkLNbHJcBnkhQZ02bFQaQclR2Hl3cEZkOmp9f2FG0brfxM= =dRG0 -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:15:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7353106566B; Tue, 9 Nov 2010 22:15:03 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2BA598FC0A; Tue, 9 Nov 2010 22:15:03 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id oA9MF2DS061362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Nov 2010 23:15:02 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1289340902; bh=HVTx3rkCp0qJaUuAtolCF3Jo8pOUP1M2yAZcQBycruM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=P43tr/4Fzkdp2TFXk4lkqLAFwzb3ncHmq+e3uEHcqYEjgzng/fLSY8y+tjVtFqMF+ QgQFu4RpthUpAIkEtqxO/gL3YQChO08D0zlhC58r+FGbGZ0Yi/Agk7tFuqhfOi4sAV Wqjz/kWWqEFxVQfDd8KU7ksAF/68kZpLYgxgVmyU= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id oA9MF2mG061361; Tue, 9 Nov 2010 23:15:02 +0100 (CET) (envelope-from uqs@spoerlein.net) Date: Tue, 9 Nov 2010 23:15:02 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: John Baldwin Message-ID: <20101109221501.GD85693@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , John Baldwin , "David E. O'Brien" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201011091832.oA9IWvCo034092@svn.freebsd.org> <20101109212356.GC85693@acme.spoerlein.net> <201011091704.27846.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201011091704.27846.jhb@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, "David E. O'Brien" Subject: Re: svn commit: r215041 - head/contrib/bzip2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:15:03 -0000 On Tue, 09.11.2010 at 17:04:27 -0500, John Baldwin wrote: > On Tuesday, November 09, 2010 4:23:56 pm Ulrich Spörlein wrote: > > On Tue, 09.11.2010 at 18:32:57 +0000, David E. O'Brien wrote: > > > Author: obrien > > > Date: Tue Nov 9 18:32:57 2010 > > > New Revision: 215041 > > > URL: http://svn.freebsd.org/changeset/base/215041 > > > > > > Log: > > > Upgrade to Bzip2 version 1.0.6. > > > > > > Reviewed by: SO (cperciva) > > > > > > Modified: > > > head/contrib/bzip2/CHANGES > > > head/contrib/bzip2/LICENSE > > > head/contrib/bzip2/Makefile > > > head/contrib/bzip2/Makefile-libbz2_so > > > head/contrib/bzip2/README > > > head/contrib/bzip2/README.COMPILATION.PROBLEMS > > > head/contrib/bzip2/blocksort.c > > > head/contrib/bzip2/bzip2.1 > > > head/contrib/bzip2/bzip2.c > > > head/contrib/bzip2/bzip2recover.c > > > head/contrib/bzip2/bzlib.c > > > head/contrib/bzip2/bzlib.h > > > head/contrib/bzip2/bzlib_private.h > > > head/contrib/bzip2/compress.c > > > head/contrib/bzip2/crctable.c > > > head/contrib/bzip2/decompress.c > > > head/contrib/bzip2/huffman.c > > > head/contrib/bzip2/randtable.c > > > head/contrib/bzip2/spewG.c > > > head/contrib/bzip2/unzcrash.c > > > Directory Properties: > > > head/contrib/bzip2/ (props changed) > > > > Perhaps I'm reading this wrong, but shouldn't those files have been > > copied/merged from vendor/bzip2/dist? > > I think they were. Notice the prop change on the directory. Also, 1.0.6 was > imported into the vendor area a while ago. I think David was just now able to > get review completed and commit the merge. Subversion is weird. I was expecting lines like these to appear: (from /vendor/bzip2/dist/foo:12345) but this seems to be only done for (A)dded files. Sorry for the noise. Uli From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:17:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62F1E1065672; Tue, 9 Nov 2010 22:17:54 +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 34DCE8FC1D; Tue, 9 Nov 2010 22:17:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9MHsIi054075; Tue, 9 Nov 2010 22:17:54 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9MHsiV054071; Tue, 9 Nov 2010 22:17:54 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011092217.oA9MHsiV054071@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 9 Nov 2010 22:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215063 - in stable/8/tools/regression/bin/sh: builtins parser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:17:54 -0000 Author: jilles Date: Tue Nov 9 22:17:53 2010 New Revision: 215063 URL: http://svn.freebsd.org/changeset/base/215063 Log: MFC r214280,214853: New tests that also work with stable/8 sh. Added: stable/8/tools/regression/bin/sh/builtins/printf1.0 - copied unchanged from r214853, head/tools/regression/bin/sh/builtins/printf1.0 stable/8/tools/regression/bin/sh/builtins/printf2.0 - copied unchanged from r214853, head/tools/regression/bin/sh/builtins/printf2.0 stable/8/tools/regression/bin/sh/parser/alias1.0 - copied unchanged from r214280, head/tools/regression/bin/sh/parser/alias1.0 stable/8/tools/regression/bin/sh/parser/alias2.0 - copied unchanged from r214280, head/tools/regression/bin/sh/parser/alias2.0 Modified: Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/builtins/printf1.0 (from r214853, head/tools/regression/bin/sh/builtins/printf1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/printf1.0 Tue Nov 9 22:17:53 2010 (r215063, copy of r214853, head/tools/regression/bin/sh/builtins/printf1.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +[ "$(printf '%c\0%s%d' x '\' 010 | tr '\0' Z)" = 'xZ\8' ] Copied: stable/8/tools/regression/bin/sh/builtins/printf2.0 (from r214853, head/tools/regression/bin/sh/builtins/printf2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/printf2.0 Tue Nov 9 22:17:53 2010 (r215063, copy of r214853, head/tools/regression/bin/sh/builtins/printf2.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +[ "$(printf '%cZ%s%d' x '\' 010)" = 'xZ\8' ] Copied: stable/8/tools/regression/bin/sh/parser/alias1.0 (from r214280, head/tools/regression/bin/sh/parser/alias1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/parser/alias1.0 Tue Nov 9 22:17:53 2010 (r215063, copy of r214280, head/tools/regression/bin/sh/parser/alias1.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +alias alias0=exit +eval 'alias0 0' +exit 1 Copied: stable/8/tools/regression/bin/sh/parser/alias2.0 (from r214280, head/tools/regression/bin/sh/parser/alias2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/parser/alias2.0 Tue Nov 9 22:17:53 2010 (r215063, copy of r214280, head/tools/regression/bin/sh/parser/alias2.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +alias alias0=exit +x=alias0 +eval 'case $x in alias0) exit 0;; esac' +exit 1 From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:18:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A9B11065693; Tue, 9 Nov 2010 22:18:20 +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 773288FC1E; Tue, 9 Nov 2010 22:18:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9MIKFL054158; Tue, 9 Nov 2010 22:18:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9MIKXh054153; Tue, 9 Nov 2010 22:18:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011092218.oA9MIKXh054153@svn.freebsd.org> From: Alexander Motin Date: Tue, 9 Nov 2010 22:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215064 - in stable/8/sys: dev/pci kern x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:18:20 -0000 Author: mav Date: Tue Nov 9 22:18:20 2010 New Revision: 215064 URL: http://svn.freebsd.org/changeset/base/215064 Log: MFC r209154: Virtualize pci_remap_msi_irq() call from general MSI code. It allows MSI (FSB interrupts) to be used by non-PCI devices, such as HPET. Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pcivar.h stable/8/sys/kern/bus_if.m stable/8/sys/x86/x86/msi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Tue Nov 9 22:17:53 2010 (r215063) +++ stable/8/sys/dev/pci/pci.c Tue Nov 9 22:18:20 2010 (r215064) @@ -116,6 +116,8 @@ static void pci_unmask_msix(device_t de static int pci_msi_blacklisted(void); static void pci_resume_msi(device_t dev); static void pci_resume_msix(device_t dev); +static int pci_remap_intr_method(device_t bus, device_t dev, + u_int irq); static device_method_t pci_methods[] = { /* Device interface */ @@ -145,6 +147,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method), DEVMETHOD(bus_child_location_str, pci_child_location_str_method), + DEVMETHOD(bus_remap_intr, pci_remap_intr_method), /* PCI interface */ DEVMETHOD(pci_read_config, pci_read_config_method), @@ -1713,21 +1716,18 @@ pci_resume_msi(device_t dev) 2); } -int -pci_remap_msi_irq(device_t dev, u_int irq) +static int +pci_remap_intr_method(device_t bus, device_t dev, u_int irq) { struct pci_devinfo *dinfo = device_get_ivars(dev); pcicfgregs *cfg = &dinfo->cfg; struct resource_list_entry *rle; struct msix_table_entry *mte; struct msix_vector *mv; - device_t bus; uint64_t addr; uint32_t data; int error, i, j; - bus = device_get_parent(dev); - /* * Handle MSI first. We try to find this IRQ among our list * of MSI IRQs. If we find it, we request updated address and Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Tue Nov 9 22:17:53 2010 (r215063) +++ stable/8/sys/dev/pci/pcivar.h Tue Nov 9 22:18:20 2010 (r215064) @@ -445,12 +445,6 @@ device_t pci_find_bsf(uint8_t, uint8_t, device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t); device_t pci_find_device(uint16_t, uint16_t); -/* - * Can be used by MD code to request the PCI bus to re-map an MSI or - * MSI-X message. - */ -int pci_remap_msi_irq(device_t dev, u_int irq); - /* Can be used by drivers to manage the MSI-X table. */ int pci_pending_msix(device_t dev, u_int index); Modified: stable/8/sys/kern/bus_if.m ============================================================================== --- stable/8/sys/kern/bus_if.m Tue Nov 9 22:17:53 2010 (r215063) +++ stable/8/sys/kern/bus_if.m Tue Nov 9 22:18:20 2010 (r215064) @@ -50,6 +50,15 @@ CODE { return (0); } + static int + null_remap_intr(device_t bus, device_t dev, u_int irq) + { + + if (dev != NULL) + return (BUS_REMAP_INTR(dev, NULL, irq)); + return (ENXIO); + } + static device_t null_add_child(device_t bus, int order, const char *name, int unit) @@ -610,3 +619,16 @@ METHOD void hint_device_unit { METHOD void new_pass { device_t _dev; } DEFAULT bus_generic_new_pass; + +/** + * @brief Notify a bus that specified child's IRQ should be remapped. + * + * @param _dev the bus device + * @param _child the child device + * @param _irq the irq number + */ +METHOD int remap_intr { + device_t _dev; + device_t _child; + u_int _irq; +} DEFAULT null_remap_intr; Modified: stable/8/sys/x86/x86/msi.c ============================================================================== --- stable/8/sys/x86/x86/msi.c Tue Nov 9 22:17:53 2010 (r215063) +++ stable/8/sys/x86/x86/msi.c Tue Nov 9 22:18:20 2010 (r215064) @@ -247,7 +247,8 @@ msi_assign_cpu(struct intsrc *isrc, u_in "msi: Assigning MSI IRQ %d to local APIC %u vector %u\n", sib->msi_irq, sib->msi_cpu, sib->msi_vector); } - pci_remap_msi_irq(msi->msi_dev, msi->msi_irq); + BUS_REMAP_INTR(device_get_parent(msi->msi_dev), msi->msi_dev, + msi->msi_irq); /* * Free the old vector after the new one is established. This is done From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:32:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DFEA106566B; Tue, 9 Nov 2010 22:32:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1558FC12; Tue, 9 Nov 2010 22:32:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9MW9KZ055302; Tue, 9 Nov 2010 22:32:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9MW96U055300; Tue, 9 Nov 2010 22:32:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011092232.oA9MW96U055300@svn.freebsd.org> From: Warner Losh Date: Tue, 9 Nov 2010 22:32: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: r215065 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:32:09 -0000 Author: imp Date: Tue Nov 9 22:32:09 2010 New Revision: 215065 URL: http://svn.freebsd.org/changeset/base/215065 Log: Merge from tbemd: o TARGET=mips --> little endian 32-bit mips build o mipsel and mipseb TARGET_ARCH are both mips TARGETs o Add some more architecture combinations Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Nov 9 22:18:20 2010 (r215064) +++ head/Makefile.inc1 Tue Nov 9 22:32:09 2010 (r215065) @@ -118,16 +118,16 @@ VERSION+= ${OSRELDATE} # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) -TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/} +TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} -TARGET= ${TARGET_ARCH} +TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm} .endif # Otherwise, default to current machine type and architecture. TARGET?= ${MACHINE} TARGET_ARCH?= ${MACHINE_ARCH} -KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc powerpc64/powerpc sparc64 sparc64/sun4v +KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips powerpc powerpc64/powerpc sparc64 sparc64/sun4v .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} .else From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 22:32:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77D9A10657A5; Tue, 9 Nov 2010 22:32:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 497448FC14; Tue, 9 Nov 2010 22:32:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9MWCRU055340; Tue, 9 Nov 2010 22:32:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9MWC1x055336; Tue, 9 Nov 2010 22:32:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011092232.oA9MWC1x055336@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 9 Nov 2010 22:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215066 - in stable/8: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:32:12 -0000 Author: jilles Date: Tue Nov 9 22:32:11 2010 New Revision: 215066 URL: http://svn.freebsd.org/changeset/base/215066 Log: MFC r198454: sh: Exempt $@ and $* from set -u This seems more useful and will likely be in the next POSIX standard. Also document more precisely in the man page what set -u does (note that $@, $* and $! are the only special parameters that can ever be unset, all the others are always set, although they may be empty). Added: stable/8/tools/regression/bin/sh/expansion/set-u2.0 - copied unchanged from r198454, head/tools/regression/bin/sh/expansion/set-u2.0 Modified: stable/8/bin/sh/expand.c stable/8/bin/sh/sh.1 Directory Properties: stable/8/bin/sh/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Modified: stable/8/bin/sh/expand.c ============================================================================== --- stable/8/bin/sh/expand.c Tue Nov 9 22:32:09 2010 (r215065) +++ stable/8/bin/sh/expand.c Tue Nov 9 22:32:11 2010 (r215066) @@ -670,7 +670,7 @@ again: /* jump here after setting a vari } varlen = 0; startloc = expdest - stackblock(); - if (!set && uflag) { + if (!set && uflag && *var != '@' && *var != '*') { switch (subtype) { case VSNORMAL: case VSTRIMLEFT: Modified: stable/8/bin/sh/sh.1 ============================================================================== --- stable/8/bin/sh/sh.1 Tue Nov 9 22:32:09 2010 (r215065) +++ stable/8/bin/sh/sh.1 Tue Nov 9 22:32:11 2010 (r215066) @@ -311,7 +311,10 @@ sh -T -c "trap 'exit 1' 2 ; some-blockin .Ed .It Fl u Li nounset Write a message to standard error when attempting -to expand a variable that is not set, and if the +to expand a variable, a positional parameter or +the special parameter +.Va \&! +that is not set, and if the shell is not interactive, exit immediately. .It Fl V Li vi Enable the built-in Copied: stable/8/tools/regression/bin/sh/expansion/set-u2.0 (from r198454, head/tools/regression/bin/sh/expansion/set-u2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/set-u2.0 Tue Nov 9 22:32:11 2010 (r215066, copy of r198454, head/tools/regression/bin/sh/expansion/set-u2.0) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +set -u +: $* $@ "$@" "$*" +set -- x +: $* $@ "$@" "$*" +shift $# +: $* $@ "$@" "$*" +set -- y +set -- +: $* $@ "$@" "$*" +exit 0 From owner-svn-src-all@FreeBSD.ORG Tue Nov 9 23:53:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19F0C106566B; Tue, 9 Nov 2010 23:53:48 +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 E0E2B8FC19; Tue, 9 Nov 2010 23:53:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oA9Nrlqp062168; Tue, 9 Nov 2010 23:53:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA9NrlVi062164; Tue, 9 Nov 2010 23:53:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011092353.oA9NrlVi062164@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 9 Nov 2010 23:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215067 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 23:53:48 -0000 Author: nwhitehorn Date: Tue Nov 9 23:53:47 2010 New Revision: 215067 URL: http://svn.freebsd.org/changeset/base/215067 Log: Make AIM early-boot code function correctly without Open Firmware. Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/nexus.c head/sys/powerpc/aim/ofw_machdep.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Nov 9 22:32:11 2010 (r215066) +++ head/sys/powerpc/aim/mmu_oea64.c Tue Nov 9 23:53:47 2010 (r215067) @@ -274,7 +274,6 @@ static struct mem_region *regions; static struct mem_region *pregions; static u_int phys_avail_count; static int regions_sz, pregions_sz; -extern int ofw_real_mode; extern struct pmap ofw_pmap; @@ -1118,7 +1117,8 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t * mode. */ - if (!ofw_real_mode) { + chosen = OF_finddevice("/chosen"); + if (chosen != -1 && OF_getprop(chosen, "mmu", &mmui, 4) != -1) { #ifndef __powerpc64__ moea64_pinit(mmup, &ofw_pmap); @@ -1126,10 +1126,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t ofw_pmap.pm_sr[i] = kernel_pmap->pm_sr[i]; #endif - if ((chosen = OF_finddevice("/chosen")) == -1) - panic("moea64_bootstrap: can't find /chosen"); - OF_getprop(chosen, "mmu", &mmui, 4); - if ((mmu = OF_instance_to_package(mmui)) == -1) panic("moea64_bootstrap: can't get mmu package"); if ((sz = OF_getproplen(mmu, "translations")) == -1) Modified: head/sys/powerpc/aim/nexus.c ============================================================================== --- head/sys/powerpc/aim/nexus.c Tue Nov 9 22:32:11 2010 (r215066) +++ head/sys/powerpc/aim/nexus.c Tue Nov 9 23:53:47 2010 (r215067) @@ -213,9 +213,6 @@ nexus_attach(device_t dev) struct nexus_softc *sc; u_long start, end; - if ((root = OF_peer(0)) == -1) - panic("nexus_probe: OF_peer failed."); - sc = device_get_softc(dev); start = 0; @@ -229,6 +226,9 @@ nexus_attach(device_t dev) rman_manage_region(&sc->sc_rman, start, end)) panic("nexus_probe IRQ rman"); + if ((root = OF_peer(0)) == 0) + return (bus_generic_attach(dev)); + /* * Now walk the OFW tree to locate top-level devices */ Modified: head/sys/powerpc/aim/ofw_machdep.c ============================================================================== --- head/sys/powerpc/aim/ofw_machdep.c Tue Nov 9 22:32:11 2010 (r215066) +++ head/sys/powerpc/aim/ofw_machdep.c Tue Nov 9 23:53:47 2010 (r215067) @@ -333,6 +333,12 @@ OF_initial_setup(void *fdt_ptr, void *ju #endif fdt = fdt_ptr; + + #ifdef FDT_DTB_STATIC + /* Check for a statically included blob */ + if (fdt == NULL) + fdt = &fdt_static_dtb; + #endif } boolean_t @@ -361,7 +367,7 @@ OF_bootstrap() * background processes. */ ofw_quiesce(); - } else { + } else if (fdt != NULL) { status = OF_install(OFW_FDT, 0); if (status != TRUE) From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 00:28:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D0CC106566B; Wed, 10 Nov 2010 00:28:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3C328FC18; Wed, 10 Nov 2010 00:28:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA0SKZH065130; Wed, 10 Nov 2010 00:28:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA0SKwO065124; Wed, 10 Nov 2010 00:28:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011100028.oAA0SKwO065124@svn.freebsd.org> From: Warner Losh Date: Wed, 10 Nov 2010 00:28: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: r215068 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 00:28:21 -0000 Author: imp Date: Wed Nov 10 00:28:20 2010 New Revision: 215068 URL: http://svn.freebsd.org/changeset/base/215068 Log: rename SWARM_COMMON to std.SWARM so universe doesn't try to build it standalone Added: head/sys/mips/conf/std.SWARM - copied unchanged from r215066, head/sys/mips/conf/SWARM_COMMON Deleted: head/sys/mips/conf/SWARM_COMMON Modified: head/sys/mips/conf/SWARM head/sys/mips/conf/SWARM64 head/sys/mips/conf/SWARM64_SMP head/sys/mips/conf/SWARM_SMP Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Tue Nov 9 23:53:47 2010 (r215067) +++ head/sys/mips/conf/SWARM Wed Nov 10 00:28:20 2010 (r215068) @@ -2,7 +2,7 @@ # $FreeBSD$ # -include SWARM_COMMON +include std.SWARM ident SWARM Modified: head/sys/mips/conf/SWARM64 ============================================================================== --- head/sys/mips/conf/SWARM64 Tue Nov 9 23:53:47 2010 (r215067) +++ head/sys/mips/conf/SWARM64 Wed Nov 10 00:28:20 2010 (r215068) @@ -2,7 +2,7 @@ # $FreeBSD$ # -include SWARM_COMMON +include std.SWARM ident SWARM64 Modified: head/sys/mips/conf/SWARM64_SMP ============================================================================== --- head/sys/mips/conf/SWARM64_SMP Tue Nov 9 23:53:47 2010 (r215067) +++ head/sys/mips/conf/SWARM64_SMP Wed Nov 10 00:28:20 2010 (r215068) @@ -2,7 +2,7 @@ # $FreeBSD$ # -include SWARM_COMMON +include std.SWARM ident SWARM64_SMP Modified: head/sys/mips/conf/SWARM_SMP ============================================================================== --- head/sys/mips/conf/SWARM_SMP Tue Nov 9 23:53:47 2010 (r215067) +++ head/sys/mips/conf/SWARM_SMP Wed Nov 10 00:28:20 2010 (r215068) @@ -2,7 +2,7 @@ # $FreeBSD$ # -include SWARM_COMMON +include std.SWARM ident SWARM_SMP Copied: head/sys/mips/conf/std.SWARM (from r215066, head/sys/mips/conf/SWARM_COMMON) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/std.SWARM Wed Nov 10 00:28:20 2010 (r215068, copy of r215066, head/sys/mips/conf/SWARM_COMMON) @@ -0,0 +1,60 @@ +# +# $FreeBSD$ +# + +files "../sibyte/files.sibyte" +hints "SWARM.hints" + +options CFE +options CFE_CONSOLE +options CFE_ENV +options ALT_BREAK_TO_DEBUGGER + +cpu CPU_SB1 + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Debugging for use in -current +#options DEADLKRES +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS + +options FFS #Fast filesystem + +options KTRACE + +device pci +device miibus +device bge +device loop +device ether +device md +device random + +options USB_DEBUG +device usb +device ohci +device uhci +device ehci + +device umass + +device scbus +device da + +device ata +device atadisk +device atapicd +options ATA_STATIC_ID From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 00:39:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E07251065675; Wed, 10 Nov 2010 00:39:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF04E8FC1A; Wed, 10 Nov 2010 00:39:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA0dgwD066264; Wed, 10 Nov 2010 00:39:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA0dgHp066262; Wed, 10 Nov 2010 00:39:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011100039.oAA0dgHp066262@svn.freebsd.org> From: Warner Losh Date: Wed, 10 Nov 2010 00:39: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: r215069 - head/tools/tools/nanobsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 00:39:43 -0000 Author: imp Date: Wed Nov 10 00:39:42 2010 New Revision: 215069 URL: http://svn.freebsd.org/changeset/base/215069 Log: Document NANO_CFGDIR and NANO_DATADIR Submitted by: n_hibma@ Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:28:20 2010 (r215068) +++ head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:39:42 2010 (r215069) @@ -153,6 +153,12 @@ NANO_LABEL="" NANO_ARCH=`uname -p` +# Directory to populate /cfg from +NANO_CFGDIR="" + +# Directory to populate /data from +NANO_DATADIR="" + ####################################################################### # # The functions which do the real work. From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 00:56:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DAB81065672; Wed, 10 Nov 2010 00:56:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C42F8FC13; Wed, 10 Nov 2010 00:56:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA0uicH067696; Wed, 10 Nov 2010 00:56:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA0uimN067694; Wed, 10 Nov 2010 00:56:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011100056.oAA0uimN067694@svn.freebsd.org> From: Warner Losh Date: Wed, 10 Nov 2010 00:56: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: r215070 - head/tools/tools/nanobsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 00:56:44 -0000 Author: imp Date: Wed Nov 10 00:56:44 2010 New Revision: 215070 URL: http://svn.freebsd.org/changeset/base/215070 Log: Build make.conf when the world is not selected to build, but the kernel is. PR: 151696 Submitted by: lev@ Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:39:42 2010 (r215069) +++ head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:56:44 2010 (r215070) @@ -917,6 +917,9 @@ else fi if $do_kernel ; then + if ! $do_world ; then + make_conf_build + fi build_kernel else pprint 2 "Skipping buildkernel (as instructed)" From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 01:29:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D42106566B; Wed, 10 Nov 2010 01:29:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F2808FC12; Wed, 10 Nov 2010 01:29:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA1TulZ069843; Wed, 10 Nov 2010 01:29:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA1TuKP069836; Wed, 10 Nov 2010 01:29:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011100129.oAA1TuKP069836@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 10 Nov 2010 01:29: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: r215072 - in head/sys: amd64/acpica conf dev/acpica i386/acpica modules/acpi/acpi x86/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 01:29:56 -0000 Author: jkim Date: Wed Nov 10 01:29:56 2010 New Revision: 215072 URL: http://svn.freebsd.org/changeset/base/215072 Log: Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a new file acpi_apm.c, and place it on sys/x86/acpica. Added: head/sys/x86/acpica/acpi_apm.c - copied, changed from r215066, head/sys/i386/acpica/acpi_machdep.c Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/acpica/acpivar.h head/sys/i386/acpica/acpi_machdep.c head/sys/modules/acpi/acpi/Makefile Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Wed Nov 10 01:27:48 2010 (r215071) +++ head/sys/amd64/acpica/acpi_machdep.c Wed Nov 10 01:29:56 2010 (r215072) @@ -44,24 +44,6 @@ __FBSDID("$FreeBSD$"); #include -/* - * APM driver emulation - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - SYSCTL_DECL(_debug_acpi); int acpi_resume_beep; @@ -73,445 +55,16 @@ int acpi_reset_video; TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); static int intr_model = ACPI_INTR_PIC; -static int apm_active; -static struct clonedevs *apm_clones; - -MALLOC_DEFINE(M_APMDEV, "apmdev", "APM device emulation"); - -static d_open_t apmopen; -static d_close_t apmclose; -static d_write_t apmwrite; -static d_ioctl_t apmioctl; -static d_poll_t apmpoll; -static d_kqfilter_t apmkqfilter; -static void apmreadfiltdetach(struct knote *kn); -static int apmreadfilt(struct knote *kn, long hint); -static struct filterops apm_readfiltops = { - .f_isfd = 1, - .f_detach = apmreadfiltdetach, - .f_event = apmreadfilt, -}; - -static struct cdevsw apm_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE | D_NEEDMINOR, - .d_open = apmopen, - .d_close = apmclose, - .d_write = apmwrite, - .d_ioctl = apmioctl, - .d_poll = apmpoll, - .d_name = "apm", - .d_kqfilter = apmkqfilter -}; - -static int -acpi_capm_convert_battstate(struct acpi_battinfo *battp) -{ - int state; - - state = APM_UNKNOWN; - - if (battp->state & ACPI_BATT_STAT_DISCHARG) { - if (battp->cap >= 50) - state = 0; /* high */ - else - state = 1; /* low */ - } - if (battp->state & ACPI_BATT_STAT_CRITICAL) - state = 2; /* critical */ - if (battp->state & ACPI_BATT_STAT_CHARGING) - state = 3; /* charging */ - - /* If still unknown, determine it based on the battery capacity. */ - if (state == APM_UNKNOWN) { - if (battp->cap >= 50) - state = 0; /* high */ - else - state = 1; /* low */ - } - - return (state); -} - -static int -acpi_capm_convert_battflags(struct acpi_battinfo *battp) -{ - int flags; - - flags = 0; - - if (battp->cap >= 50) - flags |= APM_BATT_HIGH; - else { - if (battp->state & ACPI_BATT_STAT_CRITICAL) - flags |= APM_BATT_CRITICAL; - else - flags |= APM_BATT_LOW; - } - if (battp->state & ACPI_BATT_STAT_CHARGING) - flags |= APM_BATT_CHARGING; - if (battp->state == ACPI_BATT_STAT_NOT_PRESENT) - flags = APM_BATT_NOT_PRESENT; - - return (flags); -} - -static int -acpi_capm_get_info(apm_info_t aip) -{ - int acline; - struct acpi_battinfo batt; - - aip->ai_infoversion = 1; - aip->ai_major = 1; - aip->ai_minor = 2; - aip->ai_status = apm_active; - aip->ai_capabilities= 0xff00; /* unknown */ - - if (acpi_acad_get_acline(&acline)) - aip->ai_acline = APM_UNKNOWN; /* unknown */ - else - aip->ai_acline = acline; /* on/off */ - - if (acpi_battery_get_battinfo(NULL, &batt) != 0) { - aip->ai_batt_stat = APM_UNKNOWN; - aip->ai_batt_life = APM_UNKNOWN; - aip->ai_batt_time = -1; /* unknown */ - aip->ai_batteries = ~0U; /* unknown */ - } else { - aip->ai_batt_stat = acpi_capm_convert_battstate(&batt); - aip->ai_batt_life = batt.cap; - aip->ai_batt_time = (batt.min == -1) ? -1 : batt.min * 60; - aip->ai_batteries = acpi_battery_get_units(); - } - - return (0); -} - -static int -acpi_capm_get_pwstatus(apm_pwstatus_t app) -{ - device_t dev; - int acline, unit, error; - struct acpi_battinfo batt; - - if (app->ap_device != PMDV_ALLDEV && - (app->ap_device < PMDV_BATT0 || app->ap_device > PMDV_BATT_ALL)) - return (1); - - if (app->ap_device == PMDV_ALLDEV) - error = acpi_battery_get_battinfo(NULL, &batt); - else { - unit = app->ap_device - PMDV_BATT0; - dev = devclass_get_device(devclass_find("battery"), unit); - if (dev != NULL) - error = acpi_battery_get_battinfo(dev, &batt); - else - error = ENXIO; - } - if (error) - return (1); - - app->ap_batt_stat = acpi_capm_convert_battstate(&batt); - app->ap_batt_flag = acpi_capm_convert_battflags(&batt); - app->ap_batt_life = batt.cap; - app->ap_batt_time = (batt.min == -1) ? -1 : batt.min * 60; - - if (acpi_acad_get_acline(&acline)) - app->ap_acline = APM_UNKNOWN; - else - app->ap_acline = acline; /* on/off */ - - return (0); -} - -/* Create single-use devices for /dev/apm and /dev/apmctl. */ -static void -apm_clone(void *arg, struct ucred *cred, char *name, int namelen, - struct cdev **dev) -{ - int ctl_dev, unit; - - if (*dev != NULL) - return; - if (strcmp(name, "apmctl") == 0) - ctl_dev = TRUE; - else if (strcmp(name, "apm") == 0) - ctl_dev = FALSE; - else - return; - - /* Always create a new device and unit number. */ - unit = -1; - if (clone_create(&apm_clones, &apm_cdevsw, &unit, dev, 0)) { - if (ctl_dev) { - *dev = make_dev(&apm_cdevsw, unit, - UID_ROOT, GID_OPERATOR, 0660, "apmctl%d", unit); - } else { - *dev = make_dev(&apm_cdevsw, unit, - UID_ROOT, GID_OPERATOR, 0664, "apm%d", unit); - } - if (*dev != NULL) { - dev_ref(*dev); - (*dev)->si_flags |= SI_CHEAPCLONE; - } - } -} - -/* Create a struct for tracking per-device suspend notification. */ -static struct apm_clone_data * -apm_create_clone(struct cdev *dev, struct acpi_softc *acpi_sc) -{ - struct apm_clone_data *clone; - - clone = malloc(sizeof(*clone), M_APMDEV, M_WAITOK); - clone->cdev = dev; - clone->acpi_sc = acpi_sc; - clone->notify_status = APM_EV_NONE; - bzero(&clone->sel_read, sizeof(clone->sel_read)); - knlist_init_mtx(&clone->sel_read.si_note, &acpi_mutex); - - /* - * The acpi device is always managed by devd(8) and is considered - * writable (i.e., ack is required to allow suspend to proceed.) - */ - if (strcmp("acpi", devtoname(dev)) == 0) - clone->flags = ACPI_EVF_DEVD | ACPI_EVF_WRITE; - else - clone->flags = ACPI_EVF_NONE; - - ACPI_LOCK(acpi); - STAILQ_INSERT_TAIL(&acpi_sc->apm_cdevs, clone, entries); - ACPI_UNLOCK(acpi); - return (clone); -} - -static int -apmopen(struct cdev *dev, int flag, int fmt, struct thread *td) -{ - struct acpi_softc *acpi_sc; - struct apm_clone_data *clone; - - acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); - clone = apm_create_clone(dev, acpi_sc); - dev->si_drv1 = clone; - - /* If the device is opened for write, record that. */ - if ((flag & FWRITE) != 0) - clone->flags |= ACPI_EVF_WRITE; - - return (0); -} - -static int -apmclose(struct cdev *dev, int flag, int fmt, struct thread *td) -{ - struct apm_clone_data *clone; - struct acpi_softc *acpi_sc; - - clone = dev->si_drv1; - acpi_sc = clone->acpi_sc; - - /* We are about to lose a reference so check if suspend should occur */ - if (acpi_sc->acpi_next_sstate != 0 && - clone->notify_status != APM_EV_ACKED) - acpi_AckSleepState(clone, 0); - - /* Remove this clone's data from the list and free it. */ - ACPI_LOCK(acpi); - STAILQ_REMOVE(&acpi_sc->apm_cdevs, clone, apm_clone_data, entries); - knlist_destroy(&clone->sel_read.si_note); - ACPI_UNLOCK(acpi); - free(clone, M_APMDEV); - destroy_dev_sched(dev); - return (0); -} - -static int -apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) -{ - int error; - struct apm_clone_data *clone; - struct acpi_softc *acpi_sc; - struct apm_info info; - struct apm_event_info *ev_info; - apm_info_old_t aiop; - - error = 0; - clone = dev->si_drv1; - acpi_sc = clone->acpi_sc; - - switch (cmd) { - case APMIO_SUSPEND: - if ((flag & FWRITE) == 0) - return (EPERM); - if (acpi_sc->acpi_next_sstate == 0) { - if (acpi_sc->acpi_suspend_sx != ACPI_STATE_S5) { - error = acpi_ReqSleepState(acpi_sc, - acpi_sc->acpi_suspend_sx); - } else { - printf( - "power off via apm suspend not supported\n"); - error = ENXIO; - } - } else - error = acpi_AckSleepState(clone, 0); - break; - case APMIO_STANDBY: - if ((flag & FWRITE) == 0) - return (EPERM); - if (acpi_sc->acpi_next_sstate == 0) { - if (acpi_sc->acpi_standby_sx != ACPI_STATE_S5) { - error = acpi_ReqSleepState(acpi_sc, - acpi_sc->acpi_standby_sx); - } else { - printf( - "power off via apm standby not supported\n"); - error = ENXIO; - } - } else - error = acpi_AckSleepState(clone, 0); - break; - case APMIO_NEXTEVENT: - printf("apm nextevent start\n"); - ACPI_LOCK(acpi); - if (acpi_sc->acpi_next_sstate != 0 && clone->notify_status == - APM_EV_NONE) { - ev_info = (struct apm_event_info *)addr; - if (acpi_sc->acpi_next_sstate <= ACPI_STATE_S3) - ev_info->type = PMEV_STANDBYREQ; - else - ev_info->type = PMEV_SUSPENDREQ; - ev_info->index = 0; - clone->notify_status = APM_EV_NOTIFIED; - printf("apm event returning %d\n", ev_info->type); - } else - error = EAGAIN; - ACPI_UNLOCK(acpi); - break; - case APMIO_GETINFO_OLD: - if (acpi_capm_get_info(&info)) - error = ENXIO; - aiop = (apm_info_old_t)addr; - aiop->ai_major = info.ai_major; - aiop->ai_minor = info.ai_minor; - aiop->ai_acline = info.ai_acline; - aiop->ai_batt_stat = info.ai_batt_stat; - aiop->ai_batt_life = info.ai_batt_life; - aiop->ai_status = info.ai_status; - break; - case APMIO_GETINFO: - if (acpi_capm_get_info((apm_info_t)addr)) - error = ENXIO; - break; - case APMIO_GETPWSTATUS: - if (acpi_capm_get_pwstatus((apm_pwstatus_t)addr)) - error = ENXIO; - break; - case APMIO_ENABLE: - if ((flag & FWRITE) == 0) - return (EPERM); - apm_active = 1; - break; - case APMIO_DISABLE: - if ((flag & FWRITE) == 0) - return (EPERM); - apm_active = 0; - break; - case APMIO_HALTCPU: - break; - case APMIO_NOTHALTCPU: - break; - case APMIO_DISPLAY: - if ((flag & FWRITE) == 0) - return (EPERM); - break; - case APMIO_BIOS: - if ((flag & FWRITE) == 0) - return (EPERM); - bzero(addr, sizeof(struct apm_bios_arg)); - break; - default: - error = EINVAL; - break; - } - - return (error); -} - -static int -apmwrite(struct cdev *dev, struct uio *uio, int ioflag) -{ - return (uio->uio_resid); -} - -static int -apmpoll(struct cdev *dev, int events, struct thread *td) -{ - struct apm_clone_data *clone; - int revents; - - revents = 0; - ACPI_LOCK(acpi); - clone = dev->si_drv1; - if (clone->acpi_sc->acpi_next_sstate) - revents |= events & (POLLIN | POLLRDNORM); - else - selrecord(td, &clone->sel_read); - ACPI_UNLOCK(acpi); - return (revents); -} - -static int -apmkqfilter(struct cdev *dev, struct knote *kn) -{ - struct apm_clone_data *clone; - - ACPI_LOCK(acpi); - clone = dev->si_drv1; - kn->kn_hook = clone; - kn->kn_fop = &apm_readfiltops; - knlist_add(&clone->sel_read.si_note, kn, 0); - ACPI_UNLOCK(acpi); - return (0); -} - -static void -apmreadfiltdetach(struct knote *kn) -{ - struct apm_clone_data *clone; - - ACPI_LOCK(acpi); - clone = kn->kn_hook; - knlist_remove(&clone->sel_read.si_note, kn, 0); - ACPI_UNLOCK(acpi); -} - -static int -apmreadfilt(struct knote *kn, long hint) -{ - struct apm_clone_data *clone; - int sleeping; - - ACPI_LOCK(acpi); - clone = kn->kn_hook; - sleeping = clone->acpi_sc->acpi_next_sstate ? 1 : 0; - ACPI_UNLOCK(acpi); - return (sleeping); -} int acpi_machdep_init(device_t dev) { - struct acpi_softc *sc; + struct acpi_softc *sc; sc = devclass_get_softc(devclass_find("acpi"), 0); /* Create a clone for /dev/acpi also. */ - STAILQ_INIT(&sc->apm_cdevs); - sc->acpi_clone = apm_create_clone(sc->acpi_dev_t, sc); - clone_setup(&apm_clones); - EVENTHANDLER_REGISTER(dev_clone, apm_clone, 0, 1000); + sc->acpi_clone = acpi_apm_create_clone(sc->acpi_dev_t, sc); if (intr_model != ACPI_INTR_PIC) acpi_SetIntrModel(intr_model); @@ -534,12 +87,14 @@ acpi_SetDefaultIntrModel(int model) int acpi_machdep_quirks(int *quirks) { + return (0); } void acpi_cpu_c1() { + __asm __volatile("sti; hlt"); } Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Nov 10 01:27:48 2010 (r215071) +++ head/sys/conf/files.amd64 Wed Nov 10 01:29:56 2010 (r215072) @@ -300,6 +300,7 @@ contrib/x86emu/x86emu.c optional x86bio # x86 shared code between IA32, AMD64 and PC98 architectures # x86/acpica/OsdEnvironment.c optional acpi +x86/acpica/acpi_apm.c optional acpi x86/acpica/madt.c optional acpi x86/acpica/srat.c optional acpi x86/bios/smbios.c optional smbios Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Nov 10 01:27:48 2010 (r215071) +++ head/sys/conf/files.i386 Wed Nov 10 01:29:56 2010 (r215072) @@ -373,6 +373,7 @@ compat/x86bios/x86bios.c optional x86bio # x86 shared code between IA32, AMD64 and PC98 architectures # x86/acpica/OsdEnvironment.c optional acpi +x86/acpica/acpi_apm.c optional acpi x86/acpica/madt.c optional acpi apic x86/acpica/srat.c optional acpi x86/bios/smbios.c optional smbios Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Nov 10 01:27:48 2010 (r215071) +++ head/sys/dev/acpica/acpivar.h Wed Nov 10 01:29:56 2010 (r215072) @@ -396,6 +396,9 @@ ACPI_STATUS acpi_pwr_switch_consumer(ACP int acpi_device_pwr_for_sleep(device_t bus, device_t dev, int *dstate); +/* APM emulation */ +struct apm_clone_data *acpi_apm_create_clone(struct cdev *, struct acpi_softc *); + /* Misc. */ static __inline struct acpi_softc * acpi_device_get_parent_softc(device_t child) Modified: head/sys/i386/acpica/acpi_machdep.c ============================================================================== --- head/sys/i386/acpica/acpi_machdep.c Wed Nov 10 01:27:48 2010 (r215071) +++ head/sys/i386/acpica/acpi_machdep.c Wed Nov 10 01:29:56 2010 (r215072) @@ -29,15 +29,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include -#include #include -#include #include -#include + #include #include @@ -46,469 +41,31 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -/* - * APM driver emulation - */ - -#include -#include - -#include - SYSCTL_DECL(_debug_acpi); uint32_t acpi_resume_beep; TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, 0, "Beep the PC speaker when resuming"); + uint32_t acpi_reset_video; TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); static int intr_model = ACPI_INTR_PIC; -static int apm_active; -static struct clonedevs *apm_clones; - -MALLOC_DEFINE(M_APMDEV, "apmdev", "APM device emulation"); - -static d_open_t apmopen; -static d_close_t apmclose; -static d_write_t apmwrite; -static d_ioctl_t apmioctl; -static d_poll_t apmpoll; -static d_kqfilter_t apmkqfilter; -static void apmreadfiltdetach(struct knote *kn); -static int apmreadfilt(struct knote *kn, long hint); -static struct filterops apm_readfiltops = { - .f_isfd = 1, - .f_detach = apmreadfiltdetach, - .f_event = apmreadfilt, -}; - -static struct cdevsw apm_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE | D_NEEDMINOR, - .d_open = apmopen, - .d_close = apmclose, - .d_write = apmwrite, - .d_ioctl = apmioctl, - .d_poll = apmpoll, - .d_name = "apm", - .d_kqfilter = apmkqfilter -}; - -static int -acpi_capm_convert_battstate(struct acpi_battinfo *battp) -{ - int state; - - state = APM_UNKNOWN; - - if (battp->state & ACPI_BATT_STAT_DISCHARG) { - if (battp->cap >= 50) - state = 0; /* high */ - else - state = 1; /* low */ - } - if (battp->state & ACPI_BATT_STAT_CRITICAL) - state = 2; /* critical */ - if (battp->state & ACPI_BATT_STAT_CHARGING) - state = 3; /* charging */ - - /* If still unknown, determine it based on the battery capacity. */ - if (state == APM_UNKNOWN) { - if (battp->cap >= 50) - state = 0; /* high */ - else - state = 1; /* low */ - } - - return (state); -} - -static int -acpi_capm_convert_battflags(struct acpi_battinfo *battp) -{ - int flags; - - flags = 0; - - if (battp->cap >= 50) - flags |= APM_BATT_HIGH; - else { - if (battp->state & ACPI_BATT_STAT_CRITICAL) - flags |= APM_BATT_CRITICAL; - else - flags |= APM_BATT_LOW; - } - if (battp->state & ACPI_BATT_STAT_CHARGING) - flags |= APM_BATT_CHARGING; - if (battp->state == ACPI_BATT_STAT_NOT_PRESENT) - flags = APM_BATT_NOT_PRESENT; - - return (flags); -} - -static int -acpi_capm_get_info(apm_info_t aip) -{ - int acline; - struct acpi_battinfo batt; - - aip->ai_infoversion = 1; - aip->ai_major = 1; - aip->ai_minor = 2; - aip->ai_status = apm_active; - aip->ai_capabilities= 0xff00; /* unknown */ - - if (acpi_acad_get_acline(&acline)) - aip->ai_acline = APM_UNKNOWN; /* unknown */ - else - aip->ai_acline = acline; /* on/off */ - - if (acpi_battery_get_battinfo(NULL, &batt) != 0) { - aip->ai_batt_stat = APM_UNKNOWN; - aip->ai_batt_life = APM_UNKNOWN; - aip->ai_batt_time = -1; /* unknown */ - aip->ai_batteries = ~0U; /* unknown */ - } else { - aip->ai_batt_stat = acpi_capm_convert_battstate(&batt); - aip->ai_batt_life = batt.cap; - aip->ai_batt_time = (batt.min == -1) ? -1 : batt.min * 60; - aip->ai_batteries = acpi_battery_get_units(); - } - - return (0); -} - -static int -acpi_capm_get_pwstatus(apm_pwstatus_t app) -{ - device_t dev; - int acline, unit, error; - struct acpi_battinfo batt; - - if (app->ap_device != PMDV_ALLDEV && - (app->ap_device < PMDV_BATT0 || app->ap_device > PMDV_BATT_ALL)) - return (1); - - if (app->ap_device == PMDV_ALLDEV) - error = acpi_battery_get_battinfo(NULL, &batt); - else { - unit = app->ap_device - PMDV_BATT0; - dev = devclass_get_device(devclass_find("battery"), unit); - if (dev != NULL) - error = acpi_battery_get_battinfo(dev, &batt); - else - error = ENXIO; - } - if (error) - return (1); - - app->ap_batt_stat = acpi_capm_convert_battstate(&batt); - app->ap_batt_flag = acpi_capm_convert_battflags(&batt); - app->ap_batt_life = batt.cap; - app->ap_batt_time = (batt.min == -1) ? -1 : batt.min * 60; - - if (acpi_acad_get_acline(&acline)) - app->ap_acline = APM_UNKNOWN; - else - app->ap_acline = acline; /* on/off */ - - return (0); -} - -/* Create single-use devices for /dev/apm and /dev/apmctl. */ -static void -apm_clone(void *arg, struct ucred *cred, char *name, int namelen, - struct cdev **dev) -{ - int ctl_dev, unit; - - if (*dev != NULL) - return; - if (strcmp(name, "apmctl") == 0) - ctl_dev = TRUE; - else if (strcmp(name, "apm") == 0) - ctl_dev = FALSE; - else - return; - - /* Always create a new device and unit number. */ - unit = -1; - if (clone_create(&apm_clones, &apm_cdevsw, &unit, dev, 0)) { - if (ctl_dev) { - *dev = make_dev(&apm_cdevsw, unit, - UID_ROOT, GID_OPERATOR, 0660, "apmctl%d", unit); - } else { - *dev = make_dev(&apm_cdevsw, unit, - UID_ROOT, GID_OPERATOR, 0664, "apm%d", unit); - } - if (*dev != NULL) { - dev_ref(*dev); - (*dev)->si_flags |= SI_CHEAPCLONE; - } - } -} - -/* Create a struct for tracking per-device suspend notification. */ -static struct apm_clone_data * -apm_create_clone(struct cdev *dev, struct acpi_softc *acpi_sc) -{ - struct apm_clone_data *clone; - - clone = malloc(sizeof(*clone), M_APMDEV, M_WAITOK); - clone->cdev = dev; - clone->acpi_sc = acpi_sc; - clone->notify_status = APM_EV_NONE; - bzero(&clone->sel_read, sizeof(clone->sel_read)); - knlist_init_mtx(&clone->sel_read.si_note, &acpi_mutex); - - /* - * The acpi device is always managed by devd(8) and is considered - * writable (i.e., ack is required to allow suspend to proceed.) - */ - if (strcmp("acpi", devtoname(dev)) == 0) - clone->flags = ACPI_EVF_DEVD | ACPI_EVF_WRITE; - else - clone->flags = ACPI_EVF_NONE; - - ACPI_LOCK(acpi); - STAILQ_INSERT_TAIL(&acpi_sc->apm_cdevs, clone, entries); - ACPI_UNLOCK(acpi); - return (clone); -} - -static int -apmopen(struct cdev *dev, int flag, int fmt, struct thread *td) -{ - struct acpi_softc *acpi_sc; - struct apm_clone_data *clone; - - acpi_sc = devclass_get_softc(devclass_find("acpi"), 0); - clone = apm_create_clone(dev, acpi_sc); - dev->si_drv1 = clone; - - /* If the device is opened for write, record that. */ - if ((flag & FWRITE) != 0) - clone->flags |= ACPI_EVF_WRITE; - - return (0); -} - -static int -apmclose(struct cdev *dev, int flag, int fmt, struct thread *td) -{ - struct apm_clone_data *clone; - struct acpi_softc *acpi_sc; - - clone = dev->si_drv1; - acpi_sc = clone->acpi_sc; - - /* We are about to lose a reference so check if suspend should occur */ - if (acpi_sc->acpi_next_sstate != 0 && - clone->notify_status != APM_EV_ACKED) - acpi_AckSleepState(clone, 0); - - /* Remove this clone's data from the list and free it. */ - ACPI_LOCK(acpi); - STAILQ_REMOVE(&acpi_sc->apm_cdevs, clone, apm_clone_data, entries); - knlist_destroy(&clone->sel_read.si_note); - ACPI_UNLOCK(acpi); - free(clone, M_APMDEV); - destroy_dev_sched(dev); - return (0); -} - -static int -apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) -{ - int error; - struct apm_clone_data *clone; - struct acpi_softc *acpi_sc; - struct apm_info info; - struct apm_event_info *ev_info; - apm_info_old_t aiop; - - error = 0; - clone = dev->si_drv1; - acpi_sc = clone->acpi_sc; - - switch (cmd) { - case APMIO_SUSPEND: - if ((flag & FWRITE) == 0) - return (EPERM); - if (acpi_sc->acpi_next_sstate == 0) { - if (acpi_sc->acpi_suspend_sx != ACPI_STATE_S5) { - error = acpi_ReqSleepState(acpi_sc, - acpi_sc->acpi_suspend_sx); - } else { - printf( - "power off via apm suspend not supported\n"); - error = ENXIO; - } - } else - error = acpi_AckSleepState(clone, 0); - break; - case APMIO_STANDBY: - if ((flag & FWRITE) == 0) - return (EPERM); - if (acpi_sc->acpi_next_sstate == 0) { - if (acpi_sc->acpi_standby_sx != ACPI_STATE_S5) { - error = acpi_ReqSleepState(acpi_sc, - acpi_sc->acpi_standby_sx); - } else { - printf( - "power off via apm standby not supported\n"); - error = ENXIO; - } - } else - error = acpi_AckSleepState(clone, 0); - break; - case APMIO_NEXTEVENT: - printf("apm nextevent start\n"); - ACPI_LOCK(acpi); - if (acpi_sc->acpi_next_sstate != 0 && clone->notify_status == - APM_EV_NONE) { - ev_info = (struct apm_event_info *)addr; - if (acpi_sc->acpi_next_sstate <= ACPI_STATE_S3) - ev_info->type = PMEV_STANDBYREQ; - else - ev_info->type = PMEV_SUSPENDREQ; - ev_info->index = 0; - clone->notify_status = APM_EV_NOTIFIED; - printf("apm event returning %d\n", ev_info->type); - } else - error = EAGAIN; - ACPI_UNLOCK(acpi); - break; - case APMIO_GETINFO_OLD: - if (acpi_capm_get_info(&info)) - error = ENXIO; - aiop = (apm_info_old_t)addr; - aiop->ai_major = info.ai_major; - aiop->ai_minor = info.ai_minor; - aiop->ai_acline = info.ai_acline; - aiop->ai_batt_stat = info.ai_batt_stat; - aiop->ai_batt_life = info.ai_batt_life; - aiop->ai_status = info.ai_status; - break; - case APMIO_GETINFO: - if (acpi_capm_get_info((apm_info_t)addr)) - error = ENXIO; - break; - case APMIO_GETPWSTATUS: - if (acpi_capm_get_pwstatus((apm_pwstatus_t)addr)) - error = ENXIO; - break; - case APMIO_ENABLE: - if ((flag & FWRITE) == 0) - return (EPERM); - apm_active = 1; - break; - case APMIO_DISABLE: - if ((flag & FWRITE) == 0) - return (EPERM); - apm_active = 0; - break; - case APMIO_HALTCPU: - break; - case APMIO_NOTHALTCPU: - break; - case APMIO_DISPLAY: - if ((flag & FWRITE) == 0) - return (EPERM); - break; - case APMIO_BIOS: - if ((flag & FWRITE) == 0) - return (EPERM); - bzero(addr, sizeof(struct apm_bios_arg)); - break; - default: - error = EINVAL; - break; - } - - return (error); -} - -static int -apmwrite(struct cdev *dev, struct uio *uio, int ioflag) -{ - return (uio->uio_resid); -} - -static int -apmpoll(struct cdev *dev, int events, struct thread *td) -{ - struct apm_clone_data *clone; - int revents; - - revents = 0; - ACPI_LOCK(acpi); - clone = dev->si_drv1; - if (clone->acpi_sc->acpi_next_sstate) - revents |= events & (POLLIN | POLLRDNORM); - else - selrecord(td, &clone->sel_read); - ACPI_UNLOCK(acpi); - return (revents); -} - -static int -apmkqfilter(struct cdev *dev, struct knote *kn) -{ - struct apm_clone_data *clone; - - ACPI_LOCK(acpi); - clone = dev->si_drv1; - kn->kn_hook = clone; - kn->kn_fop = &apm_readfiltops; - knlist_add(&clone->sel_read.si_note, kn, 0); - ACPI_UNLOCK(acpi); - return (0); -} - -static void -apmreadfiltdetach(struct knote *kn) -{ - struct apm_clone_data *clone; - - ACPI_LOCK(acpi); - clone = kn->kn_hook; - knlist_remove(&clone->sel_read.si_note, kn, 0); - ACPI_UNLOCK(acpi); -} - -static int -apmreadfilt(struct knote *kn, long hint) -{ - struct apm_clone_data *clone; - int sleeping; - - ACPI_LOCK(acpi); - clone = kn->kn_hook; - sleeping = clone->acpi_sc->acpi_next_sstate ? 1 : 0; - ACPI_UNLOCK(acpi); - return (sleeping); -} int acpi_machdep_init(device_t dev) { - struct acpi_softc *acpi_sc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 05:22:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3427A106566C; Wed, 10 Nov 2010 05:22:13 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F6E48FC0C; Wed, 10 Nov 2010 05:22:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA5MDeY084944; Wed, 10 Nov 2010 05:22:13 GMT (envelope-from nork@svn.freebsd.org) Received: (from nork@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA5MDLb084941; Wed, 10 Nov 2010 05:22:13 GMT (envelope-from nork@svn.freebsd.org) Message-Id: <201011100522.oAA5MDLb084941@svn.freebsd.org> From: Norikatsu Shigemura Date: Wed, 10 Nov 2010 05:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215077 - in stable/8: . contrib/top etc/periodic/daily gnu/usr.bin lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/sched sys/modules tools/regression/lib/msun tools/regress... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 05:22:13 -0000 Author: nork Date: Wed Nov 10 05:22:12 2010 New Revision: 215077 URL: http://svn.freebsd.org/changeset/base/215077 Log: MFC 211249 This depends on ACPI, so only build on i386:i386, amd64:amd64 and ia64:ia64. It can't possibly work on pc98, or any of the embedded platforms, since they lack ACPI. Pointy hat: myself Pointed out: nyan, releng_8 tinderbox Approved by: imp (mentor, implicitly) Modified: stable/8/sys/modules/Makefile Directory Properties: stable/8/ (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/one-true-awk/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/etc/periodic/daily/ (props changed) stable/8/etc/periodic/daily/800.scrub-zfs (props changed) stable/8/etc/periodic/security/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libproc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/librtld_db/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libthread_db/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/etc/ (props changed) stable/8/share/examples/kld/syscall/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/mk/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fold/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/lex/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/ncal/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/ruptime/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/tr/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/uudecode/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.bin/yacc/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/cxgbtool/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/ (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rtadvd/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/watchdogd/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Wed Nov 10 04:37:09 2010 (r215076) +++ stable/8/sys/modules/Makefile Wed Nov 10 05:22:12 2010 (r215077) @@ -281,7 +281,7 @@ SUBDIR= ${_3dfx} \ ti \ tl \ ${_tmpfs} \ - tpm \ + ${_tpm} \ trm \ ${_twa} \ twe \ @@ -468,6 +468,7 @@ _nfe= nfe _nve= nve _nvram= nvram _nxge= nxge +_tpm= tpm _wpi= wpi _wpifw= wpifw .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) @@ -561,6 +562,7 @@ _speaker= speaker _splash= splash _sppp= sppp _tmpfs= tmpfs +_tpm= tpm _twa= twa _vesa= vesa _x86bios= x86bios @@ -605,6 +607,7 @@ _sound= sound _splash= splash _sppp= sppp _streams= streams +_tpm= tpm _twa= twa _wi= wi _xe= xe From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 05:32:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69D781065670; Wed, 10 Nov 2010 05:32:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58E598FC19; Wed, 10 Nov 2010 05:32:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA5WaUM085568; Wed, 10 Nov 2010 05:32:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA5WahA085566; Wed, 10 Nov 2010 05:32:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011100532.oAA5WahA085566@svn.freebsd.org> From: Warner Losh Date: Wed, 10 Nov 2010 05:32: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: r215078 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 05:32:36 -0000 Author: imp Date: Wed Nov 10 05:32:36 2010 New Revision: 215078 URL: http://svn.freebsd.org/changeset/base/215078 Log: When we switched to the gpart backend, and provided selection between MBR & GPT, the MBR full-disk init failed to stamp boot1, and results in a boot not found error. This patch fixes the issue. PR: 151990 Submitted by: Kris Moore Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Wed Nov 10 05:22:12 2010 (r215077) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Wed Nov 10 05:32:36 2010 (r215078) @@ -646,8 +646,11 @@ init_mbr_full_disk() rc_halt "dd if=/dev/zero of=/dev/${_intDISK}s1 count=1024" if [ "$_intBOOT" = "bsd" ] ; then - echo_log "Stamping boot sector on ${_intDISK}" + echo_log "Stamping boot0 on ${_intDISK}" rc_halt "gpart bootcode -b /boot/boot0 ${_intDISK}" + else + echo_log "Stamping boot1 on ${_intDISK}" + rc_halt "gpart bootcode -b /boot/boot1 ${_intDISK}" fi } From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 05:48:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 564581065694; Wed, 10 Nov 2010 05:48:59 +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 A40308FC08; Wed, 10 Nov 2010 05:48:57 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id HAA09816; Wed, 10 Nov 2010 07:48:56 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PG3YF-000Adc-LI; Wed, 10 Nov 2010 07:48:55 +0200 Message-ID: <4CDA3247.1000608@freebsd.org> Date: Wed, 10 Nov 2010 07:48:55 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Norikatsu Shigemura References: <201011100522.oAA5MDLb084941@svn.freebsd.org> In-Reply-To: <201011100522.oAA5MDLb084941@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r215077 - in stable/8: . contrib/top etc/periodic/daily gnu/usr.bin lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/sched sys/modules tools/regression/lib/msun tools/regress... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 05:48:59 -0000 Hmm, properties changing on pretty much all directories and files with svn:mergeinfo doesn't look correct. on 10/11/2010 07:22 Norikatsu Shigemura said the following: > Directory Properties: > stable/8/ (props changed) > stable/8/Makefile (props changed) > stable/8/Makefile.inc1 (props changed) > stable/8/ObsoleteFiles.inc (props changed) > stable/8/UPDATING (props changed) > stable/8/bin/ (props changed) > stable/8/bin/chio/ (props changed) > stable/8/bin/chmod/ (props changed) > stable/8/bin/cp/ (props changed) > stable/8/bin/csh/ (props changed) > stable/8/bin/date/ (props changed) > stable/8/bin/expr/ (props changed) > stable/8/bin/getfacl/ (props changed) > stable/8/bin/kill/ (props changed) > stable/8/bin/ln/ (props changed) > stable/8/bin/ls/ (props changed) > stable/8/bin/mv/ (props changed) > stable/8/bin/pax/ (props changed) > stable/8/bin/pkill/ (props changed) > stable/8/bin/ps/ (props changed) > stable/8/bin/pwait/ (props changed) > stable/8/bin/setfacl/ (props changed) > stable/8/bin/sh/ (props changed) > stable/8/bin/sleep/ (props changed) > stable/8/bin/test/ (props changed) > stable/8/cddl/compat/opensolaris/ (props changed) > stable/8/cddl/contrib/opensolaris/ (props changed) > stable/8/cddl/lib/ (props changed) > stable/8/cddl/lib/libnvpair/ (props changed) > stable/8/cddl/lib/libzpool/ (props changed) > stable/8/cddl/usr.bin/ (props changed) > stable/8/cddl/usr.sbin/ (props changed) > stable/8/contrib/ (props changed) > stable/8/contrib/bind9/ (props changed) > stable/8/contrib/binutils/ (props changed) > stable/8/contrib/bsnmp/ (props changed) > stable/8/contrib/bzip2/ (props changed) > stable/8/contrib/com_err/ (props changed) > stable/8/contrib/csup/ (props changed) > stable/8/contrib/ee/ (props changed) > stable/8/contrib/expat/ (props changed) > stable/8/contrib/file/ (props changed) > stable/8/contrib/gcc/ (props changed) > stable/8/contrib/gdb/ (props changed) > stable/8/contrib/gdtoa/ (props changed) > stable/8/contrib/groff/ (props changed) > stable/8/contrib/ipfilter/ (props changed) > stable/8/contrib/less/ (props changed) > stable/8/contrib/libpcap/ (props changed) > stable/8/contrib/ncurses/ (props changed) > stable/8/contrib/netcat/ (props changed) > stable/8/contrib/ntp/ (props changed) > stable/8/contrib/nvi/ (props changed) > stable/8/contrib/one-true-awk/ (props changed) > stable/8/contrib/openbsm/ (props changed) > stable/8/contrib/openpam/ (props changed) > stable/8/contrib/pf/ (props changed) > stable/8/contrib/sendmail/ (props changed) > stable/8/contrib/tcp_wrappers/ (props changed) > stable/8/contrib/tcpdump/ (props changed) > stable/8/contrib/tcsh/ (props changed) > stable/8/contrib/telnet/ (props changed) > stable/8/contrib/top/ (props changed) > stable/8/contrib/top/install-sh (props changed) > stable/8/contrib/traceroute/ (props changed) > stable/8/contrib/wpa/ (props changed) > stable/8/contrib/xz/ (props changed) > stable/8/crypto/heimdal/ (props changed) > stable/8/crypto/openssh/ (props changed) > stable/8/crypto/openssl/ (props changed) > stable/8/etc/ (props changed) > stable/8/etc/periodic/daily/ (props changed) > stable/8/etc/periodic/daily/800.scrub-zfs (props changed) > stable/8/etc/periodic/security/ (props changed) > stable/8/games/factor/ (props changed) > stable/8/games/fortune/ (props changed) > stable/8/games/grdc/ (props changed) > stable/8/games/pom/ (props changed) > stable/8/gnu/lib/csu/ (props changed) > stable/8/gnu/lib/libstdc++/ (props changed) > stable/8/gnu/usr.bin/ (props changed) > stable/8/gnu/usr.bin/Makefile (props changed) > stable/8/gnu/usr.bin/dialog/ (props changed) > stable/8/gnu/usr.bin/gdb/ (props changed) > stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) > stable/8/gnu/usr.bin/groff/ (props changed) > stable/8/gnu/usr.bin/patch/ (props changed) > stable/8/include/ (props changed) > stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) > stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) > stable/8/kerberos5/usr.bin/kdestroy/ (props changed) > stable/8/kerberos5/usr.bin/kpasswd/ (props changed) > stable/8/lib/ (props changed) > stable/8/lib/bind/ (props changed) > stable/8/lib/csu/ (props changed) > stable/8/lib/libarchive/ (props changed) > stable/8/lib/libbluetooth/ (props changed) > stable/8/lib/libc/ (props changed) > stable/8/lib/libc/locale/ (props changed) > stable/8/lib/libc/stdtime/ (props changed) > stable/8/lib/libc/sys/ (props changed) > stable/8/lib/libc_r/ (props changed) > stable/8/lib/libcam/ (props changed) > stable/8/lib/libcompat/ (props changed) > stable/8/lib/libdevinfo/ (props changed) > stable/8/lib/libdisk/ (props changed) > stable/8/lib/libedit/ (props changed) > stable/8/lib/libelf/ (props changed) > stable/8/lib/libexpat/ (props changed) > stable/8/lib/libfetch/ (props changed) > stable/8/lib/libgeom/ (props changed) > stable/8/lib/libgpib/ (props changed) > stable/8/lib/libgssapi/ (props changed) > stable/8/lib/libjail/ (props changed) > stable/8/lib/libkse/ (props changed) > stable/8/lib/libkvm/ (props changed) > stable/8/lib/liblzma/ (props changed) > stable/8/lib/libmagic/ (props changed) > stable/8/lib/libmemstat/ (props changed) > stable/8/lib/libpam/ (props changed) > stable/8/lib/libpmc/ (props changed) > stable/8/lib/libproc/ (props changed) > stable/8/lib/libradius/ (props changed) > stable/8/lib/librpcsec_gss/ (props changed) > stable/8/lib/librtld_db/ (props changed) > stable/8/lib/libsm/ (props changed) > stable/8/lib/libstand/ (props changed) > stable/8/lib/libtacplus/ (props changed) > stable/8/lib/libthr/ (props changed) > stable/8/lib/libthread_db/ (props changed) > stable/8/lib/libufs/ (props changed) > stable/8/lib/libugidfw/ (props changed) > stable/8/lib/libusb/ (props changed) > stable/8/lib/libusb/usb.h (props changed) > stable/8/lib/libusbhid/ (props changed) > stable/8/lib/libutil/ (props changed) > stable/8/lib/libz/ (props changed) > stable/8/lib/libz/contrib/ (props changed) > stable/8/lib/msun/ (props changed) > stable/8/libexec/ (props changed) > stable/8/libexec/ftpd/ (props changed) > stable/8/libexec/rtld-elf/ (props changed) > stable/8/libexec/tftpd/ (props changed) > stable/8/release/ (props changed) > stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) > stable/8/release/picobsd/ (props changed) > stable/8/release/picobsd/floppy.tree/sbin/ (props changed) > stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) > stable/8/release/picobsd/qemu/ (props changed) > stable/8/release/picobsd/tinyware/login/ (props changed) > stable/8/release/powerpc/ (props changed) > stable/8/sbin/ (props changed) > stable/8/sbin/atacontrol/ (props changed) > stable/8/sbin/bsdlabel/ (props changed) > stable/8/sbin/camcontrol/ (props changed) > stable/8/sbin/ddb/ (props changed) > stable/8/sbin/devd/ (props changed) > stable/8/sbin/devfs/ (props changed) > stable/8/sbin/dhclient/ (props changed) > stable/8/sbin/dump/ (props changed) > stable/8/sbin/dumpfs/ (props changed) > stable/8/sbin/fsck/ (props changed) > stable/8/sbin/fsck_ffs/ (props changed) > stable/8/sbin/fsck_msdosfs/ (props changed) > stable/8/sbin/fsirand/ (props changed) > stable/8/sbin/geom/ (props changed) > stable/8/sbin/geom/class/part/ (props changed) > stable/8/sbin/geom/class/sched/gsched.8 (props changed) > stable/8/sbin/geom/class/stripe/ (props changed) > stable/8/sbin/ggate/ (props changed) > stable/8/sbin/growfs/ (props changed) > stable/8/sbin/hastctl/ (props changed) > stable/8/sbin/hastd/ (props changed) > stable/8/sbin/ifconfig/ (props changed) > stable/8/sbin/ipfw/ (props changed) > stable/8/sbin/iscontrol/ (props changed) > stable/8/sbin/kldload/ (props changed) > stable/8/sbin/kldstat/ (props changed) > stable/8/sbin/mdconfig/ (props changed) > stable/8/sbin/mksnap_ffs/ (props changed) > stable/8/sbin/mount/ (props changed) > stable/8/sbin/mount_cd9660/ (props changed) > stable/8/sbin/mount_msdosfs/ (props changed) > stable/8/sbin/mount_nfs/ (props changed) > stable/8/sbin/natd/ (props changed) > stable/8/sbin/newfs/ (props changed) > stable/8/sbin/newfs_msdos/ (props changed) > stable/8/sbin/ping6/ (props changed) > stable/8/sbin/reboot/ (props changed) > stable/8/sbin/restore/ (props changed) > stable/8/sbin/routed/ (props changed) > stable/8/sbin/setkey/ (props changed) > stable/8/sbin/spppcontrol/ (props changed) > stable/8/sbin/sysctl/ (props changed) > stable/8/sbin/tunefs/ (props changed) > stable/8/sbin/umount/ (props changed) > stable/8/secure/ (props changed) > stable/8/secure/lib/libcrypto/ (props changed) > stable/8/secure/lib/libssl/ (props changed) > stable/8/secure/usr.bin/bdes/ (props changed) > stable/8/secure/usr.bin/openssl/ (props changed) > stable/8/share/dict/ (props changed) > stable/8/share/examples/ (props changed) > stable/8/share/examples/etc/ (props changed) > stable/8/share/examples/kld/syscall/ (props changed) > stable/8/share/man/ (props changed) > stable/8/share/man/man1/ (props changed) > stable/8/share/man/man3/ (props changed) > stable/8/share/man/man4/ (props changed) > stable/8/share/man/man5/ (props changed) > stable/8/share/man/man7/ (props changed) > stable/8/share/man/man8/ (props changed) > stable/8/share/man/man9/ (props changed) > stable/8/share/misc/ (props changed) > stable/8/share/mk/ (props changed) > stable/8/share/termcap/ (props changed) > stable/8/share/timedef/ (props changed) > stable/8/share/zoneinfo/ (props changed) > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/dev/xen/xenpci/ (props changed) > stable/8/tools/ (props changed) > stable/8/tools/build/mk/ (props changed) > stable/8/tools/build/options/ (props changed) > stable/8/tools/debugscripts/ (props changed) > stable/8/tools/kerneldoc/subsys/ (props changed) > stable/8/tools/regression/acltools/ (props changed) > stable/8/tools/regression/aio/aiotest/ (props changed) > stable/8/tools/regression/bin/sh/ (props changed) > stable/8/tools/regression/fifo/ (props changed) > stable/8/tools/regression/geom/ (props changed) > stable/8/tools/regression/lib/libc/ (props changed) > stable/8/tools/regression/lib/msun/test-conj.t (props changed) > stable/8/tools/regression/mqueue/mqtest1/ (props changed) > stable/8/tools/regression/mqueue/mqtest2/ (props changed) > stable/8/tools/regression/mqueue/mqtest3/ (props changed) > stable/8/tools/regression/mqueue/mqtest4/ (props changed) > stable/8/tools/regression/mqueue/mqtest5/ (props changed) > stable/8/tools/regression/poll/ (props changed) > stable/8/tools/regression/posixsem/ (props changed) > stable/8/tools/regression/priv/ (props changed) > stable/8/tools/regression/usr.bin/ (props changed) > stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) > stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) > stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) > stable/8/tools/regression/usr.bin/sed/ (props changed) > stable/8/tools/regression/usr.bin/tr/ (props changed) > stable/8/tools/test/ (props changed) > stable/8/tools/tools/ (props changed) > stable/8/tools/tools/ath/ (props changed) > stable/8/tools/tools/ath/common/dumpregs.h (props changed) > stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) > stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) > stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) > stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) > stable/8/tools/tools/nanobsd/ (props changed) > stable/8/tools/tools/netrate/ (props changed) > stable/8/tools/tools/netrate/tcpp/ (props changed) > stable/8/tools/tools/termcap/termcap.pl (props changed) > stable/8/tools/tools/umastat/ (props changed) > stable/8/tools/tools/vimage/ (props changed) > stable/8/usr.bin/ (props changed) > stable/8/usr.bin/apply/ (props changed) > stable/8/usr.bin/ar/ (props changed) > stable/8/usr.bin/awk/ (props changed) > stable/8/usr.bin/biff/ (props changed) > stable/8/usr.bin/c89/ (props changed) > stable/8/usr.bin/c99/ (props changed) > stable/8/usr.bin/catman/ (props changed) > stable/8/usr.bin/column/ (props changed) > stable/8/usr.bin/comm/ (props changed) > stable/8/usr.bin/cpio/ (props changed) > stable/8/usr.bin/csup/ (props changed) > stable/8/usr.bin/du/ (props changed) > stable/8/usr.bin/ee/ (props changed) > stable/8/usr.bin/enigma/ (props changed) > stable/8/usr.bin/fetch/ (props changed) > stable/8/usr.bin/find/ (props changed) > stable/8/usr.bin/finger/ (props changed) > stable/8/usr.bin/fold/ (props changed) > stable/8/usr.bin/fstat/ (props changed) > stable/8/usr.bin/gcore/ (props changed) > stable/8/usr.bin/getopt/ (props changed) > stable/8/usr.bin/gzip/ (props changed) > stable/8/usr.bin/hexdump/ (props changed) > stable/8/usr.bin/indent/ (props changed) > stable/8/usr.bin/jot/ (props changed) > stable/8/usr.bin/kdump/ (props changed) > stable/8/usr.bin/killall/ (props changed) > stable/8/usr.bin/ktrace/ (props changed) > stable/8/usr.bin/lex/ (props changed) > stable/8/usr.bin/locale/ (props changed) > stable/8/usr.bin/lockf/ (props changed) > stable/8/usr.bin/look/ (props changed) > stable/8/usr.bin/mail/ (props changed) > stable/8/usr.bin/make/ (props changed) > stable/8/usr.bin/makewhatis/ (props changed) > stable/8/usr.bin/minigzip/ (props changed) > stable/8/usr.bin/ncal/ (props changed) > stable/8/usr.bin/netstat/ (props changed) > stable/8/usr.bin/pathchk/ (props changed) > stable/8/usr.bin/perror/ (props changed) > stable/8/usr.bin/procstat/ (props changed) > stable/8/usr.bin/rpcgen/ (props changed) > stable/8/usr.bin/ruptime/ (props changed) > stable/8/usr.bin/script/ (props changed) > stable/8/usr.bin/sed/ (props changed) > stable/8/usr.bin/sockstat/ (props changed) > stable/8/usr.bin/split/ (props changed) > stable/8/usr.bin/stat/ (props changed) > stable/8/usr.bin/systat/ (props changed) > stable/8/usr.bin/tar/ (props changed) > stable/8/usr.bin/tftp/ (props changed) > stable/8/usr.bin/touch/ (props changed) > stable/8/usr.bin/tr/ (props changed) > stable/8/usr.bin/truss/ (props changed) > stable/8/usr.bin/uname/ (props changed) > stable/8/usr.bin/unifdef/ (props changed) > stable/8/usr.bin/uniq/ (props changed) > stable/8/usr.bin/unzip/ (props changed) > stable/8/usr.bin/uudecode/ (props changed) > stable/8/usr.bin/vmstat/ (props changed) > stable/8/usr.bin/w/ (props changed) > stable/8/usr.bin/whois/ (props changed) > stable/8/usr.bin/xinstall/ (props changed) > stable/8/usr.bin/xlint/ (props changed) > stable/8/usr.bin/yacc/ (props changed) > stable/8/usr.sbin/ (props changed) > stable/8/usr.sbin/Makefile (props changed) > stable/8/usr.sbin/acpi/ (props changed) > stable/8/usr.sbin/arp/ (props changed) > stable/8/usr.sbin/asf/ (props changed) > stable/8/usr.sbin/bluetooth/ (props changed) > stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) > stable/8/usr.sbin/bluetooth/bthidd/ (props changed) > stable/8/usr.sbin/boot0cfg/ (props changed) > stable/8/usr.sbin/bsnmpd/ (props changed) > stable/8/usr.sbin/burncd/ (props changed) > stable/8/usr.sbin/cdcontrol/ (props changed) > stable/8/usr.sbin/chown/ (props changed) > stable/8/usr.sbin/config/ (props changed) > stable/8/usr.sbin/cpucontrol/ (props changed) > stable/8/usr.sbin/crashinfo/ (props changed) > stable/8/usr.sbin/cron/ (props changed) > stable/8/usr.sbin/crunch/examples/ (props changed) > stable/8/usr.sbin/ctm/ (props changed) > stable/8/usr.sbin/cxgbtool/ (props changed) > stable/8/usr.sbin/devinfo/ (props changed) > stable/8/usr.sbin/diskinfo/ (props changed) > stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) > stable/8/usr.sbin/dumpcis/cis.h (props changed) > stable/8/usr.sbin/faithd/ (props changed) > stable/8/usr.sbin/fdcontrol/ (props changed) > stable/8/usr.sbin/fdformat/ (props changed) > stable/8/usr.sbin/fdread/ (props changed) > stable/8/usr.sbin/fdwrite/ (props changed) > stable/8/usr.sbin/fifolog/ (props changed) > stable/8/usr.sbin/flowctl/ (props changed) > stable/8/usr.sbin/freebsd-update/ (props changed) > stable/8/usr.sbin/i2c/ (props changed) > stable/8/usr.sbin/inetd/ (props changed) > stable/8/usr.sbin/iostat/ (props changed) > stable/8/usr.sbin/jail/ (props changed) > stable/8/usr.sbin/jls/ (props changed) > stable/8/usr.sbin/lpr/ (props changed) > stable/8/usr.sbin/mailwrapper/ (props changed) > stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) > stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) > stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) > stable/8/usr.sbin/makefs/getid.c (props changed) > stable/8/usr.sbin/mergemaster/ (props changed) > stable/8/usr.sbin/mfiutil/ (props changed) > stable/8/usr.sbin/mountd/ (props changed) > stable/8/usr.sbin/moused/ (props changed) > stable/8/usr.sbin/mptutil/ (props changed) > stable/8/usr.sbin/mtest/ (props changed) > stable/8/usr.sbin/mtree/ (props changed) > stable/8/usr.sbin/named/ (props changed) > stable/8/usr.sbin/ndp/ (props changed) > stable/8/usr.sbin/newsyslog/ (props changed) > stable/8/usr.sbin/nfsdumpstate/ (props changed) > stable/8/usr.sbin/ntp/ (props changed) > stable/8/usr.sbin/pciconf/ (props changed) > stable/8/usr.sbin/periodic/ (props changed) > stable/8/usr.sbin/pmcannotate/ (props changed) > stable/8/usr.sbin/pmccontrol/ (props changed) > stable/8/usr.sbin/pmcstat/ (props changed) > stable/8/usr.sbin/powerd/ (props changed) > stable/8/usr.sbin/ppp/ (props changed) > stable/8/usr.sbin/pppctl/ (props changed) > stable/8/usr.sbin/pstat/ (props changed) > stable/8/usr.sbin/rpc.lockd/ (props changed) > stable/8/usr.sbin/rpc.umntall/ (props changed) > stable/8/usr.sbin/rtadvd/ (props changed) > stable/8/usr.sbin/rtsold/ (props changed) > stable/8/usr.sbin/sade/ (props changed) > stable/8/usr.sbin/service/ (props changed) > stable/8/usr.sbin/services_mkdb/ (props changed) > stable/8/usr.sbin/setfmac/ (props changed) > stable/8/usr.sbin/setpmac/ (props changed) > stable/8/usr.sbin/smbmsg/ (props changed) > stable/8/usr.sbin/sysinstall/ (props changed) > stable/8/usr.sbin/syslogd/ (props changed) > stable/8/usr.sbin/traceroute/ (props changed) > stable/8/usr.sbin/traceroute6/ (props changed) > stable/8/usr.sbin/uathload/ (props changed) > stable/8/usr.sbin/ugidfw/ (props changed) > stable/8/usr.sbin/uhsoctl/ (props changed) > stable/8/usr.sbin/usbconfig/ (props changed) > stable/8/usr.sbin/vidcontrol/ (props changed) > stable/8/usr.sbin/watchdogd/ (props changed) > stable/8/usr.sbin/wpa/ (props changed) > stable/8/usr.sbin/ypserv/ (props changed) > stable/8/usr.sbin/zic/ (props changed) -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 06:24:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C6A0106566B; Wed, 10 Nov 2010 06:24:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BB4D8FC14; Wed, 10 Nov 2010 06:24:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA6OH2c088540; Wed, 10 Nov 2010 06:24:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA6OHgA088538; Wed, 10 Nov 2010 06:24:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011100624.oAA6OHgA088538@svn.freebsd.org> From: Warner Losh Date: Wed, 10 Nov 2010 06:24: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: r215081 - head/tools/tools/nanobsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 06:24:17 -0000 Author: imp Date: Wed Nov 10 06:24:16 2010 New Revision: 215081 URL: http://svn.freebsd.org/changeset/base/215081 Log: Insulate the nanobsd build from the current system by opting out of the SRCCONF processing. Noted by: gcopper@ Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 05:54:05 2010 (r215080) +++ head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 06:24:16 2010 (r215081) @@ -182,6 +182,7 @@ make_conf_build ( ) ( echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD} echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD} + echo "_WITHOUT_SRCCONF=t" >> ${NANO_MAKE_CONF_BUILD} ) build_world ( ) ( @@ -244,6 +245,7 @@ make_conf_install ( ) ( echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_INSTALL} echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF_INSTALL} + echo "_WITHOUT_SRCCONF=t" >> ${NANO_MAKE_CONF_INSTALL} ) install_world ( ) ( From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 06:39:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45FC8106564A; Wed, 10 Nov 2010 06:39:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 313368FC1A; Wed, 10 Nov 2010 06:39:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA6dovc089449; Wed, 10 Nov 2010 06:39:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA6dnQ8089429; Wed, 10 Nov 2010 06:39:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011100639.oAA6dnQ8089429@svn.freebsd.org> From: Warner Losh Date: Wed, 10 Nov 2010 06:39: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: r215082 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/binutils/as gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/cc/cc_int gnu/usr.bin/cc/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 06:39:50 -0000 Author: imp Date: Wed Nov 10 06:39:49 2010 New Revision: 215082 URL: http://svn.freebsd.org/changeset/base/215082 Log: Complete the integration of tbemd branch into head. TARGET_BIG_ENDIAN is now completely dead, except where it was originally supposed to be used (internally in the toolchain building). TARGET_ARCH has changed in three cases: (1) Little endian mips has changed to mipsel. (2) Big endian mips has changed to mipseb. (3) Big endian arm has changed to armeb. Some additional changes are needed to make 'make universe' work on arm and mips after this change, so those are commented out for now. UPDATING information will be forthcoming. Any remaining rough edges will be hammered out in -current. Modified: head/Makefile head/gnu/lib/libgcc/Makefile head/gnu/usr.bin/binutils/Makefile.inc0 head/gnu/usr.bin/binutils/as/Makefile head/gnu/usr.bin/binutils/ld/Makefile.arm head/gnu/usr.bin/binutils/ld/Makefile.mips head/gnu/usr.bin/binutils/libbfd/Makefile.arm head/gnu/usr.bin/binutils/libbfd/Makefile.mips head/gnu/usr.bin/cc/Makefile.inc head/gnu/usr.bin/cc/Makefile.tgt head/gnu/usr.bin/cc/cc_int/Makefile head/gnu/usr.bin/cc/cc_tools/Makefile head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/kgdb/Makefile head/gnu/usr.bin/gdb/libgdb/Makefile head/share/mk/bsd.cpu.mk head/share/mk/bsd.endian.mk head/sys/conf/Makefile.mips Modified: head/Makefile ============================================================================== --- head/Makefile Wed Nov 10 06:24:16 2010 (r215081) +++ head/Makefile Wed Nov 10 06:39:49 2010 (r215082) @@ -281,7 +281,7 @@ tinderbox: # existing system is. # .if make(universe) || make(universe_kernels) || make(tinderbox) -TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v +TARGETS?=amd64 i386 ia64 pc98 powerpc sparc64 sun4v .if defined(DOING_TINDERBOX) FAILFILE=tinderbox.failed Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/lib/libgcc/Makefile Wed Nov 10 06:39:49 2010 (r215082) @@ -27,7 +27,7 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_F LDFLAGS+= -nodefaultlibs LDADD+= -lc -OBJS= # added to below in various ways depending on TARGET_ARCH +OBJS= # added to below in various ways depending on TARGET_CPUARCH #--------------------------------------------------------------------------- # @@ -100,7 +100,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udi # Platform specific bits. # When upgrading GCC, get the following definitions from config//t-* # -.if ${TARGET_ARCH} == "arm" +.if ${TARGET_CPUARCH} == "arm" # from config/arm/t-strongarm-elf CFLAGS+= -Dinhibit_libc -fno-inline LIB1ASMSRC = lib1funcs.asm @@ -116,7 +116,7 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatuns # _fixsfsi _fixunssfsi _floatdidf _floatdisf .endif -.if ${TARGET_ARCH} == "mips" +.if ${TARGET_CPUARCH} == "mips" LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c .if defined(TARGET_ABI) && ${TARGET_ABI} != "o32" LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c @@ -126,7 +126,7 @@ LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c .endif .endif -.if ${TARGET_ARCH} == "ia64" +.if ${TARGET_CPUARCH} == "ia64" # from config/ia64/t-ia64 LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \ @@ -137,18 +137,18 @@ LIB1ASMFUNCS = __divxf3 __divdf3 __divsf LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c .endif -.if ${TARGET_ARCH} == "powerpc" +.if ${TARGET_CPUARCH} == "powerpc" # from config/rs6000/t-ppccomm LIB2FUNCS_EXTRA = tramp.asm LIB2FUNCS_STATIC_EXTRA = eabi.asm .endif -.if ${TARGET_ARCH} == "powerpc64" +.if ${TARGET_CPUARCH} == "powerpc64" # from config/rs6000/t-ppccomm LIB2FUNCS_EXTRA = tramp.asm .endif -.if ${TARGET_ARCH} == "sparc64" +.if ${TARGET_CPUARCH} == "sparc64" # from config/sparc/t-elf LIB1ASMSRC = lb1spc.asm LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 @@ -195,8 +195,8 @@ OBJ_GRPS = STD DIV # # Floating point emulation functions # -.if ${TARGET_ARCH} == "armNOT_YET" || \ - ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64" +.if ${TARGET_CPUARCH} == "armNOT_YET" || \ + ${TARGET_CPUARCH} == "powerpc" || ${TARGET_CPUARCH} == "sparc64" FPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES -DFLOAT DPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES Modified: head/gnu/usr.bin/binutils/Makefile.inc0 ============================================================================== --- head/gnu/usr.bin/binutils/Makefile.inc0 Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/binutils/Makefile.inc0 Wed Nov 10 06:39:49 2010 (r215082) @@ -6,13 +6,17 @@ VERSION= "2.15 [FreeBSD] 2004-05-23" -TARGET_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH} == "amd64" -BINUTILS_ARCH=x86_64 +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} .else -BINUTILS_ARCH=${TARGET_ARCH} +TARGET_CPUARCH=${MACHINE_CPUARCH} .endif +TARGET_ARCH?= ${MACHINE_ARCH} +BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/} TARGET_TUPLE?= ${BINUTILS_ARCH}-obrien-freebsd +.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "mipseb" +TARGET_BIG_ENDIAN=t +.endif # RELTOP is the relative path to this point in the source or object # tree, from any subdirectory of same. It gets extra "../" prefixes @@ -22,28 +26,29 @@ RELTOP:= .. RELSRC= ${RELTOP}/../../../contrib/binutils SRCDIR= ${.CURDIR}/${RELSRC} -.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "i386" || \ - ${TARGET_ARCH} == "powerpc" || \ - (${TARGET_ARCH} == "mips" && (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) +.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \ + ${TARGET_CPUARCH} == "powerpc" || \ + (${TARGET_CPUARCH} == "mips" && \ + (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32 .else CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64 .endif CFLAGS+= -I. -.if exists(${.CURDIR}/${TARGET_ARCH}) -CFLAGS+= -I${.CURDIR}/${TARGET_ARCH} +.if exists(${.CURDIR}/${TARGET_CPUARCH}) +CFLAGS+= -I${.CURDIR}/${TARGET_CPUARCH} .endif CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd CFLAGS+= -I${.OBJDIR}/${RELTOP}/libbfd CFLAGS+= -I${SRCDIR}/include -.if exists(${.CURDIR}/${TARGET_ARCH}) -.PATH: ${.CURDIR}/${TARGET_ARCH} +.if exists(${.CURDIR}/${TARGET_CPUARCH}) +.PATH: ${.CURDIR}/${TARGET_CPUARCH} .endif -ARCHS= ${TARGET_ARCH} +ARCHS= ${TARGET_CPUARCH} .for _arch in ${CROSS_ARCH} .if (${ARCHS:R:M${_arch:R}} == "") Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/binutils/as/Makefile Wed Nov 10 06:39:49 2010 (r215082) @@ -20,7 +20,7 @@ SRCS+= app.c as.c atof-generic.c atof-ie # DEO: why not used? #SRCS+= itbl-ops.c -.if ${TARGET_ARCH} == "mips" +.if ${TARGET_CPUARCH} == "mips" SRCS+= itbl-ops.c itbl-parse.y itbl-lex.l .endif @@ -32,7 +32,7 @@ SRCS+= tc-ppc.c # change back to tc-sparc.c when new binutils is imported SRCS+= tc-sparc-fixed.c .else -SRCS+= tc-${TARGET_ARCH}.c +SRCS+= tc-${TARGET_CPUARCH}.c .endif .if ${TARGET_ARCH} == "sparc64" @@ -49,7 +49,7 @@ CFLAGS+= -DTARGET_ALIAS=\"${TARGET_TUPLE CFLAGS+= -DVERSION=\"${VERSION}\" CFLAGS+= -D_GNU_SOURCE CFLAGS+= -I${SRCDIR}/gas -I${SRCDIR}/gas/config -I${SRCDIR} -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_ARCH}-freebsd +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-freebsd NO_SHARED?= yes Modified: head/gnu/usr.bin/binutils/ld/Makefile.arm ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile.arm Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/binutils/ld/Makefile.arm Wed Nov 10 06:39:49 2010 (r215082) @@ -1,6 +1,6 @@ # $FreeBSD$ -.if defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "armeb" NATIVE_EMULATION= armelfb_fbsd .else NATIVE_EMULATION= armelf_fbsd Modified: head/gnu/usr.bin/binutils/ld/Makefile.mips ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile.mips Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/binutils/ld/Makefile.mips Wed Nov 10 06:39:49 2010 (r215082) @@ -1,8 +1,6 @@ # $FreeBSD$ -#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention -# of mipsel and mips. -.if !defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "mipsel" _EMULATION_ENDIAN=l .else _EMULATION_ENDIAN=b Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.arm ============================================================================== --- head/gnu/usr.bin/binutils/libbfd/Makefile.arm Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/binutils/libbfd/Makefile.arm Wed Nov 10 06:39:49 2010 (r215082) @@ -1,6 +1,6 @@ # $FreeBSD$ -.if defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "armeb" DEFAULT_VECTOR= bfd_elf32_bigarm_vec .else DEFAULT_VECTOR= bfd_elf32_littlearm_vec @@ -14,7 +14,7 @@ SRCS+= cpu-arm.c \ elflink.c VECS+= ${DEFAULT_VECTOR} -.if defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "armeb" VECS+= bfd_elf32_littlearm_vec .else VECS+= bfd_elf32_bigarm_vec Modified: head/gnu/usr.bin/binutils/libbfd/Makefile.mips ============================================================================== --- head/gnu/usr.bin/binutils/libbfd/Makefile.mips Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/binutils/libbfd/Makefile.mips Wed Nov 10 06:39:49 2010 (r215082) @@ -1,15 +1,11 @@ # $FreeBSD$ -#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention -# of mipsel and mips. -.if !defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "mipsel" _EMULATION_ENDIAN=little .else _EMULATION_ENDIAN=big .endif -DEFAULT_VECTOR= bfd_elf32_tradbigmips_vec - .if defined(TARGET_ABI) && ${TARGET_ABI} != "o32" .if ${TARGET_ABI} == "n32" DEFAULT_VECTOR= bfd_elf32_ntrad${_EMULATION_ENDIAN}mips_vec Modified: head/gnu/usr.bin/cc/Makefile.inc ============================================================================== --- head/gnu/usr.bin/cc/Makefile.inc Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/cc/Makefile.inc Wed Nov 10 06:39:49 2010 (r215082) @@ -32,9 +32,13 @@ CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SI CFLAGS+= -DCROSS_COMPILE .endif -.if ${TARGET_ARCH} == "mips" -# XXX This is backwards, MIPS should default to BE. -.if !defined(TARGET_BIG_ENDIAN) +.if ${TARGET_ARCH} == "armeb" +CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END +.endif + + +.if ${TARGET_CPUARCH} == "mips" +.if ${TARGET_ARCH} == "mipsel" CFLAGS += -DTARGET_ENDIAN_DEFAULT=0 .endif Modified: head/gnu/usr.bin/cc/Makefile.tgt ============================================================================== --- head/gnu/usr.bin/cc/Makefile.tgt Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/cc/Makefile.tgt Wed Nov 10 06:39:49 2010 (r215082) @@ -1,16 +1,15 @@ # $FreeBSD$ -TARGET_ARCH?= ${MACHINE_ARCH} +# These assignments duplicate much of the functionality of +# MACHINE_CPUARCH, but there's no easy way to export make functions... -.if ${TARGET_ARCH} == "amd64" -GCC_CPU= i386 -.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" -GCC_CPU= rs6000 -.elif ${TARGET_ARCH} == "sparc64" -GCC_CPU= sparc +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} .else -GCC_CPU= ${TARGET_ARCH} +TARGET_CPUARCH=${MACHINE_CPUARCH} .endif +TARGET_ARCH?= ${MACHINE_ARCH} +GCC_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc/rs6000/:C/sparc64/sparc/} .if ${TARGET_ARCH} == "ia64" TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD @@ -18,7 +17,9 @@ TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU .if ${TARGET_ARCH} == "sparc64" TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc .endif +.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "mipseb" || ${TARGET_ARCH} == "mips64eb" +TARGET_BIG_ENDIAN=t +.endif .if ${TARGET_ARCH} == "powerpc64" TARGET_CPU_DEFAULT= \"powerpc64\" .endif - Modified: head/gnu/usr.bin/cc/cc_int/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_int/Makefile Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/cc/cc_int/Makefile Wed Nov 10 06:39:49 2010 (r215082) @@ -75,10 +75,6 @@ OBJS-md+= ${GCC_CPU}-c.o # Target specific, C specific object file C_TARGET_OBJS= -.if ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) -CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END -.endif - # Language-specific object files for C and Objective C. C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \ c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \ Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Wed Nov 10 06:39:49 2010 (r215082) @@ -22,13 +22,13 @@ LIBIBERTY= libiberty.a # The list of headers to go into tm.h # TARGET_INC+= options.h -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_CPUARCH} == "amd64" TARGET_INC+= i386/biarch64.h .endif -.if ${TARGET_ARCH} != "arm" +.if ${TARGET_CPUARCH} != "arm" TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h .endif -.if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64" +.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64" TARGET_INC+= ${GCC_CPU}/unix.h TARGET_INC+= ${GCC_CPU}/att.h .endif @@ -38,18 +38,18 @@ TARGET_INC+= elfos.h TARGET_INC+= freebsd-native.h TARGET_INC+= freebsd-spec.h TARGET_INC+= freebsd.h -.if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64" +.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64" . if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h) TARGET_INC+= ${GCC_CPU}/sysv4.h . endif .endif -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_CPUARCH} == "amd64" TARGET_INC+= ${GCC_CPU}/x86-64.h .endif -.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "mips" +.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips" TARGET_INC+= ${GCC_CPU}/elf.h .endif -.if ${TARGET_ARCH} == "arm" +.if ${TARGET_CPUARCH} == "arm" TARGET_INC+= ${GCC_CPU}/aout.h .endif .if ${TARGET_ARCH} == "powerpc64" @@ -57,10 +57,10 @@ TARGET_INC+= ${GCC_CPU}/biarch64.h TARGET_INC+= ${GCC_CPU}/default64.h .endif TARGET_INC+= ${GCC_CPU}/freebsd.h -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_CPUARCH} == "amd64" TARGET_INC+= ${GCC_CPU}/freebsd64.h .endif -.if ${TARGET_ARCH} == "arm" +.if ${TARGET_CPUARCH} == "arm" TARGET_INC+= ${GCC_CPU}/arm.h .endif TARGET_INC+= defaults.h @@ -175,11 +175,11 @@ OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/ OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt .endif -.if ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" +.if ${TARGET_CPUARCH} == "powerpc" OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt .endif -.if ${TARGET_ARCH} == "sparc64" +.if ${TARGET_CPUARCH} == "sparc64" OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt .endif Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/gdb/Makefile.inc Wed Nov 10 06:39:49 2010 (r215082) @@ -16,8 +16,16 @@ OBJ_ROOT= ${.OBJDIR}/../.. OBJ_BU= ${OBJ_ROOT}/binutils OBJ_GDB= ${OBJ_ROOT}/gdb -TARGET_ARCH?= ${MACHINE_ARCH} -TARGET_SUBDIR= ${BMAKE_GDB}/arch/${TARGET_ARCH} +# These assignments duplicate much of the functionality of +# MACHINE_CPUARCH, but there's no easy way to export make functions... + +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +.else +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif +TARGET_ARCH?= ${MACHINE_ARCH} +TARGET_SUBDIR= ${BMAKE_GDB}/arch/${TARGET_CPUARCH} .if ${TARGET_ARCH} != ${MACHINE_ARCH} GDB_CROSS_DEBUGGER= @@ -31,7 +39,7 @@ GDB_CROSS_DEBUGGER= CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1 CFLAGS+= -I. CFLAGS+= -I${TARGET_SUBDIR} -CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_ARCH} +CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_CPUARCH} CFLAGS+= -I${CNTRB_GDB}/gdb CFLAGS+= -I${CNTRB_GDB}/gdb/config CFLAGS+= -I${CNTRB_GDB}/include Modified: head/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/Makefile Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/gdb/kgdb/Makefile Wed Nov 10 06:39:49 2010 (r215082) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= kgdb${GDB_SUFFIX} -SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_ARCH}.c +SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_CPUARCH}.c WARNS?= 2 BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \ Modified: head/gnu/usr.bin/gdb/libgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/libgdb/Makefile Wed Nov 10 06:24:16 2010 (r215081) +++ head/gnu/usr.bin/gdb/libgdb/Makefile Wed Nov 10 06:39:49 2010 (r215082) @@ -1,6 +1,14 @@ # $FreeBSD$ -TARGET_ARCH?= ${MACHINE_ARCH} +# These assignments duplicate much of the functionality of +# MACHINE_CPUARCH, but there's no easy way to export make functions... + +.if defined(TARGET_ARCH) +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +.else +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif +TARGET_ARCH?= ${MACHINE_ARCH} LIB= gdb INTERNALLIB= Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed Nov 10 06:24:16 2010 (r215081) +++ head/share/mk/bsd.cpu.mk Wed Nov 10 06:39:49 2010 (r215082) @@ -114,7 +114,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ . else _CPUCFLAGS = -mcpu=${CPUTYPE} . endif -. elif ${MACHINE_ARCH} == "powerpc" +. elif ${MACHINE_CPUARCH} == "powerpc" . if ${CPUTYPE} == "e500" MACHINE_CPU = booke _CPUCFLAGS = -Wa,-me500 -msoft-float @@ -196,12 +196,6 @@ MACHINE_CPU = itanium . endif .endif -.if ${MACHINE_CPUARCH} == "arm" && defined(TARGET_BIG_ENDIAN) -CFLAGS += -mbig-endian -LDFLAGS += -mbig-endian -LD += -EB -.endif - .if ${MACHINE_CPUARCH} == "mips" CFLAGS += -G0 .endif Modified: head/share/mk/bsd.endian.mk ============================================================================== --- head/share/mk/bsd.endian.mk Wed Nov 10 06:24:16 2010 (r215081) +++ head/share/mk/bsd.endian.mk Wed Nov 10 06:39:49 2010 (r215082) @@ -3,13 +3,13 @@ .if ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386" || \ ${MACHINE_ARCH} == "ia64" || \ - (${MACHINE_ARCH} == "arm" && !defined(TARGET_BIG_ENDIAN)) || \ - (${MACHINE_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN)) + ${MACHINE_ARCH} == "arm" || \ + ${MACHINE_ARCH} == "mipsel" TARGET_ENDIANNESS= 1234 .elif ${MACHINE_ARCH} == "powerpc" || \ ${MACHINE_ARCH} == "powerpc64" || \ ${MACHINE_ARCH} == "sparc64" || \ - ${MACHINE_ARCH} == "arm" || \ - ${MACHINE_ARCH} == "mips" + ${MACHINE_ARCH} == "armeb" || \ + ${MACHINE_ARCH} == "mipseb" TARGET_ENDIANNESS= 4321 .endif Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Wed Nov 10 06:24:16 2010 (r215081) +++ head/sys/conf/Makefile.mips Wed Nov 10 06:39:49 2010 (r215082) @@ -32,9 +32,6 @@ LDSCRIPT_NAME?=ldscript.$M SYSTEM_LD:= ${SYSTEM_LD:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}} SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}} -# XXX: Such sweeping assumptions... -MACHINE=mips -MACHINE_ARCH=mips KERNLOADADDR?=0x80001000 # This obscure value is defined by CFE for WR160N # To be changed later @@ -48,20 +45,6 @@ ARCH_FLAGS?=-march=mips32 EXTRA_FLAGS=-fno-pic -mno-abicalls -G0 HACK_EXTRA_FLAGS=-shared -.if defined(TARGET_BIG_ENDIAN) -CFLAGS+=-EB -SYSTEM_LD+=-EB -EXTRA_FLAGS+=-EB -TRAMP_LDFLAGS+=-Wl,-EB -HACK_EXTRA_FLAGS+=-EB -Wl,-EB -.else -CFLAGS+=-EL -SYSTEM_LD+=-EL -EXTRA_FLAGS+=-EL -TRAMP_LDFLAGS+=-Wl,-EL -HACK_EXTRA_FLAGS+=-EL -Wl,-EL -.endif - # We add the -fno-pic flag to kernels because otherwise performance # is extremely poor, as well as -mno-abicalls to force no ABI usage. From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 08:21:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10839106566C; Wed, 10 Nov 2010 08:21:26 +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 D959D8FC14; Wed, 10 Nov 2010 08:21:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA8LPPB095320; Wed, 10 Nov 2010 08:21:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA8LPhS095319; Wed, 10 Nov 2010 08:21:25 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201011100821.oAA8LPhS095319@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 10 Nov 2010 08:21: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: r215083 - head/crypto/openssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 08:21:26 -0000 Author: des Date: Wed Nov 10 08:21:25 2010 New Revision: 215083 URL: http://svn.freebsd.org/changeset/base/215083 Log: Forgot to svn rm this when I imported 5.4p1. Deleted: head/crypto/openssh/ssh-pkcs11-helper.0 From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 08:46:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B19DF106566B; Wed, 10 Nov 2010 08:46:29 +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 9F2D28FC0C; Wed, 10 Nov 2010 08:46:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAA8kTvV096835; Wed, 10 Nov 2010 08:46:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAA8kTsC096832; Wed, 10 Nov 2010 08:46:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011100846.oAA8kTsC096832@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 10 Nov 2010 08:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215084 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 08:46:29 -0000 Author: kib Date: Wed Nov 10 08:46:29 2010 New Revision: 215084 URL: http://svn.freebsd.org/changeset/base/215084 Log: MFC r214728: If dlopen() is called for the dso that has been already loaded as a dependency, then the dso never has its DAG initialized. Empty DAG makes ref_dag() call in dlopen() a nop, and the dso refcount is off by one. Initialize the DAG on the first dlopen() call, using a boolean flag to prevent double initialization. MFC r214776: Fix style. MFC r214777: Change init_dag() to not increment DAG refcount. Unconditionally call both init_dag() and ref_dag() in dlopen() for the case when the object was already loaded. Modified: stable/8/libexec/rtld-elf/rtld.c stable/8/libexec/rtld-elf/rtld.h Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Wed Nov 10 08:21:25 2010 (r215083) +++ stable/8/libexec/rtld-elf/rtld.c Wed Nov 10 08:46:29 2010 (r215084) @@ -1278,8 +1278,11 @@ init_dag(Obj_Entry *root) { DoneList donelist; + if (root->dag_inited) + return; donelist_init(&donelist); init_dag1(root, root, &donelist); + root->dag_inited = true; } static void @@ -1290,7 +1293,6 @@ init_dag1(Obj_Entry *root, Obj_Entry *ob if (donelist_check(dlp, obj)) return; - obj->refcount++; objlist_push_tail(&obj->dldags, root); objlist_push_tail(&root->dagmembers, obj); for (needed = obj->needed; needed != NULL; needed = needed->next) @@ -2035,6 +2037,7 @@ dlopen(const char *name, int mode) assert(*old_obj_tail == obj); result = load_needed_objects(obj, RTLD_LO_DLOPEN); init_dag(obj); + ref_dag(obj); if (result != -1) result = rtld_verify_versions(&obj->dagmembers); if (result != -1 && ld_tracing) @@ -2052,7 +2055,13 @@ dlopen(const char *name, int mode) } } else { - /* Bump the reference counts for objects on this DAG. */ + /* + * Bump the reference counts for objects on this DAG. If + * this is the first dlopen() call for the object that was + * already loaded as a dependency, initialize the dag + * starting at it. + */ + init_dag(obj); ref_dag(obj); if (ld_tracing) @@ -3059,6 +3068,7 @@ ref_dag(Obj_Entry *root) { Objlist_Entry *elm; + assert(root->dag_inited); STAILQ_FOREACH(elm, &root->dagmembers, link) elm->obj->refcount++; } @@ -3068,6 +3078,7 @@ unref_dag(Obj_Entry *root) { Objlist_Entry *elm; + assert(root->dag_inited); STAILQ_FOREACH(elm, &root->dagmembers, link) elm->obj->refcount--; } Modified: stable/8/libexec/rtld-elf/rtld.h ============================================================================== --- stable/8/libexec/rtld-elf/rtld.h Wed Nov 10 08:21:25 2010 (r215083) +++ stable/8/libexec/rtld-elf/rtld.h Wed Nov 10 08:46:29 2010 (r215084) @@ -222,6 +222,7 @@ typedef struct Struct_Obj_Entry { bool ref_nodel : 1; /* Refcount increased to prevent dlclose */ bool init_scanned: 1; /* Object is already on init list. */ bool on_fini_list: 1; /* Object is already on fini list. */ + bool dag_inited : 1; /* Object has its DAG initialized. */ struct link_map linkmap; /* For GDB and dlinfo() */ Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 10:23:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 532B61065674; Wed, 10 Nov 2010 10:23:40 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2710B8FC14; Wed, 10 Nov 2010 10:23:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAANeU2003068; Wed, 10 Nov 2010 10:23:40 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAANejB003064; Wed, 10 Nov 2010 10:23:40 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201011101023.oAAANejB003064@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 10 Nov 2010 10:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215085 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 10:23:40 -0000 Author: jchandra Date: Wed Nov 10 10:23:39 2010 New Revision: 215085 URL: http://svn.freebsd.org/changeset/base/215085 Log: Switch to the new network driver nlge, the old rge driver is deprecated now. Modified: head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Wed Nov 10 08:46:29 2010 (r215084) +++ head/sys/mips/conf/XLR Wed Nov 10 10:23:39 2010 (r215085) @@ -77,7 +77,7 @@ options NFS_ROOT options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 -options BOOTP_WIRED_TO=rge0 +options BOOTP_WIRED_TO=nlge0 options BOOTP_COMPAT options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" # @@ -123,7 +123,7 @@ device bpf # Network device miibus -device rge +device nlge device ether device re device msk Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Wed Nov 10 08:46:29 2010 (r215084) +++ head/sys/mips/conf/XLR64 Wed Nov 10 10:23:39 2010 (r215085) @@ -50,7 +50,7 @@ options NFS_ROOT options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 -options BOOTP_WIRED_TO=rge0 +options BOOTP_WIRED_TO=nlge0 options BOOTP_COMPAT options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" # @@ -96,7 +96,7 @@ device bpf # Network device miibus -device rge +device nlge device ether device re device msk Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Wed Nov 10 08:46:29 2010 (r215084) +++ head/sys/mips/conf/XLRN32 Wed Nov 10 10:23:39 2010 (r215085) @@ -50,7 +50,7 @@ options NFS_ROOT options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 -options BOOTP_WIRED_TO=rge0 +options BOOTP_WIRED_TO=nlge0 options BOOTP_COMPAT options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" # @@ -96,7 +96,7 @@ device bpf # Network device miibus -device rge +device nlge device ether device re device msk From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 14:33:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01A20106564A; Wed, 10 Nov 2010 14:33:10 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48E48FC15; Wed, 10 Nov 2010 14:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAEX9JC021977; Wed, 10 Nov 2010 14:33:09 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAEX9rY021975; Wed, 10 Nov 2010 14:33:09 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201011101433.oAAEX9rY021975@svn.freebsd.org> From: Benedict Reuschling Date: Wed, 10 Nov 2010 14:33: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: r215087 - head/usr.sbin/freebsd-update X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 14:33:10 -0000 Author: bcr (doc committer) Date: Wed Nov 10 14:33:09 2010 New Revision: 215087 URL: http://svn.freebsd.org/changeset/base/215087 Log: Typo fix in a comment. Reviewed by: cperciva Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed Nov 10 13:58:24 2010 (r215086) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Nov 10 14:33:09 2010 (r215087) @@ -1470,7 +1470,7 @@ fetch_inspect_system () { sort -k 3,3 -t '|' > $2.tmp rm filelist - # Check if an error occured during system inspection + # Check if an error occurred during system inspection if [ -f .err ]; then return 1 fi From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 14:38:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4335A106566B; Wed, 10 Nov 2010 14:38:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 320EB8FC15; Wed, 10 Nov 2010 14:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAEcqZ4022129; Wed, 10 Nov 2010 14:38:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAEcqDQ022127; Wed, 10 Nov 2010 14:38:52 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201011101438.oAAEcqDQ022127@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 10 Nov 2010 14: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: r215088 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 14:38:52 -0000 Author: ae Date: Wed Nov 10 14:38:51 2010 New Revision: 215088 URL: http://svn.freebsd.org/changeset/base/215088 Log: In r212554 name of G_PART_PARM_GEOM and G_PART_PARM_PROVIDER ctlreq parameters was changed to "arg0". Fix the last place where it is used. Approved by: kib (mentor) Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Nov 10 14:33:09 2010 (r215087) +++ head/sys/geom/part/g_part.c Wed Nov 10 14:38:51 2010 (r215088) @@ -748,7 +748,7 @@ g_part_ctl_create(struct gctl_req *req, g_topology_assert(); /* Check that there isn't already a g_part geom on the provider. */ - error = g_part_parm_geom(req, "provider", &gp); + error = g_part_parm_geom(req, "arg0", &gp); if (!error) { null = gp->softc; if (null->gpt_scheme != &g_part_null_scheme) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 14:59:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41444106564A; Wed, 10 Nov 2010 14:59:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4798FC1F; Wed, 10 Nov 2010 14:59:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAExEZr022649; Wed, 10 Nov 2010 14:59:14 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAExEOG022647; Wed, 10 Nov 2010 14:59:14 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011101459.oAAExEOG022647@svn.freebsd.org> From: Attilio Rao Date: Wed, 10 Nov 2010 14:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215089 - stable/8/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 14:59:14 -0000 Author: attilio Date: Wed Nov 10 14:59:13 2010 New Revision: 215089 URL: http://svn.freebsd.org/changeset/base/215089 Log: Fix-up MFC r214446, r214516: Use the appropriate SYSINIT() ordering between the arches. This is intended as a fixup for r215059, so no further notes are merged. Reported by: jhb Sponsored by: Sandvine Incorporated Modified: stable/8/sys/x86/x86/mptable.c Modified: stable/8/sys/x86/x86/mptable.c ============================================================================== --- stable/8/sys/x86/x86/mptable.c Wed Nov 10 14:38:51 2010 (r215088) +++ stable/8/sys/x86/x86/mptable.c Wed Nov 10 14:59:13 2010 (r215089) @@ -53,8 +53,10 @@ __FBSDID("$FreeBSD$"); #ifdef __amd64__ #define MAX_LAPIC_ID 63 /* Max local APIC ID for HTT fixup */ +#define SI_SUB_MPTBL (SI_SUB_TUNABLES - 1) #else #define MAX_LAPIC_ID 31 /* Max local APIC ID for HTT fixup */ +#define SI_SUB_MPTBL (SI_SUB_CPU - 1) #endif #ifdef PC98 @@ -389,8 +391,7 @@ mptable_register(void *dummy __unused) apic_register_enumerator(&mptable_enumerator); } -SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register, - NULL); +SYSINIT(mptable_register, SI_SUB_MPTBL, SI_ORDER_FIRST, mptable_register, NULL); /* * Call the handler routine for each entry in the MP config table. From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 15:00:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D4CB10656D1; Wed, 10 Nov 2010 15:00:57 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 98F5C8FC17; Wed, 10 Nov 2010 15:00:56 +0000 (UTC) Received: by qyk35 with SMTP id 35so83305qyk.13 for ; Wed, 10 Nov 2010 07:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=u/bjSDIRMH/q4pPVD7Mr6fPashxnb+hi9X3pToBY/Jc=; b=aYTvh1tbZib/eCHHrhaZJpbagefltutuJdkazKFktP9vG+UA/nsi2xzgxBxTldpoEO GXexQvPE8tn9wjzxs3KR6m+QIwEmXz60nV0DQIw0iVWpsxV5IzlR5eGhmBZX/DGMPeZw aXYzmZuLu2gKiwiYZPFINfHln60jX4b+bLm3Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=MBGiEFVuDfIQlZnM/VMbTAW30jzpS1DRyLYznNs1EAZ6NuxiuYQleSgYnmIeJ8uiNp 584lR5uPmNSKPx+foV8VQC19eZAUaN4EwgilPFX3PFOdSjRwnnr4lGoDE/tdC8E4q+Rg 7I/TrbfdXf5/4pBYUdSs3LyuM/frBgFxY6uMM= MIME-Version: 1.0 Received: by 10.229.236.83 with SMTP id kj19mr3987029qcb.218.1289401255510; Wed, 10 Nov 2010 07:00:55 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.229.216.66 with HTTP; Wed, 10 Nov 2010 07:00:55 -0800 (PST) In-Reply-To: <201011101459.oAAExEOG022647@svn.freebsd.org> References: <201011101459.oAAExEOG022647@svn.freebsd.org> Date: Wed, 10 Nov 2010 16:00:55 +0100 X-Google-Sender-Auth: 0UPw20Vwah2sHoMkjeOdSnmDV64 Message-ID: From: Attilio Rao To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r215089 - stable/8/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 15:00:57 -0000 2010/11/10 Attilio Rao : > Author: attilio > Date: Wed Nov 10 14:59:13 2010 > New Revision: 215089 > URL: http://svn.freebsd.org/changeset/base/215089 > > Log: > =C2=A0Fix-up MFC r214446, r214516: > =C2=A0Use the appropriate SYSINIT() ordering between the arches. > =C2=A0This is intended as a fixup for r215059, so no further notes are me= rged. Forgot to mention: as explained by jhb, on HEAD this is no longer a problem (fixed by r215009). Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 16:42:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93FD61065675; Wed, 10 Nov 2010 16:42:36 +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 834CE8FC25; Wed, 10 Nov 2010 16:42:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAGgabu026904; Wed, 10 Nov 2010 16:42:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAGgaFO026902; Wed, 10 Nov 2010 16:42:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011101642.oAAGgaFO026902@svn.freebsd.org> From: Alexander Motin Date: Wed, 10 Nov 2010 16:42: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: r215090 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 16:42:36 -0000 Author: mav Date: Wed Nov 10 16:42:36 2010 New Revision: 215090 URL: http://svn.freebsd.org/changeset/base/215090 Log: Remove unexisted since r212541 timer1hz/timer2hz variables. Modified: head/sys/sys/kernel.h Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Wed Nov 10 14:59:13 2010 (r215089) +++ head/sys/sys/kernel.h Wed Nov 10 16:42:36 2010 (r215090) @@ -64,8 +64,6 @@ extern int stathz; /* statistics clock extern int profhz; /* profiling clock's frequency */ extern int profprocs; /* number of process's profiling */ extern int ticks; -extern int timer1hz; /* timer 1 frequency */ -extern int timer2hz; /* timer 2 frequency */ #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 16:47:23 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id C076A1065674; Wed, 10 Nov 2010 16:47:21 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Thu, 11 Nov 2010 01:47:21 +0900 From: Norikatsu Shigemura To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-8@FreeBSD.org Message-Id: <20101111014721.bc6556e1.nork@FreeBSD.org> In-Reply-To: <4CDA3247.1000608@freebsd.org> References: <201011100522.oAA5MDLb084941@svn.freebsd.org> <4CDA3247.1000608@freebsd.org> X-Mailer: Sylpheed 3.0.3 (GTK+ 2.20.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: imp@FreeBSD.org, nork@FreeBSD.org Subject: Re: svn commit: r215077 - in stable/8: . contrib/top etc/periodic/daily gnu/usr.bin lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/sched sys/modules tools/regression/lib/msun tools/regress... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 16:47:23 -0000 On Wed, 10 Nov 2010 07:48:55 +0200 Andriy Gapon wrote: > Hmm, properties changing on pretty much all directories and files with > svn:mergeinfo doesn't look correct. Humm, my operations are confirmed by mentor (imp@). But I was explained by hrs, ume and nyan about this case, too. Sorry, I forgot http://wiki.freebsd.org/SubversionPrimer/Merging. So I'll contact to mentor, and remove svn:mergeinfo (r211201, r211204, r211270-r211271, r212861, r211249) from src/ exclude src/sys. -- Norikatsu Shigemura From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 17:00:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFEDD106566B; Wed, 10 Nov 2010 17:00:39 +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 AA4258FC13; Wed, 10 Nov 2010 17:00:39 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 560D846B2D; Wed, 10 Nov 2010 12:00:39 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 83CD58A009; Wed, 10 Nov 2010 12:00:38 -0500 (EST) From: John Baldwin To: Norikatsu Shigemura Date: Wed, 10 Nov 2010 12:00:07 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201011100522.oAA5MDLb084941@svn.freebsd.org> <4CDA3247.1000608@freebsd.org> <20101111014721.bc6556e1.nork@FreeBSD.org> In-Reply-To: <20101111014721.bc6556e1.nork@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201011101200.07324.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 10 Nov 2010 12:00:38 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , svn-src-stable-8@freebsd.org, imp@freebsd.org Subject: Re: svn commit: r215077 - in stable/8: . contrib/top etc/periodic/daily gnu/usr.bin lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/sched sys/modules tools/regression/lib/msun tools/regress... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 17:00:40 -0000 On Wednesday, November 10, 2010 11:47:21 am Norikatsu Shigemura wrote: > On Wed, 10 Nov 2010 07:48:55 +0200 > Andriy Gapon wrote: > > Hmm, properties changing on pretty much all directories and files with > > svn:mergeinfo doesn't look correct. > > Humm, my operations are confirmed by mentor (imp@). But I was > explained by hrs, ume and nyan about this case, too. Sorry, I > forgot http://wiki.freebsd.org/SubversionPrimer/Merging. > So I'll contact to mentor, and remove svn:mergeinfo (r211201, > r211204, r211270-r211271, r212861, r211249) from src/ exclude > src/sys. If you want to fix the mergeinfo, the easiest way I've found to do so, is to do 'svn merge --record-only -c-' for each of the changes. Then go back and redo the svn merges to the proper locations using '--record-only'. This should only affect mergeinfo and nothing else. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 17:17:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99230106564A; Wed, 10 Nov 2010 17:17:38 +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 8725A8FC15; Wed, 10 Nov 2010 17:17:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAHHcoP028940; Wed, 10 Nov 2010 17:17:38 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAHHcTn028938; Wed, 10 Nov 2010 17:17:38 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201011101717.oAAHHcTn028938@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 10 Nov 2010 17:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215091 - stable/8/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 17:17:38 -0000 Author: jh Date: Wed Nov 10 17:17:38 2010 New Revision: 215091 URL: http://svn.freebsd.org/changeset/base/215091 Log: MFC r214418: Add missing "readahead" to the nfs_opts list. PR: 151321 Modified: stable/8/sys/nfsclient/nfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vfsops.c Wed Nov 10 16:42:36 2010 (r215090) +++ stable/8/sys/nfsclient/nfs_vfsops.c Wed Nov 10 17:17:38 2010 (r215091) @@ -779,10 +779,10 @@ static const char *nfs_opts[] = { "from" "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union", "noclusterr", "noclusterw", "multilabel", "acls", "force", "update", "async", "dumbtimer", "noconn", "nolockd", "intr", "rdirplus", "resvport", - "readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize", - "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", - "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", - "maxgroups", "principal", "negnametimeo", + "readahead", "readdirsize", "soft", "hard", "mntudp", "tcp", "udp", + "wsize", "rsize", "retrans", "acregmin", "acregmax", "acdirmin", + "acdirmax", "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3", + "sec", "maxgroups", "principal", "negnametimeo", NULL }; /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 17:30:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 884261065674; Wed, 10 Nov 2010 17:30:32 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Thu, 11 Nov 2010 02:30:26 +0900 From: Norikatsu Shigemura To: John Baldwin Message-Id: <20101111023026.371a5d52.nork@FreeBSD.org> In-Reply-To: <201011101200.07324.jhb@freebsd.org> References: <201011100522.oAA5MDLb084941@svn.freebsd.org> <4CDA3247.1000608@freebsd.org> <20101111014721.bc6556e1.nork@FreeBSD.org> <201011101200.07324.jhb@freebsd.org> X-Mailer: Sylpheed 3.0.3 (GTK+ 2.20.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Norikatsu Shigemura , Andriy Gapon , svn-src-stable-8@freebsd.org, imp@freebsd.org Subject: Re: svn commit: r215077 - in stable/8: . contrib/top etc/periodic/daily gnu/usr.bin lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/sched sys/modules tools/regression/lib/msun tools/regress... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 17:30:34 -0000 On Wed, 10 Nov 2010 12:00:07 -0500 John Baldwin wrote: > > So I'll contact to mentor, and remove svn:mergeinfo (r211201, > > r211204, r211270-r211271, r212861, r211249) from src/ exclude > > src/sys. > If you want to fix the mergeinfo, the easiest way I've found to do so, is to > do 'svn merge --record-only -c-' for each of the changes. Then go back > and redo the svn merges to the proper locations using '--record-only'. This > should only affect mergeinfo and nothing else. Thank you! I'll confirm operations you said, and test on my local environment. -- Norikatsu Shigemura From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 17:33:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA63A1065673; Wed, 10 Nov 2010 17:33:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7B8B8FC12; Wed, 10 Nov 2010 17:33:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAHXluS029825; Wed, 10 Nov 2010 17:33:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAHXlqv029822; Wed, 10 Nov 2010 17:33:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011101733.oAAHXlqv029822@svn.freebsd.org> From: John Baldwin Date: Wed, 10 Nov 2010 17:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215092 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 17:33:47 -0000 Author: jhb Date: Wed Nov 10 17:33:47 2010 New Revision: 215092 URL: http://svn.freebsd.org/changeset/base/215092 Log: MFC 211117: Simplify the logic for handling ipi_selected() and ipi_cpu() in the amd64/i386 case. Modified: stable/8/sys/amd64/amd64/mp_machdep.c stable/8/sys/i386/i386/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/mp_machdep.c Wed Nov 10 17:17:38 2010 (r215091) +++ stable/8/sys/amd64/amd64/mp_machdep.c Wed Nov 10 17:33:47 2010 (r215092) @@ -1081,6 +1081,30 @@ smp_targeted_tlb_shootdown(cpumask_t mas mtx_unlock_spin(&smp_ipi_mtx); } +/* + * Send an IPI to specified CPU handling the bitmap logic. + */ +static void +ipi_send_cpu(int cpu, u_int ipi) +{ + u_int bitmap, old_pending, new_pending; + + KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); + + if (IPI_IS_BITMAPED(ipi)) { + bitmap = 1 << ipi; + ipi = IPI_BITMAP_VECTOR; + do { + old_pending = cpu_ipi_pending[cpu]; + new_pending = old_pending | bitmap; + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); + if (old_pending) + return; + } + lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); +} + void smp_cache_flush(void) { @@ -1172,14 +1196,6 @@ void ipi_selected(cpumask_t cpus, u_int ipi) { int cpu; - u_int bitmap = 0; - u_int old_pending; - u_int new_pending; - - if (IPI_IS_BITMAPED(ipi)) { - bitmap = 1 << ipi; - ipi = IPI_BITMAP_VECTOR; - } /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit @@ -1193,20 +1209,7 @@ ipi_selected(cpumask_t cpus, u_int ipi) while ((cpu = ffs(cpus)) != 0) { cpu--; cpus &= ~(1 << cpu); - - KASSERT(cpu_apic_ids[cpu] != -1, - ("IPI to non-existent CPU %d", cpu)); - - if (bitmap) { - do { - old_pending = cpu_ipi_pending[cpu]; - new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], - old_pending, new_pending)); - if (old_pending) - continue; - } - lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); + ipi_send_cpu(cpu, ipi); } } @@ -1216,14 +1219,6 @@ ipi_selected(cpumask_t cpus, u_int ipi) void ipi_cpu(int cpu, u_int ipi) { - u_int bitmap = 0; - u_int old_pending; - u_int new_pending; - - if (IPI_IS_BITMAPED(ipi)) { - bitmap = 1 << ipi; - ipi = IPI_BITMAP_VECTOR; - } /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit @@ -1234,18 +1229,7 @@ ipi_cpu(int cpu, u_int ipi) atomic_set_int(&ipi_nmi_pending, 1 << cpu); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); - KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); - - if (bitmap) { - do { - old_pending = cpu_ipi_pending[cpu]; - new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], - old_pending, new_pending)); - if (old_pending) - return; - } - lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); + ipi_send_cpu(cpu, ipi); } /* Modified: stable/8/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/8/sys/i386/i386/mp_machdep.c Wed Nov 10 17:17:38 2010 (r215091) +++ stable/8/sys/i386/i386/mp_machdep.c Wed Nov 10 17:33:47 2010 (r215092) @@ -1212,6 +1212,30 @@ smp_targeted_tlb_shootdown(cpumask_t mas mtx_unlock_spin(&smp_ipi_mtx); } +/* + * Send an IPI to specified CPU handling the bitmap logic. + */ +static void +ipi_send_cpu(int cpu, u_int ipi) +{ + u_int bitmap, old_pending, new_pending; + + KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); + + if (IPI_IS_BITMAPED(ipi)) { + bitmap = 1 << ipi; + ipi = IPI_BITMAP_VECTOR; + do { + old_pending = cpu_ipi_pending[cpu]; + new_pending = old_pending | bitmap; + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); + if (old_pending) + return; + } + lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); +} + void smp_cache_flush(void) { @@ -1333,14 +1357,6 @@ void ipi_selected(cpumask_t cpus, u_int ipi) { int cpu; - u_int bitmap = 0; - u_int old_pending; - u_int new_pending; - - if (IPI_IS_BITMAPED(ipi)) { - bitmap = 1 << ipi; - ipi = IPI_BITMAP_VECTOR; - } /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit @@ -1354,20 +1370,7 @@ ipi_selected(cpumask_t cpus, u_int ipi) while ((cpu = ffs(cpus)) != 0) { cpu--; cpus &= ~(1 << cpu); - - KASSERT(cpu_apic_ids[cpu] != -1, - ("IPI to non-existent CPU %d", cpu)); - - if (bitmap) { - do { - old_pending = cpu_ipi_pending[cpu]; - new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], - old_pending, new_pending)); - if (old_pending) - continue; - } - lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); + ipi_send_cpu(cpu, ipi); } } @@ -1377,14 +1380,6 @@ ipi_selected(cpumask_t cpus, u_int ipi) void ipi_cpu(int cpu, u_int ipi) { - u_int bitmap = 0; - u_int old_pending; - u_int new_pending; - - if (IPI_IS_BITMAPED(ipi)) { - bitmap = 1 << ipi; - ipi = IPI_BITMAP_VECTOR; - } /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit @@ -1395,18 +1390,7 @@ ipi_cpu(int cpu, u_int ipi) atomic_set_int(&ipi_nmi_pending, 1 << cpu); CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); - KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); - - if (bitmap) { - do { - old_pending = cpu_ipi_pending[cpu]; - new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], - old_pending, new_pending)); - if (old_pending) - return; - } - lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); + ipi_send_cpu(cpu, ipi); } /* From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 17:57:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BE8B106566B; Wed, 10 Nov 2010 17:57:34 +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 6AA5A8FC1C; Wed, 10 Nov 2010 17:57:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAHvYpI031131; Wed, 10 Nov 2010 17:57:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAHvYUd031128; Wed, 10 Nov 2010 17:57:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011101757.oAAHvYUd031128@svn.freebsd.org> From: Alan Cox Date: Wed, 10 Nov 2010 17:57: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: r215093 - in head/sys: sparc64/include vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 17:57:34 -0000 Author: alc Date: Wed Nov 10 17:57:34 2010 New Revision: 215093 URL: http://svn.freebsd.org/changeset/base/215093 Log: Enable reservation-based physical memory allocation. Even without the creation of large page mappings in the pmap, it can provide modest performance benefits. In particular, for a "buildworld" on a 2x 1GHz Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system time by 12.6%. Tested by: marius@ Modified: head/sys/sparc64/include/vmparam.h head/sys/vm/vm_reserv.c Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Wed Nov 10 17:33:47 2010 (r215092) +++ head/sys/sparc64/include/vmparam.h Wed Nov 10 17:57:34 2010 (r215093) @@ -128,10 +128,17 @@ #endif /* - * Disable superpage reservations. + * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL -#define VM_NRESERVLEVEL 0 +#define VM_NRESERVLEVEL 1 +#endif + +/* + * Level 0 reservations consist of 512 pages. + */ +#ifndef VM_LEVEL_0_ORDER +#define VM_LEVEL_0_ORDER 9 #endif /* Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Wed Nov 10 17:33:47 2010 (r215092) +++ head/sys/vm/vm_reserv.c Wed Nov 10 17:57:34 2010 (r215093) @@ -194,7 +194,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER } mtx_unlock(&vm_page_queue_free_mtx); sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, - unused_pages * (PAGE_SIZE / 1024), counter); + unused_pages * ((int)PAGE_SIZE / 1024), counter); } error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 18:37:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6DB5106566B; Wed, 10 Nov 2010 18:37:03 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95B788FC0A; Wed, 10 Nov 2010 18:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAIb3T9033501; Wed, 10 Nov 2010 18:37:03 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAIb396033499; Wed, 10 Nov 2010 18:37:03 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201011101837.oAAIb396033499@svn.freebsd.org> From: Zack Kirsch Date: Wed, 10 Nov 2010 18:37: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: r215094 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 18:37:03 -0000 Author: zack Date: Wed Nov 10 18:37:03 2010 New Revision: 215094 URL: http://svn.freebsd.org/changeset/base/215094 Log: Add myself as a new committer and add zml as my mentor. Approved by: zml (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Nov 10 17:57:34 2010 (r215093) +++ head/share/misc/committers-src.dot Wed Nov 10 18:37:03 2010 (r215094) @@ -211,6 +211,7 @@ wilko [label="Wilko Bulte\nwilko@FreeBSD wsalamon [label="Wayne Salamon\nwsalamon@FreeBSD.org\n2005/06/25"] yar [label="Yar Tikhiy\nyar@FreeBSD.org\n2001/03/25"] yongari [label="Pyun YongHyeon\nyongari@FreeBSD.org\n2004/08/01"] +zack [label="Zack Kirsch\nzack@FreeBSD.org\n2010/11/05"] zec [label="Marko Zec\nzec@FreeBSD.org\n2008/06/22"] # Pseudo target representing rev 1.1 of commit.allow @@ -503,5 +504,6 @@ wes -> scf wollman -> gad zml -> mdf +zml -> zack } From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 18:40:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC7FD1065673; Wed, 10 Nov 2010 18:40:45 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id C08AD8FC1B; Wed, 10 Nov 2010 18:40:45 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 64bit)) with ESMTPSA id <0LBO00FGYJQRIA50@asmtp029.mac.com>; Wed, 10 Nov 2010 09:40:05 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1011100110 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-11-10_06:2010-11-10, 2010-11-10, 1970-01-01 signatures=0 From: Marcel Moolenaar In-reply-to: <201011101438.oAAEcqDQ022127@svn.freebsd.org> Date: Wed, 10 Nov 2010 09:40:03 -0800 Message-id: <48E80281-F1B2-46A7-90F8-426D9D5CBBD5@mac.com> References: <201011101438.oAAEcqDQ022127@svn.freebsd.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215088 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 18:40:46 -0000 On Nov 10, 2010, at 6:38 AM, Andrey V. Elsukov wrote: > Author: ae > Date: Wed Nov 10 14:38:51 2010 > New Revision: 215088 > URL: http://svn.freebsd.org/changeset/base/215088 > > Log: > In r212554 name of G_PART_PARM_GEOM and G_PART_PARM_PROVIDER > ctlreq parameters was changed to "arg0". Fix the last place where > it is used. A regression for sure. Nothing worse than having a good and clear interface messed up by a lousy implementation of geom(8)... *sigh* -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 18:41:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 429A91065674; Wed, 10 Nov 2010 18:41:39 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 309908FC1A; Wed, 10 Nov 2010 18:41:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAIfdVj033672; Wed, 10 Nov 2010 18:41:39 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAIfdcV033668; Wed, 10 Nov 2010 18:41:39 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201011101841.oAAIfdcV033668@svn.freebsd.org> From: Nick Hibma Date: Wed, 10 Nov 2010 18:41: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: r215095 - in head/sys/dev/usb: quirk serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 18:41:39 -0000 Author: n_hibma Date: Wed Nov 10 18:41:38 2010 New Revision: 215095 URL: http://svn.freebsd.org/changeset/base/215095 Log: Allow specification of eject method through quirks, so people can test drive eject methods before supplying patches. Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h head/sys/dev/usb/serial/u3g.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Nov 10 18:37:03 2010 (r215094) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Nov 10 18:41:38 2010 (r215095) @@ -512,6 +512,16 @@ static const char *usb_quirk_str[USB_QUI [UQ_MSC_FORCE_PROTO_ATAPI] = "UQ_MSC_FORCE_PROTO_ATAPI", [UQ_MSC_FORCE_PROTO_UFI] = "UQ_MSC_FORCE_PROTO_UFI", [UQ_MSC_FORCE_PROTO_RBC] = "UQ_MSC_FORCE_PROTO_RBC", + [UQ_MSC_EJECT_HUAWEI] = "UQ_MSC_EJECT_HUAWEI", + [UQ_MSC_EJECT_SIERRA] = "UQ_MSC_EJECT_SIERRA", + [UQ_MSC_EJECT_SCSIEJECT] = "UQ_MSC_EJECT_SCSIEJECT", + [UQ_MSC_EJECT_REZERO] = "UQ_MSC_EJECT_REZERO", + [UQ_MSC_EJECT_ZTESTOR] = "UQ_MSC_EJECT_ZTESTOR", + [UQ_MSC_EJECT_CMOTECH] = "UQ_MSC_EJECT_CMOTECH", + [UQ_MSC_EJECT_WAIT] = "UQ_MSC_EJECT_WAIT", + [UQ_MSC_EJECT_SAEL_M460] = "UQ_MSC_EJECT_SAEL_M460", + [UQ_MSC_EJECT_HUAWEISCSI] = "UQ_MSC_EJECT_HUAWEISCSI", + [UQ_MSC_EJECT_TCT] = "UQ_MSC_EJECT_TCT", }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Wed Nov 10 18:37:03 2010 (r215094) +++ head/sys/dev/usb/quirk/usb_quirk.h Wed Nov 10 18:41:38 2010 (r215095) @@ -59,31 +59,43 @@ enum { /* keep in sync with usb_quirk_st UQ_CFG_INDEX_3, /* select configuration index 3 by default */ UQ_CFG_INDEX_4, /* select configuration index 4 by default */ UQ_CFG_INDEX_0, /* select configuration index 0 by default */ - UQ_ASSUME_CM_OVER_DATA, /* modem device breaks on cm over data */ + UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */ /* USB Mass Storage Quirks. See "storage/umass.c" for a detailed description. */ - UQ_MSC_NO_TEST_UNIT_READY, - UQ_MSC_NO_RS_CLEAR_UA, - UQ_MSC_NO_START_STOP, - UQ_MSC_NO_GETMAXLUN, - UQ_MSC_NO_INQUIRY, - UQ_MSC_NO_INQUIRY_EVPD, - UQ_MSC_NO_SYNC_CACHE, - UQ_MSC_SHUTTLE_INIT, - UQ_MSC_ALT_IFACE_1, - UQ_MSC_FLOPPY_SPEED, - UQ_MSC_IGNORE_RESIDUE, - UQ_MSC_WRONG_CSWSIG, - UQ_MSC_RBC_PAD_TO_12, - UQ_MSC_READ_CAP_OFFBY1, - UQ_MSC_FORCE_SHORT_INQ, - UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_WIRE_CBI, - UQ_MSC_FORCE_WIRE_CBI_I, - UQ_MSC_FORCE_PROTO_SCSI, - UQ_MSC_FORCE_PROTO_ATAPI, - UQ_MSC_FORCE_PROTO_UFI, - UQ_MSC_FORCE_PROTO_RBC, + UQ_MSC_NO_TEST_UNIT_READY, /* send start/stop instead of TUR */ + UQ_MSC_NO_RS_CLEAR_UA, /* does not reset Unit Att. */ + UQ_MSC_NO_START_STOP, /* does not support start/stop */ + UQ_MSC_NO_GETMAXLUN, /* does not support get max LUN */ + UQ_MSC_NO_INQUIRY, /* fake generic inq response */ + UQ_MSC_NO_INQUIRY_EVPD, /* does not support inq EVPD */ + UQ_MSC_NO_SYNC_CACHE, /* does not support sync cache */ + UQ_MSC_SHUTTLE_INIT, /* requires Shuttle init sequence */ + UQ_MSC_ALT_IFACE_1, /* switch to alternate interface 1 */ + UQ_MSC_FLOPPY_SPEED, /* does floppy speeds (20kb/s) */ + UQ_MSC_IGNORE_RESIDUE, /* gets residue wrong */ + UQ_MSC_WRONG_CSWSIG, /* uses wrong CSW signature */ + UQ_MSC_RBC_PAD_TO_12, /* pad RBC requests to 12 bytes */ + UQ_MSC_READ_CAP_OFFBY1, /* reports sector count, not max sec. */ + UQ_MSC_FORCE_SHORT_INQ, /* does not support full inq. */ + UQ_MSC_FORCE_WIRE_BBB, /* force BBB wire protocol */ + UQ_MSC_FORCE_WIRE_CBI, /* force CBI wire protocol */ + UQ_MSC_FORCE_WIRE_CBI_I, /* force CBI with int. wire protocol */ + UQ_MSC_FORCE_PROTO_SCSI, /* force SCSI command protocol */ + UQ_MSC_FORCE_PROTO_ATAPI, /* force ATAPI command protocol */ + UQ_MSC_FORCE_PROTO_UFI, /* force UFI command protocol */ + UQ_MSC_FORCE_PROTO_RBC, /* force RBC command protocol */ + + /* Ejection of mass storage (driver disk) */ + UQ_MSC_EJECT_HUAWEI, /* ejects after Huawei USB command */ + UQ_MSC_EJECT_SIERRA, /* ejects after Sierra USB command */ + UQ_MSC_EJECT_SCSIEJECT, /* ejects after SCSI eject command */ + UQ_MSC_EJECT_REZERO, /* ejects after SCSI rezero command */ + UQ_MSC_EJECT_ZTESTOR, /* ejects after ZTE SCSI command */ + UQ_MSC_EJECT_CMOTECH, /* ejects after C-motech SCSI cmd */ + UQ_MSC_EJECT_WAIT, /* wait for the device to eject */ + UQ_MSC_EJECT_SAEL_M460, /* ejects after Sael USB commands */ + UQ_MSC_EJECT_HUAWEISCSI, /* ejects after Huawei SCSI command */ + UQ_MSC_EJECT_TCT, /* ejects after TCT SCSI command */ USB_QUIRK_MAX }; Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Wed Nov 10 18:37:03 2010 (r215094) +++ head/sys/dev/usb/serial/u3g.c Wed Nov 10 18:41:38 2010 (r215095) @@ -62,6 +62,7 @@ #include #include +#include #ifdef USB_DEBUG static int u3g_debug = 0; @@ -84,6 +85,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3GSP_HSPA 6 #define U3GSP_MAX 7 +/* Eject methods; See also usb_quirks.h:UQ_MSC_EJECT_* */ #define U3GINIT_HUAWEI 1 /* Requires Huawei init command */ #define U3GINIT_SIERRA 2 /* Requires Sierra init command */ #define U3GINIT_SCSIEJECT 3 /* Requires SCSI eject command */ @@ -641,6 +643,7 @@ u3g_test_autoinst(void *arg, struct usb_ struct usb_interface *iface; struct usb_interface_descriptor *id; int error; + unsigned long method; if (uaa->dev_state != UAA_DEV_READY) return; @@ -651,16 +654,37 @@ u3g_test_autoinst(void *arg, struct usb_ id = iface->idesc; if (id == NULL || id->bInterfaceClass != UICLASS_MASS) return; - if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)) + + if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEI)) + method = U3GINIT_HUAWEI; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_SIERRA)) + method = U3GINIT_SIERRA; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_SCSIEJECT)) + method = U3GINIT_SCSIEJECT; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_REZERO)) + method = U3GINIT_REZERO; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_ZTESTOR)) + method = U3GINIT_ZTESTOR; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_CMOTECH)) + method = U3GINIT_CMOTECH; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_WAIT)) + method = U3GINIT_WAIT; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI)) + method = U3GINIT_HUAWEISCSI; + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_TCT)) + method = U3GINIT_TCT; + else if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa) == 0) + method = USB_GET_DRIVER_INFO(uaa); + else return; /* no device match */ if (bootverbose) { - printf("Ejecting 0x%04x:0x%04x using method %ld\n", - uaa->info.idVendor, uaa->info.idProduct, - USB_GET_DRIVER_INFO(uaa)); + printf("Ejecting %s %s using method %ld\n", + usb_get_manufacturer(udev), + usb_get_product(udev), method); } - switch (USB_GET_DRIVER_INFO(uaa)) { + switch (method) { case U3GINIT_HUAWEI: error = u3g_huawei_init(udev); break; @@ -752,8 +776,10 @@ u3g_attach(device_t dev) DPRINTF("sc=%p\n", sc); type = USB_GET_DRIVER_INFO(uaa); - if (type == U3GINIT_SAEL_M460) + if (type == U3GINIT_SAEL_M460 + || usb_test_quirk(uaa, UQ_MSC_EJECT_SAEL_M460)) { u3g_sael_m460_init(uaa->device); + } /* copy in USB config */ for (n = 0; n != U3G_N_TRANSFER; n++) From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 18:45:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D192106566B; Wed, 10 Nov 2010 18:45:33 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BCD08FC17; Wed, 10 Nov 2010 18:45:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAIjX7Q033799; Wed, 10 Nov 2010 18:45:33 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAIjXBt033797; Wed, 10 Nov 2010 18:45:33 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201011101845.oAAIjXBt033797@svn.freebsd.org> From: Zack Kirsch Date: Wed, 10 Nov 2010 18:45: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: r215096 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 18:45:33 -0000 Author: zack Date: Wed Nov 10 18:45:32 2010 New Revision: 215096 URL: http://svn.freebsd.org/changeset/base/215096 Log: Add my birthday to the calendar so everyone can send me presents. Approved by: zml (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Nov 10 18:41:38 2010 (r215095) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Nov 10 18:45:32 2010 (r215096) @@ -171,6 +171,7 @@ 06/04 Justin Gibbs born in San Pedro, California, United States, 1973 06/04 Jason Evans born in Greeley, Colorado, United States, 1973 06/04 Thomas Moestl born in Braunschweig, Niedersachsen, Germany, 1980 +06/04 Zack Kirsch born in Memphis, Tennessee, United States, 1982 06/06 Sergei Kolobov born in Karpinsk, Russian Federation, 1972 06/06 Alan Eldridge died in Denver, Colorado, 2003 06/07 Jimmy Olgeni born in Milano, Italy, 1976 From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 18:50:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4675E106564A; Wed, 10 Nov 2010 18:50:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29A4A8FC23; Wed, 10 Nov 2010 18:50:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAIoDKa033930; Wed, 10 Nov 2010 18:50:13 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAIoDTc033925; Wed, 10 Nov 2010 18:50:13 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011101850.oAAIoDTc033925@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 10 Nov 2010 18:50: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: r215097 - in head/sys: amd64/acpica dev/acpica i386/acpica x86/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 18:50:13 -0000 Author: jkim Date: Wed Nov 10 18:50:12 2010 New Revision: 215097 URL: http://svn.freebsd.org/changeset/base/215097 Log: Make APM emulation look more closer to its origin. Use device_get_softc(9) instead of hardcoding acpi(4) unit number as we have device_t for it. Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/dev/acpica/acpivar.h head/sys/i386/acpica/acpi_machdep.c head/sys/x86/acpica/acpi_apm.c Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Wed Nov 10 18:45:32 2010 (r215096) +++ head/sys/amd64/acpica/acpi_machdep.c Wed Nov 10 18:50:12 2010 (r215097) @@ -61,10 +61,9 @@ acpi_machdep_init(device_t dev) { struct acpi_softc *sc; - sc = devclass_get_softc(devclass_find("acpi"), 0); + sc = device_get_softc(dev); - /* Create a clone for /dev/acpi also. */ - sc->acpi_clone = acpi_apm_create_clone(sc->acpi_dev_t, sc); + acpi_apm_init(sc); if (intr_model != ACPI_INTR_PIC) acpi_SetIntrModel(intr_model); Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Nov 10 18:45:32 2010 (r215096) +++ head/sys/dev/acpica/acpivar.h Wed Nov 10 18:50:12 2010 (r215097) @@ -397,7 +397,7 @@ int acpi_device_pwr_for_sleep(device_t int *dstate); /* APM emulation */ -struct apm_clone_data *acpi_apm_create_clone(struct cdev *, struct acpi_softc *); +void acpi_apm_init(struct acpi_softc *); /* Misc. */ static __inline struct acpi_softc * Modified: head/sys/i386/acpica/acpi_machdep.c ============================================================================== --- head/sys/i386/acpica/acpi_machdep.c Wed Nov 10 18:45:32 2010 (r215096) +++ head/sys/i386/acpica/acpi_machdep.c Wed Nov 10 18:50:12 2010 (r215097) @@ -61,10 +61,9 @@ acpi_machdep_init(device_t dev) { struct acpi_softc *sc; - sc = devclass_get_softc(devclass_find("acpi"), 0); + sc = device_get_softc(dev); - /* Create a clone for /dev/acpi also. */ - sc->acpi_clone = acpi_apm_create_clone(sc->acpi_dev_t, sc); + acpi_apm_init(sc); acpi_install_wakeup_handler(sc); if (intr_model == ACPI_INTR_PIC) Modified: head/sys/x86/acpica/acpi_apm.c ============================================================================== --- head/sys/x86/acpica/acpi_apm.c Wed Nov 10 18:45:32 2010 (r215096) +++ head/sys/x86/acpica/acpi_apm.c Wed Nov 10 18:50:12 2010 (r215097) @@ -29,10 +29,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include +#include #include #include #include @@ -477,14 +477,13 @@ apmreadfilt(struct knote *kn, long hint) return (sleeping); } -struct apm_clone_data * -acpi_apm_create_clone(struct cdev *dev, struct acpi_softc *acpi_sc) +void +acpi_apm_init(struct acpi_softc *sc) { - struct apm_clone_data *clone; - STAILQ_INIT(&acpi_sc->apm_cdevs); - clone = apm_create_clone(dev, acpi_sc); + /* Create a clone for /dev/acpi also. */ + STAILQ_INIT(&sc->apm_cdevs); + sc->acpi_clone = apm_create_clone(sc->acpi_dev_t, sc); clone_setup(&apm_clones); EVENTHANDLER_REGISTER(dev_clone, apm_clone, 0, 1000); - return (clone); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 19:00:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD53B106566C; Wed, 10 Nov 2010 19:00:38 +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 9DEE18FC18; Wed, 10 Nov 2010 19:00:38 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 39E2546B29; Wed, 10 Nov 2010 14:00:38 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5828B8A009; Wed, 10 Nov 2010 14:00:37 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Date: Wed, 10 Nov 2010 12:44:45 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201011101733.oAAHXlqv029822@svn.freebsd.org> In-Reply-To: <201011101733.oAAHXlqv029822@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201011101244.45841.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 10 Nov 2010 14:00:37 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r215092 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 19:00:38 -0000 On Wednesday, November 10, 2010 12:33:47 pm John Baldwin wrote: > Author: jhb > Date: Wed Nov 10 17:33:47 2010 > New Revision: 215092 > URL: http://svn.freebsd.org/changeset/base/215092 > > Log: > MFC 211117: > Simplify the logic for handling ipi_selected() and ipi_cpu() in the > amd64/i386 case. I probably should have included this change when MFC'ing ipi_cpu() yesterday. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 19:33:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7581A106566C; Wed, 10 Nov 2010 19:33:13 +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 61E088FC1C; Wed, 10 Nov 2010 19:33:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAJXDBp035388; Wed, 10 Nov 2010 19:33:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAJXD20035377; Wed, 10 Nov 2010 19:33:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011101933.oAAJXD20035377@svn.freebsd.org> From: Alexander Motin Date: Wed, 10 Nov 2010 19:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215099 - in stable/8/sys/powerpc: aim booke include mpc85xx powermac powerpc psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 19:33:13 -0000 Author: mav Date: Wed Nov 10 19:33:13 2010 New Revision: 215099 URL: http://svn.freebsd.org/changeset/base/215099 Log: MFC r209639 by marcel: Remove the unneeded header . Reviewed by: marcel Deleted: stable/8/sys/powerpc/include/intr.h Modified: stable/8/sys/powerpc/aim/clock.c stable/8/sys/powerpc/booke/clock.c stable/8/sys/powerpc/mpc85xx/atpic.c stable/8/sys/powerpc/mpc85xx/opic.c stable/8/sys/powerpc/powermac/cuda.c stable/8/sys/powerpc/powermac/hrowpic.c stable/8/sys/powerpc/powermac/openpic_macio.c stable/8/sys/powerpc/powermac/pmu.c stable/8/sys/powerpc/powerpc/openpic.c stable/8/sys/powerpc/psim/openpic_iobus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/clock.c ============================================================================== --- stable/8/sys/powerpc/aim/clock.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/aim/clock.c Wed Nov 10 19:33:13 2010 (r215099) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: stable/8/sys/powerpc/booke/clock.c ============================================================================== --- stable/8/sys/powerpc/booke/clock.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/booke/clock.c Wed Nov 10 19:33:13 2010 (r215099) @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* Modified: stable/8/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- stable/8/sys/powerpc/mpc85xx/atpic.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/mpc85xx/atpic.c Wed Nov 10 19:33:13 2010 (r215099) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: stable/8/sys/powerpc/mpc85xx/opic.c ============================================================================== --- stable/8/sys/powerpc/mpc85xx/opic.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/mpc85xx/opic.c Wed Nov 10 19:33:13 2010 (r215099) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: stable/8/sys/powerpc/powermac/cuda.c ============================================================================== --- stable/8/sys/powerpc/powermac/cuda.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/powermac/cuda.c Wed Nov 10 19:33:13 2010 (r215099) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: stable/8/sys/powerpc/powermac/hrowpic.c ============================================================================== --- stable/8/sys/powerpc/powermac/hrowpic.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/powermac/hrowpic.c Wed Nov 10 19:33:13 2010 (r215099) @@ -45,7 +45,6 @@ #include #include -#include #include #include #include Modified: stable/8/sys/powerpc/powermac/openpic_macio.c ============================================================================== --- stable/8/sys/powerpc/powermac/openpic_macio.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/powermac/openpic_macio.c Wed Nov 10 19:33:13 2010 (r215099) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: stable/8/sys/powerpc/powermac/pmu.c ============================================================================== --- stable/8/sys/powerpc/powermac/pmu.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/powermac/pmu.c Wed Nov 10 19:33:13 2010 (r215099) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: stable/8/sys/powerpc/powerpc/openpic.c ============================================================================== --- stable/8/sys/powerpc/powerpc/openpic.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/powerpc/openpic.c Wed Nov 10 19:33:13 2010 (r215099) @@ -33,7 +33,6 @@ #include #include -#include #include #include #include Modified: stable/8/sys/powerpc/psim/openpic_iobus.c ============================================================================== --- stable/8/sys/powerpc/psim/openpic_iobus.c Wed Nov 10 19:03:30 2010 (r215098) +++ stable/8/sys/powerpc/psim/openpic_iobus.c Wed Nov 10 19:33:13 2010 (r215099) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 19:33:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 855CA1065695; Wed, 10 Nov 2010 19:33:30 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A785E8FC08; Wed, 10 Nov 2010 19:33:29 +0000 (UTC) Received: by bwz2 with SMTP id 2so1092374bwz.13 for ; Wed, 10 Nov 2010 11:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=Ntja3M77eLy7xhPLggeWeRZt8Ea0Xeq4mJuBhUjoWwI=; b=ppC8AI/VYg342QxZmjJy/JqVzQuU4kRNrU8Z+nkIvLbVdWZ7YdvVAkspqdB3WYVk59 AglpF7i4KRJWU77utdgKNKzbLQA5ILF5kvKWS5VKshnArw3vAp0lp2wN0JlhCSEqc71C zQV6gCuXzbtbUVDqoRKT4rNIP/PX8ZcQjnnIA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=qdAPkHZjMmU0KlulMLHsgINOE8gQYnihNjCGMHVxkXGAdiH1KJNjAKkBpqm6wcdKIR 62ubi+yLvWfx/FeA8IuKZcoLNn77Rlgzsy11916LOXi7JLVb6FjVQ4vdimsTh61gZHbT v1zNXHUjiGTTZKt6czTyeH+3EhxxJh7b+BzAI= Received: by 10.204.102.2 with SMTP id e2mr8383910bko.24.1289417403278; Wed, 10 Nov 2010 11:30:03 -0800 (PST) Received: from ernst.jennejohn.org (p578E31C5.dip.t-dialin.net [87.142.49.197]) by mx.google.com with ESMTPS id d27sm552628bkw.2.2010.11.10.11.30.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Nov 2010 11:30:01 -0800 (PST) Date: Wed, 10 Nov 2010 20:29:59 +0100 From: Gary Jennejohn To: Marcel Moolenaar Message-ID: <20101110202959.44759eae@ernst.jennejohn.org> In-Reply-To: <48E80281-F1B2-46A7-90F8-426D9D5CBBD5@mac.com> References: <201011101438.oAAEcqDQ022127@svn.freebsd.org> <48E80281-F1B2-46A7-90F8-426D9D5CBBD5@mac.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215088 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 19:33:30 -0000 On Wed, 10 Nov 2010 09:40:03 -0800 Marcel Moolenaar wrote: > > On Nov 10, 2010, at 6:38 AM, Andrey V. Elsukov wrote: > > > Author: ae > > Date: Wed Nov 10 14:38:51 2010 > > New Revision: 215088 > > URL: http://svn.freebsd.org/changeset/base/215088 > > > > Log: > > In r212554 name of G_PART_PARM_GEOM and G_PART_PARM_PROVIDER > > ctlreq parameters was changed to "arg0". Fix the last place where > > it is used. > > A regression for sure. Nothing worse than having a good > and clear interface messed up by a lousy implementation > of geom(8)... > > *sigh* > I wondered about this change myself. Juat because it's called arg0 in the declaration doesn't mean that the callers have to use it. Maybe ther was a good reason for it which I don't understand. Consistency, I suppose. -- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 20:09:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4321106566B; Wed, 10 Nov 2010 20:09:05 +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 D27258FC16; Wed, 10 Nov 2010 20:09:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAK95eq036119; Wed, 10 Nov 2010 20:09:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAK951m036117; Wed, 10 Nov 2010 20:09:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011102009.oAAK951m036117@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 10 Nov 2010 20:09: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: r215100 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 20:09:06 -0000 Author: nwhitehorn Date: Wed Nov 10 20:09:05 2010 New Revision: 215100 URL: http://svn.freebsd.org/changeset/base/215100 Log: Disabling CPU NAP modes during SMU commands is a hack needed only on U3 systems. Don't use it on non-U3 systems to allow cpu_idle() to work correctly. Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Wed Nov 10 19:33:13 2010 (r215099) +++ head/sys/powerpc/powermac/smu.c Wed Nov 10 20:09:05 2010 (r215100) @@ -96,6 +96,7 @@ struct smu_softc { struct resource *sc_memr; int sc_memrid; + int sc_u3; bus_dma_tag_t sc_dmatag; bus_space_tag_t sc_bt; @@ -275,6 +276,10 @@ smu_attach(device_t dev) sc->sc_cur_cmd = NULL; sc->sc_doorbellirqid = -1; + sc->sc_u3 = 0; + if (OF_finddevice("/u3") != -1) + sc->sc_u3 = 1; + /* * Map the mailbox area. This should be determined from firmware, * but I have not found a simple way to do that. @@ -417,7 +422,9 @@ smu_send_cmd(device_t dev, struct smu_cm mtx_assert(&sc->sc_mtx, MA_OWNED); - powerpc_pow_enabled = 0; /* SMU cannot work if we go to NAP */ + if (sc->sc_u3) + powerpc_pow_enabled = 0; /* SMU cannot work if we go to NAP */ + sc->sc_cur_cmd = cmd; /* Copy the command to the mailbox */ @@ -464,7 +471,8 @@ smu_doorbell_intr(void *xdev) sizeof(sc->sc_cmd->data)); wakeup(sc->sc_cur_cmd); sc->sc_cur_cmd = NULL; - powerpc_pow_enabled = 1; + if (sc->sc_u3) + powerpc_pow_enabled = 1; done: /* Queue next command if one is pending */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 20:28:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B71D1106564A; Wed, 10 Nov 2010 20:28:10 +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 A56398FC08; Wed, 10 Nov 2010 20:28:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAKSAm8036703; Wed, 10 Nov 2010 20:28:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAKSA8G036701; Wed, 10 Nov 2010 20:28:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011102028.oAAKSA8G036701@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 10 Nov 2010 20:28: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: r215101 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 20:28:10 -0000 Author: nwhitehorn Date: Wed Nov 10 20:28:10 2010 New Revision: 215101 URL: http://svn.freebsd.org/changeset/base/215101 Log: Entering deep nap mode on the 970MP requires that both MSR[NAP] and MSR[DEEPNAP] be set, not just MSR[DEEPNAP]. Fixing this reduces the idle temperature of my CPUs from 57 to 38 degrees and makes one-shot timer mode work properly. Hint from: mav MFC after: 4 days Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Wed Nov 10 20:09:05 2010 (r215100) +++ head/sys/powerpc/powerpc/cpu.c Wed Nov 10 20:28:10 2010 (r215101) @@ -455,8 +455,8 @@ cpu_970_setup(int cpuid, uint16_t vers) /* Configure power-saving mode */ switch (vers) { case IBM970MP: - hid0_hi |= (HID0_DEEPNAP | HID0_DPM); - hid0_hi &= ~(HID0_DOZE | HID0_NAP); + hid0_hi |= (HID0_DEEPNAP | HID0_NAP | HID0_DPM); + hid0_hi &= ~HID0_DOZE; break; default: hid0_hi |= (HID0_NAP | HID0_DPM); From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 21:06:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B2CD1065698; Wed, 10 Nov 2010 21:06:49 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89CE78FC0A; Wed, 10 Nov 2010 21:06:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAAL6nxQ037545; Wed, 10 Nov 2010 21:06:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAAL6nGf037543; Wed, 10 Nov 2010 21:06:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201011102106.oAAL6nGf037543@svn.freebsd.org> From: Attilio Rao Date: Wed, 10 Nov 2010 21:06: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: r215102 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 21:06:49 -0000 Author: attilio Date: Wed Nov 10 21:06:49 2010 New Revision: 215102 URL: http://svn.freebsd.org/changeset/base/215102 Log: Fix typos. Submitted by: gianni MFC after: 3 days Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Nov 10 20:28:10 2010 (r215101) +++ head/sys/kern/sched_ule.c Wed Nov 10 21:06:49 2010 (r215102) @@ -165,7 +165,7 @@ static struct td_sched td_sched0; * before throttling back. * SLP_RUN_FORK: Maximum slp+run time to inherit at fork time. * INTERACT_MAX: Maximum interactivity value. Smaller is better. - * INTERACT_THRESH: Threshhold for placement on the current runq. + * INTERACT_THRESH: Threshold for placement on the current runq. */ #define SCHED_SLP_RUN_MAX ((hz * 5) << SCHED_TICK_SHIFT) #define SCHED_SLP_RUN_FORK ((hz / 2) << SCHED_TICK_SHIFT) @@ -2179,7 +2179,7 @@ sched_tick(int cnt) ts->ts_ltick = ticks; ts->ts_incrtick = ticks; /* - * Update if we've exceeded our desired tick threshhold by over one + * Update if we've exceeded our desired tick threshold by over one * second. */ if (ts->ts_ftick + SCHED_TICK_MAX < ts->ts_ltick) From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 21:33:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F2AA1065673; Wed, 10 Nov 2010 21:33:39 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id D2F838FC0A; Wed, 10 Nov 2010 21:33:38 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LBO00J02RS1A500@smtpauth3.wiscmail.wisc.edu>; Wed, 10 Nov 2010 14:33:37 -0600 (CST) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LBO00FAHRRYRL50@smtpauth3.wiscmail.wisc.edu>; Wed, 10 Nov 2010 14:33:34 -0600 (CST) Date: Wed, 10 Nov 2010 14:33:34 -0600 From: Nathan Whitehorn In-reply-to: <201011102028.oAAKSA8G036701@svn.freebsd.org> To: Nathan Whitehorn Message-id: <20101110143334.421a05d0@anacreon.physics.wisc.edu> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; powerpc64-portbld-freebsd9.0) X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-10, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.11.10.202414, SenderIP=128.104.160.176 References: <201011102028.oAAKSA8G036701@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215101 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 21:33:39 -0000 On Wed, 10 Nov 2010 20:28:10 +0000 (UTC) Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Wed Nov 10 20:28:10 2010 > New Revision: 215101 > URL: http://svn.freebsd.org/changeset/base/215101 > > Log: > Entering deep nap mode on the 970MP requires that both MSR[NAP] and > MSR[DEEPNAP] be set, not just MSR[DEEPNAP]. Fixing this reduces the > idle temperature of my CPUs from 57 to 38 degrees and makes one-shot > timer mode work properly. All instances of MSR in this commit message should be HID0. -Nathan From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 23:36:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8FB3106566B; Wed, 10 Nov 2010 23:36:13 +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 96FFB8FC18; Wed, 10 Nov 2010 23:36:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAANaD0K040729; Wed, 10 Nov 2010 23:36:13 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAANaDqo040725; Wed, 10 Nov 2010 23:36:13 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201011102336.oAANaDqo040725@svn.freebsd.org> From: Colin Percival Date: Wed, 10 Nov 2010 23:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215103 - in releng/7.1: . sys/conf sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 23:36:13 -0000 Author: cperciva Date: Wed Nov 10 23:36:13 2010 New Revision: 215103 URL: http://svn.freebsd.org/changeset/base/215103 Log: Don't unlock a mutex which wasn't locked. PR: kern/137310 Approved by: so (cperciva) Security: FreeBSD-SA-10:09.pseudofs Modified: releng/7.1/UPDATING releng/7.1/sys/conf/newvers.sh releng/7.1/sys/fs/pseudofs/pseudofs_vnops.c Modified: releng/7.1/UPDATING ============================================================================== --- releng/7.1/UPDATING Wed Nov 10 21:06:49 2010 (r215102) +++ releng/7.1/UPDATING Wed Nov 10 23:36:13 2010 (r215103) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20101110: p15 FreeBSD-SA-10:09.pseudofs + Don't unlock a mutex which wasn't locked. + 20100920: p14 FreeBSD-SA-10:08.bzip2 Fix an integer overflow in RLE length parsing when decompressing corrupt bzip2 data. Modified: releng/7.1/sys/conf/newvers.sh ============================================================================== --- releng/7.1/sys/conf/newvers.sh Wed Nov 10 21:06:49 2010 (r215102) +++ releng/7.1/sys/conf/newvers.sh Wed Nov 10 23:36:13 2010 (r215103) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.1" -BRANCH="RELEASE-p14" +BRANCH="RELEASE-p15" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.1/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- releng/7.1/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 10 21:06:49 2010 (r215102) +++ releng/7.1/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 10 23:36:13 2010 (r215103) @@ -305,7 +305,6 @@ pfs_getextattr(struct vop_getextattr_arg if (proc != NULL) PROC_UNLOCK(proc); - pfs_unlock(pn); PFS_RETURN (error); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 10 23:45:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8869A1065694; Wed, 10 Nov 2010 23:45:44 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7503D8FC1B; Wed, 10 Nov 2010 23:45:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAANjifs040942; Wed, 10 Nov 2010 23:45:44 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAANjiLs040936; Wed, 10 Nov 2010 23:45:44 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201011102345.oAANjiLs040936@svn.freebsd.org> From: Nick Hibma Date: Wed, 10 Nov 2010 23:45: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: r215104 - in head: share/man/man4 sys/dev/usb/quirk usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 23:45:44 -0000 Author: n_hibma Date: Wed Nov 10 23:45:44 2010 New Revision: 215104 URL: http://svn.freebsd.org/changeset/base/215104 Log: Add a man page for usb_quirk module, plus references in other man pages, and updated comments in the usb_quirk.h header file. The main purpose of this is to expose the quirks for ejecting 3G modules. usb_modeswitch in Linux does a great job of collecting information on these, and with the quirks module people can try out the modeswitch config file entries on FreeBSD, hence the SCSI strings in the man page. MFC after: 2 weeks Added: head/share/man/man4/usb_quirk.4 - copied, changed from r214753, head/share/man/man4/u3g.4 Modified: head/share/man/man4/Makefile head/share/man/man4/u3g.4 head/sys/dev/usb/quirk/usb_quirk.h head/usr.sbin/usbconfig/usbconfig.8 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Nov 10 23:36:13 2010 (r215103) +++ head/share/man/man4/Makefile Wed Nov 10 23:45:44 2010 (r215104) @@ -469,6 +469,7 @@ MAN= aac.4 \ urio.4 \ ${_urtw.4} \ usb.4 \ + usb_quirk.4 \ uslcom.4 \ utopia.4 \ uvisor.4 \ Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Wed Nov 10 23:36:13 2010 (r215103) +++ head/share/man/man4/u3g.4 Wed Nov 10 23:45:44 2010 (r215104) @@ -85,26 +85,19 @@ In some of these devices a mass storage .Xr umass 4 driver is present which contains Windows and Mac OS X drivers. The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires -additional commands to switch it to modem mode. +additional commands to switch it to modem mode. If your device is not +switching automatically, please try to add quirks. See +.Xr usbconfig 5 +and +.Xr usb_quirk 4 . .Pp -The -.Xr u3gstub 4 -device will attach temporarily to a 3G device with a mass storage device and -force it to switch to modem mode. -The attach and detach of -.Xr u3gstub -and any driver disk device present on the 3G device is hidden, unless the -machine was booted in verbose mode (see -.Xr boot 8 ) . -To temporarily unhide the device, set -.Va debug.bootverbose -to 1 using -.Xr sysctl 8 -and replug the device. .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , -.Xr usb 4 +.XR u3g 4 , +.Xr usb 4 , +.Xr usb_quirk 4 , +.Xr usbconfig 5 .Sh HISTORY The .Nm Copied and modified: head/share/man/man4/usb_quirk.4 (from r214753, head/share/man/man4/u3g.4) ============================================================================== --- head/share/man/man4/u3g.4 Wed Nov 3 20:50:41 2010 (r214753, copy source) +++ head/share/man/man4/usb_quirk.4 Wed Nov 10 23:45:44 2010 (r215104) @@ -1,9 +1,7 @@ .\" -.\" Copyright (c) 2008 AnyWi Technologies +.\" Copyright (c) 2010 AnyWi Technologies .\" All rights reserved. .\" -.\" This code is derived from uark.c -.\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. @@ -18,108 +16,181 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2008 -.Dt U3G 4 +.Dd November 9, 2010 +.Dt USB_QUIRK 4 .Os .Sh NAME -.Nm u3g -.Nd USB support for 3G datacards +.Nm usb_quirk +.Nd USB quirks module .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your +To compile this module into the kernel, +place the following line in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device u3g" .Cd "device ucom" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +Alternatively, to load the module at boot +time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -u3g_load="YES" +usb_quirk_load="YES" .Ed .Sh DESCRIPTION The .Nm -driver provides support for the multiple USB-to-serial interfaces exposed by -many 3G USB/PCCard modems. -.Pp -The device is accessed through the -.Xr ucom 4 -driver which makes it behave like a -.Xr tty 4 . -.Sh HARDWARE -The -.Nm -driver supports the following adapters: -.Pp -.Bl -bullet -compact -.It -Option GT 3G Fusion, GT Fusion Quad, etc. (only 3G part, not WLAN) -.It -Option GT 3G, GT 3G Quad, etc. -.It -Vodafone Mobile Connect Card 3G -.It -Qualcomm Inc. CDMA MSM -.It -Huawei B190, E180v, E220 ('') -.It -Novatel U740, MC950D, X950D, etc. -.It -Sierra MC875U, MC8775U, etc. +module provides support for dynamically adding and removing quirks for +USB devices with +.Xr usbconfig 5 . +.Sh General quirks: +.Bl -tag -width Ds +.It UQ_AUDIO_SWAP_LR +swap left and right channels +.It UQ_AU_INP_ASYNC +input is async despite claim of adaptive +.It UQ_AU_NO_FRAC +don't adjust for fractional samples +.It UQ_AU_NO_XU +audio device has broken extension unit +.It UQ_BAD_ADC +bad audio spec version number +.It UQ_BAD_AUDIO +device claims audio class, but isn't +.It UQ_BROKEN_BIDIR +printer has broken bidir mode +.It UQ_BUS_POWERED +device is bus powered, despite claim +.It UQ_HID_IGNORE +device should be ignored by hid class +.It UQ_KBD_IGNORE +device should be ignored by kbd class +.It UQ_KBD_BOOTPROTO +device should set the boot protocol +.It UQ_MS_BAD_CLASS +doesn't identify properly +.It UQ_MS_LEADING_BYTE +mouse sends an unknown leading byte +.It UQ_MS_REVZ +mouse has Z-axis reversed +.It UQ_NO_STRINGS +string descriptors are broken +.It UQ_OPEN_CLEARSTALL +device needs clear endpoint stall +.It UQ_POWER_CLAIM +hub lies about power status +.It UQ_SPUR_BUT_UP +spurious mouse button up events +.It UQ_SWAP_UNICODE +has some Unicode strings swapped +.It UQ_CFG_INDEX_1 +select configuration index 1 by default +.It UQ_CFG_INDEX_2 +select configuration index 2 by default +.It UQ_CFG_INDEX_3 +select configuration index 3 by default +.It UQ_CFG_INDEX_4 +select configuration index 4 by default +.It UQ_CFG_INDEX_0 +select configuration index 0 by default +.It UQ_ASSUME_CM_OVER_DATA +assume cm over data feature .El -.Pp -(See -.Pa /sys/dev/usb/serial/u3g.c -for the complete list of supported cards for each vendor -mentioned above.) -.Pp -The supported 3G cards provide the necessary modem port for ppp, or mpd -connections as well as extra ports (depending on the specific device) to -provide other functions (additional command port, diagnostic port, SIM toolkit -port). -.Pp -In some of these devices a mass storage device supported by the -.Xr umass 4 -driver is present which contains Windows and Mac OS X drivers. -The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires -additional commands to switch it to modem mode. -.Pp -The -.Xr u3gstub 4 -device will attach temporarily to a 3G device with a mass storage device and -force it to switch to modem mode. -The attach and detach of -.Xr u3gstub -and any driver disk device present on the 3G device is hidden, unless the -machine was booted in verbose mode (see -.Xr boot 8 ) . -To temporarily unhide the device, set -.Va debug.bootverbose -to 1 using -.Xr sysctl 8 -and replug the device. +.Sh USB Mass Storage Quirks +.Bl -tag -width Ds +.It UQ_MSC_NO_TEST_UNIT_READY +send start/stop instead of TUR +.It UQ_MSC_NO_RS_CLEAR_UA +does not reset Unit Att. +.It UQ_MSC_NO_START_STOP +does not support start/stop +.It UQ_MSC_NO_GETMAXLUN +does not support get max LUN +.It UQ_MSC_NO_INQUIRY +fake generic inq response +.It UQ_MSC_NO_INQUIRY_EVPD +does not support inq EVPD +.It UQ_MSC_NO_SYNC_CACHE +does not support sync cache +.It UQ_MSC_SHUTTLE_INIT +requires Shuttle init sequence +.It UQ_MSC_ALT_IFACE_1 +switch to alternate interface 1 +.It UQ_MSC_FLOPPY_SPEED +does floppy speeds (20kb/s) +.It UQ_MSC_IGNORE_RESIDUE +gets residue wrong +.It UQ_MSC_WRONG_CSWSIG +uses wrong CSW signature +.It UQ_MSC_RBC_PAD_TO_12 +pad RBC requests to 12 bytes +.It UQ_MSC_READ_CAP_OFFBY1 +reports sector count, not max sec. +.It UQ_MSC_FORCE_SHORT_INQ +does not support full inq. +.It UQ_MSC_FORCE_WIRE_BBB +force BBB wire protocol +.It UQ_MSC_FORCE_WIRE_CBI +force CBI wire protocol +.It UQ_MSC_FORCE_WIRE_CBI_I +force CBI with int. wire protocol +.It UQ_MSC_FORCE_PROTO_SCSI +force SCSI command protocol +.It UQ_MSC_FORCE_PROTO_ATAPI +force ATAPI command protocol +.It UQ_MSC_FORCE_PROTO_UFI +force UFI command protocol +.It UQ_MSC_FORCE_PROTO_RBC +force RBC command protocol +.El +.Sh Mass Storage Change (u3g) quirks: +.Bl -tag -width Ds +.It UQ_MSC_EJECT_HUAWEI +ejects after Huawei USB command +.It UQ_MSC_EJECT_SIERRA +ejects after Sierra USB command +.It UQ_MSC_EJECT_SCSIEJECT +ejects after SCSI eject command +0x1b0000000200 +.It UQ_MSC_EJECT_REZERO +ejects after SCSI rezero command +0x010000000000 +.It UQ_MSC_EJECT_ZTESTOR +ejects after ZTE SCSI command +0x850101011801010101010000 +.It UQ_MSC_EJECT_CMOTECH +ejects after C-motech SCSI command +0xff52444556434847 +.It UQ_MSC_EJECT_WAIT +wait for the device to eject +.It UQ_MSC_EJECT_SAEL_M460 +ejects after Sael USB commands +.It UQ_MSC_EJECT_HUAWEISCSI +ejects after Huawei SCSI command +0x11060000000000000000000000000000 +.It UQ_MSC_EJECT_TCT +ejects after TCT SCSI command +0x06f504025270 +.El +See +.Pa /sys/dev/usb/quirk/usb_quirk.h +for the complete list of supported quirks. +.Sh EXAMPLES +After attaching a +.Nm u3g +device which appears as a USB device on +.Pa ugen0.3 : +.Bd -literal -offset indent +usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT +.Ed .Sh SEE ALSO -.Xr tty 4 , -.Xr ucom 4 , -.Xr usb 4 +.Xr usb_quirk 4 , +.Xr usbconfig 5 .Sh HISTORY The .Nm -driver appeared in -.Fx 7.2 , -is based on the -.Xr uark 4 -driver, and written by -.An Andrea Guzzo Aq aguzzo@anywi.com -in September 2008. -.Sh AUTHORS -The -.Nm -driver was written by -.An Andrea Guzzo Aq aguzzo@anywi.com -and +module appeared in +.Fx 8.0 , +and was written by +.An Hans Petter Selasky Aq hselasky@FreeBSD.org . +This manual page was written by .An Nick Hibma Aq n_hibma@FreeBSD.org . -Hardware for testing was provided by AnyWi Technologies, Leiden, NL. Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Wed Nov 10 23:36:13 2010 (r215103) +++ head/sys/dev/usb/quirk/usb_quirk.h Wed Nov 10 23:45:44 2010 (r215104) @@ -27,11 +27,14 @@ #ifndef _USB_QUIRK_H_ #define _USB_QUIRK_H_ -/* NOTE: UQ_NONE is not a valid quirk */ -enum { /* keep in sync with usb_quirk_str table */ - UQ_NONE, +enum { + /* + * Keep in sync with theusb_quirk_str usb_quirk.c, and with the + * share/man/man4/usb_quirk.4 + */ + UQ_NONE, /* not a valid quirk */ - UQ_MATCH_VENDOR_ONLY, + UQ_MATCH_VENDOR_ONLY, /* match quirk on vendor only */ /* Various quirks */ Modified: head/usr.sbin/usbconfig/usbconfig.8 ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.8 Wed Nov 10 23:36:13 2010 (r215103) +++ head/usr.sbin/usbconfig/usbconfig.8 Wed Nov 10 23:45:44 2010 (r215104) @@ -92,5 +92,9 @@ Display a list of available quirk names: .Pp .Dl usbconfig dump_quirk_names .Pp +See +.Xr usb_quirk 4 +for more information on quirks. .Sh SEE ALSO -.Xr usb 4 +.Xr usb 4 , +.Xr usb_quirk 4 From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 00:29:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E476C1065693; Thu, 11 Nov 2010 00:29:19 +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 D377A8FC0A; Thu, 11 Nov 2010 00:29:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAB0TJPq041906; Thu, 11 Nov 2010 00:29:19 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAB0TJPi041904; Thu, 11 Nov 2010 00:29:19 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201011110029.oAB0TJPi041904@svn.freebsd.org> From: Colin Percival Date: Thu, 11 Nov 2010 00:29: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: r215105 - head/contrib/binutils/bfd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 00:29:20 -0000 Author: cperciva Date: Thu Nov 11 00:29:19 2010 New Revision: 215105 URL: http://svn.freebsd.org/changeset/base/215105 Log: Zero the buffer containing the .gnu_debuglink section before writing into it. Prior to this commit the .gnu_debuglink section can have up to 3 bytes of uninitialized garbage; as a result, .ko files could change vary between builds. Approved by: dim MFC after: 7 days Modified: head/contrib/binutils/bfd/opncls.c Modified: head/contrib/binutils/bfd/opncls.c ============================================================================== --- head/contrib/binutils/bfd/opncls.c Wed Nov 10 23:45:44 2010 (r215104) +++ head/contrib/binutils/bfd/opncls.c Thu Nov 11 00:29:19 2010 (r215105) @@ -1151,7 +1151,7 @@ bfd_fill_in_gnu_debuglink_section (bfd * debuglink_size &= ~3; debuglink_size += 4; - contents = malloc (debuglink_size); + contents = bfd_zmalloc (debuglink_size); if (contents == NULL) { /* XXX Should we delete the section from the bfd ? */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 02:37:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0CF0106564A; Thu, 11 Nov 2010 02:37:50 +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 950BA8FC15; Thu, 11 Nov 2010 02:37:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAB2boGY044792; Thu, 11 Nov 2010 02:37:50 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAB2bowa044790; Thu, 11 Nov 2010 02:37:50 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201011110237.oAB2bowa044790@svn.freebsd.org> From: Kevin Lo Date: Thu, 11 Nov 2010 02:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215106 - stable/8/sys/arm/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 02:37:50 -0000 Author: kevlo Date: Thu Nov 11 02:37:50 2010 New Revision: 215106 URL: http://svn.freebsd.org/changeset/base/215106 Log: MFC r214972,r215031: - Intel IXP425 SoC is based on the ARMv5TE architecture - Minor cosmetic changes Modified: stable/8/sys/arm/include/cpuconf.h Modified: stable/8/sys/arm/include/cpuconf.h ============================================================================== --- stable/8/sys/arm/include/cpuconf.h Thu Nov 11 00:29:19 2010 (r215105) +++ stable/8/sys/arm/include/cpuconf.h Thu Nov 11 02:37:50 2010 (r215106) @@ -68,7 +68,7 @@ */ #if (defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined(CPU_ARM9) || \ defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110) || \ - defined(CPU_IXP12X0) || defined(CPU_XSCALE_IXP425)) + defined(CPU_IXP12X0)) #define ARM_ARCH_4 1 #else #define ARM_ARCH_4 0 @@ -77,7 +77,7 @@ #if (defined(CPU_ARM9E) || defined(CPU_ARM10) || \ defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ - defined(CPU_XSCALE_PXA2X0)) + defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425)) #define ARM_ARCH_5 1 #else #define ARM_ARCH_5 0 @@ -138,9 +138,9 @@ #define ARM_MMU_SA1 0 #endif -#if(defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ - defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ - defined(CPU_XSCALE_80219)) || defined(CPU_XSCALE_81342) +#if (defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ + defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ + defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342)) #define ARM_MMU_XSCALE 1 #else #define ARM_MMU_XSCALE 0 @@ -159,7 +159,7 @@ */ #if (defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ - defined(CPU_XSCALE_80219)) || defined(CPU_XSCALE_81342) + defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342)) #define ARM_XSCALE_PMU 1 #else #define ARM_XSCALE_PMU 0 From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 02:40:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 178CB106564A; Thu, 11 Nov 2010 02:40:01 +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 F35F18FC15; Thu, 11 Nov 2010 02:40:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAB2e0nh044874; Thu, 11 Nov 2010 02:40:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAB2e05P044871; Thu, 11 Nov 2010 02:40:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011110240.oAB2e05P044871@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 11 Nov 2010 02:40: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: r215107 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 02:40:01 -0000 Author: nwhitehorn Date: Thu Nov 11 02:40:00 2010 New Revision: 215107 URL: http://svn.freebsd.org/changeset/base/215107 Log: Add support for the IMISS, DLMISS, and DSMISS traps required to run FreeBSD on a G2 core. PR: powerpc/111296 Submitted by: Andrew Turner Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/trap_subr32.S Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Thu Nov 11 02:37:50 2010 (r215106) +++ head/sys/powerpc/aim/machdep.c Thu Nov 11 02:40:00 2010 (r215107) @@ -245,6 +245,9 @@ extern void *dsitrap, *dsisize; extern void *decrint, *decrsize; extern void *extint, *extsize; extern void *dblow, *dbsize; +extern void *imisstrap, *imisssize; +extern void *dlmisstrap, *dlmisssize; +extern void *dsmisstrap, *dsmisssize; uintptr_t powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel, @@ -491,6 +494,12 @@ powerpc_init(vm_offset_t startkernel, vm bcopy(generictrap, (void *)EXC_VEC, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_VECAST_G4, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_VECAST_G5, (size_t)&trapsize); + #ifndef __powerpc64__ + /* G2-specific TLB miss helper handlers */ + bcopy(&imisstrap, (void *)EXC_IMISS, (size_t)&imisssize); + bcopy(&dlmisstrap, (void *)EXC_DLMISS, (size_t)&dlmisssize); + bcopy(&dsmisstrap, (void *)EXC_DSMISS, (size_t)&dsmisssize); + #endif __syncicache(EXC_RSVD, EXC_LAST - EXC_RSVD); /* Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu Nov 11 02:37:50 2010 (r215106) +++ head/sys/powerpc/aim/trap_subr32.S Thu Nov 11 02:40:00 2010 (r215107) @@ -362,6 +362,207 @@ CNAME(alitrap): CNAME(alisize) = .-CNAME(alitrap) /* + * G2 specific: instuction TLB miss. + */ + .globl CNAME(imisstrap),CNAME(imisssize) +CNAME(imisstrap): + mfspr %r2, SPR_HASH1 /* get first pointer */ + addi %r1, 0, 8 /* load 8 for counter */ + mfctr %r0 /* save counter */ + mfspr %r3, SPR_ICMP /* get first compare value */ + addi %r2, %r2, -8 /* pre dec the pointer */ +im0: + mtctr %r1 /* load counter */ +im1: + lwzu %r1, 8(%r2) /* get next pte */ + cmp 0, %r1, %r3 /* see if found pte */ + bdnzf 2, im1 /* dec count br if cmp ne and if + * count not zero */ + bne instr_sec_hash /* if not found set up second hash + * or exit */ + lwz %r1, +4(%r2) /* load tlb entry lower-word */ + andi. %r3, %r1, 8 /* check G bit */ + bne do_isi_prot /* if guarded, take an ISI */ + mtctr %r0 /* restore counter */ + mfspr %r0, SPR_IMISS /* get the miss address for the tlbli */ + mfspr %r3, SPR_SRR1 /* get the saved cr0 bits */ + mtcrf 0x80, %r3 /* restore CR0 */ + mtspr SPR_RPA, %r1 /* set the pte */ + ori %r1, %r1, 0x100 /* set reference bit */ + srwi %r1, %r1, 8 /* get byte 7 of pte */ + tlbli %r0 /* load the itlb */ + stb %r1, +6(%r2) /* update page table */ + rfi /* return to executing program */ + +instr_sec_hash: + andi. %r1, %r3, 0x0040 /* see if we have done second hash */ + bne do_isi /* if so, go to ISI interrupt */ + mfspr %r2, SPR_HASH2 /* get the second pointer */ + ori %r3, %r3, 0x0040 /* change the compare value */ + addi %r1, %r0, 8 /* load 8 for counter */ + addi %r2, %r2, -8 /* pre dec for update on load */ + b im0 /* try second hash */ + +/* Create a faked ISI interrupt as the address was not found */ +do_isi_prot: + mfspr %r3, SPR_SRR1 /* get srr1 */ + andi. %r2, %r3, 0xffff /* clean upper srr1 */ + addis %r2, %r2, 0x0800 /* or in srr<4> = 1 to flag prot + * violation */ + b isi1 +do_isi: + mfspr %r3, SPR_SRR1 /* get srr1 */ + andi. %r2, %r3, 0xffff /* clean srr1 */ + addis %r2, %r2, 0x4000 /* or in srr1<1> = 1 to flag pte + * not found */ +isi1: + mtctr %r0 /* restore counter */ + mtspr SPR_SRR1, %r2 /* set srr1 */ + mfmsr %r0 /* get msr */ + xoris %r0, %r0, 0x2 /* flip the msr bit */ + mtcrf 0x80, %r3 /* restore CR0 */ + mtmsr %r0 /* flip back to the native gprs */ + ba EXC_ISI /* go to instr. access interrupt */ + +CNAME(imisssize) = .-CNAME(imisstrap) + +/* + * G2 specific: data load TLB miss. + */ + .globl CNAME(dlmisstrap),CNAME(dlmisssize) +CNAME(dlmisstrap): + mfspr %r2, SPR_HASH1 /* get first pointer */ + addi %r1, 0, 8 /* load 8 for counter */ + mfctr %r0 /* save counter */ + mfspr %r3, SPR_DCMP /* get first compare value */ + addi %r2, %r2, -8 /* pre dec the pointer */ +dm0: + mtctr %r1 /* load counter */ +dm1: + lwzu %r1, 8(%r2) /* get next pte */ + cmp 0, 0, %r1, %r3 /* see if found pte */ + bdnzf 2, dm1 /* dec count br if cmp ne and if + * count not zero */ + bne data_sec_hash /* if not found set up second hash + * or exit */ + lwz %r1, +4(%r2) /* load tlb entry lower-word */ + mtctr %r0 /* restore counter */ + mfspr %r0, SPR_DMISS /* get the miss address for the tlbld */ + mfspr %r3, SPR_SRR1 /* get the saved cr0 bits */ + mtcrf 0x80, %r3 /* restore CR0 */ + mtspr SPR_RPA, %r1 /* set the pte */ + ori %r1, %r1, 0x100 /* set reference bit */ + srwi %r1, %r1, 8 /* get byte 7 of pte */ + tlbld %r0 /* load the dtlb */ + stb %r1, +6(%r2) /* update page table */ + rfi /* return to executing program */ + +data_sec_hash: + andi. %r1, %r3, 0x0040 /* see if we have done second hash */ + bne do_dsi /* if so, go to DSI interrupt */ + mfspr %r2, SPR_HASH2 /* get the second pointer */ + ori %r3, %r3, 0x0040 /* change the compare value */ + addi %r1, 0, 8 /* load 8 for counter */ + addi %r2, %r2, -8 /* pre dec for update on load */ + b dm0 /* try second hash */ + +CNAME(dlmisssize) = .-CNAME(dlmisstrap) + +/* + * G2 specific: data store TLB miss. + */ + .globl CNAME(dsmisstrap),CNAME(dsmisssize) +CNAME(dsmisstrap): + mfspr %r2, SPR_HASH1 /* get first pointer */ + addi %r1, 0, 8 /* load 8 for counter */ + mfctr %r0 /* save counter */ + mfspr %r3, SPR_DCMP /* get first compare value */ + addi %r2, %r2, -8 /* pre dec the pointer */ +ds0: + mtctr %r1 /* load counter */ +ds1: + lwzu %r1, 8(%r2) /* get next pte */ + cmp 0, 0, %r1, %r3 /* see if found pte */ + bdnzf 2, ds1 /* dec count br if cmp ne and if + * count not zero */ + bne data_store_sec_hash /* if not found set up second hash + * or exit */ + lwz %r1, +4(%r2) /* load tlb entry lower-word */ + andi. %r3, %r1, 0x80 /* check the C-bit */ + beq data_store_chk_prot /* if (C==0) + * go check protection modes */ +ds2: + mtctr %r0 /* restore counter */ + mfspr %r0, SPR_DMISS /* get the miss address for the tlbld */ + mfspr %r3, SPR_SRR1 /* get the saved cr0 bits */ + mtcrf 0x80, %r3 /* restore CR0 */ + mtspr SPR_RPA, %r1 /* set the pte */ + tlbld %r0 /* load the dtlb */ + rfi /* return to executing program */ + +data_store_sec_hash: + andi. %r1, %r3, 0x0040 /* see if we have done second hash */ + bne do_dsi /* if so, go to DSI interrupt */ + mfspr %r2, SPR_HASH2 /* get the second pointer */ + ori %r3, %r3, 0x0040 /* change the compare value */ + addi %r1, 0, 8 /* load 8 for counter */ + addi %r2, %r2, -8 /* pre dec for update on load */ + b ds0 /* try second hash */ + +/* Check the protection before setting PTE(c-bit) */ +data_store_chk_prot: + rlwinm. %r3,%r1,30,0,1 /* test PP */ + bge- chk0 /* if (PP == 00 or PP == 01) + * goto chk0: */ + andi. %r3, %r1, 1 /* test PP[0] */ + beq+ chk2 /* return if PP[0] == 0 */ + b do_dsi_prot /* else DSIp */ +chk0: + mfspr %r3,SPR_SRR1 /* get old msr */ + andis. %r3,%r3,0x0008 /* test the KEY bit (SRR1-bit 12) */ + beq chk2 /* if (KEY==0) goto chk2: */ + b do_dsi_prot /* else do_dsi_prot */ +chk2: + ori %r1, %r1, 0x180 /* set reference and change bit */ + sth %r1, 6(%r2) /* update page table */ + b ds2 /* and back we go */ + +/* Create a faked DSI interrupt as the address was not found */ +do_dsi: + mfspr %r3, SPR_SRR1 /* get srr1 */ + rlwinm %r1,%r3,9,6,6 /* get srr1 to bit 6 for + * load/store, zero rest */ + addis %r1, %r1, 0x4000 /* or in dsisr<1> = 1 to flag pte + * not found */ + b dsi1 + +do_dsi_prot: + mfspr %r3, SPR_SRR1 /* get srr1 */ + rlwinm %r1,%r3,9,6,6 /* get srr1 to bit 6 for + *load/store, zero rest */ + addis %r1, %r1, 0x0800 /* or in dsisr<4> = 1 to flag prot + * violation */ + +dsi1: + mtctr %r0 /* restore counter */ + andi. %r2, %r3, 0xffff /* clear upper bits of srr1 */ + mtspr SPR_SRR1, %r2 /* set srr1 */ + mtspr SPR_DSISR, %r1 /* load the dsisr */ + mfspr %r1, SPR_DMISS /* get miss address */ + rlwinm. %r2,%r2,0,31,31 /* test LE bit */ + beq dsi2 /* if little endian then: */ + xor %r1, %r1, 0x07 /* de-mung the data address */ +dsi2: + mtspr SPR_DAR, %r1 /* put in dar */ + mfmsr %r0 /* get msr */ + xoris %r0, %r0, 0x2 /* flip the msr bit */ + mtcrf 0x80, %r3 /* restore CR0 */ + mtmsr %r0 /* flip back to the native gprs */ + ba EXC_DSI /* branch to DSI interrupt */ + +CNAME(dsmisssize) = .-CNAME(dsmisstrap) + +/* * Similar to the above for DSI * Has to handle BAT spills * and standard pagetable spills From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 05:40:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8169F106566C; Thu, 11 Nov 2010 05:40:39 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 705A68FC0A; Thu, 11 Nov 2010 05:40:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAB5ed2Z049347; Thu, 11 Nov 2010 05:40:39 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAB5edwR049345; Thu, 11 Nov 2010 05:40:39 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201011110540.oAB5edwR049345@svn.freebsd.org> From: Randall Stewart Date: Thu, 11 Nov 2010 05:40: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: r215110 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 05:40:39 -0000 Author: rrs Date: Thu Nov 11 05:40:39 2010 New Revision: 215110 URL: http://svn.freebsd.org/changeset/base/215110 Log: Fix so that a multicast packet can be sent even if there is no route out to that mcast address. The code in in_pcb inadvertantly would error (no route) even though the user may have specified the address with the proper socket option (to specify the egress interface). Thanks bz for reminding me I forgot to commit this ;-) Reviewed by: bz MFC after: 1 week Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Nov 11 05:38:32 2010 (r215109) +++ head/sys/netinet/in_pcb.c Thu Nov 11 05:40:39 2010 (r215110) @@ -874,10 +874,6 @@ in_pcbconnect_setup(struct inpcb *inp, s } } if (laddr.s_addr == INADDR_ANY) { - error = in_pcbladdr(inp, &faddr, &laddr, cred); - if (error) - return (error); - /* * If the destination address is multicast and an outgoing * interface has been set as a multicast option, use the @@ -902,9 +898,12 @@ in_pcbconnect_setup(struct inpcb *inp, s laddr = ia->ia_addr.sin_addr; IN_IFADDR_RUNLOCK(); } + } else { + error = in_pcbladdr(inp, &faddr, &laddr, cred); + if (error) + return (error); } } - oinp = in_pcblookup_hash(inp->inp_pcbinfo, faddr, fport, laddr, lport, 0, NULL); if (oinp != NULL) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 08:15:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAC70106564A; Thu, 11 Nov 2010 08:15:12 +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 A95E38FC15; Thu, 11 Nov 2010 08:15:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAB8FC3F053883; Thu, 11 Nov 2010 08:15:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAB8FCtQ053881; Thu, 11 Nov 2010 08:15:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201011110815.oAB8FCtQ053881@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 11 Nov 2010 08:15: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: r215111 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 08:15:12 -0000 Author: trasz Date: Thu Nov 11 08:15:12 2010 New Revision: 215111 URL: http://svn.freebsd.org/changeset/base/215111 Log: Remove unneeded conditional. Discussed with: kib Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Nov 11 05:40:39 2010 (r215110) +++ head/sys/kern/kern_proc.c Thu Nov 11 08:15:12 2010 (r215111) @@ -778,18 +778,16 @@ fill_kinfo_proc_only(struct proc *p, str rufetch(p, &kp->ki_rusage); kp->ki_runtime = cputick2usec(p->p_rux.rux_runtime); PROC_SUNLOCK(p); - if ((p->p_flag & P_INMEM) && p->p_stats != NULL) { - kp->ki_start = p->p_stats->p_start; - timevaladd(&kp->ki_start, &boottime); - PROC_SLOCK(p); - calcru(p, &kp->ki_rusage.ru_utime, &kp->ki_rusage.ru_stime); - PROC_SUNLOCK(p); - calccru(p, &kp->ki_childutime, &kp->ki_childstime); - - /* Some callers want child-times in a single value */ - kp->ki_childtime = kp->ki_childstime; - timevaladd(&kp->ki_childtime, &kp->ki_childutime); - } + kp->ki_start = p->p_stats->p_start; + timevaladd(&kp->ki_start, &boottime); + PROC_SLOCK(p); + calcru(p, &kp->ki_rusage.ru_utime, &kp->ki_rusage.ru_stime); + PROC_SUNLOCK(p); + calccru(p, &kp->ki_childutime, &kp->ki_childstime); + + /* Some callers want child-times in a single value */ + kp->ki_childtime = kp->ki_childstime; + timevaladd(&kp->ki_childtime, &kp->ki_childutime); tp = NULL; if (p->p_pgrp) { kp->ki_pgid = p->p_pgrp->pg_id; From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 08:56:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ACB31065698; Thu, 11 Nov 2010 08:56:50 +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 2F0478FC1A; Thu, 11 Nov 2010 08:56:49 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oAB8ukeT019634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Nov 2010 10:56:46 +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.4/8.14.4) with ESMTP id oAB8ukc5046877; Thu, 11 Nov 2010 10:56:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oAB8ukfA046876; Thu, 11 Nov 2010 10:56:46 +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: Thu, 11 Nov 2010 10:56:46 +0200 From: Kostik Belousov To: Edward Tomasz Napierala Message-ID: <20101111085646.GL2392@deviant.kiev.zoral.com.ua> References: <201011110815.oAB8FCtQ053881@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IYo2qFxOzWNZW4Mx" Content-Disposition: inline In-Reply-To: <201011110815.oAB8FCtQ053881@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215111 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 08:56:50 -0000 --IYo2qFxOzWNZW4Mx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 11, 2010 at 08:15:12AM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Thu Nov 11 08:15:12 2010 > New Revision: 215111 > URL: http://svn.freebsd.org/changeset/base/215111 >=20 > Log: > Remove unneeded conditional. The commit message is unuseful. Why the conditional is not needed ? There are two parts of the condition. P_INMEM is irrelevant since accessed data does not live in the kernel stack of the threads (long time gone is user structure). The p_stats structure is allocated during struct proc initialization and cannot be NULL after the system booted. During the boot, proc0 have p_stats empty until initialized. > =20 > Discussed with: kib >=20 > Modified: > head/sys/kern/kern_proc.c >=20 > Modified: head/sys/kern/kern_proc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_proc.c Thu Nov 11 05:40:39 2010 (r215110) > +++ head/sys/kern/kern_proc.c Thu Nov 11 08:15:12 2010 (r215111) > @@ -778,18 +778,16 @@ fill_kinfo_proc_only(struct proc *p, str > rufetch(p, &kp->ki_rusage); > kp->ki_runtime =3D cputick2usec(p->p_rux.rux_runtime); > PROC_SUNLOCK(p); > - if ((p->p_flag & P_INMEM) && p->p_stats !=3D NULL) { > - kp->ki_start =3D p->p_stats->p_start; > - timevaladd(&kp->ki_start, &boottime); > - PROC_SLOCK(p); > - calcru(p, &kp->ki_rusage.ru_utime, &kp->ki_rusage.ru_stime); > - PROC_SUNLOCK(p); > - calccru(p, &kp->ki_childutime, &kp->ki_childstime); > - > - /* Some callers want child-times in a single value */ > - kp->ki_childtime =3D kp->ki_childstime; > - timevaladd(&kp->ki_childtime, &kp->ki_childutime); > - } > + kp->ki_start =3D p->p_stats->p_start; > + timevaladd(&kp->ki_start, &boottime); > + PROC_SLOCK(p); > + calcru(p, &kp->ki_rusage.ru_utime, &kp->ki_rusage.ru_stime); > + PROC_SUNLOCK(p); > + calccru(p, &kp->ki_childutime, &kp->ki_childstime); > + > + /* Some callers want child-times in a single value */ > + kp->ki_childtime =3D kp->ki_childstime; > + timevaladd(&kp->ki_childtime, &kp->ki_childutime); > tp =3D NULL; > if (p->p_pgrp) { > kp->ki_pgid =3D p->p_pgrp->pg_id; --IYo2qFxOzWNZW4Mx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkzbr80ACgkQC3+MBN1Mb4h99ACfdCfNpGex7yopG+W+PnDiLX0a kf0AoOy3AsUUF8S9wbK/XPtqgB9rj0Gm =hpAT -----END PGP SIGNATURE----- --IYo2qFxOzWNZW4Mx-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 11:26:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916F81065672; Thu, 11 Nov 2010 11:26:59 +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 7FE028FC16; Thu, 11 Nov 2010 11:26:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABBQxSg065712; Thu, 11 Nov 2010 11:26:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABBQxWp065710; Thu, 11 Nov 2010 11:26:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011111126.oABBQxWp065710@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 11 Nov 2010 11:26: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: r215112 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 11:26:59 -0000 Author: kib Date: Thu Nov 11 11:26:59 2010 New Revision: 215112 URL: http://svn.freebsd.org/changeset/base/215112 Log: Fix typo. Function is called ffs_blkfree. Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 08:15:12 2010 (r215111) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:26:59 2010 (r215112) @@ -5488,7 +5488,7 @@ cancel_allocdirect(adphead, adp, freeblk newblk = (struct newblk *)adp; /* * If the journal hasn't been written the jnewblk must be passed - * to the call to ffs_freeblk that reclaims the space. We accomplish + * to the call to ffs_blkfree that reclaims the space. We accomplish * this by linking the journal dependency into the freework to be * freed when freework_freeblock() is called. If the journal has * been written we can simply reclaim the journal space when the @@ -6273,7 +6273,7 @@ cancel_allocindir(aip, inodedep, freeblk /* * If the journal hasn't been written the jnewblk must be passed - * to the call to ffs_freeblk that reclaims the space. We accomplish + * to the call to ffs_blkfree that reclaims the space. We accomplish * this by linking the journal dependency into the indirdep to be * freed when indir_trunc() is called. If the journal has already * been written we can simply reclaim the journal space when the From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 11:35:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6BF110656AE; Thu, 11 Nov 2010 11:35:42 +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 AB4208FC24; Thu, 11 Nov 2010 11:35:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABBZgNE065933; Thu, 11 Nov 2010 11:35:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABBZgK9065929; Thu, 11 Nov 2010 11:35:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011111135.oABBZgK9065929@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 11 Nov 2010 11:35: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: r215113 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 11:35:42 -0000 Author: kib Date: Thu Nov 11 11:35:42 2010 New Revision: 215113 URL: http://svn.freebsd.org/changeset/base/215113 Log: Add function lbn_offset to calculate offset of the indirect block of given level. Reviewed by: jeff Tested by: pho Modified: head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/fs.h Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Thu Nov 11 11:26:59 2010 (r215112) +++ head/sys/ufs/ffs/ffs_inode.c Thu Nov 11 11:35:42 2010 (r215113) @@ -582,9 +582,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev * block to be kept. -1 indicates the entire * block so we need not calculate the index. */ - factor = 1; - for (i = SINGLE; i < level; i++) - factor *= NINDIR(fs); + factor = lbn_offset(fs, level); last = lastbn; if (lastbn > 0) last /= factor; Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:26:59 2010 (r215112) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:35:42 2010 (r215113) @@ -6075,9 +6075,7 @@ indir_trunc(freework, dbn, lbn) fs_pendingblocks = 0; freedeps = 0; needj = UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ; - lbnadd = 1; - for (i = level; i > 0; i--) - lbnadd *= NINDIR(fs); + lbnadd = lbn_offset(fs, level); /* * Get buffer of block pointers to be freed. This routine is not * called until the zero'ed inode has been written, so it is safe Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Thu Nov 11 11:26:59 2010 (r215112) +++ head/sys/ufs/ffs/fs.h Thu Nov 11 11:35:42 2010 (r215113) @@ -607,6 +607,11 @@ struct cg { : (fragroundup(fs, blkoff(fs, (size))))) /* + * Number of indirects in a filesystem block. + */ +#define NINDIR(fs) ((fs)->fs_nindir) + +/* * Indirect lbns are aligned on NDADDR addresses where single indirects * are the negated address of the lowest lbn reachable, double indirects * are this lbn - 1 and triple indirects are this lbn - 2. This yields @@ -631,6 +636,17 @@ lbn_level(ufs_lbn_t lbn) } return (-1); } + +static inline ufs_lbn_t +lbn_offset(struct fs *fs, int level) +{ + ufs_lbn_t res; + + for (res = 1; level > 0; level--) + res *= NINDIR(fs); + return (res); +} + /* * Number of inodes in a secondary storage block/fragment. */ @@ -638,11 +654,6 @@ lbn_level(ufs_lbn_t lbn) #define INOPF(fs) ((fs)->fs_inopb >> (fs)->fs_fragshift) /* - * Number of indirects in a filesystem block. - */ -#define NINDIR(fs) ((fs)->fs_nindir) - -/* * Softdep journal record format. */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 11:38:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 442BA106564A; Thu, 11 Nov 2010 11:38:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 187988FC17; Thu, 11 Nov 2010 11:38:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABBcvdi066045; Thu, 11 Nov 2010 11:38:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABBcvqk066043; Thu, 11 Nov 2010 11:38:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011111138.oABBcvqk066043@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 11 Nov 2010 11:38: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: r215114 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 11:38:58 -0000 Author: kib Date: Thu Nov 11 11:38:57 2010 New Revision: 215114 URL: http://svn.freebsd.org/changeset/base/215114 Log: In journal_mount(), only set MNTK_SUJ flag after the jblocks are mapped. I believe there is a window otherwise where jblocks can be accessed without proper initialization. Reviewed by: jeff Tested by: pho Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:35:42 2010 (r215113) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:38:57 2010 (r215114) @@ -2270,7 +2270,6 @@ journal_mount(mp, fs, cred) int error; int i; - mp->mnt_kern_flag |= MNTK_SUJ; error = softdep_journal_lookup(mp, &vp); if (error != 0) { printf("Failed to find journal. Use tunefs to create one\n"); @@ -2295,20 +2294,26 @@ journal_mount(mp, fs, cred) } jblocks->jb_low = jblocks->jb_free / 3; /* Reserve 33%. */ jblocks->jb_min = jblocks->jb_free / 10; /* Suspend at 10%. */ - /* - * Only validate the journal contents if the filesystem is clean, - * otherwise we write the logs but they'll never be used. If the - * filesystem was still dirty when we mounted it the journal is - * invalid and a new journal can only be valid if it starts from a - * clean mount. - */ - if (fs->fs_clean) { - DIP_SET(ip, i_modrev, fs->fs_mtime); - ip->i_flags |= IN_MODIFIED; - ffs_update(vp, 1); - } VFSTOUFS(mp)->softdep_jblocks = jblocks; out: + if (error == 0) { + MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_SUJ; + MNT_IUNLOCK(mp); + /* + * Only validate the journal contents if the + * filesystem is clean, otherwise we write the logs + * but they'll never be used. If the filesystem was + * still dirty when we mounted it the journal is + * invalid and a new journal can only be valid if it + * starts from a clean mount. + */ + if (fs->fs_clean) { + DIP_SET(ip, i_modrev, fs->fs_mtime); + ip->i_flags |= IN_MODIFIED; + ffs_update(vp, 1); + } + } vput(vp); return (error); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 11:41:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A02821065673; Thu, 11 Nov 2010 11:41:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF208FC1B; Thu, 11 Nov 2010 11:41:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABBfq3l066143; Thu, 11 Nov 2010 11:41:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABBfqA0066141; Thu, 11 Nov 2010 11:41:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011111141.oABBfqA0066141@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 11 Nov 2010 11:41: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: r215115 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 11:41:52 -0000 Author: kib Date: Thu Nov 11 11:41:52 2010 New Revision: 215115 URL: http://svn.freebsd.org/changeset/base/215115 Log: Change #ifdef INVARIANTS panic into KASSERT, and print some useful information to diagnose the issue, in handle_complete_freeblocks(). Reviewed by: jeff Tested by: pho Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:38:57 2010 (r215114) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:41:52 2010 (r215115) @@ -6021,11 +6021,11 @@ handle_complete_freeblocks(freeblks) vput(vp); } -#ifdef INVARIANTS - if (freeblks->fb_chkcnt != 0 && - ((fs->fs_flags & FS_UNCLEAN) == 0 || (flags & LK_NOWAIT) != 0)) - printf("handle_workitem_freeblocks: block count\n"); -#endif /* INVARIANTS */ + KASSERT(freeblks->fb_chkcnt == 0 || + ((fs->fs_flags & FS_UNCLEAN) != 0 && (flags & LK_NOWAIT) == 0), + ("handle_workitem_freeblocks: inode %ju block count %jd\n", + (uintmax_t)freeblks->fb_previousinum, + (intmax_t)freeblks->fb_chkcnt)); ACQUIRE_LOCK(&lk); /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 11:46:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30CD106566B; Thu, 11 Nov 2010 11:46:19 +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 9F8AA8FC13; Thu, 11 Nov 2010 11:46:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABBkJx7066298; Thu, 11 Nov 2010 11:46:19 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABBkJxp066291; Thu, 11 Nov 2010 11:46:19 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201011111146.oABBkJxp066291@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 11 Nov 2010 11:46: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: r215116 - in head/crypto/openssh: . openbsd-compat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 11:46:19 -0000 Author: des Date: Thu Nov 11 11:46:19 2010 New Revision: 215116 URL: http://svn.freebsd.org/changeset/base/215116 Log: Upgrade to OpenSSH 5.6p1. Added: head/crypto/openssh/openbsd-compat/strptime.c - copied unchanged from r214980, vendor-crypto/openssh/dist/openbsd-compat/strptime.c Modified: head/crypto/openssh/ChangeLog head/crypto/openssh/PROTOCOL.certkeys head/crypto/openssh/PROTOCOL.mux head/crypto/openssh/README head/crypto/openssh/auth-options.c head/crypto/openssh/auth-options.h head/crypto/openssh/auth-rsa.c head/crypto/openssh/auth.c head/crypto/openssh/auth.h head/crypto/openssh/auth1.c head/crypto/openssh/auth2-hostbased.c head/crypto/openssh/auth2-none.c head/crypto/openssh/auth2-pubkey.c head/crypto/openssh/authfd.c head/crypto/openssh/authfile.c head/crypto/openssh/authfile.h head/crypto/openssh/bufaux.c head/crypto/openssh/channels.c head/crypto/openssh/channels.h head/crypto/openssh/clientloop.c head/crypto/openssh/clientloop.h head/crypto/openssh/config.h head/crypto/openssh/config.h.in head/crypto/openssh/jpake.c head/crypto/openssh/key.c head/crypto/openssh/key.h head/crypto/openssh/loginrec.h head/crypto/openssh/misc.c head/crypto/openssh/misc.h head/crypto/openssh/monitor.c head/crypto/openssh/mux.c head/crypto/openssh/myproposal.h head/crypto/openssh/openbsd-compat/openbsd-compat.h head/crypto/openssh/openbsd-compat/openssl-compat.h head/crypto/openssh/openbsd-compat/port-tun.c head/crypto/openssh/openbsd-compat/port-uw.c head/crypto/openssh/packet.c head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/scp.c head/crypto/openssh/servconf.c head/crypto/openssh/servconf.h head/crypto/openssh/session.c head/crypto/openssh/sftp-client.c head/crypto/openssh/sftp.c head/crypto/openssh/ssh-add.c head/crypto/openssh/ssh-agent.c head/crypto/openssh/ssh-dss.c head/crypto/openssh/ssh-keygen.1 head/crypto/openssh/ssh-keygen.c head/crypto/openssh/ssh-keyscan.c head/crypto/openssh/ssh-keysign.8 head/crypto/openssh/ssh-keysign.c head/crypto/openssh/ssh-pkcs11.c head/crypto/openssh/ssh-rsa.c head/crypto/openssh/ssh.1 head/crypto/openssh/ssh.c head/crypto/openssh/ssh.h head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.5 head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.8 head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 head/crypto/openssh/version.h Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/ChangeLog ============================================================================== --- head/crypto/openssh/ChangeLog Thu Nov 11 11:41:52 2010 (r215115) +++ head/crypto/openssh/ChangeLog Thu Nov 11 11:46:19 2010 (r215116) @@ -1,3 +1,522 @@ +20100823 + - (djm) Release OpenSSH-5.6p1 + +20100816 + - (dtucker) [configure.ac openbsd-compat/Makefile.in + openbsd-compat/openbsd-compat.h openbsd-compat/strptime.c] Add strptime to + the compat library which helps on platforms like old IRIX. Based on work + by djm, tested by Tom Christensen. + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/08/12 21:49:44 + [ssh.c] + close any extra file descriptors inherited from parent at start and + reopen stdin/stdout to /dev/null when forking for ControlPersist. + + prevents tools that fork and run a captive ssh for communication from + failing to exit when the ssh completes while they wait for these fds to + close. The inherited fds may persist arbitrarily long if a background + mux master has been started by ControlPersist. cvs and scp were effected + by this. + + "please commit" markus@ + - (djm) [regress/README.regress] typo + +20100812 + - (tim) [regress/login-timeout.sh regress/reconfigure.sh regress/reexec.sh + regress/test-exec.sh] Under certain conditions when testing with sudo + tests would fail because the pidfile could not be read by a regular user. + "cat: cannot open ...../regress/pidfile: Permission denied (error 13)" + Make sure cat is run by $SUDO. no objection from me. djm@ + - (tim) [auth.c] add cast to quiet compiler. Change only affects SVR5 systems. + +20100809 + - (djm) bz#1561: don't bother setting IFF_UP on tun(4) device if it is + already set. Makes FreeBSD user openable tunnels useful; patch from + richard.burakowski+ossh AT mrburak.net, ok dtucker@ + - (dtucker) bug #1530: strip trailing ":" from hostname in ssh-copy-id. + based in part on a patch from Colin Watson, ok djm@ + +20100809 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/08/08 16:26:42 + [version.h] + crank to 5.6 + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + +20100805 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/08/04 05:37:01 + [ssh.1 ssh_config.5 sshd.8] + Remove mentions of weird "addr/port" alternate address format for IPv6 + addresses combinations. It hasn't worked for ages and we have supported + the more commen "[addr]:port" format for a long time. ok jmc@ markus@ + - djm@cvs.openbsd.org 2010/08/04 05:40:39 + [PROTOCOL.certkeys ssh-keygen.c] + tighten the rules for certificate encoding by requiring that options + appear in lexical order and make our ssh-keygen comply. ok markus@ + - djm@cvs.openbsd.org 2010/08/04 05:42:47 + [auth.c auth2-hostbased.c authfile.c authfile.h ssh-keysign.8] + [ssh-keysign.c ssh.c] + enable certificates for hostbased authentication, from Iain Morgan; + "looks ok" markus@ + - djm@cvs.openbsd.org 2010/08/04 05:49:22 + [authfile.c] + commited the wrong version of the hostbased certificate diff; this + version replaces some strlc{py,at} verbosity with xasprintf() at + the request of markus@ + - djm@cvs.openbsd.org 2010/08/04 06:07:11 + [ssh-keygen.1 ssh-keygen.c] + Support CA keys in PKCS#11 tokens; feedback and ok markus@ + - djm@cvs.openbsd.org 2010/08/04 06:08:40 + [ssh-keysign.c] + clean for -Wuninitialized (Id sync only; portable had this change) + - djm@cvs.openbsd.org 2010/08/05 13:08:42 + [channels.c] + Fix a trio of bugs in the local/remote window calculation for datagram + data channels (i.e. TunnelForward): + + Calculate local_consumed correctly in channel_handle_wfd() by measuring + the delta to buffer_len(c->output) from when we start to when we finish. + The proximal problem here is that the output_filter we use in portable + modified the length of the dequeued datagram (to futz with the headers + for !OpenBSD). + + In channel_output_poll(), don't enqueue datagrams that won't fit in the + peer's advertised packet size (highly unlikely to ever occur) or which + won't fit in the peer's remaining window (more likely). + + In channel_input_data(), account for the 4-byte string header in + datagram packets that we accept from the peer and enqueue in c->output. + + report, analysis and testing 2/3 cases from wierbows AT us.ibm.com; + "looks good" markus@ + +20100803 + - (dtucker) [monitor.c] Bug #1795: Initialize the values to be returned from + PAM to sane values in case the PAM method doesn't write to them. Spotted by + Bitman Zhou, ok djm@. + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/07/16 04:45:30 + [ssh-keygen.c] + avoid bogus compiler warning + - djm@cvs.openbsd.org 2010/07/16 14:07:35 + [ssh-rsa.c] + more timing paranoia - compare all parts of the expected decrypted + data before returning. AFAIK not exploitable in the SSH protocol. + "groovy" deraadt@ + - djm@cvs.openbsd.org 2010/07/19 03:16:33 + [sftp-client.c] + bz#1797: fix swapped args in upload_dir_internal(), breaking recursive + upload depth checks and causing verbose printing of transfers to always + be turned on; patch from imorgan AT nas.nasa.gov + - djm@cvs.openbsd.org 2010/07/19 09:15:12 + [clientloop.c readconf.c readconf.h ssh.c ssh_config.5] + add a "ControlPersist" option that automatically starts a background + ssh(1) multiplex master when connecting. This connection can stay alive + indefinitely, or can be set to automatically close after a user-specified + duration of inactivity. bz#1330 - patch by dwmw2 AT infradead.org, but + further hacked on by wmertens AT cisco.com, apb AT cequrux.com, + martin-mindrot-bugzilla AT earth.li and myself; "looks ok" markus@ + - djm@cvs.openbsd.org 2010/07/21 02:10:58 + [misc.c] + sync timingsafe_bcmp() with the one dempsky@ committed to sys/lib/libkern + - dtucker@cvs.openbsd.org 2010/07/23 08:49:25 + [ssh.1] + Ciphers is documented in ssh_config(5) these days + +20100819 + - (dtucker) [contrib/ssh-copy-ud.1] Bug #1786: update ssh-copy-id.1 with more + details about its behaviour WRT existing directories. Patch from + asguthrie at gmail com, ok djm. + +20100716 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/07/02 04:32:44 + [misc.c] + unbreak strdelim() skipping past quoted strings, e.g. + AllowUsers "blah blah" blah + was broken; report and fix in bz#1757 from bitman.zhou AT centrify.com + ok dtucker; + - djm@cvs.openbsd.org 2010/07/12 22:38:52 + [ssh.c] + Make ExitOnForwardFailure work with fork-after-authentication ("ssh -f") + for protocol 2. ok markus@ + - djm@cvs.openbsd.org 2010/07/12 22:41:13 + [ssh.c ssh_config.5] + expand %h to the hostname in ssh_config Hostname options. While this + sounds useless, it is actually handy for working with unqualified + hostnames: + + Host *.* + Hostname %h + Host * + Hostname %h.example.org + + "I like it" markus@ + - djm@cvs.openbsd.org 2010/07/13 11:52:06 + [auth-rsa.c channels.c jpake.c key.c misc.c misc.h monitor.c] + [packet.c ssh-rsa.c] + implement a timing_safe_cmp() function to compare memory without leaking + timing information by short-circuiting like memcmp() and use it for + some of the more sensitive comparisons (though nothing high-value was + readily attackable anyway); "looks ok" markus@ + - djm@cvs.openbsd.org 2010/07/13 23:13:16 + [auth-rsa.c channels.c jpake.c key.c misc.c misc.h monitor.c packet.c] + [ssh-rsa.c] + s/timing_safe_cmp/timingsafe_bcmp/g + - jmc@cvs.openbsd.org 2010/07/14 17:06:58 + [ssh.1] + finally ssh synopsis looks nice again! this commit just removes a ton of + hacks we had in place to make it work with old groff; + - schwarze@cvs.openbsd.org 2010/07/15 21:20:38 + [ssh-keygen.1] + repair incorrect block nesting, which screwed up indentation; + problem reported and fix OK by jmc@ + +20100714 + - (tim) [contrib/redhat/openssh.spec] Bug 1796: Test for skip_x11_askpass + (line 77) should have been for no_x11_askpass. + +20100702 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/06/26 00:57:07 + [ssh_config.5] + tweak previous; + - djm@cvs.openbsd.org 2010/06/26 23:04:04 + [ssh.c] + oops, forgot to #include ; spotted and patch from chl@ + - djm@cvs.openbsd.org 2010/06/29 23:15:30 + [ssh-keygen.1 ssh-keygen.c] + allow import (-i) and export (-e) of PEM and PKCS#8 encoded keys; + bz#1749; ok markus@ + - djm@cvs.openbsd.org 2010/06/29 23:16:46 + [auth2-pubkey.c sshd_config.5] + allow key options (command="..." and friends) in AuthorizedPrincipals; + ok markus@ + - jmc@cvs.openbsd.org 2010/06/30 07:24:25 + [ssh-keygen.1] + tweak previous; + - jmc@cvs.openbsd.org 2010/06/30 07:26:03 + [ssh-keygen.c] + sort usage(); + - jmc@cvs.openbsd.org 2010/06/30 07:28:34 + [sshd_config.5] + tweak previous; + - millert@cvs.openbsd.org 2010/07/01 13:06:59 + [scp.c] + Fix a longstanding problem where if you suspend scp at the + password/passphrase prompt the terminal mode is not restored. + OK djm@ + - phessler@cvs.openbsd.org 2010/06/27 19:19:56 + [regress/Makefile] + fix how we run the tests so we can successfully use SUDO='sudo -E' + in our env + - djm@cvs.openbsd.org 2010/06/29 23:59:54 + [cert-userkey.sh] + regress tests for key options in AuthorizedPrincipals + +20100627 + - (tim) [openbsd-compat/port-uw.c] Reorder includes. auth-options.h now needs + key.h. + +20100626 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/05/21 05:00:36 + [misc.c] + colon() returns char*, so s/return (0)/return NULL/ + - markus@cvs.openbsd.org 2010/06/08 21:32:19 + [ssh-pkcs11.c] + check length of value returned C_GetAttributValue for != 0 + from mdrtbugzilla@codefive.co.uk; bugzilla #1773; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/17 07:07:30 + [mux.c] + Correct sizing of object to be allocated by calloc(), replacing + sizeof(state) with sizeof(*state). This worked by accident since + the struct contained a single int at present, but could have broken + in the future. patch from hyc AT symas.com + - djm@cvs.openbsd.org 2010/06/18 00:58:39 + [sftp.c] + unbreak ls in working directories that contains globbing characters in + their pathnames. bz#1655 reported by vgiffin AT apple.com + - djm@cvs.openbsd.org 2010/06/18 03:16:03 + [session.c] + Missing check for chroot_director == "none" (we already checked against + NULL); bz#1564 from Jan.Pechanec AT Sun.COM + - djm@cvs.openbsd.org 2010/06/18 04:43:08 + [sftp-client.c] + fix memory leak in do_realpath() error path; bz#1771, patch from + anicka AT suse.cz + - djm@cvs.openbsd.org 2010/06/22 04:22:59 + [servconf.c sshd_config.5] + expose some more sshd_config options inside Match blocks: + AuthorizedKeysFile AuthorizedPrincipalsFile + HostbasedUsesNameFromPacketOnly PermitTunnel + bz#1764; feedback from imorgan AT nas.nasa.gov; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/22 04:32:06 + [ssh-keygen.c] + standardise error messages when attempting to open private key + files to include "progname: filename: error reason" + bz#1783; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/22 04:49:47 + [auth.c] + queue auth debug messages for bad ownership or permissions on the user's + keyfiles. These messages will be sent after the user has successfully + authenticated (where our client will display them with LogLevel=debug). + bz#1554; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/22 04:54:30 + [ssh-keyscan.c] + replace verbose and overflow-prone Linebuf code with read_keyfile_line() + based on patch from joachim AT joachimschipper.nl; bz#1565; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/22 04:59:12 + [session.c] + include the user name on "subsystem request for ..." log messages; + bz#1571; ok dtucker@ + - djm@cvs.openbsd.org 2010/06/23 02:59:02 + [ssh-keygen.c] + fix printing of extensions in v01 certificates that I broke in r1.190 + - djm@cvs.openbsd.org 2010/06/25 07:14:46 + [channels.c mux.c readconf.c readconf.h ssh.h] + bz#1327: remove hardcoded limit of 100 permitopen clauses and port + forwards per direction; ok markus@ stevesk@ + - djm@cvs.openbsd.org 2010/06/25 07:20:04 + [channels.c session.c] + bz#1750: fix requirement for /dev/null inside ChrootDirectory for + internal-sftp accidentally introduced in r1.253 by removing the code + that opens and dup /dev/null to stderr and modifying the channels code + to read stderr but discard it instead; ok markus@ + - djm@cvs.openbsd.org 2010/06/25 08:46:17 + [auth1.c auth2-none.c] + skip the initial check for access with an empty password when + PermitEmptyPasswords=no; bz#1638; ok markus@ + - djm@cvs.openbsd.org 2010/06/25 23:10:30 + [ssh.c] + log the hostname and address that we connected to at LogLevel=verbose + after authentication is successful to mitigate "phishing" attacks by + servers with trusted keys that accept authentication silently and + automatically before presenting fake password/passphrase prompts; + "nice!" markus@ + - djm@cvs.openbsd.org 2010/06/25 23:10:30 + [ssh.c] + log the hostname and address that we connected to at LogLevel=verbose + after authentication is successful to mitigate "phishing" attacks by + servers with trusted keys that accept authentication silently and + automatically before presenting fake password/passphrase prompts; + "nice!" markus@ + +20100622 + - (djm) [loginrec.c] crank LINFO_NAMESIZE (username length) to 512 + bz#1579; ok dtucker + +20100618 + - (djm) [contrib/ssh-copy-id] Update key file explicitly under ~ + rather than assuming that $CWD == $HOME. bz#1500, patch from + timothy AT gelter.com + +20100617 + - (tim) [contrib/cygwin/README] Remove a reference to the obsolete + minires-devel package, and to add the reference to the libedit-devel + package since CYgwin now provides libedit. Patch from Corinna Vinschen. + +20100521 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/05/07 11:31:26 + [regress/Makefile regress/cert-userkey.sh] + regress tests for AuthorizedPrincipalsFile and "principals=" key option. + feedback and ok markus@ + - djm@cvs.openbsd.org 2010/05/11 02:58:04 + [auth-rsa.c] + don't accept certificates marked as "cert-authority" here; ok markus@ + - djm@cvs.openbsd.org 2010/05/14 00:47:22 + [ssh-add.c] + check that the certificate matches the corresponding private key before + grafting it on + - djm@cvs.openbsd.org 2010/05/14 23:29:23 + [channels.c channels.h mux.c ssh.c] + Pause the mux channel while waiting for reply from aynch callbacks. + Prevents misordering of replies if new requests arrive while waiting. + + Extend channel open confirm callback to allow signalling failure + conditions as well as success. Use this to 1) fix a memory leak, 2) + start using the above pause mechanism and 3) delay sending a success/ + failure message on mux slave session open until we receive a reply from + the server. + + motivated by and with feedback from markus@ + - markus@cvs.openbsd.org 2010/05/16 12:55:51 + [PROTOCOL.mux clientloop.h mux.c readconf.c readconf.h ssh.1 ssh.c] + mux support for remote forwarding with dynamic port allocation, + use with + LPORT=`ssh -S muxsocket -R0:localhost:25 -O forward somehost` + feedback and ok djm@ + - djm@cvs.openbsd.org 2010/05/20 11:25:26 + [auth2-pubkey.c] + fix logspam when key options (from="..." especially) deny non-matching + keys; reported by henning@ also bz#1765; ok markus@ dtucker@ + - djm@cvs.openbsd.org 2010/05/20 23:46:02 + [PROTOCOL.certkeys auth-options.c ssh-keygen.c] + Move the permit-* options to the non-critical "extensions" field for v01 + certificates. The logic is that if another implementation fails to + implement them then the connection just loses features rather than fails + outright. + + ok markus@ + +20100511 + - (dtucker) [Makefile.in] Bug #1770: Link libopenbsd-compat twice to solve + circular dependency problem on old or odd platforms. From Tom Lane, ok + djm@. + - (djm) [openbsd-compat/openssl-compat.h] Fix build breakage on older + libcrypto by defining OPENSSL_[DR]SA_MAX_MODULUS_BITS if they aren't + already. ok dtucker@ + +20100510 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/04/23 01:47:41 + [ssh-keygen.c] + bz#1740: display a more helpful error message when $HOME is + inaccessible while trying to create .ssh directory. Based on patch + from jchadima AT redhat.com; ok dtucker@ + - djm@cvs.openbsd.org 2010/04/23 22:27:38 + [mux.c] + set "detach_close" flag when registering channel cleanup callbacks. + This causes the channel to close normally when its fds close and + hangs when terminating a mux slave using ~. bz#1758; ok markus@ + - djm@cvs.openbsd.org 2010/04/23 22:42:05 + [session.c] + set stderr to /dev/null for subsystems rather than just closing it. + avoids hangs if a subsystem or shell initialisation writes to stderr. + bz#1750; ok markus@ + - djm@cvs.openbsd.org 2010/04/23 22:48:31 + [ssh-keygen.c] + refuse to generate keys longer than OPENSSL_[RD]SA_MAX_MODULUS_BITS, + since we would refuse to use them anyway. bz#1516; ok dtucker@ + - djm@cvs.openbsd.org 2010/04/26 22:28:24 + [sshconnect2.c] + bz#1502: authctxt.success is declared as an int, but passed by + reference to function that accepts sig_atomic_t*. Convert it to + the latter; ok markus@ dtucker@ + - djm@cvs.openbsd.org 2010/05/01 02:50:50 + [PROTOCOL.certkeys] + typo; jmeltzer@ + - dtucker@cvs.openbsd.org 2010/05/05 04:22:09 + [sftp.c] + restore mput and mget which got lost in the tab-completion changes. + found by Kenneth Whitaker, ok djm@ + - djm@cvs.openbsd.org 2010/05/07 11:30:30 + [auth-options.c auth-options.h auth.c auth.h auth2-pubkey.c] + [key.c servconf.c servconf.h sshd.8 sshd_config.5] + add some optional indirection to matching of principal names listed + in certificates. Currently, a certificate must include the a user's name + to be accepted for authentication. This change adds the ability to + specify a list of certificate principal names that are acceptable. + + When authenticating using a CA trusted through ~/.ssh/authorized_keys, + this adds a new principals="name1[,name2,...]" key option. + + For CAs listed through sshd_config's TrustedCAKeys option, a new config + option "AuthorizedPrincipalsFile" specifies a per-user file containing + the list of acceptable names. + + If either option is absent, the current behaviour of requiring the + username to appear in principals continues to apply. + + These options are useful for role accounts, disjoint account namespaces + and "user@realm"-style naming policies in certificates. + + feedback and ok markus@ + - jmc@cvs.openbsd.org 2010/05/07 12:49:17 + [sshd_config.5] + tweak previous; + +20100423 + - (dtucker) [configure.ac] Bug #1756: Check for the existence of a lib64 dir + in the openssl install directory (some newer openssl versions do this on at + least some amd64 platforms). + +20100418 + - OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2010/04/16 06:45:01 + [ssh_config.5] + tweak previous; ok djm + - jmc@cvs.openbsd.org 2010/04/16 06:47:04 + [ssh-keygen.1 ssh-keygen.c] + tweak previous; ok djm + - djm@cvs.openbsd.org 2010/04/16 21:14:27 + [sshconnect.c] + oops, %r => remote username, not %u + - djm@cvs.openbsd.org 2010/04/16 01:58:45 + [regress/cert-hostkey.sh regress/cert-userkey.sh] + regression tests for v01 certificate format + includes interop tests for v00 certs + - (dtucker) [contrib/aix/buildbff.sh] Fix creation of ssh_prng_cmds.default + file. + +20100416 + - (djm) Release openssh-5.5p1 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2010/03/26 03:13:17 + [bufaux.c] + allow buffer_get_int_ret/buffer_get_int64_ret to take a NULL pointer + argument to allow skipping past values in a buffer + - jmc@cvs.openbsd.org 2010/03/26 06:54:36 + [ssh.1] + tweak previous; + - jmc@cvs.openbsd.org 2010/03/27 14:26:55 + [ssh_config.5] + tweak previous; ok dtucker + - djm@cvs.openbsd.org 2010/04/10 00:00:16 + [ssh.c] + bz#1746 - suppress spurious tty warning when using -O and stdin + is not a tty; ok dtucker@ markus@ + - djm@cvs.openbsd.org 2010/04/10 00:04:30 + [sshconnect.c] + fix terminology: we didn't find a certificate in known_hosts, we found + a CA key + - djm@cvs.openbsd.org 2010/04/10 02:08:44 + [clientloop.c] + bz#1698: kill channel when pty allocation requests fail. Fixed + stuck client if the server refuses pty allocation. + ok dtucker@ "think so" markus@ + - djm@cvs.openbsd.org 2010/04/10 02:10:56 + [sshconnect2.c] + show the key type that we are offering in debug(), helps distinguish + between certs and plain keys as the path to the private key is usually + the same. + - djm@cvs.openbsd.org 2010/04/10 05:48:16 + [mux.c] + fix NULL dereference; from matthew.haub AT alumni.adelaide.edu.au + - djm@cvs.openbsd.org 2010/04/14 22:27:42 + [ssh_config.5 sshconnect.c] + expand %r => remote username in ssh_config:ProxyCommand; + ok deraadt markus + - markus@cvs.openbsd.org 2010/04/15 20:32:55 + [ssh-pkcs11.c] + retry lookup for private key if there's no matching key with CKA_SIGN + attribute enabled; this fixes fixes MuscleCard support (bugzilla #1736) + ok djm@ + - djm@cvs.openbsd.org 2010/04/16 01:47:26 + [PROTOCOL.certkeys auth-options.c auth-options.h auth-rsa.c] + [auth2-pubkey.c authfd.c key.c key.h myproposal.h ssh-add.c] + [ssh-agent.c ssh-dss.c ssh-keygen.1 ssh-keygen.c ssh-rsa.c] + [sshconnect.c sshconnect2.c sshd.c] + revised certificate format ssh-{dss,rsa}-cert-v01@openssh.com with the + following changes: + + move the nonce field to the beginning of the certificate where it can + better protect against chosen-prefix attacks on the signature hash + + Rename "constraints" field to "critical options" + + Add a new non-critical "extensions" field + + Add a serial number + + The older format is still support for authentication and cert generation + (use "ssh-keygen -t v00 -s ca_key ..." to generate a v00 certificate) + + ok markus@ + 20100410 - (dtucker) [configure.ac] Put the check for the existence of getaddrinfo back so we disable the IPv6 tests if we don't have it. Modified: head/crypto/openssh/PROTOCOL.certkeys ============================================================================== --- head/crypto/openssh/PROTOCOL.certkeys Thu Nov 11 11:41:52 2010 (r215115) +++ head/crypto/openssh/PROTOCOL.certkeys Thu Nov 11 11:46:19 2010 (r215116) @@ -16,7 +16,7 @@ These protocol extensions build on the s system already in SSH to allow certificate-based authentication. The certificates used are not traditional X.509 certificates, with numerous options and complex encoding rules, but something rather -more minimal: a key, some identity information and usage constraints +more minimal: a key, some identity information and usage options that have been signed with some other trusted key. A sshd server may be configured to allow authentication via certified @@ -27,7 +27,7 @@ of acceptance of certified host keys, by to specify CA keys in ~/.ssh/known_hosts. Certified keys are represented using two new key types: -ssh-rsa-cert-v00@openssh.com and ssh-dss-cert-v00@openssh.com that +ssh-rsa-cert-v01@openssh.com and ssh-dss-cert-v01@openssh.com that include certification information along with the public key that is used to sign challenges. ssh-keygen performs the CA signing operation. @@ -47,7 +47,7 @@ in RFC4252 section 7. New public key formats ---------------------- -The ssh-rsa-cert-v00@openssh.com and ssh-dss-cert-v00@openssh.com key +The ssh-rsa-cert-v01@openssh.com and ssh-dss-cert-v01@openssh.com key types take a similar high-level format (note: data types and encoding are as per RFC4251 section 5). The serialised wire encoding of these certificates is also used for storing them on disk. @@ -57,42 +57,55 @@ these certificates is also used for stor RSA certificate - string "ssh-rsa-cert-v00@openssh.com" + string "ssh-rsa-cert-v01@openssh.com" + string nonce mpint e mpint n + uint64 serial uint32 type string key id string valid principals uint64 valid after uint64 valid before - string constraints - string nonce + string critical options + string extensions string reserved string signature key string signature DSA certificate - string "ssh-dss-cert-v00@openssh.com" + string "ssh-dss-cert-v01@openssh.com" + string nonce mpint p mpint q mpint g mpint y + uint64 serial uint32 type string key id string valid principals uint64 valid after uint64 valid before - string constraints - string nonce + string critical options + string extensions string reserved string signature key string signature +The nonce field is a CA-provided random bitstring of arbitrary length +(but typically 16 or 32 bytes) included to make attacks that depend on +inducing collisions in the signature hash infeasible. + e and n are the RSA exponent and public modulus respectively. p, q, g, y are the DSA parameters as described in FIPS-186-2. +serial is an optional certificate serial number set by the CA to +provide an abbreviated way to refer to certificates from that CA. +If a CA does not wish to number its certificates it must set this +field to zero. + type specifies whether this certificate is for identification of a user or a host using a SSH_CERT_TYPE_... value. @@ -112,13 +125,15 @@ certificate. Each represents a time in s 00:00:00. A certificate is considered valid if: valid after <= current time < valid before -constraints is a set of zero or more key constraints encoded as below. +criticial options is a set of zero or more key options encoded as +below. All such options are "critical" in the sense that an implementation +must refuse to authorise a key that has an unrecognised option. + +extensions is a set of zero or more optional extensions. These extensions +are not critical, and an implementation that encounters one that it does +not recognise may safely ignore it. -The nonce field is a CA-provided random bitstring of arbitrary length -(but typically 16 or 32 bytes) included to make attacks that depend on -inducing collisions in the signature hash infeasible. - -The reserved field is current unused and is ignored in this version of +The reserved field is currently unused and is ignored in this version of the protocol. signature key contains the CA key used to sign the certificate. @@ -132,22 +147,25 @@ up to, and including the signature key. encoded according to the rules defined for the CA's public key algorithm (RFC4253 section 6.6 for ssh-rsa and ssh-dss). -Constraints ------------ +Critical options +---------------- -The constraints section of the certificate specifies zero or more -constraints on the certificates validity. The format of this field +The critical options section of the certificate specifies zero or more +options on the certificates validity. The format of this field is a sequence of zero or more tuples: string name string data -The name field identifies the constraint and the data field encodes -constraint-specific information (see below). All constraints are -"critical", if an implementation does not recognise a constraint +Options must be lexically ordered by "name" if they appear in the +sequence. + +The name field identifies the option and the data field encodes +option-specific information (see below). All options are +"critical", if an implementation does not recognise a option then the validating party should refuse to accept the certificate. -The supported constraints and the contents and structure of their +The supported options and the contents and structure of their data fields are: Name Format Description @@ -157,37 +175,51 @@ force-command string Sp ssh command-line) whenever this key is used for authentication. +source-address string Comma-separated list of source addresses + from which this certificate is accepted + for authentication. Addresses are + specified in CIDR format (nn.nn.nn.nn/nn + or hhhh::hhhh/nn). + If this option is not present then + certificates may be presented from any + source address. + +Extensions +---------- + +The extensions section of the certificate specifies zero or more +non-critical certificate extensions. The encoding and ordering of +extensions in this field is identical to that of the critical options. +If an implementation does not recognise an extension, then it should +ignore it. + +The supported extensions and the contents and structure of their data +fields are: + +Name Format Description +----------------------------------------------------------------------------- permit-X11-forwarding empty Flag indicating that X11 forwarding should be permitted. X11 forwarding will - be refused if this constraint is absent. + be refused if this option is absent. permit-agent-forwarding empty Flag indicating that agent forwarding should be allowed. Agent forwarding must not be permitted unless this - constraint is present. + option is present. permit-port-forwarding empty Flag indicating that port-forwarding - should be allowed. If this constraint is + should be allowed. If this option is not present then no port forwarding will be allowed. permit-pty empty Flag indicating that PTY allocation should be permitted. In the absence of - this constraint PTY allocation will be + this option PTY allocation will be disabled. permit-user-rc empty Flag indicating that execution of ~/.ssh/rc should be permitted. Execution of this script will not be permitted if - this constraint is not present. - -source-address string Comma-separated list of source addresses - from which this certificate is accepted - for authentication. Addresses are - specified in CIDR format (nn.nn.nn.nn/nn - or hhhh::hhhh/nn). - If this constraint is not present then - certificates may be presented from any - source address. + this option is not present. -$OpenBSD: PROTOCOL.certkeys,v 1.3 2010/03/03 22:50:40 djm Exp $ +$OpenBSD: PROTOCOL.certkeys,v 1.7 2010/08/04 05:40:39 djm Exp $ Modified: head/crypto/openssh/PROTOCOL.mux ============================================================================== --- head/crypto/openssh/PROTOCOL.mux Thu Nov 11 11:41:52 2010 (r215115) +++ head/crypto/openssh/PROTOCOL.mux Thu Nov 11 11:46:19 2010 (r215116) @@ -109,8 +109,14 @@ A client may request the master to estab forwarding type may be MUX_FWD_LOCAL, MUX_FWD_REMOTE, MUX_FWD_DYNAMIC. -A server may reply with a MUX_S_OK, a MUX_S_PERMISSION_DENIED or a -MUX_S_FAILURE. +A server may reply with a MUX_S_OK, a MUX_S_REMOTE_PORT, a +MUX_S_PERMISSION_DENIED or a MUX_S_FAILURE. + +For dynamically allocated listen port the server replies with + + uint32 MUX_S_REMOTE_PORT + uint32 client request id + uint32 allocated remote listen port 5. Requesting closure of port forwards @@ -178,6 +184,7 @@ The MUX_S_PERMISSION_DENIED and MUX_S_FA #define MUX_S_EXIT_MESSAGE 0x80000004 #define MUX_S_ALIVE 0x80000005 #define MUX_S_SESSION_OPENED 0x80000006 +#define MUX_S_REMOTE_PORT 0x80000007 #define MUX_FWD_LOCAL 1 #define MUX_FWD_REMOTE 2 @@ -193,4 +200,4 @@ XXX server->client error/warning notific XXX port0 rfwd (need custom response message) XXX send signals via mux -$OpenBSD: PROTOCOL.mux,v 1.1 2010/01/26 01:28:35 djm Exp $ +$OpenBSD: PROTOCOL.mux,v 1.2 2010/05/16 12:55:51 markus Exp $ Modified: head/crypto/openssh/README ============================================================================== --- head/crypto/openssh/README Thu Nov 11 11:41:52 2010 (r215115) +++ head/crypto/openssh/README Thu Nov 11 11:46:19 2010 (r215116) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-5.5 for the release notes. +See http://www.openssh.com/txt/release-5.6 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.73 2010/03/21 19:11:55 djm Exp $ +$Id: README,v 1.74 2010/08/08 16:32:06 djm Exp $ Modified: head/crypto/openssh/auth-options.c ============================================================================== --- head/crypto/openssh/auth-options.c Thu Nov 11 11:41:52 2010 (r215115) +++ head/crypto/openssh/auth-options.c Thu Nov 11 11:46:19 2010 (r215116) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.49 2010/03/16 15:46:52 stevesk Exp $ */ +/* $OpenBSD: auth-options.c,v 1.52 2010/05/20 23:46:02 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -27,10 +27,10 @@ #include "canohost.h" #include "buffer.h" #include "channels.h" -#include "auth-options.h" #include "servconf.h" #include "misc.h" #include "key.h" +#include "auth-options.h" #include "hostfile.h" #include "auth.h" #ifdef GSSAPI @@ -55,6 +55,9 @@ struct envstring *custom_environment = N /* "tunnel=" option. */ int forced_tun_device = -1; +/* "principals=" option. */ +char *authorized_principals = NULL; + extern ServerOptions options; void @@ -76,6 +79,10 @@ auth_clear_options(void) xfree(forced_command); forced_command = NULL; } + if (authorized_principals) { + xfree(authorized_principals); + authorized_principals = NULL; + } forced_tun_device = -1; channel_clear_permitted_opens(); } @@ -141,6 +148,8 @@ auth_parse_options(struct passwd *pw, ch cp = "command=\""; if (strncasecmp(opts, cp, strlen(cp)) == 0) { opts += strlen(cp); + if (forced_command != NULL) + xfree(forced_command); forced_command = xmalloc(strlen(opts) + 1); i = 0; while (*opts) { @@ -167,6 +176,38 @@ auth_parse_options(struct passwd *pw, ch opts++; goto next_option; } + cp = "principals=\""; + if (strncasecmp(opts, cp, strlen(cp)) == 0) { + opts += strlen(cp); + if (authorized_principals != NULL) + xfree(authorized_principals); + authorized_principals = xmalloc(strlen(opts) + 1); + i = 0; + while (*opts) { + if (*opts == '"') + break; + if (*opts == '\\' && opts[1] == '"') { + opts += 2; + authorized_principals[i++] = '"'; + continue; + } + authorized_principals[i++] = *opts++; + } + if (!*opts) { + debug("%.100s, line %lu: missing end quote", + file, linenum); + auth_debug_add("%.100s, line %lu: missing end quote", + file, linenum); + xfree(authorized_principals); + authorized_principals = NULL; + goto bad_option; + } + authorized_principals[i] = '\0'; + auth_debug_add("principals: %.900s", + authorized_principals); + opts++; + goto next_option; + } cp = "environment=\""; if (options.permit_user_env && strncasecmp(opts, cp, strlen(cp)) == 0) { @@ -376,123 +417,147 @@ bad_option: return 0; } -/* - * Set options from certificate constraints. These supersede user key options - * so this must be called after auth_parse_options(). - */ -int -auth_cert_constraints(Buffer *c_orig, struct passwd *pw) +#define OPTIONS_CRITICAL 1 +#define OPTIONS_EXTENSIONS 2 +static int +parse_option_list(u_char *optblob, size_t optblob_len, struct passwd *pw, + u_int which, int crit, + int *cert_no_port_forwarding_flag, + int *cert_no_agent_forwarding_flag, + int *cert_no_x11_forwarding_flag, + int *cert_no_pty_flag, + int *cert_no_user_rc, + char **cert_forced_command, + int *cert_source_address_done) { + char *command, *allowed; + const char *remote_ip; u_char *name = NULL, *data_blob = NULL; u_int nlen, dlen, clen; Buffer c, data; - int ret = -1; - - int cert_no_port_forwarding_flag = 1; - int cert_no_agent_forwarding_flag = 1; - int cert_no_x11_forwarding_flag = 1; - int cert_no_pty_flag = 1; - int cert_no_user_rc = 1; - char *cert_forced_command = NULL; - int cert_source_address_done = 0; + int ret = -1, found; buffer_init(&data); /* Make copy to avoid altering original */ buffer_init(&c); - buffer_append(&c, buffer_ptr(c_orig), buffer_len(c_orig)); + buffer_append(&c, optblob, optblob_len); while (buffer_len(&c) > 0) { if ((name = buffer_get_string_ret(&c, &nlen)) == NULL || (data_blob = buffer_get_string_ret(&c, &dlen)) == NULL) { - error("Certificate constraints corrupt"); + error("Certificate options corrupt"); goto out; } buffer_append(&data, data_blob, dlen); - debug3("found certificate constraint \"%.100s\" len %u", + debug3("found certificate option \"%.100s\" len %u", name, dlen); if (strlen(name) != nlen) { error("Certificate constraint name contains \\0"); goto out; } - if (strcmp(name, "permit-X11-forwarding") == 0) - cert_no_x11_forwarding_flag = 0; - else if (strcmp(name, "permit-agent-forwarding") == 0) - cert_no_agent_forwarding_flag = 0; - else if (strcmp(name, "permit-port-forwarding") == 0) - cert_no_port_forwarding_flag = 0; - else if (strcmp(name, "permit-pty") == 0) - cert_no_pty_flag = 0; - else if (strcmp(name, "permit-user-rc") == 0) - cert_no_user_rc = 0; - else if (strcmp(name, "force-command") == 0) { - char *command = buffer_get_string_ret(&data, &clen); - - if (command == NULL) { - error("Certificate constraint \"%s\" corrupt", - name); - goto out; - } - if (strlen(command) != clen) { - error("force-command constraint contains \\0"); - goto out; - } - if (cert_forced_command != NULL) { - error("Certificate has multiple " - "force-command constraints"); - xfree(command); - goto out; - } - cert_forced_command = command; - } else if (strcmp(name, "source-address") == 0) { - char *allowed = buffer_get_string_ret(&data, &clen); - const char *remote_ip = get_remote_ipaddr(); - - if (allowed == NULL) { - error("Certificate constraint \"%s\" corrupt", - name); - goto out; - } - if (strlen(allowed) != clen) { - error("source-address constraint contains \\0"); - goto out; - } - if (cert_source_address_done++) { - error("Certificate has multiple " - "source-address constraints"); - xfree(allowed); - goto out; + found = 0; + if ((which & OPTIONS_EXTENSIONS) != 0) { + if (strcmp(name, "permit-X11-forwarding") == 0) { + *cert_no_x11_forwarding_flag = 0; + found = 1; + } else if (strcmp(name, + "permit-agent-forwarding") == 0) { + *cert_no_agent_forwarding_flag = 0; + found = 1; + } else if (strcmp(name, + "permit-port-forwarding") == 0) { + *cert_no_port_forwarding_flag = 0; + found = 1; + } else if (strcmp(name, "permit-pty") == 0) { + *cert_no_pty_flag = 0; + found = 1; + } else if (strcmp(name, "permit-user-rc") == 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 11:54:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEC48106566B; Thu, 11 Nov 2010 11:54:01 +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 832038FC2C; Thu, 11 Nov 2010 11:54:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABBs1He066497; Thu, 11 Nov 2010 11:54:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABBs1Yu066495; Thu, 11 Nov 2010 11:54:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011111154.oABBs1Yu066495@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 11 Nov 2010 11:54: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: r215117 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 11:54:01 -0000 Author: kib Date: Thu Nov 11 11:54:01 2010 New Revision: 215117 URL: http://svn.freebsd.org/changeset/base/215117 Log: The softdep_setup_freeblocks() adds worklist items before deallocate_dependencies() is done. This opens a race between softdep thread and the thread that does the truncation: A write of the indirect block causes the freeblks to become ALLCOMPLETE while softdep_setup_freeblocks() dropped softdep lock. And then, softdep_disk_write_complete() would reassign the workitem to the mount point worklist, causing premature processing of the workitem, or journal write exhaust the fb_jfreeblkhd and handle_written_jfreeblk does the same reassign. indir_trunc() then would find the indirect block that is locked (with lock owned by kernel) but without any dependencies, causing it to hang in getblk() waiting for buffer lock. Do not mark freeblks as DEPCOMPLETE until deallocate_dependencies() finished. Analyzed, suggested and reviewed by: jeff Tested by: pho Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:46:19 2010 (r215116) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Nov 11 11:54:01 2010 (r215117) @@ -5270,7 +5270,7 @@ softdep_setup_freeblocks(ip, length, fla if (delay) WORKLIST_INSERT(&bp->b_dep, &freeblks->fb_list); else if (needj) - freeblks->fb_state |= DEPCOMPLETE | COMPLETE; + freeblks->fb_state |= COMPLETE; /* * Because the file length has been truncated to zero, any * pending block allocation dependency structures associated @@ -5332,8 +5332,9 @@ restart: if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0) (void) free_inodedep(inodedep); - if (delay) { + if (delay || needj) freeblks->fb_state |= DEPCOMPLETE; + if (delay) { /* * If the inode with zeroed block pointers is now on disk * we can start freeing blocks. Add freeblks to the worklist @@ -5344,6 +5345,8 @@ restart: if ((freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE) add_to_worklist(&freeblks->fb_list, 1); } + if (needj && LIST_EMPTY(&freeblks->fb_jfreeblkhd)) + needj = 0; FREE_LOCK(&lk); /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 12:13:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 889C5106566B; Thu, 11 Nov 2010 12:13:41 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 772008FC1C; Thu, 11 Nov 2010 12:13:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABCDfsC066985; Thu, 11 Nov 2010 12:13:41 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABCDfXf066983; Thu, 11 Nov 2010 12:13:41 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201011111213.oABCDfXf066983@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 11 Nov 2010 12:13: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: r215118 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 12:13:41 -0000 Author: ae Date: Thu Nov 11 12:13:41 2010 New Revision: 215118 URL: http://svn.freebsd.org/changeset/base/215118 Log: Fix regression introduced in r215088: gpart(8) reports "arg0 'provider': Invalid argument" after creating new partition table. Move code for search of existing geom into g_part_find_geom function and use this function instead of g_part_parm_geom in g_part_ctl_create. Approved by: kib (mentor) Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Thu Nov 11 11:54:01 2010 (r215117) +++ head/sys/geom/part/g_part.c Thu Nov 11 12:13:41 2010 (r215118) @@ -296,6 +296,17 @@ g_part_new_provider(struct g_geom *gp, s g_error_provider(entry->gpe_pp, 0); } +static struct g_geom* +g_part_find_geom(const char *name) +{ + struct g_geom *gp; + LIST_FOREACH(gp, &g_part_class.geom, geom) { + if (!strcmp(name, gp->name)) + break; + } + return (gp); +} + static int g_part_parm_geom(struct gctl_req *req, const char *name, struct g_geom **v) { @@ -307,10 +318,7 @@ g_part_parm_geom(struct gctl_req *req, c return (ENOATTR); if (strncmp(gname, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) gname += sizeof(_PATH_DEV) - 1; - LIST_FOREACH(gp, &g_part_class.geom, geom) { - if (!strcmp(gname, gp->name)) - break; - } + gp = g_part_find_geom(gname); if (gp == NULL) { gctl_error(req, "%d %s '%s'", EINVAL, name, gname); return (EINVAL); @@ -748,8 +756,8 @@ g_part_ctl_create(struct gctl_req *req, g_topology_assert(); /* Check that there isn't already a g_part geom on the provider. */ - error = g_part_parm_geom(req, "arg0", &gp); - if (!error) { + gp = g_part_find_geom(pp->name); + if (gp != NULL) { null = gp->softc; if (null->gpt_scheme != &g_part_null_scheme) { gctl_error(req, "%d geom '%s'", EEXIST, pp->name); From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 13:35:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8814106564A; Thu, 11 Nov 2010 13:35:23 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D67DB8FC12; Thu, 11 Nov 2010 13:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABDZNta068854; Thu, 11 Nov 2010 13:35:23 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABDZNFr068849; Thu, 11 Nov 2010 13:35:23 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201011111335.oABDZNFr068849@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 11 Nov 2010 13:35: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: r215119 - in head/sys/powerpc: booke include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 13:35:24 -0000 Author: raj Date: Thu Nov 11 13:35:23 2010 New Revision: 215119 URL: http://svn.freebsd.org/changeset/base/215119 Log: Use local TLB_UNLOCKED marker instead of MTX_UNOWNED for Book-E PowerPC trap routines. This unbreaks Book-E build after the recent machine/mutex.h removal. While there move tlb_*lock() prototypes to machine/tlb.h. Submitted by: jhb Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/tlb.h Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/machdep.c Thu Nov 11 13:35:23 2010 (r215119) @@ -453,7 +453,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu ptr = &tlb0_miss_locks[cpuid * words_per_gran]; pcpu->pc_booke_tlb_lock = ptr; - *ptr = MTX_UNOWNED; + *ptr = TLB_UNLOCKED; *(ptr + 1) = 0; /* recurse counter */ #endif } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/pmap.c Thu Nov 11 13:35:23 2010 (r215119) @@ -162,8 +162,6 @@ unsigned int kernel_ptbls; /* Number of #define PMAP_REMOVE_DONE(pmap) \ ((pmap) != kernel_pmap && (pmap)->pm_stats.resident_count == 0) -extern void tlb_lock(uint32_t *); -extern void tlb_unlock(uint32_t *); extern void tid_flush(tlbtid_t); /**************************************************************************/ Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/trap_subr.S Thu Nov 11 13:35:23 2010 (r215119) @@ -330,7 +330,7 @@ lwz %r22, PC_BOOKE_TLB_LOCK(%r20); \ \ 1: lwarx %r23, 0, %r22; \ - cmpwi %r23, MTX_UNOWNED; \ + cmpwi %r23, TLB_UNLOCKED; \ beq 2f; \ \ /* check if this is recursion */ \ @@ -364,7 +364,7 @@ msync; \ \ /* release the lock */ \ - li %r23, MTX_UNOWNED; \ + li %r23, TLB_UNLOCKED; \ stw %r23, 0(%r22); \ 1: isync; \ msync @@ -860,7 +860,7 @@ ENTRY(tlb_lock) GET_CPUINFO(%r5) lwz %r5, PC_CURTHREAD(%r5) 1: lwarx %r4, 0, %r3 - cmpwi %r4, MTX_UNOWNED + cmpwi %r4, TLB_UNLOCKED bne 1b stwcx. %r5, 0, %r3 bne- 1b @@ -871,11 +871,12 @@ ENTRY(tlb_lock) ENTRY(tlb_unlock) isync msync - li %r4, MTX_UNOWNED + li %r4, TLB_UNLOCKED stw %r4, 0(%r3) isync msync blr + /* * TLB miss spin locks. For each CPU we have a reservation granule (32 bytes); * only a single word from this granule will actually be used as a spin lock Modified: head/sys/powerpc/include/tlb.h ============================================================================== --- head/sys/powerpc/include/tlb.h Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/include/tlb.h Thu Nov 11 13:35:23 2010 (r215119) @@ -129,6 +129,8 @@ #define TID_MAX 255 #define TID_NONE -1 +#define TLB_UNLOCKED 0 + #if !defined(LOCORE) typedef struct tlb_entry { uint32_t mas1; @@ -146,6 +148,9 @@ void tlb1_init(vm_offset_t); void tlb1_print_entries(void); void tlb1_print_tlbentries(void); +void tlb_lock(uint32_t *); +void tlb_unlock(uint32_t *); + #endif /* !LOCORE */ #endif /* _MACHINE_TLB_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 13:42:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 591501065670; Thu, 11 Nov 2010 13:42:47 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D69C8FC0A; Thu, 11 Nov 2010 13:42:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABDglsp069050; Thu, 11 Nov 2010 13:42:47 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABDglN3069048; Thu, 11 Nov 2010 13:42:47 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201011111342.oABDglN3069048@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 11 Nov 2010 13:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215120 - head/sys/dev/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 13:42:47 -0000 Author: raj Date: Thu Nov 11 13:42:46 2010 New Revision: 215120 URL: http://svn.freebsd.org/changeset/base/215120 Log: Return IEEE 1275 compliant error codes. Submitted by: nwhitehorn Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Thu Nov 11 13:35:23 2010 (r215119) +++ head/sys/dev/ofw/ofw_fdt.c Thu Nov 11 13:42:46 2010 (r215120) @@ -221,7 +221,7 @@ ofw_fdt_instance_to_package(ofw_t ofw, i */ offset = fdt_node_offset_by_phandle(fdtp, instance); if (offset < 0) - return (0); + return (-1); p = (phandle_t)fdt_offset_ptr(fdtp, offset, sizeof(phandle_t)); return (p); @@ -236,7 +236,7 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (strcmp(propname, "name") == 0) { /* Emulate the 'name' property */ @@ -244,7 +244,7 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t return (len + 1); } - len = 0; + len = -1; prop = fdt_get_property(fdtp, offset, propname, &len); return (len); @@ -261,7 +261,7 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (strcmp(propname, "name") == 0) { /* Emulate the 'name' property */ @@ -274,7 +274,7 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac prop = fdt_getprop(fdtp, offset, propname, &len); if (prop == NULL) - return (0); + return (-1); if (len > buflen) len = buflen; @@ -314,7 +314,7 @@ fdt_nextprop(int offset, char *buf, size depth = -1; } while (depth >= 0); - return (0); + return (-1); } /* @@ -330,7 +330,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (previous == NULL) /* Find the first prop in the node */ @@ -341,7 +341,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa */ prop = fdt_get_property(fdtp, offset, previous, NULL); if (prop == NULL) - return (0); + return (-1); offset = fdt_phandle_offset((phandle_t)prop); rv = fdt_nextprop(offset, buf, size); From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 13:46:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2EFC1065670; Thu, 11 Nov 2010 13:46:28 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D16B08FC1F; Thu, 11 Nov 2010 13:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABDkS9D069194; Thu, 11 Nov 2010 13:46:28 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABDkSTW069191; Thu, 11 Nov 2010 13:46:28 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201011111346.oABDkSTW069191@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 11 Nov 2010 13:46: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: r215121 - in head/sys/powerpc: aim booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 13:46:29 -0000 Author: raj Date: Thu Nov 11 13:46:28 2010 New Revision: 215121 URL: http://svn.freebsd.org/changeset/base/215121 Log: Fix typo in the comment. Modified: head/sys/powerpc/aim/clock.c head/sys/powerpc/booke/clock.c Modified: head/sys/powerpc/aim/clock.c ============================================================================== --- head/sys/powerpc/aim/clock.c Thu Nov 11 13:42:46 2010 (r215120) +++ head/sys/powerpc/aim/clock.c Thu Nov 11 13:46:28 2010 (r215121) @@ -105,7 +105,7 @@ static struct timecounter decr_tc = { }; /* - * Decrementor interrupt handler. + * Decrementer interrupt handler. */ void decr_intr(struct trapframe *frame) Modified: head/sys/powerpc/booke/clock.c ============================================================================== --- head/sys/powerpc/booke/clock.c Thu Nov 11 13:42:46 2010 (r215120) +++ head/sys/powerpc/booke/clock.c Thu Nov 11 13:46:28 2010 (r215121) @@ -108,7 +108,7 @@ static struct timecounter decr_timecount }; /* - * Decrementor interrupt handler. + * Decrementer interrupt handler. */ void decr_intr(struct trapframe *frame) From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 13:48:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC8511065670; Thu, 11 Nov 2010 13:48:48 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB3F68FC14; Thu, 11 Nov 2010 13:48:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABDmmDD069274; Thu, 11 Nov 2010 13:48:48 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABDmmwg069272; Thu, 11 Nov 2010 13:48:48 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201011111348.oABDmmwg069272@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 11 Nov 2010 13:48: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: r215122 - head/sys/boot/fdt/dts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 13:48:49 -0000 Author: raj Date: Thu Nov 11 13:48:48 2010 New Revision: 215122 URL: http://svn.freebsd.org/changeset/base/215122 Log: Correct RAM size of the MPC8555CDS board. Modified: head/sys/boot/fdt/dts/mpc8555cds.dts Modified: head/sys/boot/fdt/dts/mpc8555cds.dts ============================================================================== --- head/sys/boot/fdt/dts/mpc8555cds.dts Thu Nov 11 13:46:28 2010 (r215121) +++ head/sys/boot/fdt/dts/mpc8555cds.dts Thu Nov 11 13:48:48 2010 (r215122) @@ -97,7 +97,7 @@ memory { device_type = "memory"; - reg = <0x0 0x8000000>; // 128M at 0x0 + reg = <0x0 0x10000000>; // 256M at 0x0 }; localbus@e0005000 { From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 14:13:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59DE5106566B; Thu, 11 Nov 2010 14:13:57 +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 42E748FC1A; Thu, 11 Nov 2010 14:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABEDvUE069972; Thu, 11 Nov 2010 14:13:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABEDvvT069970; Thu, 11 Nov 2010 14:13:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011111413.oABEDvvT069970@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 11 Nov 2010 14:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215123 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 14:13:57 -0000 Author: nwhitehorn Date: Thu Nov 11 14:13:56 2010 New Revision: 215123 URL: http://svn.freebsd.org/changeset/base/215123 Log: MFC r198588: Turn off Altivec data-stream prefetching before going into power-save mode on those CPUs that need it. Modified: stable/8/sys/powerpc/aim/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Thu Nov 11 13:48:48 2010 (r215122) +++ stable/8/sys/powerpc/aim/machdep.c Thu Nov 11 14:13:56 2010 (r215123) @@ -614,8 +614,10 @@ void cpu_idle(int busy) { uint32_t msr; + uint16_t vers; msr = mfmsr(); + vers = mfpvr() >> 16; #ifdef INVARIANTS if ((msr & PSL_EE) != PSL_EE) { @@ -625,9 +627,25 @@ cpu_idle(int busy) } #endif if (powerpc_pow_enabled) { - powerpc_sync(); - mtmsr(msr | PSL_POW); - isync(); + switch (vers) { + case IBM970: + case IBM970FX: + case IBM970MP: + case MPC7447A: + case MPC7448: + case MPC7450: + case MPC7455: + case MPC7457: + __asm __volatile("\ + dssall; sync; mtmsr %0; isync" + :: "r"(msr | PSL_POW)); + break; + default: + powerpc_sync(); + mtmsr(msr | PSL_POW); + isync(); + break; + } } } From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 15:02:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16AE81065670; Thu, 11 Nov 2010 15:02:15 +0000 (UTC) (envelope-from ticso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 058798FC1E; Thu, 11 Nov 2010 15:02:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABF2EGd071853; Thu, 11 Nov 2010 15:02:14 GMT (envelope-from ticso@svn.freebsd.org) Received: (from ticso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABF2E7X071851; Thu, 11 Nov 2010 15:02:14 GMT (envelope-from ticso@svn.freebsd.org) Message-Id: <201011111502.oABF2E7X071851@svn.freebsd.org> From: Bernd Walter Date: Thu, 11 Nov 2010 15:02: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: r215124 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 15:02:15 -0000 Author: ticso Date: Thu Nov 11 15:02:14 2010 New Revision: 215124 URL: http://svn.freebsd.org/changeset/base/215124 Log: add hint for at45d flash device sitting of spibus0 Modified: head/sys/arm/conf/BWCT.hints Modified: head/sys/arm/conf/BWCT.hints ============================================================================== --- head/sys/arm/conf/BWCT.hints Thu Nov 11 14:13:56 2010 (r215123) +++ head/sys/arm/conf/BWCT.hints Thu Nov 11 15:02:14 2010 (r215124) @@ -7,3 +7,7 @@ hint.ds1672_rtc.0.addr=0xd0 # National Semiconductor LM75 temperature sensor sitting on the I2C bus hint.lm75.0.at="iicbus0" hint.lm75.0.addr=0x9e + +# Atmel SPIflash sitting on the spibus +hint.at45d.0.at="spibus0" +hint.at45d.0.addr=0x00 From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 15:13:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FA50106566C; Thu, 11 Nov 2010 15:13:12 +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 2B7F78FC14; Thu, 11 Nov 2010 15:13:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABFDCXn072222; Thu, 11 Nov 2010 15:13:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABFDCmN072216; Thu, 11 Nov 2010 15:13:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201011111513.oABFDCmN072216@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Nov 2010 15:13: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: r215125 - in head: contrib/compiler-rt contrib/compiler-rt/BlocksRuntime contrib/compiler-rt/BlocksRuntime/tests contrib/compiler-rt/cmake contrib/compiler-rt/lib contrib/compiler-rt/li... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 15:13:12 -0000 Author: ed Date: Thu Nov 11 15:13:11 2010 New Revision: 215125 URL: http://svn.freebsd.org/changeset/base/215125 Log: Import libcompiler_rt into HEAD and add Makefiles. Obtained from: user/ed/compiler-rt Added: head/contrib/compiler-rt/ - copied from r214849, vendor/compiler-rt/dist/ head/lib/libblocksruntime/ head/lib/libblocksruntime/Makefile (contents, props changed) head/lib/libblocksruntime/config.h (contents, props changed) head/lib/libcompiler_rt/ head/lib/libcompiler_rt/Makefile (contents, props changed) Deleted: head/contrib/compiler-rt/.gitignore head/contrib/compiler-rt/BlocksRuntime/CMakeLists.txt head/contrib/compiler-rt/BlocksRuntime/tests/ head/contrib/compiler-rt/CMakeLists.txt head/contrib/compiler-rt/Makefile head/contrib/compiler-rt/cmake/ head/contrib/compiler-rt/lib/CMakeLists.txt head/contrib/compiler-rt/lib/Makefile.mk head/contrib/compiler-rt/lib/arm/CMakeLists.txt head/contrib/compiler-rt/lib/arm/Makefile.mk head/contrib/compiler-rt/lib/i386/CMakeLists.txt head/contrib/compiler-rt/lib/i386/Makefile.mk head/contrib/compiler-rt/lib/ppc/CMakeLists.txt head/contrib/compiler-rt/lib/ppc/Makefile.mk head/contrib/compiler-rt/lib/sparc64/ head/contrib/compiler-rt/lib/x86_64/CMakeLists.txt head/contrib/compiler-rt/lib/x86_64/Makefile.mk head/contrib/compiler-rt/make/ head/contrib/compiler-rt/test/ head/contrib/compiler-rt/www/ Modified: head/contrib/compiler-rt/lib/clear_cache.c head/contrib/compiler-rt/lib/trampoline_setup.c Modified: head/contrib/compiler-rt/lib/clear_cache.c ============================================================================== --- vendor/compiler-rt/dist/lib/clear_cache.c Fri Nov 5 20:24:26 2010 (r214849) +++ head/contrib/compiler-rt/lib/clear_cache.c Thu Nov 11 15:13:11 2010 (r215125) @@ -8,6 +8,7 @@ * ===----------------------------------------------------------------------=== */ +#include "int_lib.h" #include #if __APPLE__ Modified: head/contrib/compiler-rt/lib/trampoline_setup.c ============================================================================== --- vendor/compiler-rt/dist/lib/trampoline_setup.c Fri Nov 5 20:24:26 2010 (r214849) +++ head/contrib/compiler-rt/lib/trampoline_setup.c Thu Nov 11 15:13:11 2010 (r215125) @@ -23,7 +23,7 @@ extern void __clear_cache(void* start, v * and then jumps to the target nested function. */ -#if __ppc__ +#if __ppc__ && !defined(__powerpc64__) void __trampoline_setup(uint32_t* trampOnStack, int trampSizeAllocated, const void* realFunc, void* localsPtr) { Added: head/lib/libblocksruntime/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libblocksruntime/Makefile Thu Nov 11 15:13:11 2010 (r215125) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +LIB= BlocksRuntime +SHLIB_MAJOR=0 +CFLAGS+=-I${.CURDIR} +WARNS?= 2 + +.PATH: ${.CURDIR}/../../contrib/compiler-rt/BlocksRuntime + +INCS= Block.h Block_private.h +SRCS= data.c runtime.c + +.include Added: head/lib/libblocksruntime/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libblocksruntime/config.h Thu Nov 11 15:13:11 2010 (r215125) @@ -0,0 +1,14 @@ +/* $FreeBSD$ */ + +/* #undef HAVE_SYS_BYTEORDER_H */ +/* #undef HAVE_AVAILABILITY_MACROS_H */ +/* #undef HAVE_TARGET_CONDITIONALS_H */ +/* #undef HAVE_LIBKERN_OSATOMIC_H */ + +#define HAVE_SYSCONF 1 + +/* #undef HAVE_OSATOMIC_COMPARE_AND_SWAP_INT */ +/* #undef HAVE_OSATOMIC_COMPARE_AND_SWAP_LONG */ + +#define HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT 1 +#define HAVE_SYNC_BOOL_COMPARE_AND_SWAP_LONG 1 Added: head/lib/libcompiler_rt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcompiler_rt/Makefile Thu Nov 11 15:13:11 2010 (r215125) @@ -0,0 +1,157 @@ +# $FreeBSD$ + +.include + +LIB= compiler_rt +NO_PIC= +WARNS?= 2 + +CFLAGS+=${PICFLAG} + +.if ${MACHINE_CPUARCH} == "amd64" +CRTARCH=x86_64 +.else +CRTARCH=${MACHINE_CPUARCH} +.endif + +CRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib + +.PATH: ${CRTSRC}/${CRTARCH} ${CRTSRC} + +SRCF= absvdi2 \ + absvsi2 \ + absvti2 \ + addvdi3 \ + addvsi3 \ + addvti3 \ + ashldi3 \ + ashlti3 \ + ashrdi3 \ + ashrti3 \ + clear_cache \ + clzdi2 \ + clzsi2 \ + clzti2 \ + cmpdi2 \ + cmpti2 \ + comparedf2 \ + comparesf2 \ + ctzdi2 \ + ctzsi2 \ + ctzti2 \ + divdc3 \ + divdi3 \ + divsc3 \ + divti3 \ + divxc3 \ + enable_execute_stack \ + eprintf \ + ffsdi2 \ + ffsti2 \ + fixdfdi \ + fixdfti \ + fixsfdi \ + fixsfti \ + fixunsdfdi \ + fixunsdfsi \ + fixunsdfti \ + fixunssfdi \ + fixunssfsi \ + fixunssfti \ + fixunsxfdi \ + fixunsxfsi \ + fixunsxfti \ + fixxfdi \ + fixxfti \ + floatdidf \ + floatdisf \ + floatdixf \ + floattidf \ + floattisf \ + floattixf \ + floatundidf \ + floatundisf \ + floatundixf \ + floatunsidf \ + floatunsisf \ + floatuntidf \ + floatuntisf \ + floatuntixf \ + lshrdi3 \ + lshrti3 \ + moddi3 \ + modti3 \ + muldc3 \ + muldi3 \ + mulsc3 \ + multi3 \ + mulvdi3 \ + mulvsi3 \ + mulvti3 \ + mulxc3 \ + negdf2 \ + negdi2 \ + negsf2 \ + negti2 \ + negvdi2 \ + negvsi2 \ + negvti2 \ + paritydi2 \ + paritysi2 \ + parityti2 \ + popcountdi2 \ + popcountsi2 \ + popcountti2 \ + powidf2 \ + powisf2 \ + powitf2 \ + powixf2 \ + subvdi3 \ + subvsi3 \ + subvti3 \ + trampoline_setup \ + ucmpdi2 \ + ucmpti2 \ + udivdi3 \ + udivmoddi4 \ + udivmodti4 \ + udivti3 \ + umoddi3 \ + umodti3 + +# These are already shipped by libc.a on arm and mips +.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" +SRCF+= adddf3 \ + addsf3 \ + divdf3 \ + divsf3 \ + divsi3 \ + extendsfdf2 \ + fixdfsi \ + fixsfsi \ + floatsidf \ + floatsisf \ + modsi3 \ + muldf3 \ + mulsf3 \ + truncdfsf2 \ + udivsi3 \ + umodsi3 +.endif + +.for file in ${SRCF} +. if ${MACHINE_CPUARCH} != "arm" && exists(${CRTSRC}/${CRTARCH}/${file}.S) +SRCS+= ${file}.S +. else +SRCS+= ${file}.c +. endif +.endfor + +.if ${MK_INSTALLLIB} != "no" +SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a +.endif +.if ${MK_PROFILE} != "no" +SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a +.endif + +.include From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 15:24:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB701065674; Thu, 11 Nov 2010 15:24:57 +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 9AB918FC1C; Thu, 11 Nov 2010 15:24:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABFOvd5072894; Thu, 11 Nov 2010 15:24:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABFOvPL072892; Thu, 11 Nov 2010 15:24:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201011111524.oABFOvPL072892@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Nov 2010 15:24: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: r215126 - head/gnu/lib/libgcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 15:24:57 -0000 Author: ed Date: Thu Nov 11 15:24:57 2010 New Revision: 215126 URL: http://svn.freebsd.org/changeset/base/215126 Log: Don't use ${LIB} to obtain the library name. Once we use libcompiler_rt, the LIB-line must go, to prevent libgcc.a from being built. Therefore, just hardcode the name. Obtained from: user/ed/compiler-rt Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Thu Nov 11 15:13:11 2010 (r215125) +++ head/gnu/lib/libgcc/Makefile Thu Nov 11 15:24:57 2010 (r215126) @@ -334,21 +334,21 @@ CLEANFILES += libgcc.map # # Build additional static libgcc_eh[_p].a libraries. # -lib${LIB}_eh.a: ${EH_OBJS_T} - @${ECHO} building static ${LIB}_eh library +libgcc_eh.a: ${EH_OBJS_T} + @${ECHO} building static gcc_eh library @rm -f ${.TARGET} @${AR} cq ${.TARGET} `lorder ${EH_OBJS_T} | tsort -q` ${RANLIB} ${.TARGET} -all: lib${LIB}_eh.a +all: libgcc_eh.a .if ${MK_PROFILE} != "no" -lib${LIB}_eh_p.a: ${EH_OBJS_P} - @${ECHO} building profiled ${LIB}_eh library +libgcc_eh_p.a: ${EH_OBJS_P} + @${ECHO} building profiled gcc_eh library @rm -f ${.TARGET} @${AR} cq ${.TARGET} `lorder ${EH_OBJS_P} | tsort -q` ${RANLIB} ${.TARGET} -all: lib${LIB}_eh_p.a +all: libgcc_eh_p.a .endif _libinstall: _lib-eh-install @@ -356,14 +356,14 @@ _libinstall: _lib-eh-install _lib-eh-install: .if ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}_eh.a ${DESTDIR}${LIBDIR} + ${_INSTALLFLAGS} libgcc_eh.a ${DESTDIR}${LIBDIR} .endif .if ${MK_PROFILE} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}_eh_p.a ${DESTDIR}${LIBDIR} + ${_INSTALLFLAGS} libgcc_eh_p.a ${DESTDIR}${LIBDIR} .endif -CLEANFILES+= lib${LIB}_eh.a lib${LIB}_eh_p.a ${EH_OBJS_T} ${EH_OBJS_P} +CLEANFILES+= libgcc_eh.a libgcc_eh_p.a ${EH_OBJS_T} ${EH_OBJS_P} .include From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 15:48:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A56C4106564A; Thu, 11 Nov 2010 15:48:27 +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 79AD78FC13; Thu, 11 Nov 2010 15:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABFmREN074011; Thu, 11 Nov 2010 15:48:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABFmRPU074006; Thu, 11 Nov 2010 15:48:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201011111548.oABFmRPU074006@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Nov 2010 15:48: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: r215127 - in head: . gnu/lib/libgcc lib sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 15:48:27 -0000 Author: ed Date: Thu Nov 11 15:48:27 2010 New Revision: 215127 URL: http://svn.freebsd.org/changeset/base/215127 Log: Replace libgcc.a by libcompiler_rt.a. libcompiler_rt.a is a BSD licensed C language runtime, which implements many routines which are linked into binaries on architectures where certain functionality is missing (e.g. 64 bits mul/div on i386). Unfortunately, libcompiler_rt cannot replace libgcc entirely. Certain features, such as an unwinder for exception handling, are missing. That's why only libgcc.a is replaced for now, because this one does seem to be complete. Tested by: rene (amd64), nwhitehorn (powerpc), droso (i386 exprun) and many others. Thanks! Obtained from: user/ed/compiler-rt Modified: head/Makefile.inc1 head/gnu/lib/libgcc/Makefile head/lib/Makefile head/sys/sys/param.h Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 11 15:24:57 2010 (r215126) +++ head/Makefile.inc1 Thu Nov 11 15:48:27 2010 (r215127) @@ -1123,7 +1123,7 @@ libraries: # # static libgcc.a prerequisite for shared libc # -_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc +_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt # These dependencies are not automatically generated: # @@ -1139,6 +1139,7 @@ _startup_libs+= lib/csu/${MACHINE_ARCH} _startup_libs+= lib/csu/${MACHINE_CPUARCH} .endif _startup_libs+= gnu/lib/libgcc +_startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libc gnu/lib/libgcc__L: lib/libc__L Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Thu Nov 11 15:24:57 2010 (r215126) +++ head/gnu/lib/libgcc/Makefile Thu Nov 11 15:48:27 2010 (r215127) @@ -3,7 +3,6 @@ GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs -LIB= gcc SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Nov 11 15:24:57 2010 (r215126) +++ head/lib/Makefile Thu Nov 11 15:48:27 2010 (r215127) @@ -34,6 +34,7 @@ SUBDIR_ORDERED= ${_csu} \ libbsm \ libauditd \ libcom_err \ + libcompiler_rt \ libcrypt \ libelf \ libkvm \ @@ -53,6 +54,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libarchive \ ${_libatm} \ libbegemot \ + libblocksruntime \ ${_libbluetooth} \ ${_libbsnmp} \ libbz2 \ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Nov 11 15:24:57 2010 (r215126) +++ head/sys/sys/param.h Thu Nov 11 15:48:27 2010 (r215127) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900023 /* Master, propagated to newvers */ +#define __FreeBSD_version 900024 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 16:06:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 404301065679; Thu, 11 Nov 2010 16:06:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0E38FC15; Thu, 11 Nov 2010 16:06:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABG6m0Y074486; Thu, 11 Nov 2010 16:06:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABG6mvt074482; Thu, 11 Nov 2010 16:06:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011111606.oABG6mvt074482@svn.freebsd.org> From: John Baldwin Date: Thu, 11 Nov 2010 16:06: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: r215128 - in head/sys/sun4v: include sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 16:06:48 -0000 Author: jhb Date: Thu Nov 11 16:06:47 2010 New Revision: 215128 URL: http://svn.freebsd.org/changeset/base/215128 Log: Fix a few more places to use cpumask_t rather than 'u_int'. These are just cosmetic. Modified: head/sys/sun4v/include/pmap.h head/sys/sun4v/include/smp.h head/sys/sun4v/sun4v/mp_machdep.c Modified: head/sys/sun4v/include/pmap.h ============================================================================== --- head/sys/sun4v/include/pmap.h Thu Nov 11 15:48:27 2010 (r215127) +++ head/sys/sun4v/include/pmap.h Thu Nov 11 16:06:47 2010 (r215128) @@ -54,7 +54,6 @@ #define TSB_MAX_RESIZE (20 - TSB_INIT_SHIFT - PAGE_SHIFT) typedef struct pmap *pmap_t; -typedef uint32_t pmap_cpumask_t; struct pv_entry; struct tte_hash; @@ -77,8 +76,8 @@ struct pmap { struct hv_tsb_info pm_tsb; uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ u_int pm_retries; - pmap_cpumask_t pm_active; /* mask of cpus currently using pmap */ - pmap_cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ + cpumask_t pm_active; /* mask of cpus currently using pmap */ + cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ struct pmap_statistics pm_stats; uint32_t pm_tsb_miss_count; uint32_t pm_tsb_cap_miss_count; Modified: head/sys/sun4v/include/smp.h ============================================================================== --- head/sys/sun4v/include/smp.h Thu Nov 11 15:48:27 2010 (r215127) +++ head/sys/sun4v/include/smp.h Thu Nov 11 16:06:47 2010 (r215128) @@ -75,7 +75,7 @@ struct pcpu; void cpu_mp_bootstrap(struct pcpu *pc); void cpu_mp_shutdown(void); -void cpu_ipi_selected(int cpus, uint16_t *cpulist, u_long d0, u_long d1, u_long d2, uint64_t *ackmask); +void cpu_ipi_selected(int cpu_count, uint16_t *cpulist, u_long d0, u_long d1, u_long d2, uint64_t *ackmask); void cpu_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); void cpu_ipi_ast(struct trapframe *tf); @@ -85,7 +85,7 @@ void cpu_ipi_hardclock(struct trapframe void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); -void ipi_selected(u_int cpus, u_int ipi); +void ipi_selected(cpumask_t cpus, u_int ipi); vm_offset_t mp_tramp_alloc(void); void mp_set_tsb_desc_ra(vm_paddr_t); @@ -149,7 +149,7 @@ static __inline void * ipi_tlb_context_demap(struct pmap *pm) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -168,7 +168,7 @@ static __inline void * ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -187,7 +187,7 @@ static __inline void * ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -206,7 +206,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ static __inline void ipi_wait(void *cookie) { - volatile u_int *mask; + volatile cpumask_t *mask; if ((mask = cookie) != NULL) { atomic_clear_int(mask, PCPU_GET(cpumask)); Modified: head/sys/sun4v/sun4v/mp_machdep.c ============================================================================== --- head/sys/sun4v/sun4v/mp_machdep.c Thu Nov 11 15:48:27 2010 (r215127) +++ head/sys/sun4v/sun4v/mp_machdep.c Thu Nov 11 16:06:47 2010 (r215128) @@ -539,7 +539,7 @@ retry: } void -ipi_selected(u_int icpus, u_int ipi) +ipi_selected(cpumask_t icpus, u_int ipi) { int i, cpu_count; uint16_t *cpulist; From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 16:53:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEA5F1065672; Thu, 11 Nov 2010 16:53:25 +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 9D76E8FC12; Thu, 11 Nov 2010 16:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABGrPRD075920; Thu, 11 Nov 2010 16:53:25 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABGrPc8075917; Thu, 11 Nov 2010 16:53:25 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201011111653.oABGrPc8075917@svn.freebsd.org> From: Ed Schouten Date: Thu, 11 Nov 2010 16: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: r215129 - in head: contrib/compiler-rt/lib lib/libcompiler_rt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 16:53:25 -0000 Author: ed Date: Thu Nov 11 16:53:25 2010 New Revision: 215129 URL: http://svn.freebsd.org/changeset/base/215129 Log: Set symbol visibility to hidden. Not doing so may cause all sorts of random libraries to expose libcompiler_rt's functions, which should of course not be done. Discussed with: kan, kib Modified: head/contrib/compiler-rt/lib/assembly.h head/lib/libcompiler_rt/Makefile Modified: head/contrib/compiler-rt/lib/assembly.h ============================================================================== --- head/contrib/compiler-rt/lib/assembly.h Thu Nov 11 16:06:47 2010 (r215128) +++ head/contrib/compiler-rt/lib/assembly.h Thu Nov 11 16:53:25 2010 (r215129) @@ -33,7 +33,7 @@ #ifdef VISIBILITY_HIDDEN #define DEFINE_COMPILERRT_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ - .private_extern SYMBOL_NAME(name) SEPARATOR \ + .hidden SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #else #define DEFINE_COMPILERRT_FUNCTION(name) \ @@ -43,12 +43,12 @@ #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ - .private_extern SYMBOL_NAME(name) SEPARATOR \ + .hidden SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \ .globl name SEPARATOR \ - .private_extern name SEPARATOR \ + .hidden name SEPARATOR \ name: #endif /* COMPILERRT_ASSEMBLY_H */ Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Thu Nov 11 16:06:47 2010 (r215128) +++ head/lib/libcompiler_rt/Makefile Thu Nov 11 16:53:25 2010 (r215129) @@ -6,7 +6,7 @@ LIB= compiler_rt NO_PIC= WARNS?= 2 -CFLAGS+=${PICFLAG} +CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN .if ${MACHINE_CPUARCH} == "amd64" CRTARCH=x86_64 From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 17:30:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A779106566C; Thu, 11 Nov 2010 17:30:50 +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 29FED8FC1A; Thu, 11 Nov 2010 17:30:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABHUokk078515; Thu, 11 Nov 2010 17:30:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABHUoS7078513; Thu, 11 Nov 2010 17:30:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011111730.oABHUoS7078513@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Nov 2010 17:30: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: r215131 - head/sys/x86/cpufreq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 17:30:50 -0000 Author: avg Date: Thu Nov 11 17:30:49 2010 New Revision: 215131 URL: http://svn.freebsd.org/changeset/base/215131 Log: make it possible to actually enable hwpstate_verbose Either via the tunable or the sysctl. MFC after: 3 days Modified: head/sys/x86/cpufreq/hwpstate.c Modified: head/sys/x86/cpufreq/hwpstate.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate.c Thu Nov 11 17:08:34 2010 (r215130) +++ head/sys/x86/cpufreq/hwpstate.c Thu Nov 11 17:30:49 2010 (r215131) @@ -118,8 +118,9 @@ static int hwpstate_get_info_from_msr(de static int hwpstate_goto_pstate(device_t dev, int pstate_id); static int hwpstate_verbose = 0; -SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RDTUN, +SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RW | CTLFLAG_TUN, &hwpstate_verbose, 0, "Debug hwpstate"); +TUNABLE_INT("debug.hwpstate_verbose", &hwpstate_verbose); static device_method_t hwpstate_methods[] = { /* Device interface */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 18:08:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9991B1065670; Thu, 11 Nov 2010 18:08:50 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87D638FC08; Thu, 11 Nov 2010 18:08:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABI8o98079574; Thu, 11 Nov 2010 18:08:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABI8olX079570; Thu, 11 Nov 2010 18:08:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011111808.oABI8olX079570@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 11 Nov 2010 18:08: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: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 18:08:50 -0000 Author: yongari Date: Thu Nov 11 18:08:50 2010 New Revision: 215132 URL: http://svn.freebsd.org/changeset/base/215132 Log: Add basic WOL support for MCP ethernet controllers. It seems the controller does not perform automatic switching from 1000Mbps link to 10/100Mbps link when WOL is activated. Implement establishing 10/100Mps link with auto-negotiation in driver. Link status change handler was modified to remove taskqueue based approach since driver now needs synchronous handling for link establishment. Submitted by: Yamagi Burmeister (lists <> yamagi.org ) (initial version) Tested by: Yamagi Burmeister (lists <> yamagi.org ) MFC after: 1 week Modified: head/sys/dev/nfe/if_nfe.c head/sys/dev/nfe/if_nfereg.h head/sys/dev/nfe/if_nfevar.h Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Thu Nov 11 17:30:49 2010 (r215131) +++ head/sys/dev/nfe/if_nfe.c Thu Nov 11 18:08:50 2010 (r215132) @@ -81,7 +81,7 @@ static void nfe_power(struct nfe_softc * static int nfe_miibus_readreg(device_t, int, int); static int nfe_miibus_writereg(device_t, int, int, int); static void nfe_miibus_statchg(device_t); -static void nfe_link_task(void *, int); +static void nfe_mac_config(struct nfe_softc *, struct mii_data *); static void nfe_set_intr(struct nfe_softc *); static __inline void nfe_enable_intr(struct nfe_softc *); static __inline void nfe_disable_intr(struct nfe_softc *); @@ -125,6 +125,8 @@ static int sysctl_hw_nfe_proc_limit(SYSC static void nfe_sysctl_node(struct nfe_softc *); static void nfe_stats_clear(struct nfe_softc *); static void nfe_stats_update(struct nfe_softc *); +static void nfe_set_linkspeed(struct nfe_softc *); +static void nfe_set_wol(struct nfe_softc *); #ifdef NFE_DEBUG static int nfedebug = 0; @@ -348,7 +350,6 @@ nfe_attach(device_t dev) mtx_init(&sc->nfe_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->nfe_stat_ch, &sc->nfe_mtx, 0); - TASK_INIT(&sc->nfe_link_task, 0, nfe_link_task, sc); pci_enable_busmaster(dev); @@ -586,6 +587,9 @@ nfe_attach(device_t dev) if ((ifp->if_capabilities & IFCAP_HWCSUM) != 0) ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } + + if (pci_find_extcap(dev, PCIY_PMG, ®) == 0) + ifp->if_capabilities |= IFCAP_WOL_MAGIC; ifp->if_capenable = ifp->if_capabilities; /* @@ -666,7 +670,6 @@ nfe_detach(device_t dev) NFE_UNLOCK(sc); callout_drain(&sc->nfe_stat_ch); taskqueue_drain(taskqueue_fast, &sc->nfe_tx_task); - taskqueue_drain(taskqueue_swi, &sc->nfe_link_task); ether_ifdetach(ifp); } @@ -752,6 +755,7 @@ nfe_suspend(device_t dev) NFE_LOCK(sc); nfe_stop(sc->nfe_ifp); + nfe_set_wol(sc); sc->nfe_suspended = 1; NFE_UNLOCK(sc); @@ -768,6 +772,7 @@ nfe_resume(device_t dev) sc = device_get_softc(dev); NFE_LOCK(sc); + nfe_power(sc); ifp = sc->nfe_ifp; if (ifp->if_flags & IFF_UP) nfe_init_locked(sc); @@ -806,37 +811,55 @@ static void nfe_miibus_statchg(device_t dev) { struct nfe_softc *sc; - - sc = device_get_softc(dev); - taskqueue_enqueue(taskqueue_swi, &sc->nfe_link_task); -} - - -static void -nfe_link_task(void *arg, int pending) -{ - struct nfe_softc *sc; struct mii_data *mii; struct ifnet *ifp; - uint32_t phy, seed, misc = NFE_MISC1_MAGIC, link = NFE_MEDIA_SET; - uint32_t gmask, rxctl, txctl, val; + uint32_t rxctl, txctl; - sc = (struct nfe_softc *)arg; + sc = device_get_softc(dev); NFE_LOCK(sc); mii = device_get_softc(sc->nfe_miibus); ifp = sc->nfe_ifp; - if (mii == NULL || ifp == NULL) { - NFE_UNLOCK(sc); - return; - } - if (mii->mii_media_status & IFM_ACTIVE) { - if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) + sc->nfe_link = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_1000_T: sc->nfe_link = 1; - } else - sc->nfe_link = 0; + break; + default: + break; + } + } + + nfe_mac_config(sc, mii); + txctl = NFE_READ(sc, NFE_TX_CTL); + rxctl = NFE_READ(sc, NFE_RX_CTL); + if (sc->nfe_link != 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + txctl |= NFE_TX_START; + rxctl |= NFE_RX_START; + } else { + txctl &= ~NFE_TX_START; + rxctl &= ~NFE_RX_START; + } + NFE_WRITE(sc, NFE_TX_CTL, txctl); + NFE_WRITE(sc, NFE_RX_CTL, rxctl); + + NFE_UNLOCK(sc); +} + + +static void +nfe_mac_config(struct nfe_softc *sc, struct mii_data *mii) +{ + uint32_t link, misc, phy, seed; + uint32_t val; + + NFE_LOCK_ASSERT(sc); phy = NFE_READ(sc, NFE_PHY_IFACE); phy &= ~(NFE_PHY_HDX | NFE_PHY_100TX | NFE_PHY_1000T); @@ -844,7 +867,10 @@ nfe_link_task(void *arg, int pending) seed = NFE_READ(sc, NFE_RNDSEED); seed &= ~NFE_SEED_MASK; - if (((mii->mii_media_active & IFM_GMASK) & IFM_FDX) == 0) { + misc = NFE_MISC1_MAGIC; + link = NFE_MEDIA_SET; + + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) == 0) { phy |= NFE_PHY_HDX; /* half-duplex */ misc |= NFE_MISC1_HDX; } @@ -881,18 +907,18 @@ nfe_link_task(void *arg, int pending) NFE_WRITE(sc, NFE_MISC1, misc); NFE_WRITE(sc, NFE_LINKSPEED, link); - gmask = mii->mii_media_active & IFM_GMASK; - if ((gmask & IFM_FDX) != 0) { + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { /* It seems all hardwares supports Rx pause frames. */ val = NFE_READ(sc, NFE_RXFILTER); - if ((gmask & IFM_FLAG0) != 0) + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) != 0) val |= NFE_PFF_RX_PAUSE; else val &= ~NFE_PFF_RX_PAUSE; NFE_WRITE(sc, NFE_RXFILTER, val); if ((sc->nfe_flags & NFE_TX_FLOW_CTRL) != 0) { val = NFE_READ(sc, NFE_MISC1); - if ((gmask & IFM_FLAG1) != 0) { + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_FLAG1) != 0) { NFE_WRITE(sc, NFE_TX_PAUSE_FRAME, NFE_TX_PAUSE_FRAME_ENABLE); val |= NFE_MISC1_TX_PAUSE; @@ -916,20 +942,6 @@ nfe_link_task(void *arg, int pending) NFE_WRITE(sc, NFE_MISC1, val); } } - - txctl = NFE_READ(sc, NFE_TX_CTL); - rxctl = NFE_READ(sc, NFE_RX_CTL); - if (sc->nfe_link != 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - txctl |= NFE_TX_START; - rxctl |= NFE_RX_START; - } else { - txctl &= ~NFE_TX_START; - rxctl &= ~NFE_RX_START; - } - NFE_WRITE(sc, NFE_TX_CTL, txctl); - NFE_WRITE(sc, NFE_RX_CTL, rxctl); - - NFE_UNLOCK(sc); } @@ -1714,6 +1726,10 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, } } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + if ((sc->nfe_flags & NFE_HW_CSUM) != 0 && (mask & IFCAP_HWCSUM) != 0) { ifp->if_capenable ^= IFCAP_HWCSUM; @@ -2746,7 +2762,8 @@ nfe_init_locked(void *xsc) NFE_WRITE(sc, NFE_STATUS, sc->mii_phyaddr << 24 | NFE_STATUS_MAGIC); NFE_WRITE(sc, NFE_SETUP_R4, NFE_R4_MAGIC); - NFE_WRITE(sc, NFE_WOL_CTL, NFE_WOL_MAGIC); + /* Disable WOL. */ + NFE_WRITE(sc, NFE_WOL_CTL, 0); sc->rxtxctl &= ~NFE_RXTX_BIT2; NFE_WRITE(sc, NFE_RXTX_CTL, sc->rxtxctl); @@ -2917,18 +2934,8 @@ nfe_tick(void *xsc) static int nfe_shutdown(device_t dev) { - struct nfe_softc *sc; - struct ifnet *ifp; - - sc = device_get_softc(dev); - NFE_LOCK(sc); - ifp = sc->nfe_ifp; - nfe_stop(ifp); - /* nfe_reset(sc); */ - NFE_UNLOCK(sc); - - return (0); + return (nfe_suspend(dev)); } @@ -3212,3 +3219,115 @@ nfe_stats_update(struct nfe_softc *sc) stats->rx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); } } + + +static void +nfe_set_linkspeed(struct nfe_softc *sc) +{ + struct mii_softc *miisc; + struct mii_data *mii; + int aneg, i, phyno; + + NFE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->nfe_miibus); + mii_pollstat(mii); + aneg = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch IFM_SUBTYPE(mii->mii_media_active) { + case IFM_10_T: + case IFM_100_TX: + return; + case IFM_1000_T: + aneg++; + break; + default: + break; + } + } + phyno = 0; + if (mii->mii_instance) { + miisc = LIST_FIRST(&mii->mii_phys); + phyno = miisc->mii_phy; + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + } else + return; + nfe_miibus_writereg(sc->nfe_dev, phyno, MII_100T2CR, 0); + nfe_miibus_writereg(sc->nfe_dev, phyno, + MII_ANAR, ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA); + nfe_miibus_writereg(sc->nfe_dev, phyno, + MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); + DELAY(1000); + if (aneg != 0) { + /* + * Poll link state until nfe(4) get a 10/100Mbps link. + */ + for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { + mii_pollstat(mii); + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) + == (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + nfe_mac_config(sc, mii); + return; + default: + break; + } + } + NFE_UNLOCK(sc); + pause("nfelnk", hz); + NFE_LOCK(sc); + } + if (i == MII_ANEGTICKS_GIGE) + device_printf(sc->nfe_dev, + "establishing a link failed, WOL may not work!"); + } + /* + * No link, force MAC to have 100Mbps, full-duplex link. + * This is the last resort and may/may not work. + */ + mii->mii_media_status = IFM_AVALID | IFM_ACTIVE; + mii->mii_media_active = IFM_ETHER | IFM_100_TX | IFM_FDX; + nfe_mac_config(sc, mii); +} + + +static void +nfe_set_wol(struct nfe_softc *sc) +{ + struct ifnet *ifp; + uint32_t wolctl; + int pmc; + uint16_t pmstat; + + NFE_LOCK_ASSERT(sc); + + if (pci_find_extcap(sc->nfe_dev, PCIY_PMG, &pmc) != 0) + return; + ifp = sc->nfe_ifp; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + wolctl = NFE_WOL_MAGIC; + else + wolctl = 0; + NFE_WRITE(sc, NFE_WOL_CTL, wolctl); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) { + nfe_set_linkspeed(sc); + if ((sc->nfe_flags & NFE_PWR_MGMT) != 0) + NFE_WRITE(sc, NFE_PWR2_CTL, + NFE_READ(sc, NFE_PWR2_CTL) & ~NFE_PWR2_GATE_CLOCKS); + /* Enable RX. */ + NFE_WRITE(sc, NFE_RX_RING_ADDR_HI, 0); + NFE_WRITE(sc, NFE_RX_RING_ADDR_LO, 0); + NFE_WRITE(sc, NFE_RX_CTL, NFE_READ(sc, NFE_RX_CTL) | + NFE_RX_START); + } + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->nfe_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->nfe_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} Modified: head/sys/dev/nfe/if_nfereg.h ============================================================================== --- head/sys/dev/nfe/if_nfereg.h Thu Nov 11 17:30:49 2010 (r215131) +++ head/sys/dev/nfe/if_nfereg.h Thu Nov 11 18:08:50 2010 (r215132) @@ -190,6 +190,7 @@ #define NFE_PWR2_WAKEUP_MASK 0x0f11 #define NFE_PWR2_REVA3 (1 << 0) +#define NFE_PWR2_GATE_CLOCKS 0x0f00 #define NFE_MEDIA_SET 0x10000 #define NFE_MEDIA_1000T 0x00032 Modified: head/sys/dev/nfe/if_nfevar.h ============================================================================== --- head/sys/dev/nfe/if_nfevar.h Thu Nov 11 17:30:49 2010 (r215131) +++ head/sys/dev/nfe/if_nfevar.h Thu Nov 11 18:08:50 2010 (r215132) @@ -140,7 +140,6 @@ struct nfe_softc { struct taskqueue *nfe_tq; struct task nfe_int_task; struct task nfe_tx_task; - struct task nfe_link_task; int nfe_link; int nfe_suspended; int nfe_framesize; From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 18:35:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C5E51065695; Thu, 11 Nov 2010 18:35:29 +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 EE15B8FC0C; Thu, 11 Nov 2010 18:35:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABIZSdf080435; Thu, 11 Nov 2010 18:35:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABIZSEq080431; Thu, 11 Nov 2010 18:35:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011111835.oABIZSEq080431@svn.freebsd.org> From: Andriy Gapon Date: Thu, 11 Nov 2010 18:35: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: r215133 - in head: lib/libkvm sys/amd64/amd64 sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 18:35:29 -0000 Author: avg Date: Thu Nov 11 18:35:28 2010 New Revision: 215133 URL: http://svn.freebsd.org/changeset/base/215133 Log: amd64: introduce minidump version 2 After KVA space was increased to 512GB on amd64 it became impractical to use PTEs as entries in the minidump map of dumped pages, because size of that map alone would already be 1GB. Instead, we now use PDEs as page map entries and employ two stage lookup in libkvm: virtual address -> PDE -> PTE -> physical address. PTEs are now dumped as regular pages. Fixed page map size now is 2MB. libkvm keeps support for accessing amd64 minidumps of version 1. Support for 1GB pages is added. Many thanks to Alan Cox for his guidance, numerous reviews, suggestions, enhancments and corrections. Reviewed by: alc [kernel part] MFC after: 15 days Modified: head/lib/libkvm/kvm_minidump_amd64.c head/sys/amd64/amd64/minidump_machdep.c head/sys/amd64/include/minidump.h Modified: head/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- head/lib/libkvm/kvm_minidump_amd64.c Thu Nov 11 18:08:50 2010 (r215132) +++ head/lib/libkvm/kvm_minidump_amd64.c Thu Nov 11 18:35:28 2010 (r215133) @@ -67,7 +67,7 @@ struct vmstate { struct minidumphdr hdr; void *hpt_head[HPT_SIZE]; uint64_t *bitmap; - uint64_t *ptemap; + uint64_t *page_map; }; static void @@ -127,8 +127,8 @@ _kvm_minidump_freevtop(kvm_t *kd) if (vm->bitmap) free(vm->bitmap); - if (vm->ptemap) - free(vm->ptemap); + if (vm->page_map) + free(vm->page_map); free(vm); kd->vmst = NULL; } @@ -156,7 +156,12 @@ _kvm_minidump_initvtop(kvm_t *kd) _kvm_err(kd, kd->program, "not a minidump for this platform"); return (-1); } - if (vmst->hdr.version != MINIDUMP_VERSION) { + + /* + * NB: amd64 minidump header is binary compatible between version 1 + * and version 2; this may not be the case for the future versions. + */ + if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) { _kvm_err(kd, kd->program, "wrong minidump version. expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); return (-1); @@ -177,17 +182,17 @@ _kvm_minidump_initvtop(kvm_t *kd) } off += round_page(vmst->hdr.bitmapsize); - vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); - if (vmst->ptemap == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for ptemap", vmst->hdr.ptesize); + vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize); + if (vmst->page_map == NULL) { + _kvm_err(kd, kd->program, "cannot allocate %d bytes for page_map", vmst->hdr.pmapsize); return (-1); } - if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - vmst->hdr.ptesize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); + if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) != + vmst->hdr.pmapsize) { + _kvm_err(kd, kd->program, "cannot read %d bytes for page_map", vmst->hdr.pmapsize); return (-1); } - off += vmst->hdr.ptesize; + off += vmst->hdr.pmapsize; /* build physical address hash table for sparse pages */ inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off); @@ -196,7 +201,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } static int -_kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa) +_kvm_minidump_vatop_v1(kvm_t *kd, u_long va, off_t *pa) { struct vmstate *vm; u_long offset; @@ -211,7 +216,7 @@ _kvm_minidump_vatop(kvm_t *kd, u_long va if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT; - pte = vm->ptemap[pteindex]; + pte = vm->page_map[pteindex]; if (((u_long)pte & PG_V) == 0) { _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid"); goto invalid; @@ -243,6 +248,78 @@ invalid: return (0); } +static int +_kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa) +{ + pt_entry_t pt[NPTEPG]; + struct vmstate *vm; + u_long offset; + pd_entry_t pde; + pd_entry_t pte; + u_long pteindex; + u_long pdeindex; + int i; + u_long a; + off_t ofs; + + vm = kd->vmst; + offset = va & PAGE_MASK; + + if (va >= vm->hdr.kernbase) { + pdeindex = (va - vm->hdr.kernbase) >> PDRSHIFT; + pde = vm->page_map[pdeindex]; + if (((u_long)pde & PG_V) == 0) { + _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid"); + goto invalid; + } + if ((pde & PG_PS) == 0) { + a = pde & PG_FRAME; + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: pt physical address 0x%lx not in minidump", a); + goto invalid; + } + if (pread(kd->pmfd, &pt, PAGE_SIZE, ofs) != PAGE_SIZE) { + _kvm_err(kd, kd->program, "cannot read %d bytes for pt", PAGE_SIZE); + return (-1); + } + pteindex = (va >> PAGE_SHIFT) & ((1ul << NPTEPGSHIFT) - 1); + pte = pt[pteindex]; + if (((u_long)pte & PG_V) == 0) { + _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid"); + goto invalid; + } + a = pte & PG_FRAME; + } else { + a = pde & PG_PS_FRAME; + a += (va & PDRMASK) ^ offset; + } + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: physical address 0x%lx not in minidump", a); + goto invalid; + } + *pa = ofs + offset; + return (PAGE_SIZE - offset); + } else if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { + a = (va - vm->hdr.dmapbase) & ~PAGE_MASK; + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: direct map address 0x%lx not in minidump", va); + goto invalid; + } + *pa = ofs + offset; + return (PAGE_SIZE - offset); + } else { + _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx not minidumped", va); + goto invalid; + } + +invalid: + _kvm_err(kd, 0, "invalid address (0x%lx)", va); + return (0); +} + int _kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa) { @@ -251,5 +328,8 @@ _kvm_minidump_kvatop(kvm_t *kd, u_long v _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); return (0); } - return (_kvm_minidump_vatop(kd, va, pa)); + if (((struct vmstate *)kd->vmst)->hdr.version == 1) + return (_kvm_minidump_vatop_v1(kd, va, pa)); + else + return (_kvm_minidump_vatop(kd, va, pa)); } Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Thu Nov 11 18:08:50 2010 (r215132) +++ head/sys/amd64/amd64/minidump_machdep.c Thu Nov 11 18:35:28 2010 (r215133) @@ -167,63 +167,91 @@ blk_write(struct dumperinfo *di, char *p } /* A fake page table page, to avoid having to handle both 4K and 2M pages */ -static pt_entry_t fakept[NPTEPG]; +static pd_entry_t fakepd[NPDEPG]; void minidumpsys(struct dumperinfo *di) { uint64_t dumpsize; - uint32_t ptesize; + uint32_t pmapsize; vm_offset_t va; int error; uint64_t bits; uint64_t *pdp, *pd, *pt, pa; - int i, j, k, bit; + int i, j, k, n, bit; + int retry_count; struct minidumphdr mdhdr; + retry_count = 0; + retry: + retry_count++; counter = 0; /* Walk page table pages, set bits in vm_page_dump */ - ptesize = 0; + pmapsize = 0; pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys); for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR, - kernel_vm_end); va += NBPDR) { - i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); + kernel_vm_end); ) { /* * We always write a page, even if it is zero. Each - * page written corresponds to 2MB of space + * page written corresponds to 1GB of space */ - ptesize += PAGE_SIZE; - if ((pdp[i] & PG_V) == 0) + pmapsize += PAGE_SIZE; + i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); + if ((pdp[i] & PG_V) == 0) { + va += NBPDP; continue; - pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME); - j = ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1)); - if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - /* This is an entire 2M page. */ - pa = pd[j] & PG_PS_FRAME; - for (k = 0; k < NPTEPG; k++) { + } + + /* + * 1GB page is represented as 512 2MB pages in a dump. + */ + if ((pdp[i] & PG_PS) != 0) { + va += NBPDP; + pa = pdp[i] & PG_PS_FRAME; + for (n = 0; n < NPDEPG * NPTEPG; n++) { if (is_dumpable(pa)) dump_add_page(pa); pa += PAGE_SIZE; } continue; } - if ((pd[j] & PG_V) == PG_V) { - /* set bit for each valid page in this 2MB block */ - pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME); - for (k = 0; k < NPTEPG; k++) { - if ((pt[k] & PG_V) == PG_V) { - pa = pt[k] & PG_FRAME; + + pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME); + for (n = 0; n < NPDEPG; n++, va += NBPDR) { + j = (va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1); + + if ((pd[j] & PG_V) == 0) + continue; + + if ((pd[j] & PG_PS) != 0) { + /* This is an entire 2M page. */ + pa = pd[j] & PG_PS_FRAME; + for (k = 0; k < NPTEPG; k++) { if (is_dumpable(pa)) dump_add_page(pa); + pa += PAGE_SIZE; } + continue; + } + + pa = pd[j] & PG_FRAME; + /* set bit for this PTE page */ + if (is_dumpable(pa)) + dump_add_page(pa); + /* and for each valid page in this 2MB block */ + pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME); + for (k = 0; k < NPTEPG; k++) { + if ((pt[k] & PG_V) == 0) + continue; + pa = pt[k] & PG_FRAME; + if (is_dumpable(pa)) + dump_add_page(pa); } - } else { - /* nothing, we're going to dump a null page */ } } /* Calculate dump size. */ - dumpsize = ptesize; + dumpsize = pmapsize; dumpsize += round_page(msgbufp->msg_size); dumpsize += round_page(vm_page_dump_size); for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { @@ -244,7 +272,7 @@ minidumpsys(struct dumperinfo *di) /* Determine dump offset on device. */ if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; + error = E2BIG; goto fail; } dumplo = di->mediaoffset + di->mediasize - dumpsize; @@ -257,7 +285,7 @@ minidumpsys(struct dumperinfo *di) mdhdr.version = MINIDUMP_VERSION; mdhdr.msgbufsize = msgbufp->msg_size; mdhdr.bitmapsize = vm_page_dump_size; - mdhdr.ptesize = ptesize; + mdhdr.pmapsize = pmapsize; mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS; mdhdr.dmapbase = DMAP_MIN_ADDRESS; mdhdr.dmapend = DMAP_MAX_ADDRESS; @@ -274,9 +302,9 @@ minidumpsys(struct dumperinfo *di) dumplo += sizeof(kdh); /* Dump my header */ - bzero(&fakept, sizeof(fakept)); - bcopy(&mdhdr, &fakept, sizeof(mdhdr)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + bzero(&fakepd, sizeof(fakepd)); + bcopy(&mdhdr, &fakepd, sizeof(mdhdr)); + error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE); if (error) goto fail; @@ -290,55 +318,49 @@ minidumpsys(struct dumperinfo *di) if (error) goto fail; - /* Dump kernel page table pages */ + /* Dump kernel page directory pages */ + bzero(fakepd, sizeof(fakepd)); pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys); for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR, - kernel_vm_end); va += NBPDR) { + kernel_vm_end); va += NBPDP) { i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); + /* We always write a page, even if it is zero */ if ((pdp[i] & PG_V) == 0) { - bzero(fakept, sizeof(fakept)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE); if (error) goto fail; - /* flush, in case we reuse fakept in the same block */ + /* flush, in case we reuse fakepd in the same block */ error = blk_flush(di); if (error) goto fail; continue; } - pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME); - j = ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1)); - if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - /* This is a single 2M block. Generate a fake PTP */ - pa = pd[j] & PG_PS_FRAME; - for (k = 0; k < NPTEPG; k++) { - fakept[k] = (pa + (k * PAGE_SIZE)) | PG_V | PG_RW | PG_A | PG_M; - } - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + + /* 1GB page is represented as 512 2MB pages in a dump */ + if ((pdp[i] & PG_PS) != 0) { + /* PDPE and PDP have identical layout in this case */ + fakepd[0] = pdp[i]; + for (j = 1; j < NPDEPG; j++) + fakepd[j] = fakepd[j - 1] + NBPDR; + error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE); if (error) goto fail; - /* flush, in case we reuse fakept in the same block */ + /* flush, in case we reuse fakepd in the same block */ error = blk_flush(di); if (error) goto fail; + bzero(fakepd, sizeof(fakepd)); continue; } - if ((pd[j] & PG_V) == PG_V) { - pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME); - error = blk_write(di, (char *)pt, 0, PAGE_SIZE); - if (error) - goto fail; - } else { - bzero(fakept, sizeof(fakept)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); - if (error) - goto fail; - /* flush, in case we reuse fakept in the same block */ - error = blk_flush(di); - if (error) - goto fail; - } + + pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME); + error = blk_write(di, (char *)pd, 0, PAGE_SIZE); + if (error) + goto fail; + error = blk_flush(di); + if (error) + goto fail; } /* Dump memory chunks */ @@ -374,12 +396,21 @@ minidumpsys(struct dumperinfo *di) if (error < 0) error = -error; - if (error == ECANCELED) - printf("\nDump aborted\n"); - else if (error == ENOSPC) - printf("\nDump failed. Partition too small.\n"); + printf("\n"); + if (error == ENOSPC) { + printf("Dump map grown while dumping. "); + if (retry_count < 5) { + printf("Retrying...\n"); + goto retry; + } + printf("Dump failed.\n"); + } + else if (error == ECANCELED) + printf("Dump aborted\n"); + else if (error == E2BIG) + printf("Dump failed. Partition too small.\n"); else - printf("\n** DUMP FAILED (ERROR %d) **\n", error); + printf("** DUMP FAILED (ERROR %d) **\n", error); } void Modified: head/sys/amd64/include/minidump.h ============================================================================== --- head/sys/amd64/include/minidump.h Thu Nov 11 18:08:50 2010 (r215132) +++ head/sys/amd64/include/minidump.h Thu Nov 11 18:35:28 2010 (r215133) @@ -30,14 +30,14 @@ #define _MACHINE_MINIDUMP_H_ 1 #define MINIDUMP_MAGIC "minidump FreeBSD/amd64" -#define MINIDUMP_VERSION 1 +#define MINIDUMP_VERSION 2 struct minidumphdr { char magic[24]; uint32_t version; uint32_t msgbufsize; uint32_t bitmapsize; - uint32_t ptesize; + uint32_t pmapsize; uint64_t kernbase; uint64_t dmapbase; uint64_t dmapend; From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 18:41:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21374106564A; Thu, 11 Nov 2010 18:41:04 +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 10DA88FC16; Thu, 11 Nov 2010 18:41:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABIf33K080590; Thu, 11 Nov 2010 18:41:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABIf32X080588; Thu, 11 Nov 2010 18:41:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011111841.oABIf32X080588@svn.freebsd.org> From: Michael Tuexen Date: Thu, 11 Nov 2010 18:41: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: r215134 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 18:41:04 -0000 Author: tuexen Date: Thu Nov 11 18:41:03 2010 New Revision: 215134 URL: http://svn.freebsd.org/changeset/base/215134 Log: Fix the SACK/NR-SACK generation code. MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Nov 11 18:35:28 2010 (r215133) +++ head/sys/netinet/sctp_output.c Thu Nov 11 18:41:03 2010 (r215134) @@ -10118,19 +10118,18 @@ sctp_send_sack(struct sctp_tcb *stcb) } } - if (((type == SCTP_SELECTIVE_ACK) && - (((asoc->mapping_array[0] | asoc->nr_mapping_array[0]) & 0x01) == 0x00)) || - ((type == SCTP_NR_SELECTIVE_ACK) && - ((asoc->mapping_array[0] & 0x01) == 0x00))) { - sel_start = 0; - } else { - sel_start = 1; - } if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { offset = 1; } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } + if ((offset == 1) || + ((type == SCTP_NR_SELECTIVE_ACK) && + ((asoc->mapping_array[0] & (1 << (1 - offset))) == 0))) { + sel_start = 0; + } else { + sel_start = 1; + } if (((type == SCTP_SELECTIVE_ACK) && compare_with_wrap(highest_tsn, asoc->cumulative_tsn, MAX_TSN)) || ((type == SCTP_NR_SELECTIVE_ACK) && @@ -10200,7 +10199,7 @@ sctp_send_sack(struct sctp_tcb *stcb) siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + asoc->highest_tsn_inside_nr_map + 7) / 8; } - if ((asoc->nr_mapping_array[0] & 0x01) == 0x00) { + if ((asoc->nr_mapping_array[0] & (1 << (1 - offset))) == 0) { sel_start = 0; } else { sel_start = 1; From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 18:43:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E043E106566B; Thu, 11 Nov 2010 18:43:31 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFAE48FC08; Thu, 11 Nov 2010 18:43:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABIhVih080690; Thu, 11 Nov 2010 18:43:31 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABIhV9d080688; Thu, 11 Nov 2010 18:43:31 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011111843.oABIhV9d080688@svn.freebsd.org> From: Bernhard Schmidt Date: Thu, 11 Nov 2010 18:43: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: r215135 - head/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 18:43:32 -0000 Author: bschmidt Date: Thu Nov 11 18:43:31 2010 New Revision: 215135 URL: http://svn.freebsd.org/changeset/base/215135 Log: According to specs for MmAllocateContiguousMemorySpecifyCache() physically contiguous memory with requested restrictions must be allocated. Submitted by: Paul B Mahol Modified: head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Thu Nov 11 18:41:03 2010 (r215134) +++ head/sys/compat/ndis/subr_ntoskrnl.c Thu Nov 11 18:43:31 2010 (r215135) @@ -2426,12 +2426,9 @@ MmAllocateContiguousMemorySpecifyCache(s uint64_t boundary; uint32_t cachetype; { - void *addr; - size_t pagelength = roundup(size, PAGE_SIZE); - addr = ExAllocatePoolWithTag(NonPagedPool, pagelength, 0); - - return (addr); + return (contigmalloc(size, M_DEVBUF, M_ZERO|M_NOWAIT, lowest, + highest, PAGE_SIZE, boundary)); } static void @@ -2447,7 +2444,7 @@ MmFreeContiguousMemorySpecifyCache(base, uint32_t size; uint32_t cachetype; { - ExFreePool(base); + contigfree(base, size, M_DEVBUF); } static uint32_t From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 18:52:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C518B106566C; Thu, 11 Nov 2010 18:52:37 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id 2F3928FC1D; Thu, 11 Nov 2010 18:52:36 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 037CAE3F07C; Thu, 11 Nov 2010 19:34:15 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vW33uNxJCKza; Thu, 11 Nov 2010 19:34:12 +0100 (CET) Received: from pluto.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 89255E3F079; Thu, 11 Nov 2010 19:34:11 +0100 (CET) Date: Thu, 11 Nov 2010 19:34:09 +0100 From: Joel Dahl To: Pyun YongHyeon Message-ID: <20101111183409.GA1011@pluto.vnode.local> References: <201011111808.oABI8olX079570@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011111808.oABI8olX079570@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: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 18:52:37 -0000 On 11-11-2010 18:08, Pyun YongHyeon wrote: > Author: yongari > Date: Thu Nov 11 18:08:50 2010 > New Revision: 215132 > URL: http://svn.freebsd.org/changeset/base/215132 > > Log: > Add basic WOL support for MCP ethernet controllers. It seems the > controller does not perform automatic switching from 1000Mbps link > to 10/100Mbps link when WOL is activated. Implement establishing > 10/100Mps link with auto-negotiation in driver. Link status change > handler was modified to remove taskqueue based approach since driver > now needs synchronous handling for link establishment. Somewhat unrelated but this commit reminds me of something: why do we still keep the nve driver? I thought nfe was written as a replacement years ago? -- Joel From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:13:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D93B106564A; Thu, 11 Nov 2010 19:13:16 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533B38FC0A; Thu, 11 Nov 2010 19:13:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABJDGoa081491; Thu, 11 Nov 2010 19:13:16 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABJDGsm081489; Thu, 11 Nov 2010 19:13:16 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011111913.oABJDGsm081489@svn.freebsd.org> From: Bruce Cran Date: Thu, 11 Nov 2010 19: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: r215136 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:13:16 -0000 Author: brucec Date: Thu Nov 11 19:13:16 2010 New Revision: 215136 URL: http://svn.freebsd.org/changeset/base/215136 Log: Bump .Dd due to additions in r214279. MFC after: 3 days Modified: head/share/man/man4/ada.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Thu Nov 11 18:43:31 2010 (r215135) +++ head/share/man/man4/ada.4 Thu Nov 11 19:13:16 2010 (r215136) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 19, 2009 +.Dd October 24, 2010 .Dt ADA 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:18:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 592911065694; Thu, 11 Nov 2010 19:18:00 +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 4937E8FC1C; Thu, 11 Nov 2010 19:18:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABJI0MW081626; Thu, 11 Nov 2010 19:18:00 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABJI0g2081623; Thu, 11 Nov 2010 19:18:00 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011111918.oABJI0g2081623@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Nov 2010 19:18: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: r215137 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:18:00 -0000 Author: dim Date: Thu Nov 11 19:17:59 2010 New Revision: 215137 URL: http://svn.freebsd.org/changeset/base/215137 Log: Revert r103230, which depended on ld preserving the __start_xxx and __stop_xxx symbols for custom sections, even when these were not referenced (at link time). This behaviour was changed again in binutils commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221. This time, put the __GLOBL macro definition in cdefs.h, so it can be reused in a few other places where it will be needed. Reviewed by: kib Modified: head/sys/sys/cdefs.h head/sys/sys/linker_set.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Thu Nov 11 19:13:16 2010 (r215136) +++ head/sys/sys/cdefs.h Thu Nov 11 19:17:59 2010 (r215137) @@ -401,6 +401,9 @@ #endif /* __STDC__ */ #endif /* __GNUC__ || __INTEL_COMPILER */ +#define __GLOBL1(sym) __asm__(".globl " #sym) +#define __GLOBL(sym) __GLOBL1(sym) + #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") #else Modified: head/sys/sys/linker_set.h ============================================================================== --- head/sys/sys/linker_set.h Thu Nov 11 19:13:16 2010 (r215136) +++ head/sys/sys/linker_set.h Thu Nov 11 19:17:59 2010 (r215137) @@ -45,6 +45,8 @@ */ #ifdef __GNUCLIKE___SECTION #define __MAKE_SET(set, sym) \ + __GLOBL(__CONCAT(__start_set_,set)); \ + __GLOBL(__CONCAT(__stop_set_,set)); \ static void const * const __set_##set##_sym_##sym \ __section("set_" #set) __used = &sym #else /* !__GNUCLIKE___SECTION */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:18:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A7701065674; Thu, 11 Nov 2010 19:18:52 +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 5A5948FC1C; Thu, 11 Nov 2010 19:18:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABJIqHv081684; Thu, 11 Nov 2010 19:18:52 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABJIqvH081681; Thu, 11 Nov 2010 19:18:52 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011111918.oABJIqvH081681@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Nov 2010 19:18: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: r215138 - in head/sys: net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:18:52 -0000 Author: dim Date: Thu Nov 11 19:18:52 2010 New Revision: 215138 URL: http://svn.freebsd.org/changeset/base/215138 Log: Use the same treatment as in linker_set.h for the __start and __stop symbols of the set_vnet and set_pcpu sections, so those symbols will always be emitted in kernel modules, if they use vnet.h or pcpu.h. Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and associated macros invisible to userland, to prevent it picking up these symbols. Reviewed by: kib Modified: head/sys/net/vnet.h head/sys/sys/pcpu.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Thu Nov 11 19:17:59 2010 (r215137) +++ head/sys/net/vnet.h Thu Nov 11 19:18:52 2010 (r215138) @@ -95,7 +95,9 @@ struct vnet { * Location of the kernel's 'set_vnet' linker set. */ extern uintptr_t *__start_set_vnet; +__GLOBL(__start_set_vnet); extern uintptr_t *__stop_set_vnet; +__GLOBL(__stop_set_vnet); #define VNET_START (uintptr_t)&__start_set_vnet #define VNET_STOP (uintptr_t)&__stop_set_vnet Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Thu Nov 11 19:17:59 2010 (r215137) +++ head/sys/sys/pcpu.h Thu Nov 11 19:18:52 2010 (r215138) @@ -42,11 +42,15 @@ #include #include +#ifdef _KERNEL + /* * Define a set for pcpu data. */ extern uintptr_t *__start_set_pcpu; +__GLOBL(__start_set_pcpu); extern uintptr_t *__stop_set_pcpu; +__GLOBL(__stop_set_pcpu); /* * Array of dynamic pcpu base offsets. Indexed by id. @@ -127,6 +131,8 @@ extern uintptr_t dpcpu_off[]; } \ } while(0) +#endif /* _KERNEL */ + /* * XXXUPS remove as soon as we have per cpu variable * linker sets and can define rm_queue in _rm_lock.h From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:20:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 943411065674; Thu, 11 Nov 2010 19:20:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 841348FC22; Thu, 11 Nov 2010 19:20:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABJKXCY081757; Thu, 11 Nov 2010 19:20:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABJKXCQ081755; Thu, 11 Nov 2010 19:20:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011111920.oABJKXCQ081755@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 11 Nov 2010 19:20: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: r215139 - head/sys/i386/bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:20:33 -0000 Author: jkim Date: Thu Nov 11 19:20:33 2010 New Revision: 215139 URL: http://svn.freebsd.org/changeset/base/215139 Log: Add compat shim for apm(4) to translate APM BIOS function numbers from i386 to PC98-specific ones. Any binaries using apm ioctl(4) commands but built for i386 should also work on PC98 now. Reviewed by: imp, nyan Modified: head/sys/i386/bios/apm.c Modified: head/sys/i386/bios/apm.c ============================================================================== --- head/sys/i386/bios/apm.c Thu Nov 11 19:18:52 2010 (r215138) +++ head/sys/i386/bios/apm.c Thu Nov 11 19:20:33 2010 (r215139) @@ -1389,6 +1389,23 @@ apmioctl(struct cdev *dev, u_long cmd, c return (EPERM); /* XXX compatibility with the old interface */ args = (struct apm_bios_arg *)addr; +#ifdef PC98 + if (((args->eax >> 8) & 0xff) == 0x53) { + sc->bios.r.eax = args->eax & ~0xffff; + sc->bios.r.eax |= APM_BIOS << 8; + switch (args->eax & 0xff) { + case 0x0a: + sc->bios.r.eax |= APM_GETPWSTATUS; + break; + case 0x0e: + sc->bios.r.eax |= APM_DRVVERSION; + break; + default: + sc->bios.r.eax |= args->eax & 0xff; + break; + } + } else +#endif sc->bios.r.eax = args->eax; sc->bios.r.ebx = args->ebx; sc->bios.r.ecx = args->ecx; From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:29:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2811E1065673; Thu, 11 Nov 2010 19:29:06 +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 C248C8FC0C; Thu, 11 Nov 2010 19:29:04 +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 VAA17466; Thu, 11 Nov 2010 21:29:03 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4CDC43FE.6060401@freebsd.org> Date: Thu, 11 Nov 2010 21:29:02 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Dimitry Andric References: <201011111918.oABJIqvH081681@svn.freebsd.org> In-Reply-To: <201011111918.oABJIqvH081681@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215138 - in head/sys: net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:29:06 -0000 on 11/11/2010 21:18 Dimitry Andric said the following: > Author: dim > Date: Thu Nov 11 19:18:52 2010 > New Revision: 215138 > URL: http://svn.freebsd.org/changeset/base/215138 > > Log: > Use the same treatment as in linker_set.h for the __start and __stop > symbols of the set_vnet and set_pcpu sections, so those symbols will > always be emitted in kernel modules, if they use vnet.h or pcpu.h. Do I understand it correctly that set_pcpu section itself would not be produced if DPCPU_DEFINE() is not actually used? > Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and > associated macros invisible to userland, to prevent it picking up these > symbols. > > Reviewed by: kib > > Modified: > head/sys/net/vnet.h > head/sys/sys/pcpu.h > > Modified: head/sys/net/vnet.h > ============================================================================== > --- head/sys/net/vnet.h Thu Nov 11 19:17:59 2010 (r215137) > +++ head/sys/net/vnet.h Thu Nov 11 19:18:52 2010 (r215138) > @@ -95,7 +95,9 @@ struct vnet { > * Location of the kernel's 'set_vnet' linker set. > */ > extern uintptr_t *__start_set_vnet; > +__GLOBL(__start_set_vnet); > extern uintptr_t *__stop_set_vnet; > +__GLOBL(__stop_set_vnet); > > #define VNET_START (uintptr_t)&__start_set_vnet > #define VNET_STOP (uintptr_t)&__stop_set_vnet > > Modified: head/sys/sys/pcpu.h > ============================================================================== > --- head/sys/sys/pcpu.h Thu Nov 11 19:17:59 2010 (r215137) > +++ head/sys/sys/pcpu.h Thu Nov 11 19:18:52 2010 (r215138) > @@ -42,11 +42,15 @@ > #include > #include > > +#ifdef _KERNEL > + > /* > * Define a set for pcpu data. > */ > extern uintptr_t *__start_set_pcpu; > +__GLOBL(__start_set_pcpu); > extern uintptr_t *__stop_set_pcpu; > +__GLOBL(__stop_set_pcpu); > > /* > * Array of dynamic pcpu base offsets. Indexed by id. > @@ -127,6 +131,8 @@ extern uintptr_t dpcpu_off[]; > } \ > } while(0) > > +#endif /* _KERNEL */ > + > /* > * XXXUPS remove as soon as we have per cpu variable > * linker sets and can define rm_queue in _rm_lock.h -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:36:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C43D21065694; Thu, 11 Nov 2010 19:36:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B25E98FC08; Thu, 11 Nov 2010 19:36:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABJaLB0082214; Thu, 11 Nov 2010 19:36:21 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABJaLQ3082209; Thu, 11 Nov 2010 19:36:21 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011111936.oABJaLQ3082209@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 11 Nov 2010 19:36: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: r215140 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:36:21 -0000 Author: jkim Date: Thu Nov 11 19:36:21 2010 New Revision: 215140 URL: http://svn.freebsd.org/changeset/base/215140 Log: Move identical copies of apm_bios.h to sys/x86/include, replace them with stubs, and adjust PC98 stub accordingly. Reviewed by: imp, nyan Added: head/sys/x86/include/apm_bios.h - copied, changed from r215098, head/sys/i386/include/apm_bios.h Modified: head/sys/amd64/include/apm_bios.h head/sys/i386/include/apm_bios.h head/sys/pc98/include/apm_bios.h Modified: head/sys/amd64/include/apm_bios.h ============================================================================== --- head/sys/amd64/include/apm_bios.h Thu Nov 11 19:20:33 2010 (r215139) +++ head/sys/amd64/include/apm_bios.h Thu Nov 11 19:36:21 2010 (r215140) @@ -1,264 +1,6 @@ /*- - * APM (Advanced Power Management) BIOS Device Driver - * - * Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi - * - * This software may be used, modified, copied, and distributed, in - * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its - * use. - * - * Aug, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_APM_BIOS_H_ -#define _MACHINE_APM_BIOS_H_ - -#ifndef _KERNEL -#include -#endif -#include - -/* BIOS id */ -#define APM_BIOS 0x53 -#define APM_INT 0x15 - -/* APM flags */ -#define APM_16BIT_SUPPORT 0x01 -#define APM_32BIT_SUPPORT 0x02 -#define APM_CPUIDLE_SLOW 0x04 -#define APM_DISABLED 0x08 -#define APM_DISENGAGED 0x10 - -/* APM initializer physical address */ -#define APM_OURADDR 0x00080000 - -/* APM functions */ -#define APM_INSTCHECK 0x00 -#define APM_REALCONNECT 0x01 -#define APM_PROT16CONNECT 0x02 -#define APM_PROT32CONNECT 0x03 -#define APM_DISCONNECT 0x04 -#define APM_CPUIDLE 0x05 -#define APM_CPUBUSY 0x06 -#define APM_SETPWSTATE 0x07 -#define APM_ENABLEDISABLEPM 0x08 -#define APM_RESTOREDEFAULT 0x09 -#define APM_GETPWSTATUS 0x0a -#define APM_GETPMEVENT 0x0b -#define APM_GETPWSTATE 0x0c -#define APM_ENABLEDISABLEDPM 0x0d -#define APM_DRVVERSION 0x0e -#define APM_ENGAGEDISENGAGEPM 0x0f -#define APM_GETCAPABILITIES 0x10 -#define APM_RESUMETIMER 0x11 -#define APM_RESUMEONRING 0x12 -#define APM_TIMERREQUESTS 0x13 -#define APM_OEMFUNC 0x80 - -/* error code */ -#define APME_OK 0x00 -#define APME_PMDISABLED 0x01 -#define APME_REALESTABLISHED 0x02 -#define APME_NOTCONNECTED 0x03 -#define APME_PROT16ESTABLISHED 0x05 -#define APME_PROT16NOTSUPPORTED 0x06 -#define APME_PROT32ESTABLISHED 0x07 -#define APME_PROT32NOTDUPPORTED 0x08 -#define APME_UNKNOWNDEVICEID 0x09 -#define APME_OUTOFRANGE 0x0a -#define APME_NOTENGAGED 0x0b -#define APME_CANTENTERSTATE 0x60 -#define APME_NOPMEVENT 0x80 -#define APME_NOAPMPRESENT 0x86 - - -/* device code */ -#define PMDV_APMBIOS 0x0000 -#define PMDV_ALLDEV 0x0001 -#define PMDV_DISP0 0x0100 -#define PMDV_DISP1 0x0101 -#define PMDV_DISPALL 0x01ff -#define PMDV_2NDSTORAGE0 0x0200 -#define PMDV_2NDSTORAGE1 0x0201 -#define PMDV_2NDSTORAGE2 0x0202 -#define PMDV_2NDSTORAGE3 0x0203 -#define PMDV_PARALLEL0 0x0300 -#define PMDV_PARALLEL1 0x0301 -#define PMDV_SERIAL0 0x0400 -#define PMDV_SERIAL1 0x0401 -#define PMDV_SERIAL2 0x0402 -#define PMDV_SERIAL3 0x0403 -#define PMDV_SERIAL4 0x0404 -#define PMDV_SERIAL5 0x0405 -#define PMDV_SERIAL6 0x0406 -#define PMDV_SERIAL7 0x0407 -#define PMDV_NET0 0x0500 -#define PMDV_NET1 0x0501 -#define PMDV_NET2 0x0502 -#define PMDV_NET3 0x0503 -#define PMDV_PCMCIA0 0x0600 -#define PMDV_PCMCIA1 0x0601 -#define PMDV_PCMCIA2 0x0602 -#define PMDV_PCMCIA3 0x0603 -/* 0x0700 - 0x7fff Reserved */ -#define PMDV_BATT_BASE 0x8000 -#define PMDV_BATT0 0x8001 -#define PMDV_BATT1 0x8002 -#define PMDV_BATT_ALL 0x80ff -/* 0x8100 - 0xdfff Reserved */ -/* 0xe000 - 0xefff OEM-defined power device IDs */ -/* 0xf000 - 0xffff Reserved */ - -/* Power state */ -#define PMST_APMENABLED 0x0000 -#define PMST_STANDBY 0x0001 -#define PMST_SUSPEND 0x0002 -#define PMST_OFF 0x0003 -#define PMST_LASTREQNOTIFY 0x0004 -#define PMST_LASTREQREJECT 0x0005 -/* 0x0006 - 0x001f Reserved system states */ -/* 0x0020 - 0x003f OEM-defined system states */ -/* 0x0040 - 0x007f OEM-defined device states */ -/* 0x0080 - 0xffff Reserved device states */ - -#if !defined(ASSEMBLER) && !defined(INITIALIZER) - -/* C definitions */ -struct apmhook { - struct apmhook *ah_next; - int (*ah_fun)(void *ah_arg); - void *ah_arg; - const char *ah_name; - int ah_order; -}; -#define APM_HOOK_NONE (-1) -#define APM_HOOK_SUSPEND 0 -#define APM_HOOK_RESUME 1 -#define NAPM_HOOK 2 - -#ifdef _KERNEL - -void apm_suspend(int state); -struct apmhook *apm_hook_establish (int apmh, struct apmhook *); -void apm_hook_disestablish (int apmh, struct apmhook *); -void apm_cpu_idle(void); -void apm_cpu_busy(void); - -#endif - -#endif /* !ASSEMBLER && !INITIALIZER */ - -#define APM_MIN_ORDER 0x00 -#define APM_MID_ORDER 0x80 -#define APM_MAX_ORDER 0xff - -/* power management event code */ -#define PMEV_NOEVENT 0x0000 -#define PMEV_STANDBYREQ 0x0001 -#define PMEV_SUSPENDREQ 0x0002 -#define PMEV_NORMRESUME 0x0003 -#define PMEV_CRITRESUME 0x0004 -#define PMEV_BATTERYLOW 0x0005 -#define PMEV_POWERSTATECHANGE 0x0006 -#define PMEV_UPDATETIME 0x0007 -#define PMEV_CRITSUSPEND 0x0008 -#define PMEV_USERSTANDBYREQ 0x0009 -#define PMEV_USERSUSPENDREQ 0x000a -#define PMEV_STANDBYRESUME 0x000b -#define PMEV_CAPABILITIESCHANGE 0x000c -/* 0x000d - 0x00ff Reserved system events */ -/* 0x0100 - 0x01ff Reserved device events */ -/* 0x0200 - 0x02ff OEM-defined APM events */ -/* 0x0300 - 0xffff Reserved */ -#define PMEV_DEFAULT 0xffffffff /* used for customization */ - -#if !defined(ASSEMBLER) && !defined(INITIALIZER) - -/* - * Old apm_info structure, returned by the APMIO_GETINFO_OLD ioctl. This - * is for backward compatibility with old executables. - */ -typedef struct apm_info_old { - u_int ai_major; /* APM major version */ - u_int ai_minor; /* APM minor version */ - u_int ai_acline; /* AC line status */ - u_int ai_batt_stat; /* Battery status */ - u_int ai_batt_life; /* Remaining battery life */ - u_int ai_status; /* Status of APM support (enabled/disabled) */ -} *apm_info_old_t; - -/* - * Structure returned by the APMIO_GETINFO ioctl. - * - * In the comments below, the parenthesized numbers indicate the minimum - * value of ai_infoversion for which each field is valid. - */ -typedef struct apm_info { - u_int ai_infoversion; /* Indicates which fields are valid */ - u_int ai_major; /* APM major version (0) */ - u_int ai_minor; /* APM minor version (0) */ - u_int ai_acline; /* AC line status (0) */ - u_int ai_batt_stat; /* Battery status (0) */ - u_int ai_batt_life; /* Remaining battery life in percent (0) */ - int ai_batt_time; /* Remaining battery time in seconds (0) */ - u_int ai_status; /* True if enabled (0) */ - u_int ai_batteries; /* Number of batteries (1) */ - u_int ai_capabilities;/* APM Capabilities (1) */ - u_int ai_spare[6]; /* For future expansion */ -} *apm_info_t; - -/* Battery flag */ -#define APM_BATT_HIGH 0x01 -#define APM_BATT_LOW 0x02 -#define APM_BATT_CRITICAL 0x04 -#define APM_BATT_CHARGING 0x08 -#define APM_BATT_NOT_PRESENT 0x10 -#define APM_BATT_NO_SYSTEM 0x80 - -typedef struct apm_pwstatus { - u_int ap_device; /* Device code of battery */ - u_int ap_acline; /* AC line status (0) */ - u_int ap_batt_stat; /* Battery status (0) */ - u_int ap_batt_flag; /* Battery flag (0) */ - u_int ap_batt_life; /* Remaining battery life in percent (0) */ - int ap_batt_time; /* Remaining battery time in seconds (0) */ -} *apm_pwstatus_t; - -struct apm_bios_arg { - uint32_t eax; - uint32_t ebx; - uint32_t ecx; - uint32_t edx; - uint32_t esi; - uint32_t edi; -}; - -struct apm_event_info { - u_int type; - u_int index; - u_int spare[8]; -}; - -#define APMIO_SUSPEND _IO('P', 1) -#define APMIO_GETINFO_OLD _IOR('P', 2, struct apm_info_old) -#define APMIO_ENABLE _IO('P', 5) -#define APMIO_DISABLE _IO('P', 6) -#define APMIO_HALTCPU _IO('P', 7) -#define APMIO_NOTHALTCPU _IO('P', 8) -#define APMIO_DISPLAY _IOW('P', 9, int) -#define APMIO_BIOS _IOWR('P', 10, struct apm_bios_arg) -#define APMIO_GETINFO _IOR('P', 11, struct apm_info) -#define APMIO_STANDBY _IO('P', 12) -#define APMIO_GETPWSTATUS _IOWR('P', 13, struct apm_pwstatus) -/* for /dev/apmctl */ -#define APMIO_NEXTEVENT _IOR('A', 100, struct apm_event_info) -#define APMIO_REJECTLASTREQ _IO('P', 101) - -#endif /* !ASSEMBLER && !INITIALIZER */ - -#endif /* !_MACHINE_APM_BIOS_H_ */ +#include Modified: head/sys/i386/include/apm_bios.h ============================================================================== --- head/sys/i386/include/apm_bios.h Thu Nov 11 19:20:33 2010 (r215139) +++ head/sys/i386/include/apm_bios.h Thu Nov 11 19:36:21 2010 (r215140) @@ -1,264 +1,6 @@ /*- - * APM (Advanced Power Management) BIOS Device Driver - * - * Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi - * - * This software may be used, modified, copied, and distributed, in - * both source and binary form provided that the above copyright and - * these terms are retained. Under no circumstances is the author - * responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its - * use. - * - * Aug, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_APM_BIOS_H_ -#define _MACHINE_APM_BIOS_H_ - -#ifndef _KERNEL -#include -#endif -#include - -/* BIOS id */ -#define APM_BIOS 0x53 -#define APM_INT 0x15 - -/* APM flags */ -#define APM_16BIT_SUPPORT 0x01 -#define APM_32BIT_SUPPORT 0x02 -#define APM_CPUIDLE_SLOW 0x04 -#define APM_DISABLED 0x08 -#define APM_DISENGAGED 0x10 - -/* APM initializer physical address */ -#define APM_OURADDR 0x00080000 - -/* APM functions */ -#define APM_INSTCHECK 0x00 -#define APM_REALCONNECT 0x01 -#define APM_PROT16CONNECT 0x02 -#define APM_PROT32CONNECT 0x03 -#define APM_DISCONNECT 0x04 -#define APM_CPUIDLE 0x05 -#define APM_CPUBUSY 0x06 -#define APM_SETPWSTATE 0x07 -#define APM_ENABLEDISABLEPM 0x08 -#define APM_RESTOREDEFAULT 0x09 -#define APM_GETPWSTATUS 0x0a -#define APM_GETPMEVENT 0x0b -#define APM_GETPWSTATE 0x0c -#define APM_ENABLEDISABLEDPM 0x0d -#define APM_DRVVERSION 0x0e -#define APM_ENGAGEDISENGAGEPM 0x0f -#define APM_GETCAPABILITIES 0x10 -#define APM_RESUMETIMER 0x11 -#define APM_RESUMEONRING 0x12 -#define APM_TIMERREQUESTS 0x13 -#define APM_OEMFUNC 0x80 - -/* error code */ -#define APME_OK 0x00 -#define APME_PMDISABLED 0x01 -#define APME_REALESTABLISHED 0x02 -#define APME_NOTCONNECTED 0x03 -#define APME_PROT16ESTABLISHED 0x05 -#define APME_PROT16NOTSUPPORTED 0x06 -#define APME_PROT32ESTABLISHED 0x07 -#define APME_PROT32NOTDUPPORTED 0x08 -#define APME_UNKNOWNDEVICEID 0x09 -#define APME_OUTOFRANGE 0x0a -#define APME_NOTENGAGED 0x0b -#define APME_CANTENTERSTATE 0x60 -#define APME_NOPMEVENT 0x80 -#define APME_NOAPMPRESENT 0x86 - - -/* device code */ -#define PMDV_APMBIOS 0x0000 -#define PMDV_ALLDEV 0x0001 -#define PMDV_DISP0 0x0100 -#define PMDV_DISP1 0x0101 -#define PMDV_DISPALL 0x01ff -#define PMDV_2NDSTORAGE0 0x0200 -#define PMDV_2NDSTORAGE1 0x0201 -#define PMDV_2NDSTORAGE2 0x0202 -#define PMDV_2NDSTORAGE3 0x0203 -#define PMDV_PARALLEL0 0x0300 -#define PMDV_PARALLEL1 0x0301 -#define PMDV_SERIAL0 0x0400 -#define PMDV_SERIAL1 0x0401 -#define PMDV_SERIAL2 0x0402 -#define PMDV_SERIAL3 0x0403 -#define PMDV_SERIAL4 0x0404 -#define PMDV_SERIAL5 0x0405 -#define PMDV_SERIAL6 0x0406 -#define PMDV_SERIAL7 0x0407 -#define PMDV_NET0 0x0500 -#define PMDV_NET1 0x0501 -#define PMDV_NET2 0x0502 -#define PMDV_NET3 0x0503 -#define PMDV_PCMCIA0 0x0600 -#define PMDV_PCMCIA1 0x0601 -#define PMDV_PCMCIA2 0x0602 -#define PMDV_PCMCIA3 0x0603 -/* 0x0700 - 0x7fff Reserved */ -#define PMDV_BATT_BASE 0x8000 -#define PMDV_BATT0 0x8001 -#define PMDV_BATT1 0x8002 -#define PMDV_BATT_ALL 0x80ff -/* 0x8100 - 0xdfff Reserved */ -/* 0xe000 - 0xefff OEM-defined power device IDs */ -/* 0xf000 - 0xffff Reserved */ - -/* Power state */ -#define PMST_APMENABLED 0x0000 -#define PMST_STANDBY 0x0001 -#define PMST_SUSPEND 0x0002 -#define PMST_OFF 0x0003 -#define PMST_LASTREQNOTIFY 0x0004 -#define PMST_LASTREQREJECT 0x0005 -/* 0x0006 - 0x001f Reserved system states */ -/* 0x0020 - 0x003f OEM-defined system states */ -/* 0x0040 - 0x007f OEM-defined device states */ -/* 0x0080 - 0xffff Reserved device states */ - -#if !defined(ASSEMBLER) && !defined(INITIALIZER) - -/* C definitions */ -struct apmhook { - struct apmhook *ah_next; - int (*ah_fun)(void *ah_arg); - void *ah_arg; - const char *ah_name; - int ah_order; -}; -#define APM_HOOK_NONE (-1) -#define APM_HOOK_SUSPEND 0 -#define APM_HOOK_RESUME 1 -#define NAPM_HOOK 2 - -#ifdef _KERNEL - -void apm_suspend(int state); -struct apmhook *apm_hook_establish (int apmh, struct apmhook *); -void apm_hook_disestablish (int apmh, struct apmhook *); -void apm_cpu_idle(void); -void apm_cpu_busy(void); - -#endif - -#endif /* !ASSEMBLER && !INITIALIZER */ - -#define APM_MIN_ORDER 0x00 -#define APM_MID_ORDER 0x80 -#define APM_MAX_ORDER 0xff - -/* power management event code */ -#define PMEV_NOEVENT 0x0000 -#define PMEV_STANDBYREQ 0x0001 -#define PMEV_SUSPENDREQ 0x0002 -#define PMEV_NORMRESUME 0x0003 -#define PMEV_CRITRESUME 0x0004 -#define PMEV_BATTERYLOW 0x0005 -#define PMEV_POWERSTATECHANGE 0x0006 -#define PMEV_UPDATETIME 0x0007 -#define PMEV_CRITSUSPEND 0x0008 -#define PMEV_USERSTANDBYREQ 0x0009 -#define PMEV_USERSUSPENDREQ 0x000a -#define PMEV_STANDBYRESUME 0x000b -#define PMEV_CAPABILITIESCHANGE 0x000c -/* 0x000d - 0x00ff Reserved system events */ -/* 0x0100 - 0x01ff Reserved device events */ -/* 0x0200 - 0x02ff OEM-defined APM events */ -/* 0x0300 - 0xffff Reserved */ -#define PMEV_DEFAULT 0xffffffff /* used for customization */ - -#if !defined(ASSEMBLER) && !defined(INITIALIZER) - -/* - * Old apm_info structure, returned by the APMIO_GETINFO_OLD ioctl. This - * is for backward compatibility with old executables. - */ -typedef struct apm_info_old { - u_int ai_major; /* APM major version */ - u_int ai_minor; /* APM minor version */ - u_int ai_acline; /* AC line status */ - u_int ai_batt_stat; /* Battery status */ - u_int ai_batt_life; /* Remaining battery life */ - u_int ai_status; /* Status of APM support (enabled/disabled) */ -} *apm_info_old_t; - -/* - * Structure returned by the APMIO_GETINFO ioctl. - * - * In the comments below, the parenthesized numbers indicate the minimum - * value of ai_infoversion for which each field is valid. - */ -typedef struct apm_info { - u_int ai_infoversion; /* Indicates which fields are valid */ - u_int ai_major; /* APM major version (0) */ - u_int ai_minor; /* APM minor version (0) */ - u_int ai_acline; /* AC line status (0) */ - u_int ai_batt_stat; /* Battery status (0) */ - u_int ai_batt_life; /* Remaining battery life in percent (0) */ - int ai_batt_time; /* Remaining battery time in seconds (0) */ - u_int ai_status; /* True if enabled (0) */ - u_int ai_batteries; /* Number of batteries (1) */ - u_int ai_capabilities;/* APM Capabilities (1) */ - u_int ai_spare[6]; /* For future expansion */ -} *apm_info_t; - -/* Battery flag */ -#define APM_BATT_HIGH 0x01 -#define APM_BATT_LOW 0x02 -#define APM_BATT_CRITICAL 0x04 -#define APM_BATT_CHARGING 0x08 -#define APM_BATT_NOT_PRESENT 0x10 -#define APM_BATT_NO_SYSTEM 0x80 - -typedef struct apm_pwstatus { - u_int ap_device; /* Device code of battery */ - u_int ap_acline; /* AC line status (0) */ - u_int ap_batt_stat; /* Battery status (0) */ - u_int ap_batt_flag; /* Battery flag (0) */ - u_int ap_batt_life; /* Remaining battery life in percent (0) */ - int ap_batt_time; /* Remaining battery time in seconds (0) */ -} *apm_pwstatus_t; - -struct apm_bios_arg { - uint32_t eax; - uint32_t ebx; - uint32_t ecx; - uint32_t edx; - uint32_t esi; - uint32_t edi; -}; - -struct apm_event_info { - u_int type; - u_int index; - u_int spare[8]; -}; - -#define APMIO_SUSPEND _IO('P', 1) -#define APMIO_GETINFO_OLD _IOR('P', 2, struct apm_info_old) -#define APMIO_ENABLE _IO('P', 5) -#define APMIO_DISABLE _IO('P', 6) -#define APMIO_HALTCPU _IO('P', 7) -#define APMIO_NOTHALTCPU _IO('P', 8) -#define APMIO_DISPLAY _IOW('P', 9, int) -#define APMIO_BIOS _IOWR('P', 10, struct apm_bios_arg) -#define APMIO_GETINFO _IOR('P', 11, struct apm_info) -#define APMIO_STANDBY _IO('P', 12) -#define APMIO_GETPWSTATUS _IOWR('P', 13, struct apm_pwstatus) -/* for /dev/apmctl */ -#define APMIO_NEXTEVENT _IOR('A', 100, struct apm_event_info) -#define APMIO_REJECTLASTREQ _IO('P', 101) - -#endif /* !ASSEMBLER && !INITIALIZER */ - -#endif /* !_MACHINE_APM_BIOS_H_ */ +#include Modified: head/sys/pc98/include/apm_bios.h ============================================================================== --- head/sys/pc98/include/apm_bios.h Thu Nov 11 19:20:33 2010 (r215139) +++ head/sys/pc98/include/apm_bios.h Thu Nov 11 19:36:21 2010 (r215140) @@ -32,7 +32,7 @@ * PC98 machines implement APM bios in nearly the same was as i386 machines, * so include the i386 version and note the changes here. */ -#include +#include /* * APM BIOS and interrupt are different on pc98 Copied and modified: head/sys/x86/include/apm_bios.h (from r215098, head/sys/i386/include/apm_bios.h) ============================================================================== --- head/sys/i386/include/apm_bios.h Wed Nov 10 19:03:30 2010 (r215098, copy source) +++ head/sys/x86/include/apm_bios.h Thu Nov 11 19:36:21 2010 (r215140) @@ -15,8 +15,8 @@ * $FreeBSD$ */ -#ifndef _MACHINE_APM_BIOS_H_ -#define _MACHINE_APM_BIOS_H_ +#ifndef _X86_APM_BIOS_H_ +#define _X86_APM_BIOS_H_ #ifndef _KERNEL #include @@ -261,4 +261,4 @@ struct apm_event_info { #endif /* !ASSEMBLER && !INITIALIZER */ -#endif /* !_MACHINE_APM_BIOS_H_ */ +#endif /* !_X86_APM_BIOS_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:37:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9C1A106566C; Thu, 11 Nov 2010 19:37:26 +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 50C7E8FC16; Thu, 11 Nov 2010 19:37:26 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:a528:e2d2:e8bb:bf7b] (unknown [IPv6:2001:7b8:3a7:0:a528:e2d2:e8bb:bf7b]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 87C775C43; Thu, 11 Nov 2010 20:37:24 +0100 (CET) Message-ID: <4CDC45F7.8060506@FreeBSD.org> Date: Thu, 11 Nov 2010 20:37:27 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.13pre) Gecko/20101104 Lanikai/3.1.7pre MIME-Version: 1.0 To: Andriy Gapon References: <201011111918.oABJIqvH081681@svn.freebsd.org> <4CDC43FE.6060401@freebsd.org> In-Reply-To: <4CDC43FE.6060401@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: r215138 - in head/sys: net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:37:27 -0000 On 2010-11-11 20:29, Andriy Gapon wrote: > Do I understand it correctly that set_pcpu section itself would not be produced if > DPCPU_DEFINE() is not actually used? Yes, although currently this does not occur in any kernel module (I tested using make universe). But indeed, if you would include e.g. vnet.h or pcpu.h, but did not use any VNET_DEFINE or DPCPU_DEFINE macros, you would get an error during linking. The proper fix for this is to use the __GLOBL macros only when actually invoking the VNET_DEFINE or DPCPU_DEFINE macros, just as with the __MAKE_SET macro. But this is made more difficult by the fact that many invocations of VNET_DEFINE and DPCPU_DEFINE are either prefixed with 'static', or postfixed with '= literal_value'. Maybe we could use separate VNET_DEFINE_STATIC and DPCPU_DEFINE_STATIC macros for this, since it looks like some of the definitions actually define public variables... From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:39:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C3211065673; Thu, 11 Nov 2010 19:39:39 +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 183D08FC08; Thu, 11 Nov 2010 19:39:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABJddLC082329; Thu, 11 Nov 2010 19:39:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABJdctg082311; Thu, 11 Nov 2010 19:39:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201011111939.oABJdctg082311@svn.freebsd.org> From: John Baldwin Date: Thu, 11 Nov 2010 19:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215141 - in stable/8/sys: amd64/amd64 arm/include i386/i386 i386/xen mips/include powerpc/include sparc64/include sparc64/sparc64 sun4v/include sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:39:39 -0000 Author: jhb Date: Thu Nov 11 19:39:38 2010 New Revision: 215141 URL: http://svn.freebsd.org/changeset/base/215141 Log: MFC 211149,211151,211197,211518,215128: Update various places that store or manipulate CPU masks to use cpumask_t instead of int or u_int. Since cpumask_t is currently u_int on all platforms this should just be a cosmetic change. Modified: stable/8/sys/amd64/amd64/mp_machdep.c stable/8/sys/amd64/amd64/pmap.c stable/8/sys/amd64/amd64/vm_machdep.c stable/8/sys/arm/include/pmap.h stable/8/sys/i386/i386/mp_machdep.c stable/8/sys/i386/i386/pmap.c stable/8/sys/i386/i386/vm_machdep.c stable/8/sys/i386/xen/pmap.c stable/8/sys/mips/include/pmap.h stable/8/sys/powerpc/include/pmap.h stable/8/sys/sparc64/include/pmap.h stable/8/sys/sparc64/include/smp.h stable/8/sys/sparc64/sparc64/mp_machdep.c stable/8/sys/sun4v/include/pmap.h stable/8/sys/sun4v/include/smp.h stable/8/sys/sun4v/sun4v/mp_machdep.c stable/8/sys/sun4v/sun4v/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/mp_machdep.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/amd64/amd64/mp_machdep.c Thu Nov 11 19:39:38 2010 (r215141) @@ -1047,7 +1047,7 @@ smp_targeted_tlb_shootdown(cpumask_t mas int ncpu, othercpus; othercpus = mp_ncpus - 1; - if (mask == (u_int)-1) { + if (mask == (cpumask_t)-1) { ncpu = othercpus; if (ncpu < 1) return; @@ -1072,7 +1072,7 @@ smp_targeted_tlb_shootdown(cpumask_t mas smp_tlb_addr1 = addr1; smp_tlb_addr2 = addr2; atomic_store_rel_int(&smp_tlb_wait, 0); - if (mask == (u_int)-1) + if (mask == (cpumask_t)-1) ipi_all_but_self(vector); else ipi_selected(mask, vector); @@ -1283,8 +1283,11 @@ ipi_nmi_handler() void cpustop_handler(void) { - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask; + u_int cpu; + + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); savectx(&stoppcbs[cpu]); @@ -1312,9 +1315,12 @@ void cpususpend_handler(void) { struct savefpu *stopfpu; + cpumask_t cpumask; register_t cr3, rf; - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + u_int cpu; + + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); rf = intr_disable(); cr3 = rcr3(); @@ -1488,18 +1494,22 @@ SYSINIT(cpu_hlt, SI_SUB_SMP, SI_ORDER_AN int mp_grab_cpu_hlt(void) { - u_int mask = PCPU_GET(cpumask); + cpumask_t mask; #ifdef MP_WATCHDOG - u_int cpuid = PCPU_GET(cpuid); + u_int cpuid; #endif int retval; + mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG + cpuid = PCPU_GET(cpuid); ap_watchdog(cpuid); #endif - retval = mask & hlt_cpus_mask; - while (mask & hlt_cpus_mask) + retval = 0; + while (mask & hlt_cpus_mask) { + retval = 1; __asm __volatile("sti; hlt" : : : "memory"); + } return (retval); } Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/amd64/amd64/pmap.c Thu Nov 11 19:39:38 2010 (r215141) @@ -860,8 +860,7 @@ pmap_update_pde_invalidate(vm_offset_t v void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { @@ -881,8 +880,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; sched_pin(); @@ -906,8 +904,7 @@ pmap_invalidate_range(pmap_t pmap, vm_of void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { Modified: stable/8/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/vm_machdep.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/amd64/amd64/vm_machdep.c Thu Nov 11 19:39:38 2010 (r215141) @@ -520,7 +520,8 @@ void cpu_reset() { #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; if (smp_active) { map = PCPU_GET(other_cpus) & ~stopped_cpus; Modified: stable/8/sys/arm/include/pmap.h ============================================================================== --- stable/8/sys/arm/include/pmap.h Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/arm/include/pmap.h Thu Nov 11 19:39:38 2010 (r215141) @@ -134,7 +134,7 @@ struct pmap { struct l1_ttable *pm_l1; struct l2_dtable *pm_l2[L2_SIZE]; pd_entry_t *pm_pdir; /* KVA of page directory */ - int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statictics */ TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ }; Modified: stable/8/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/8/sys/i386/i386/mp_machdep.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/i386/i386/mp_machdep.c Thu Nov 11 19:39:38 2010 (r215141) @@ -1443,8 +1443,11 @@ ipi_nmi_handler() void cpustop_handler(void) { - int cpu = PCPU_GET(cpuid); - int cpumask = PCPU_GET(cpumask); + cpumask_t cpumask; + u_int cpu; + + cpu = PCPU_GET(cpuid); + cpumask = PCPU_GET(cpumask); savectx(&stoppcbs[cpu]); @@ -1612,19 +1615,23 @@ SYSINIT(cpu_hlt, SI_SUB_SMP, SI_ORDER_AN int mp_grab_cpu_hlt(void) { - u_int mask = PCPU_GET(cpumask); + cpumask_t mask; #ifdef MP_WATCHDOG - u_int cpuid = PCPU_GET(cpuid); + u_int cpuid; #endif int retval; + mask = PCPU_GET(cpumask); #ifdef MP_WATCHDOG + cpuid = PCPU_GET(cpuid); ap_watchdog(cpuid); #endif - retval = mask & hlt_cpus_mask; - while (mask & hlt_cpus_mask) + retval = 0; + while (mask & hlt_cpus_mask) { + retval = 1; __asm __volatile("sti; hlt" : : : "memory"); + } return (retval); } Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/i386/i386/pmap.c Thu Nov 11 19:39:38 2010 (r215141) @@ -935,8 +935,7 @@ pmap_update_pde_invalidate(vm_offset_t v void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { @@ -956,8 +955,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; sched_pin(); @@ -981,8 +979,7 @@ pmap_invalidate_range(pmap_t pmap, vm_of void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; sched_pin(); if (pmap == kernel_pmap || pmap->pm_active == all_cpus) { Modified: stable/8/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/8/sys/i386/i386/vm_machdep.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/i386/i386/vm_machdep.c Thu Nov 11 19:39:38 2010 (r215141) @@ -592,7 +592,8 @@ cpu_reset() #endif #ifdef SMP - u_int cnt, map; + cpumask_t map; + u_int cnt; if (smp_active) { map = PCPU_GET(other_cpus) & ~stopped_cpus; Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/i386/xen/pmap.c Thu Nov 11 19:39:38 2010 (r215141) @@ -851,8 +851,7 @@ pmap_cache_bits(int mode, boolean_t is_p void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; CTR2(KTR_PMAP, "pmap_invalidate_page: pmap=%p va=0x%x", pmap, va); @@ -876,8 +875,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; vm_offset_t addr; CTR3(KTR_PMAP, "pmap_invalidate_page: pmap=%p eva=0x%x sva=0x%x", @@ -905,8 +903,7 @@ pmap_invalidate_range(pmap_t pmap, vm_of void pmap_invalidate_all(pmap_t pmap) { - u_int cpumask; - u_int other_cpus; + cpumask_t cpumask, other_cpus; CTR1(KTR_PMAP, "pmap_invalidate_page: pmap=%p", pmap); Modified: stable/8/sys/mips/include/pmap.h ============================================================================== --- stable/8/sys/mips/include/pmap.h Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/mips/include/pmap.h Thu Nov 11 19:39:38 2010 (r215141) @@ -88,7 +88,7 @@ struct pmap { pd_entry_t *pm_segtab; /* KVA of segment table */ TAILQ_HEAD(, pv_entry) pm_pvlist; /* list of mappings in * pmap */ - int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct { u_int32_t asid:ASID_BITS; /* TLB address space tag */ u_int32_t gen:ASIDGEN_BITS; /* its generation number */ Modified: stable/8/sys/powerpc/include/pmap.h ============================================================================== --- stable/8/sys/powerpc/include/pmap.h Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/powerpc/include/pmap.h Thu Nov 11 19:39:38 2010 (r215141) @@ -87,7 +87,7 @@ struct pmap_md { struct pmap { struct mtx pm_mtx; u_int pm_sr[16]; - u_int pm_active; + cpumask_t pm_active; u_int pm_context; struct pmap *pmap_phys; @@ -122,7 +122,7 @@ struct md_page { struct pmap { struct mtx pm_mtx; /* pmap mutex */ tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ - u_int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ int pm_refs; /* ref count */ struct pmap_statistics pm_stats; /* pmap statistics */ Modified: stable/8/sys/sparc64/include/pmap.h ============================================================================== --- stable/8/sys/sparc64/include/pmap.h Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/sparc64/include/pmap.h Thu Nov 11 19:39:38 2010 (r215141) @@ -61,7 +61,7 @@ struct pmap { struct mtx pm_mtx; struct tte *pm_tsb; vm_object_t pm_tsb_obj; - u_int pm_active; + cpumask_t pm_active; u_int pm_context[MAXCPU]; struct pmap_statistics pm_stats; }; Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/sparc64/include/smp.h Thu Nov 11 19:39:38 2010 (r215141) @@ -75,17 +75,17 @@ struct cpu_start_args { }; struct ipi_cache_args { - u_int ica_mask; + cpumask_t ica_mask; vm_paddr_t ica_pa; }; struct ipi_rd_args { - u_int ira_mask; + cpumask_t ira_mask; register_t *ira_val; }; struct ipi_tlb_args { - u_int ita_mask; + cpumask_t ita_mask; struct pmap *ita_pmap; u_long ita_start; u_long ita_end; @@ -206,7 +206,7 @@ static __inline void * ipi_tlb_context_demap(struct pmap *pm) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -228,7 +228,7 @@ static __inline void * ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -250,7 +250,7 @@ static __inline void * ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -273,7 +273,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ static __inline void ipi_wait(void *cookie) { - volatile u_int *mask; + volatile cpumask_t *mask; if ((mask = cookie) != NULL) { atomic_clear_int(mask, PCPU_GET(cpumask)); Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Thu Nov 11 19:39:38 2010 (r215141) @@ -119,7 +119,7 @@ cpu_ipi_single_t *cpu_ipi_single; static vm_offset_t mp_tramp; static u_int cpuid_to_mid[MAXCPU]; static int isjbus; -static volatile u_int shutdown_cpus; +static volatile cpumask_t shutdown_cpus; static void ap_count(phandle_t node, u_int mid, u_int cpu_impl); static void ap_start(phandle_t node, u_int mid, u_int cpu_impl); Modified: stable/8/sys/sun4v/include/pmap.h ============================================================================== --- stable/8/sys/sun4v/include/pmap.h Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/sun4v/include/pmap.h Thu Nov 11 19:39:38 2010 (r215141) @@ -54,7 +54,6 @@ #define TSB_MAX_RESIZE (20 - TSB_INIT_SHIFT - PAGE_SHIFT) typedef struct pmap *pmap_t; -typedef uint32_t pmap_cpumask_t; struct pv_entry; struct tte_hash; @@ -75,8 +74,8 @@ struct pmap { struct tte_hash *pm_hash; TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ struct hv_tsb_info pm_tsb; - pmap_cpumask_t pm_active; /* mask of cpus currently using pmap */ - pmap_cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ + cpumask_t pm_active; /* mask of cpus currently using pmap */ + cpumask_t pm_tlbactive; /* mask of cpus that have used this pmap */ struct pmap_statistics pm_stats; uint32_t pm_tsb_miss_count; uint32_t pm_tsb_cap_miss_count; Modified: stable/8/sys/sun4v/include/smp.h ============================================================================== --- stable/8/sys/sun4v/include/smp.h Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/sun4v/include/smp.h Thu Nov 11 19:39:38 2010 (r215141) @@ -58,12 +58,12 @@ struct cpu_start_args { }; struct ipi_cache_args { - u_int ica_mask; + cpumask_t ica_mask; vm_paddr_t ica_pa; }; struct ipi_tlb_args { - u_int ita_mask; + cpumask_t ita_mask; struct pmap *ita_pmap; u_long ita_start; u_long ita_end; @@ -75,7 +75,7 @@ struct pcpu; void cpu_mp_bootstrap(struct pcpu *pc); void cpu_mp_shutdown(void); -void cpu_ipi_selected(int cpus, uint16_t *cpulist, u_long d0, u_long d1, u_long d2, uint64_t *ackmask); +void cpu_ipi_selected(int cpu_count, uint16_t *cpulist, u_long d0, u_long d1, u_long d2, uint64_t *ackmask); void cpu_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); void cpu_ipi_ast(struct trapframe *tf); @@ -84,7 +84,7 @@ void cpu_ipi_preempt(struct trapframe *t void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); -void ipi_selected(u_int cpus, u_int ipi); +void ipi_selected(cpumask_t cpus, u_int ipi); vm_offset_t mp_tramp_alloc(void); void mp_set_tsb_desc_ra(vm_paddr_t); @@ -148,7 +148,7 @@ static __inline void * ipi_tlb_context_demap(struct pmap *pm) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -167,7 +167,7 @@ static __inline void * ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -186,7 +186,7 @@ static __inline void * ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) { struct ipi_tlb_args *ita; - u_int cpus; + cpumask_t cpus; if (smp_cpus == 1) return (NULL); @@ -205,7 +205,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ static __inline void ipi_wait(void *cookie) { - volatile u_int *mask; + volatile cpumask_t *mask; if ((mask = cookie) != NULL) { atomic_clear_int(mask, PCPU_GET(cpumask)); Modified: stable/8/sys/sun4v/sun4v/mp_machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/mp_machdep.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/sun4v/sun4v/mp_machdep.c Thu Nov 11 19:39:38 2010 (r215141) @@ -115,7 +115,7 @@ vm_offset_t mp_tramp; u_int mp_boot_mid; -static volatile u_int shutdown_cpus; +static volatile cpumask_t shutdown_cpus; void cpu_mp_unleash(void *); SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); @@ -519,7 +519,7 @@ retry: } void -ipi_selected(u_int icpus, u_int ipi) +ipi_selected(cpumask_t icpus, u_int ipi) { int i, cpu_count; uint16_t *cpulist; Modified: stable/8/sys/sun4v/sun4v/pmap.c ============================================================================== --- stable/8/sys/sun4v/sun4v/pmap.c Thu Nov 11 19:36:21 2010 (r215140) +++ stable/8/sys/sun4v/sun4v/pmap.c Thu Nov 11 19:39:38 2010 (r215141) @@ -1402,7 +1402,7 @@ pmap_ipi(pmap_t pmap, char *func, uint64 { int i, cpu_count, retried; - u_int cpus; + cpumask_t cpus; cpumask_t cpumask, active, curactive; cpumask_t active_total, ackmask; uint16_t *cpulist; From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:44:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id A3B74106566C; Thu, 11 Nov 2010 19:44:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Thu, 11 Nov 2010 14:44:12 -0500 User-Agent: KMail/1.6.2 References: <201011111920.oABJKXCQ081755@svn.freebsd.org> In-Reply-To: <201011111920.oABJKXCQ081755@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201011111444.16746.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r215139 - head/sys/i386/bios X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:44:24 -0000 On Thursday 11 November 2010 02:20 pm, Jung-uk Kim wrote: > Author: jkim > Date: Thu Nov 11 19:20:33 2010 > New Revision: 215139 > URL: http://svn.freebsd.org/changeset/base/215139 > > Log: > Add compat shim for apm(4) to translate APM BIOS function numbers > from i386 to PC98-specific ones. Any binaries using apm ioctl(4) ^^^^^^^^ ioctl(2) > commands but built for i386 should also work on PC98 now. Sorry, Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 19:49:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7CCF106564A; Thu, 11 Nov 2010 19:49:36 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 23A588FC08; Thu, 11 Nov 2010 19:49:35 +0000 (UTC) Received: by gwj20 with SMTP id 20so1059527gwj.13 for ; Thu, 11 Nov 2010 11:49:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=ZzNMGj7pWuzsSjm/JJwZ/NG+ZSuSlUblGyGB9iSDnhM=; b=p8JwHwJ4oSrQfmtJ72KC1rsAINk1dhFJaXJ7WI4SVKtv6sEezQv+dQjaC2zS4+aGSw cSU9/s9XN6+Gdyu2dwanJv0pbL3pyHqOg0oeC9XRJWS2LABhDx6c80DImyVKGDnc3Pb+ zdMXj0JLCbMc+rO0QF80tWF9LTg3kXiBPU9DQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Iin50fKMbleIMJ9IpEBw69IB8jV2vuLN0uPpAdGzpGLHBXzsvI7RnzsIe03R0qArkR hpjjcKYua9a4tCDZslqJdKKDDUYptZWzJoB9gLJ1CoWX/qVNvqXxRvZpjtqzEPP+bdAz Oc0ydoHpqAen3u46NJE18AYChMJ2d5QapaIEk= Received: by 10.101.165.35 with SMTP id s35mr808553ano.190.1289503197444; Thu, 11 Nov 2010 11:19:57 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id x32sm2688065anx.4.2010.11.11.11.19.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Nov 2010 11:19:56 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 11 Nov 2010 11:19:00 -0800 From: Pyun YongHyeon Date: Thu, 11 Nov 2010 11:19:00 -0800 To: Joel Dahl Message-ID: <20101111191900.GC17566@michelle.cdnetworks.com> References: <201011111808.oABI8olX079570@svn.freebsd.org> <20101111183409.GA1011@pluto.vnode.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101111183409.GA1011@pluto.vnode.local> 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: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 19:49:36 -0000 On Thu, Nov 11, 2010 at 07:34:09PM +0100, Joel Dahl wrote: > On 11-11-2010 18:08, Pyun YongHyeon wrote: > > Author: yongari > > Date: Thu Nov 11 18:08:50 2010 > > New Revision: 215132 > > URL: http://svn.freebsd.org/changeset/base/215132 > > > > Log: > > Add basic WOL support for MCP ethernet controllers. It seems the > > controller does not perform automatic switching from 1000Mbps link > > to 10/100Mbps link when WOL is activated. Implement establishing > > 10/100Mps link with auto-negotiation in driver. Link status change > > handler was modified to remove taskqueue based approach since driver > > now needs synchronous handling for link establishment. > > Somewhat unrelated but this commit reminds me of something: why do we still > keep the nve driver? I thought nfe was written as a replacement years ago? > Perhaps to address edge cases not covered by nfe(4)? Personally I don't know any of them. From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 20:18:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD2B31065672; Thu, 11 Nov 2010 20:18:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAEA58FC14; Thu, 11 Nov 2010 20:18:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABKIXlE083225; Thu, 11 Nov 2010 20:18:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABKIXv4083218; Thu, 11 Nov 2010 20:18:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201011112018.oABKIXv4083218@svn.freebsd.org> From: Andrew Thompson Date: Thu, 11 Nov 2010 20:18: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: r215142 - in head/sys: arm/conf arm/xscale/ixp425 dev/gpio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 20:18:33 -0000 Author: thompsa Date: Thu Nov 11 20:18:33 2010 New Revision: 215142 URL: http://svn.freebsd.org/changeset/base/215142 Log: Add a GPIO driver for the Gateworks Cambria platform. The external gpio pins are connected to a PLD on the i2c bus, unfortunatley this device does not conform by failing to send an ack after each byte written. The iicbb driver will abort the transfer when the address is not ack'd and it would introduce a lot of churn to be able to pass a flag down to iicbb_start/iicbb_write. Instead we do bad things by grabbing the iicbus but then doing our own bit banging. Added: head/sys/arm/xscale/ixp425/cambria_gpio.c (contents, props changed) Modified: head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CAMBRIA.hints head/sys/arm/xscale/ixp425/files.avila head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpioc.c Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Thu Nov 11 19:39:38 2010 (r215141) +++ head/sys/arm/conf/CAMBRIA Thu Nov 11 20:18:33 2010 (r215142) @@ -90,6 +90,10 @@ device ad7418 # AD7418 on I2C bus device cambria_fled # Font Panel LED on I2C bus device cambria_led # 8-LED latch +device gpio +device gpioled +device cambria_gpio # GPIO pins on J11 + device ata device atadisk # ATA disk drives device avila_ata # Gateworks CF/IDE support Modified: head/sys/arm/conf/CAMBRIA.hints ============================================================================== --- head/sys/arm/conf/CAMBRIA.hints Thu Nov 11 19:39:38 2010 (r215141) +++ head/sys/arm/conf/CAMBRIA.hints Thu Nov 11 20:18:33 2010 (r215142) @@ -54,6 +54,10 @@ hint.fled.0.addr=0x5a # Octal LED Latch hint.led_cambria.0.at="ixp0" +# GPIO pins +hint.gpio_cambria.0.at="iicbus0" +hint.gpio_cambria.0.addr=0x56 + # Analog Devices AD7418 temperature sensor hint.ad7418.0.at="iicbus0" hint.ad7418.0.addr=0x50 Added: head/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xscale/ixp425/cambria_gpio.c Thu Nov 11 20:18:33 2010 (r215142) @@ -0,0 +1,471 @@ +/*- + * Copyright (c) 2010, Andrew Thompson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * GPIO driver for Gateworks Cambria + * + * Note: + * The Cambria PLD does not set the i2c ack bit after each write, if we used the + * regular iicbus interface it would abort the xfer after the address byte + * times out and not write our latch. To get around this we grab the iicbus and + * then do our own bit banging. This is a comprimise to changing all the iicbb + * device methods to allow a flag to be passed down and is similir to how Linux + * does it. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "iicbb_if.h" +#include "gpio_if.h" + +#define IIC_M_WR 0 /* write operation */ +#define PLD_ADDR 0xac /* slave address */ + +#define I2C_DELAY 10 + +#define GPIO_CONF_CLR(sc, reg, mask) \ + GPIO_CONF_WRITE_4(sc, reg, GPIO_CONF_READ_4(sc, reg) &~ (mask)) +#define GPIO_CONF_SET(sc, reg, mask) \ + GPIO_CONF_WRITE_4(sc, reg, GPIO_CONF_READ_4(sc, reg) | (mask)) + +#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) + +#define GPIO_PINS 5 +struct cambria_gpio_softc { + device_t sc_dev; + bus_space_tag_t sc_iot; + bus_space_handle_t sc_gpio_ioh; + struct mtx sc_mtx; + struct gpio_pin sc_pins[GPIO_PINS]; + uint8_t sc_latch; +}; + +struct cambria_gpio_pin { + const char *name; + int pin; + int flags; +}; + +extern struct ixp425_softc *ixp425_softc; + +static struct cambria_gpio_pin cambria_gpio_pins[GPIO_PINS] = { + { "GPIO0", 0, GPIO_PIN_OUTPUT }, + { "GPIO1", 1, GPIO_PIN_OUTPUT }, + { "GPIO2", 2, GPIO_PIN_OUTPUT }, + { "GPIO3", 3, GPIO_PIN_OUTPUT }, + { "GPIO4", 4, GPIO_PIN_OUTPUT }, +}; + +/* + * Helpers + */ +static int cambria_gpio_read(struct cambria_gpio_softc *, uint32_t, unsigned int *); +static int cambria_gpio_write(struct cambria_gpio_softc *); + +/* + * Driver stuff + */ +static int cambria_gpio_probe(device_t dev); +static int cambria_gpio_attach(device_t dev); +static int cambria_gpio_detach(device_t dev); + +/* + * GPIO interface + */ +static int cambria_gpio_pin_max(device_t dev, int *maxpin); +static int cambria_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps); +static int cambria_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t + *flags); +static int cambria_gpio_pin_getname(device_t dev, uint32_t pin, char *name); +static int cambria_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags); +static int cambria_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value); +static int cambria_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val); +static int cambria_gpio_pin_toggle(device_t dev, uint32_t pin); + +static int +i2c_getsda(struct cambria_gpio_softc *sc) +{ + uint32_t reg; + + mtx_lock(&Giant); + GPIO_CONF_SET(sc, IXP425_GPIO_GPOER, GPIO_I2C_SDA_BIT); + + reg = GPIO_CONF_READ_4(sc, IXP425_GPIO_GPINR); + mtx_unlock(&Giant); + return (reg & GPIO_I2C_SDA_BIT); +} + +static void +i2c_setsda(struct cambria_gpio_softc *sc, int val) +{ + + mtx_lock(&Giant); + GPIO_CONF_CLR(sc, IXP425_GPIO_GPOUTR, GPIO_I2C_SDA_BIT); + if (val) + GPIO_CONF_SET(sc, IXP425_GPIO_GPOER, GPIO_I2C_SDA_BIT); + else + GPIO_CONF_CLR(sc, IXP425_GPIO_GPOER, GPIO_I2C_SDA_BIT); + mtx_unlock(&Giant); + DELAY(I2C_DELAY); +} + +static void +i2c_setscl(struct cambria_gpio_softc *sc, int val) +{ + + mtx_lock(&Giant); + GPIO_CONF_CLR(sc, IXP425_GPIO_GPOUTR, GPIO_I2C_SCL_BIT); + if (val) + GPIO_CONF_SET(sc, IXP425_GPIO_GPOER, GPIO_I2C_SCL_BIT); + else + GPIO_CONF_CLR(sc, IXP425_GPIO_GPOER, GPIO_I2C_SCL_BIT); + mtx_unlock(&Giant); + DELAY(I2C_DELAY); +} + +static void +i2c_sendstart(struct cambria_gpio_softc *sc) +{ + i2c_setsda(sc, 1); + i2c_setscl(sc, 1); + i2c_setsda(sc, 0); + i2c_setscl(sc, 0); +} + +static void +i2c_sendstop(struct cambria_gpio_softc *sc) +{ + i2c_setscl(sc, 1); + i2c_setsda(sc, 1); + i2c_setscl(sc, 0); + i2c_setsda(sc, 0); +} + +static void +i2c_sendbyte(struct cambria_gpio_softc *sc, u_char data) +{ + int i; + + for (i=7; i>=0; i--) { + i2c_setsda(sc, data & (1<=0; i--) + { + i2c_setscl(sc, 1); + if (i2c_getsda(sc)) + data |= (1<sc_dev; + int error; + + error = iicbus_request_bus(device_get_parent(dev), dev, + IIC_DONTWAIT); + if (error) + return (error); + + i2c_sendstart(sc); + i2c_sendbyte(sc, PLD_ADDR | LSB); + *val = (i2c_readbyte(sc) & (1 << pin)) != 0; + i2c_sendstop(sc); + + iicbus_release_bus(device_get_parent(dev), dev); + + return (0); +} + +static int +cambria_gpio_write(struct cambria_gpio_softc *sc) +{ + device_t dev = sc->sc_dev; + int error; + + error = iicbus_request_bus(device_get_parent(dev), dev, + IIC_DONTWAIT); + if (error) + return (error); + + i2c_sendstart(sc); + i2c_sendbyte(sc, PLD_ADDR & ~LSB); + i2c_sendbyte(sc, sc->sc_latch); + i2c_sendstop(sc); + + iicbus_release_bus(device_get_parent(dev), dev); + + return (0); +} + +static int +cambria_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = GPIO_PINS - 1; + return (0); +} + +static int +cambria_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + + if (pin >= GPIO_PINS) + return (EINVAL); + + *caps = sc->sc_pins[pin].gp_caps; + return (0); +} + +static int +cambria_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + + if (pin >= GPIO_PINS) + return (EINVAL); + + *flags = sc->sc_pins[pin].gp_flags; + return (0); +} + +static int +cambria_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + + if (pin >= GPIO_PINS) + return (EINVAL); + + memcpy(name, sc->sc_pins[pin].gp_name, GPIOMAXNAME); + return (0); +} + +static int +cambria_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + int error; + + if (pin >= GPIO_PINS) + return (EINVAL); + + /* Filter out unwanted flags */ + if ((flags &= sc->sc_pins[pin].gp_caps) != flags) + return (EINVAL); + + /* Can't mix input/output together */ + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) + return (EINVAL); + + GPIO_LOCK(sc); + sc->sc_pins[pin].gp_flags = flags; + + sc->sc_latch |= (1 << pin); + error = cambria_gpio_write(sc); + GPIO_UNLOCK(sc); + + return (error); +} + +static int +cambria_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + int error; + + if (pin >= GPIO_PINS || sc->sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT) + return (EINVAL); + + GPIO_LOCK(sc); + if (value) + sc->sc_latch |= (1 << pin); + else + sc->sc_latch &= ~(1 << pin); + error = cambria_gpio_write(sc); + GPIO_UNLOCK(sc); + + return (error); +} + +static int +cambria_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + int error = 0; + + if (pin >= GPIO_PINS) + return (EINVAL); + + GPIO_LOCK(sc); + if (sc->sc_pins[pin].gp_flags == GPIO_PIN_OUTPUT) + *val = (sc->sc_latch & (1 << pin)) ? 1 : 0; + else + error = cambria_gpio_read(sc, pin, val); + GPIO_UNLOCK(sc); + + return (error); +} + +static int +cambria_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + int error; + + if (pin >= GPIO_PINS || sc->sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT) + return (EINVAL); + + GPIO_LOCK(sc); + sc->sc_latch ^= (1 << pin); + error = cambria_gpio_write(sc); + GPIO_UNLOCK(sc); + + return (error); +} + +static int +cambria_gpio_probe(device_t dev) +{ + + device_set_desc(dev, "Gateworks Cambria GPIO driver"); + return (0); +} + +static int +cambria_gpio_attach(device_t dev) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + int pin; + + sc->sc_dev = dev; + sc->sc_iot = ixp425_softc->sc_iot; + sc->sc_gpio_ioh = ixp425_softc->sc_gpio_ioh; + + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + + for (pin = 0; pin < GPIO_PINS; pin++) { + struct cambria_gpio_pin *p = &cambria_gpio_pins[pin]; + + strncpy(sc->sc_pins[pin].gp_name, p->name, GPIOMAXNAME); + sc->sc_pins[pin].gp_pin = pin; + sc->sc_pins[pin].gp_caps = GPIO_PIN_INPUT|GPIO_PIN_OUTPUT; + sc->sc_pins[pin].gp_flags = 0; + cambria_gpio_pin_setflags(dev, pin, p->flags); + } + + device_add_child(dev, "gpioc", device_get_unit(dev)); + device_add_child(dev, "gpiobus", device_get_unit(dev)); + return (bus_generic_attach(dev)); +} + +static int +cambria_gpio_detach(device_t dev) +{ + struct cambria_gpio_softc *sc = device_get_softc(dev); + + KASSERT(mtx_initialized(&sc->sc_mtx), ("gpio mutex not initialized")); + + bus_generic_detach(dev); + + mtx_destroy(&sc->sc_mtx); + + return(0); +} + +static device_method_t cambria_gpio_methods[] = { + DEVMETHOD(device_probe, cambria_gpio_probe), + DEVMETHOD(device_attach, cambria_gpio_attach), + DEVMETHOD(device_detach, cambria_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_pin_max, cambria_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, cambria_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, cambria_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, cambria_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, cambria_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, cambria_gpio_pin_get), + DEVMETHOD(gpio_pin_set, cambria_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, cambria_gpio_pin_toggle), + {0, 0}, +}; + +static driver_t cambria_gpio_driver = { + "gpio_cambria", + cambria_gpio_methods, + sizeof(struct cambria_gpio_softc), +}; +static devclass_t cambria_gpio_devclass; +extern devclass_t gpiobus_devclass, gpioc_devclass; +extern driver_t gpiobus_driver, gpioc_driver; + +DRIVER_MODULE(gpio_cambria, iicbus, cambria_gpio_driver, cambria_gpio_devclass, 0, 0); +DRIVER_MODULE(gpiobus, gpio_cambria, gpiobus_driver, gpiobus_devclass, 0, 0); +DRIVER_MODULE(gpioc, gpio_cambria, gpioc_driver, gpioc_devclass, 0, 0); +MODULE_VERSION(gpio_cambria, 1); +MODULE_DEPEND(gpio_cambria, iicbus, 1, 1, 1); Modified: head/sys/arm/xscale/ixp425/files.avila ============================================================================== --- head/sys/arm/xscale/ixp425/files.avila Thu Nov 11 19:39:38 2010 (r215141) +++ head/sys/arm/xscale/ixp425/files.avila Thu Nov 11 20:18:33 2010 (r215142) @@ -6,4 +6,5 @@ arm/xscale/ixp425/avila_gpio.c optional arm/xscale/ixp425/cambria_exp_space.c standard arm/xscale/ixp425/cambria_fled.c optional cambria_fled arm/xscale/ixp425/cambria_led.c optional cambria_led +arm/xscale/ixp425/cambria_gpio.c optional cambria_gpio arm/xscale/ixp425/ixdp425_pci.c optional pci Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Nov 11 19:39:38 2010 (r215141) +++ head/sys/dev/gpio/gpiobus.c Thu Nov 11 20:18:33 2010 (r215142) @@ -481,7 +481,7 @@ static device_method_t gpiobus_methods[] { 0, 0 } }; -static driver_t gpiobus_driver = { +driver_t gpiobus_driver = { "gpiobus", gpiobus_methods, sizeof(struct gpiobus_softc) Modified: head/sys/dev/gpio/gpioc.c ============================================================================== --- head/sys/dev/gpio/gpioc.c Thu Nov 11 19:39:38 2010 (r215141) +++ head/sys/dev/gpio/gpioc.c Thu Nov 11 20:18:33 2010 (r215142) @@ -188,7 +188,7 @@ static device_method_t gpioc_methods[] = { 0, 0 } }; -static driver_t gpioc_driver = { +driver_t gpioc_driver = { "gpioc", gpioc_methods, sizeof(struct gpioc_softc) From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 20:25:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DA6A106564A; Thu, 11 Nov 2010 20:25:25 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id BBA888FC19; Thu, 11 Nov 2010 20:25:24 +0000 (UTC) Received: by qyk5 with SMTP id 5so1193394qyk.13 for ; Thu, 11 Nov 2010 12:25:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.196.67 with SMTP id ef3mr1187473qab.160.1289505403073; Thu, 11 Nov 2010 11:56:43 -0800 (PST) Received: by 10.220.16.199 with HTTP; Thu, 11 Nov 2010 11:56:43 -0800 (PST) X-Originating-IP: [128.95.133.119] In-Reply-To: <20101111191900.GC17566@michelle.cdnetworks.com> References: <201011111808.oABI8olX079570@svn.freebsd.org> <20101111183409.GA1011@pluto.vnode.local> <20101111191900.GC17566@michelle.cdnetworks.com> Date: Thu, 11 Nov 2010 11:56:43 -0800 Message-ID: From: Rob Farmer To: pyunyh@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon , Joel Dahl Subject: Re: svn commit: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 20:25:25 -0000 On Thu, Nov 11, 2010 at 11:19, Pyun YongHyeon wrote: > On Thu, Nov 11, 2010 at 07:34:09PM +0100, Joel Dahl wrote: >> On 11-11-2010 18:08, Pyun YongHyeon wrote: >> > Author: yongari >> > Date: Thu Nov 11 18:08:50 2010 >> > New Revision: 215132 >> > URL: http://svn.freebsd.org/changeset/base/215132 >> > >> > Log: >> > =A0 Add basic WOL support for MCP ethernet controllers. It seems the >> > =A0 controller does not perform automatic switching from 1000Mbps link >> > =A0 to 10/100Mbps link when WOL is activated. Implement establishing >> > =A0 10/100Mps link with auto-negotiation in driver. Link status change >> > =A0 handler was modified to remove taskqueue based approach since driv= er >> > =A0 now needs synchronous handling for link establishment. >> >> Somewhat unrelated but this commit reminds me of something: why do we st= ill >> keep the nve driver? =A0I thought nfe was written as a replacement years= ago? >> > > Perhaps to address edge cases not covered by nfe(4)? > Personally I don't know any of them. amd64/115126 ? Its even assigned to you. --=20 Rob Farmer From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 21:19:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 726CB106566B; Thu, 11 Nov 2010 21:19:05 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 22DA08FC0C; Thu, 11 Nov 2010 21:19:04 +0000 (UTC) Received: by pwi10 with SMTP id 10so539852pwi.13 for ; Thu, 11 Nov 2010 13:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=4h0nHWajC6ZAPk83cLk+lLBy5JifCG6voFrc/glUAmE=; b=Sd7kKP0iMAZB7QJtcseScoNBWJHUoNXOA7m7hFjSqwoGggcqzKwnkr+ef2ZAExaxaV hywrUo1RcLT7Mrl55L6q43x3b21sNeuKPXULocuDjyLzpZmhuKFUPVNJ6Vw0eglhTQzM LEFHszf6dPNpMQov0g3I7RJxllDBuQo5a7s94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Z4YtnZ5IcX6jw+TQgIrBa9Q6dXD0daMpvldAkoGJcGGoWy7C+QeyY/iPPFw26s3aTV egcnX22QhMuVNpwJ3MkvPZJyx5Eae5QgcjMVsaSitg4O9ZuzORVYbYrwbesy1+cmPpwN JFIv7M7GSa4RrjFcbSkw5uh/wS8Or9UIj4ye0= Received: by 10.142.43.5 with SMTP id q5mr851461wfq.401.1289510344583; Thu, 11 Nov 2010 13:19:04 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id x18sm2855673wfa.11.2010.11.11.13.19.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Nov 2010 13:19:03 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 11 Nov 2010 13:18:08 -0800 From: Pyun YongHyeon Date: Thu, 11 Nov 2010 13:18:08 -0800 To: Rob Farmer Message-ID: <20101111211808.GE17566@michelle.cdnetworks.com> References: <201011111808.oABI8olX079570@svn.freebsd.org> <20101111183409.GA1011@pluto.vnode.local> <20101111191900.GC17566@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon , Joel Dahl Subject: Re: svn commit: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 21:19:05 -0000 On Thu, Nov 11, 2010 at 11:56:43AM -0800, Rob Farmer wrote: > On Thu, Nov 11, 2010 at 11:19, Pyun YongHyeon wrote: > > On Thu, Nov 11, 2010 at 07:34:09PM +0100, Joel Dahl wrote: > >> On 11-11-2010 18:08, Pyun YongHyeon wrote: > >> > Author: yongari > >> > Date: Thu Nov 11 18:08:50 2010 > >> > New Revision: 215132 > >> > URL: http://svn.freebsd.org/changeset/base/215132 > >> > > >> > Log: > >> > ? Add basic WOL support for MCP ethernet controllers. It seems the > >> > ? controller does not perform automatic switching from 1000Mbps link > >> > ? to 10/100Mbps link when WOL is activated. Implement establishing > >> > ? 10/100Mps link with auto-negotiation in driver. Link status change > >> > ? handler was modified to remove taskqueue based approach since driver > >> > ? now needs synchronous handling for link establishment. > >> > >> Somewhat unrelated but this commit reminds me of something: why do we still > >> keep the nve driver? ?I thought nfe was written as a replacement years ago? > >> > > > > Perhaps to address edge cases not covered by nfe(4)? > > Personally I don't know any of them. > > amd64/115126 ? > > Its even assigned to you. > Yes, but I think this has nothing to do with the subject. I think MCP controllers have a silicon bug that does not generate TX completion interrupts under certain conditions/controller models. The PR indicates what was really happened which also indicates possible silicon bug. nve(4) also seems to have some workaround for that but I wanted to verify it since we don't know what binary blob did during controller initialization. The message just shows informational message and does not reset controller so I think that edge case is already handled by nfe(4). From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 21:34:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E2111065672; Thu, 11 Nov 2010 21:34:36 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9ED298FC08; Thu, 11 Nov 2010 21:34:35 +0000 (UTC) Received: by qwj8 with SMTP id 8so1565279qwj.13 for ; Thu, 11 Nov 2010 13:34:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.196.67 with SMTP id ef3mr1249335qab.160.1289511274869; Thu, 11 Nov 2010 13:34:34 -0800 (PST) Received: by 10.220.16.199 with HTTP; Thu, 11 Nov 2010 13:34:34 -0800 (PST) X-Originating-IP: [128.95.133.119] In-Reply-To: <20101111211808.GE17566@michelle.cdnetworks.com> References: <201011111808.oABI8olX079570@svn.freebsd.org> <20101111183409.GA1011@pluto.vnode.local> <20101111191900.GC17566@michelle.cdnetworks.com> <20101111211808.GE17566@michelle.cdnetworks.com> Date: Thu, 11 Nov 2010 13:34:34 -0800 Message-ID: From: Rob Farmer To: pyunyh@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon , Joel Dahl Subject: Re: svn commit: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 21:34:36 -0000 On Thu, Nov 11, 2010 at 13:18, Pyun YongHyeon wrote: > Yes, but I think this has nothing to do with the subject. > I think MCP controllers have a silicon bug that does not generate > TX completion interrupts under certain conditions/controller models. > The PR indicates what was really happened which also indicates > possible silicon bug. nve(4) also seems to have some workaround for > that but I wanted to verify it since we don't know what binary blob > did during controller initialization. The message just shows > informational message and does not reset controller so I think that > edge case is already handled by nfe(4). > I have a system that does this same thing - watchdog timeout (missed Tx interrupts) over and over. It also generates so much bogus traffic that all other systems connected to the same switch/hub lose their network connection while the machine is running. Switching to nve resolves the problem. If it can't be fixed, that's fine. Just please don't remove nve - there are systems that need it. -- Rob Farmer From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 21:36:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9D081065670; Thu, 11 Nov 2010 21:36:52 +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 A9DB78FC0C; Thu, 11 Nov 2010 21:36:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABLaqiQ085228; Thu, 11 Nov 2010 21:36:52 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABLaqID085226; Thu, 11 Nov 2010 21:36:52 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011112136.oABLaqID085226@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Nov 2010 21:36: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: r215144 - head/lib/libc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 21:36:52 -0000 Author: dim Date: Thu Nov 11 21:36:52 2010 New Revision: 215144 URL: http://svn.freebsd.org/changeset/base/215144 Log: Remove some unneeded spaces from the __sym_compat() macro, since newer versions of gas are more fussy about spaces surrounding '@' signs in versioned symbol names. Modified: head/lib/libc/include/compat.h Modified: head/lib/libc/include/compat.h ============================================================================== --- head/lib/libc/include/compat.h Thu Nov 11 20:52:24 2010 (r215143) +++ head/lib/libc/include/compat.h Thu Nov 11 21:36:52 2010 (r215144) @@ -36,7 +36,7 @@ #define __LIBC_COMPAT_H__ #define __sym_compat(sym,impl,verid) \ - .symver impl , sym @ verid + .symver impl, sym@verid __sym_compat(__semctl, freebsd7___semctl, FBSD_1.0); __sym_compat(msgctl, freebsd7_msgctl, FBSD_1.0); From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 21:49:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75437106566C; Thu, 11 Nov 2010 21:49:06 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 252108FC12; Thu, 11 Nov 2010 21:49:05 +0000 (UTC) Received: by pxi1 with SMTP id 1so539410pxi.13 for ; Thu, 11 Nov 2010 13:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=p7hVfB9yFAtYSbkB3ApOar4y4L8T4paheND/zD7ZuHY=; b=VOrp0nj+Ry7eRgHsIeDUmxXAgSia+6xkFRbHnQ595cMemYglS7Z7PckMYLZt/eEc0D djyqH+hkY04odvAjd8cR2CrjthNN2KCCU5tY2hf7oIm80TO3UoCXCp2xBJamGzOxqd9T NdwG1IKPC0qoh6C4PRHBwcyGyQJ+Nn8WeVl2A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=n9HnXPV0lnNYob9Hlbj6BS4hN9fBSLjrZh4CppGV5d9qvh8NEG3TyM4iw8NBYi0Kxj x3LnQjJetLSaUT64NmkIC4FgGoMz+mM1Uq0naIpfe1aoSm/0fNXNeIT9ERIHH2IlNrR6 b1xy6d4hbedBz3knIuQywW4YbLqtvsNa9iGRE= Received: by 10.143.18.20 with SMTP id v20mr1163449wfi.113.1289512145638; Thu, 11 Nov 2010 13:49:05 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id v19sm2891682wfh.0.2010.11.11.13.49.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Nov 2010 13:49:04 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 11 Nov 2010 13:48:10 -0800 From: Pyun YongHyeon Date: Thu, 11 Nov 2010 13:48:10 -0800 To: Rob Farmer Message-ID: <20101111214810.GH17566@michelle.cdnetworks.com> References: <201011111808.oABI8olX079570@svn.freebsd.org> <20101111183409.GA1011@pluto.vnode.local> <20101111191900.GC17566@michelle.cdnetworks.com> <20101111211808.GE17566@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon , Joel Dahl Subject: Re: svn commit: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 21:49:06 -0000 On Thu, Nov 11, 2010 at 01:34:34PM -0800, Rob Farmer wrote: > On Thu, Nov 11, 2010 at 13:18, Pyun YongHyeon wrote: > > Yes, but I think this has nothing to do with the subject. > > I think MCP controllers have a silicon bug that does not generate > > TX completion interrupts under certain conditions/controller models. > > The PR indicates what was really happened which also indicates > > possible silicon bug. nve(4) also seems to have some workaround for > > that but I wanted to verify it since we don't know what binary blob > > did during controller initialization. The message just shows > > informational message and does not reset controller so I think that > > edge case is already handled by nfe(4). > > > > I have a system that does this same thing - watchdog timeout (missed > Tx interrupts) over and over. It also generates so much bogus traffic As I said, the message is informational one so you can ignore it. nve(4) just does not show any message for that case. > that all other systems connected to the same switch/hub lose their > network connection while the machine is running. Switching to nve > resolves the problem. > I believe you're the first one that reported real issue. Could you give me more details about bogus traffic? I don't know what PHY was used with the controller but e1000phy(4) may have advertised flow-control so the bogus traffic could be a kind of flow-control storm triggered nfe(4)/e1000phy(4). Maybe opening a PR with dmesg/pciconf output would be better. > If it can't be fixed, that's fine. Just please don't remove nve - > there are systems that need it. > > -- > Rob Farmer From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 21:53:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280C9106566C; Thu, 11 Nov 2010 21:53:47 +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 17F428FC12; Thu, 11 Nov 2010 21:53:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABLrkQw085593; Thu, 11 Nov 2010 21:53:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABLrk8j085591; Thu, 11 Nov 2010 21:53:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201011112153.oABLrk8j085591@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 11 Nov 2010 21:53: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: r215145 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 21:53:47 -0000 Author: trasz Date: Thu Nov 11 21:53:46 2010 New Revision: 215145 URL: http://svn.freebsd.org/changeset/base/215145 Log: Fix style. Submitted by: bde Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Nov 11 21:36:52 2010 (r215144) +++ head/sys/kern/kern_proc.c Thu Nov 11 21:53:46 2010 (r215145) @@ -784,10 +784,10 @@ fill_kinfo_proc_only(struct proc *p, str calcru(p, &kp->ki_rusage.ru_utime, &kp->ki_rusage.ru_stime); PROC_SUNLOCK(p); calccru(p, &kp->ki_childutime, &kp->ki_childstime); - - /* Some callers want child-times in a single value */ + /* Some callers want child times in a single value. */ kp->ki_childtime = kp->ki_childstime; timevaladd(&kp->ki_childtime, &kp->ki_childutime); + tp = NULL; if (p->p_pgrp) { kp->ki_pgid = p->p_pgrp->pg_id; From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 22:21:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14BFC1065670; Thu, 11 Nov 2010 22:21:31 +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 0162F8FC1E; Thu, 11 Nov 2010 22:21:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABMLUhT086407; Thu, 11 Nov 2010 22:21:30 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABMLUlK086401; Thu, 11 Nov 2010 22:21:30 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201011112221.oABMLUlK086401@svn.freebsd.org> From: Martin Matuska Date: Thu, 11 Nov 2010 22:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215146 - in vendor/xz/dist: . po src/common src/liblzma/api src/liblzma/api/lzma src/liblzma/common src/liblzma/lzma src/xz X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 22:21:31 -0000 Author: mm Date: Thu Nov 11 22:21:30 2010 New Revision: 215146 URL: http://svn.freebsd.org/changeset/base/215146 Log: Vendor import of xz (stripped) Git revision: e45929260cd902036efd40c5610a8d0a50d5712b Release: 5.0.0 Approved by: delphij (mentor) Added: vendor/xz/dist/po/xz.pot Modified: vendor/xz/dist/ChangeLog vendor/xz/dist/TODO vendor/xz/dist/po/cs.po vendor/xz/dist/po/de.po vendor/xz/dist/po/it.po vendor/xz/dist/src/common/sysdefs.h vendor/xz/dist/src/liblzma/api/lzma.h vendor/xz/dist/src/liblzma/api/lzma/base.h vendor/xz/dist/src/liblzma/api/lzma/bcj.h vendor/xz/dist/src/liblzma/api/lzma/block.h vendor/xz/dist/src/liblzma/api/lzma/container.h vendor/xz/dist/src/liblzma/api/lzma/filter.h vendor/xz/dist/src/liblzma/api/lzma/hardware.h vendor/xz/dist/src/liblzma/api/lzma/index.h vendor/xz/dist/src/liblzma/api/lzma/index_hash.h vendor/xz/dist/src/liblzma/api/lzma/lzma.h vendor/xz/dist/src/liblzma/api/lzma/stream_flags.h vendor/xz/dist/src/liblzma/api/lzma/version.h vendor/xz/dist/src/liblzma/api/lzma/vli.h vendor/xz/dist/src/liblzma/common/common.c vendor/xz/dist/src/liblzma/common/filter_encoder.c vendor/xz/dist/src/liblzma/common/filter_encoder.h vendor/xz/dist/src/liblzma/common/index.c vendor/xz/dist/src/liblzma/common/index_decoder.c vendor/xz/dist/src/liblzma/common/index_encoder.c vendor/xz/dist/src/liblzma/lzma/lzma2_decoder.c vendor/xz/dist/src/liblzma/lzma/lzma_decoder.c vendor/xz/dist/src/liblzma/lzma/lzma_encoder.c vendor/xz/dist/src/xz/message.c vendor/xz/dist/src/xz/message.h vendor/xz/dist/src/xz/signals.c Modified: vendor/xz/dist/ChangeLog ============================================================================== --- vendor/xz/dist/ChangeLog Thu Nov 11 21:53:46 2010 (r215145) +++ vendor/xz/dist/ChangeLog Thu Nov 11 22:21:30 2010 (r215146) @@ -1,3 +1,114 @@ +commit e45929260cd902036efd40c5610a8d0a50d5712b +Author: Lasse Collin +Date: Sat Oct 23 17:25:52 2010 +0300 + + Build: Fix mydist rule when .git doesn't exist. + +commit 6e1326fcdf6b6209949be57cfe3ad4b781b65168 +Author: Lasse Collin +Date: Sat Oct 23 14:15:35 2010 +0300 + + Add NEWS for 5.0.0. + +commit b667a3ef6338a2c1db7b7706b1f6c99ea392221c +Author: Lasse Collin +Date: Sat Oct 23 14:02:53 2010 +0300 + + Bump version to 5.0.0 and liblzma version-info to 5:0:0. + +commit 8c947e9291691629714dafb4536c718b6cc24fbd +Author: Lasse Collin +Date: Sat Oct 23 12:30:54 2010 +0300 + + liblzma: Make lzma_code() check the reserved members in lzma_stream. + + If any of the reserved members in lzma_stream are non-zero + or non-NULL, LZMA_OPTIONS_ERROR is returned. It is possible + that a new feature in the future is indicated by just setting + a reserved member to some other value, so the old liblzma + version need to catch it as an unsupported feature. + +commit e61d85e082743ebd2dd0ff28fc0a82482ede0538 +Author: Lasse Collin +Date: Sat Oct 23 12:26:33 2010 +0300 + + Windows: Use MinGW's stdio functions. + + The non-standard ones from msvcrt.dll appear to work + most of the time with XZ Utils, but there are some + corner cases where things may go very wrong. So it's + good to use the better replacements provided by + MinGW(-w64) runtime. + +commit 23e23f1dc029146714c9a98313ab3ea93d71a2fc +Author: Lasse Collin +Date: Sat Oct 23 12:21:32 2010 +0300 + + liblzma: Use 512 as INDEX_GROUP_SIZE. + + This lets compiler use shifting instead of 64-bit division. + +commit 613939fc82603b75b59eee840871a05bc8dd08e0 +Author: Lasse Collin +Date: Sat Oct 23 12:20:11 2010 +0300 + + liblzma: A few ABI tweaks to reserve space in structures. + +commit 68b83f252df3d27480a9f6f03445d16f6506fef1 +Author: Lasse Collin +Date: Thu Oct 21 23:16:11 2010 +0300 + + xz: Make sure that message_strm() can never return NULL. + +commit d09c5753e33ff96ee57edb6d1e98e34041203695 +Author: Lasse Collin +Date: Thu Oct 21 23:06:31 2010 +0300 + + liblzma: Update the comments in the API headers. + + Adding support for LZMA_FINISH for Index encoding and + decoding needed tiny additions to the relevant .c files too. + +commit 33c1c0e102eb529588503b8beea0903a45488fad +Author: Lasse Collin +Date: Tue Oct 19 12:08:30 2010 +0300 + + Update INSTALL.generic. + +commit 0076e03641f201c4b77dddd5a6db5880be19a78c +Author: Lasse Collin +Date: Tue Oct 19 11:44:37 2010 +0300 + + Clean up a few FIXMEs and TODOs. + + lzma_chunk_size() was commented out because it is + currently useless. + +commit ce34ec4f54ff8b753da236f371ad8dd23c8135c9 +Author: Lasse Collin +Date: Tue Oct 19 10:21:08 2010 +0300 + + Update docs. + +commit f0fa880d247e73264d2c04fe31fb3412318a0026 +Author: Lasse Collin +Date: Tue Oct 12 15:13:30 2010 +0300 + + xz: Avoid raise() also on OpenVMS. + + This is similar to DOS/DJGPP that killing the program + with a signal will print a backtrace or a similar message. + +commit ac462b1c47c451f5c62e428306314c4bdad8ae7f +Author: Lasse Collin +Date: Mon Oct 11 21:26:19 2010 +0300 + + xz: Avoid SA_RESTART for portability reasons. + + SA_RESTART is not as portable as I had hoped. It's missing + at least from OpenVMS, QNX, and DJGPP). Luckily we can do + fine without SA_RESTART. + commit d52b411716a614c202e89ba732492efb9916cd3f Author: Lasse Collin Date: Sun Oct 10 17:58:58 2010 +0300 Modified: vendor/xz/dist/TODO ============================================================================== --- vendor/xz/dist/TODO Thu Nov 11 21:53:46 2010 (r215145) +++ vendor/xz/dist/TODO Thu Nov 11 22:21:30 2010 (r215146) @@ -18,15 +18,20 @@ Known bugs XZ Utils compress some files significantly worse than LZMA Utils. This is due to faster compression presets used by XZ Utils, and - can be worked around by using "xz --extreme". However, the presets - need some tweaking and maybe this issue can be minimized without - making the typical case too much slower. + can often be worked around by using "xz --extreme". With some files + --extreme isn't enough though: it's most likely with files that + compress extremely well, so going from compression ratio of 0.003 + to 0.004 means big relative increase in the compressed file size. xz doesn't quote unprintable characters when it displays file names given on the command line. tuklib_exit() doesn't block signals => EINTR is possible. + SIGTSTP is not handled. If xz is stopped, the estimated remaining + time and calculated (de)compression speed won't make sense in the + progress indicator (xz --verbose). + Missing features ---------------- @@ -41,11 +46,13 @@ Missing features Buffer-to-buffer coding could use less RAM (especially when decompressing LZMA1 or LZMA2). - I/O library is not implemented. It will possibly be named libzzf. + I/O library is not implemented (similar to gzopen() in zlib). + It will be a separate library that supports uncompressed, .gz, + .bz2, .lzma, and .xz files. lzma_strerror() to convert lzma_ret to human readable form? This is tricky, because the same error codes are used with - slightly different meanings. + slightly different meanings, and this cannot be fixed anymore. Documentation Modified: vendor/xz/dist/po/cs.po ============================================================================== --- vendor/xz/dist/po/cs.po Thu Nov 11 21:53:46 2010 (r215145) +++ vendor/xz/dist/po/cs.po Thu Nov 11 22:21:30 2010 (r215146) @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: xz-utils\n" "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" -"POT-Creation-Date: 2010-09-17 18:33+0200\n" +"POT-Creation-Date: 2010-10-23 17:48+0300\n" "PO-Revision-Date: 2010-09-17 18:54+0200\n" "Last-Translator: Marek ÄŒernocký \n" "Language-Team: Czech \n" @@ -30,8 +30,7 @@ msgstr "%s: Neznámý typ kontroly integ #: src/xz/args.c:382 msgid "Only one file can be specified with `--files' or `--files0'." -msgstr "" -"Spolu s pÅ™epínaÄi „--files“ nebo „--files0“ může být zadán pouze jeden soubor" +msgstr "Spolu s pÅ™epínaÄi „--files“ nebo „--files0“ může být zadán pouze jeden soubor" #: src/xz/args.c:445 #, c-format @@ -52,8 +51,7 @@ msgstr "Použití pÅ™ednastavení v rež #: src/xz/coder.c:131 msgid "The exact options of the presets may vary between software versions." -msgstr "" -"PÅ™esné volby u pÅ™ednastavení se mohou liÅ¡it mezi různými verzemi softwaru." +msgstr "PÅ™esné volby u pÅ™ednastavení se mohou liÅ¡it mezi různými verzemi softwaru." #: src/xz/coder.c:157 msgid "The .lzma format supports only the LZMA1 filter" @@ -74,12 +72,8 @@ msgstr "Dekomprimace bude vyžadovat %s #: src/xz/coder.c:247 #, c-format -msgid "" -"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the " -"memory usage limit of %s MiB" -msgstr "" -"PÅ™izpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo " -"pÅ™ekroÄeno omezení použitelné pamÄ›ti %s MiB" +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "PÅ™izpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo pÅ™ekroÄeno omezení použitelné pamÄ›ti %s MiB" #. TRANSLATORS: When compression or decompression finishes, #. and xz is going to remove the source file, xz first checks @@ -159,8 +153,7 @@ msgstr "%s: Selhalo zavÅ™ení souboru: % #: src/xz/file_io.c:762 src/xz/file_io.c:946 #, c-format msgid "%s: Seeking failed when trying to create a sparse file: %s" -msgstr "" -"%s: Selhalo nastavení pozice pÅ™i pokusu o vytvoÅ™ení záložního souboru: %s" +msgstr "%s: Selhalo nastavení pozice pÅ™i pokusu o vytvoÅ™ení záložního souboru: %s" #: src/xz/file_io.c:821 #, c-format @@ -319,12 +312,10 @@ msgstr " Zarovnání proudu: %s\ #: src/xz/list.c:693 msgid "" " Streams:\n" -" Stream Blocks CompOffset UncompOffset CompSize " -"UncompSize Ratio Check Padding" +" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" msgstr "" " Proudy:\n" -" Proud Bloky KomprPozice NekomprPozice KomprVelikost " -"NekomprVelikost PomÄ›r Kontrola Zarovnání" +" Proud Bloky KomprPozice NekomprPozice KomprVelikost NekomprVelikost PomÄ›r Kontrola Zarovnání" #. TRANSLATORS: The second line is column headings. All #. except Check are right aligned; Check is left aligned. @@ -332,12 +323,10 @@ msgstr "" #, c-format msgid "" " Blocks:\n" -" Stream Block CompOffset UncompOffset TotalSize " -"UncompSize Ratio Check" +" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" msgstr "" " Bloky:\n" -" Proud Blok KomprPozice NekomprPozice CelkVelikost " -"NekomprVelikost PomÄ›r Kontrola" +" Proud Blok KomprPozice NekomprPozice CelkVelikost NekomprVelikost PomÄ›r Kontrola" #. TRANSLATORS: These are additional column headings #. for the most verbose listing mode. CheckVal @@ -408,78 +397,69 @@ msgstr "%s: NeoÄekávaný konec vstupu #: src/xz/main.c:120 #, c-format -msgid "" -"%s: Null character found when reading filenames; maybe you meant to use `--" -"files0' instead of `--files'?" -msgstr "" -"%s: Byl nalezen nulový znak pÅ™i Ätení názvů souborů; nechtÄ›li jste náhodou " -"použít „--files0“ místo „--files“?" +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Byl nalezen nulový znak pÅ™i Ätení názvů souborů; nechtÄ›li jste náhodou použít „--files0“ místo „--files“?" #: src/xz/main.c:174 msgid "Compression and decompression with --robot are not supported yet." msgstr "Komprimace a dekomprimace s pÅ™epínaÄem --robot není zatím podporovaná." #: src/xz/main.c:231 -msgid "" -"Cannot read data from standard input when reading filenames from standard " -"input" -msgstr "" -"Ze standardního vstupu nelze Äíst data, když se ze standardního vstupu " -"naÄítají názvy souborů" +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Ze standardního vstupu nelze Äíst data, když se ze standardního vstupu naÄítají názvy souborů" -#: src/xz/message.c:800 src/xz/message.c:844 +#: src/xz/message.c:792 src/xz/message.c:842 msgid "Internal error (bug)" msgstr "Interní chyba" -#: src/xz/message.c:807 +#: src/xz/message.c:799 msgid "Cannot establish signal handlers" msgstr "Nelze ustanovit ovladaÄ signálu" -#: src/xz/message.c:816 +#: src/xz/message.c:808 msgid "No integrity check; not verifying file integrity" msgstr "Žádná kontrola integrity; integrita souboru se nebude ověřovat" -#: src/xz/message.c:819 +#: src/xz/message.c:811 msgid "Unsupported type of integrity check; not verifying file integrity" -msgstr "" -"Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat" +msgstr "Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat" -#: src/xz/message.c:826 +#: src/xz/message.c:818 msgid "Memory usage limit reached" msgstr "Dosaženo omezení použitelné pamÄ›ti" -#: src/xz/message.c:829 +#: src/xz/message.c:821 msgid "File format not recognized" msgstr "Formát souboru nebyl rozpoznán" -#: src/xz/message.c:832 +#: src/xz/message.c:824 msgid "Unsupported options" msgstr "Nepodporovaná volba" -#: src/xz/message.c:835 +#: src/xz/message.c:827 msgid "Compressed data is corrupt" msgstr "Komprimovaná data jsou poÅ¡kozená" -#: src/xz/message.c:838 +#: src/xz/message.c:830 msgid "Unexpected end of input" msgstr "NeoÄekávaný konec vstupu" -#: src/xz/message.c:886 +#: src/xz/message.c:881 #, c-format msgid "%s MiB of memory is required. The limit is %s." msgstr "Je vyžadováno %s MiB pamÄ›ti. Limit je %s." -#: src/xz/message.c:1053 +#: src/xz/message.c:1048 #, c-format msgid "%s: Filter chain: %s\n" msgstr "%s: Omezující filtr: %s\n" -#: src/xz/message.c:1063 +#: src/xz/message.c:1058 #, c-format msgid "Try `%s --help' for more information." msgstr "Zkuste „%s --help“ pro více informací" -#: src/xz/message.c:1089 +#: src/xz/message.c:1084 #, c-format msgid "" "Usage: %s [OPTION]... [FILE]...\n" @@ -490,18 +470,15 @@ msgstr "" "Komprimuje nebo dekomprimuje SOUBORy ve formátu xz.\n" "\n" -#: src/xz/message.c:1096 -msgid "" -"Mandatory arguments to long options are mandatory for short options too.\n" -msgstr "" -"Povinné argumenty pro dlouhé pÅ™epínaÄe jsou povinné rovněž pro krátké " -"pÅ™epínaÄe.\n" +#: src/xz/message.c:1091 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Povinné argumenty pro dlouhé pÅ™epínaÄe jsou povinné rovněž pro krátké pÅ™epínaÄe.\n" -#: src/xz/message.c:1100 +#: src/xz/message.c:1095 msgid " Operation mode:\n" msgstr "OperaÄní režim:\n" -#: src/xz/message.c:1103 +#: src/xz/message.c:1098 msgid "" " -z, --compress force compression\n" " -d, --decompress force decompression\n" @@ -513,7 +490,7 @@ msgstr "" " -t, --test testovat integritu komprimovaného souboru\n" " -l, --list vypsat informace o souborech .xz" -#: src/xz/message.c:1109 +#: src/xz/message.c:1104 msgid "" "\n" " Operation modifiers:\n" @@ -521,39 +498,33 @@ msgstr "" "\n" "Modifikátory operací:\n" -#: src/xz/message.c:1112 +#: src/xz/message.c:1107 msgid "" " -k, --keep keep (don't delete) input files\n" " -f, --force force overwrite of output file and (de)compress links\n" " -c, --stdout write to standard output and don't delete input files" msgstr "" " -k, --keep zachovat (nemazat) vstupní soubory\n" -" -f, --force vynutit pÅ™epis výstupního souboru a de/komprimovat " -"odkazy\n" -" -c, --stdout zapisovat na standardní výstup a nemazat vstupní " -"soubory" +" -f, --force vynutit pÅ™epis výstupního souboru a de/komprimovat odkazy\n" +" -c, --stdout zapisovat na standardní výstup a nemazat vstupní soubory" -#: src/xz/message.c:1118 +#: src/xz/message.c:1113 msgid "" " --no-sparse do not create sparse files when decompressing\n" " -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" " --files[=FILE] read filenames to process from FILE; if FILE is\n" " omitted, filenames are read from the standard input;\n" -" filenames must be terminated with the newline " -"character\n" +" filenames must be terminated with the newline character\n" " --files0[=FILE] like --files but use the null character as terminator" msgstr "" " --no-sparse nevytvářet pÅ™i dekomprimaci záložní soubory\n" " -S, --suffix=.PRIP použít u komprimovaných souborů příponu „.PRIP“\n" -" --files[=SOUBOR] Äíst názvy souborů, které se mají zpracovat, ze " -"SOUBORu;\n" -" pokud není SOUBOR zadán, Äte se ze standardního " -"vstupu;\n" +" --files[=SOUBOR] Äíst názvy souborů, které se mají zpracovat, ze SOUBORu;\n" +" pokud není SOUBOR zadán, Äte se ze standardního vstupu;\n" " názvy souborů musí být zakonÄeny znakem nového řádku\n" -" --files0[=SOUBOR] stejné jako --files, ale použít k zakonÄování nulový " -"znak" +" --files0[=SOUBOR] stejné jako --files, ale použít k zakonÄování nulový znak" -#: src/xz/message.c:1126 +#: src/xz/message.c:1121 msgid "" "\n" " Basic file format and compression options:\n" @@ -561,7 +532,7 @@ msgstr "" "\n" "Základní pÅ™epínaÄe pro formát souboru a komprimaci:\n" -#: src/xz/message.c:1128 +#: src/xz/message.c:1123 msgid "" " -F, --format=FMT file format to encode or decode; possible values are\n" " `auto' (default), `xz', `lzma', and `raw'\n" @@ -570,76 +541,62 @@ msgid "" msgstr "" " -F, --format=FORMÃT formát souboru k zakódování nebo dekódování; možné\n" " hodnoty jsou „auto“ (výchozí), „xz“, „lzma“ a „raw“\n" -" -C, --check=KONTROLA typ kontroly integrity: „none“ (používejte s " -"rozmyslem),\n" +" -C, --check=KONTROLA typ kontroly integrity: „none“ (používejte s rozmyslem),\n" " „crc32“, „crc64“ (výchozí) nebo „sha256“" -#: src/xz/message.c:1135 +#: src/xz/message.c:1130 msgid "" -" -0 ... -9 compression preset; default is 6; take compressor " -"*and*\n" -" decompressor memory usage into account before using " -"7-9!" -msgstr "" -" -0 .. -9 pÅ™ednastavení komprimace; výchozí je 6; než " -"použijete\n" -" hodnoty 7 – 9, vezmÄ›te do úvahy množství použité " -"pamÄ›ti" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 .. -9 pÅ™ednastavení komprimace; výchozí je 6; než použijete\n" +" hodnoty 7 – 9, vezmÄ›te do úvahy množství použité pamÄ›ti" -#: src/xz/message.c:1139 +#: src/xz/message.c:1134 msgid "" -" -e, --extreme try to improve compression ratio by using more CPU " -"time;\n" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" " does not affect decompressor memory requirements" msgstr "" " -e, --extreme zkusit zlepÅ¡it pomÄ›r komprimace využitím více Äasu\n" " procesoru; nemá vliv na paměťové nároky dekomprimace" -#: src/xz/message.c:1144 +#: src/xz/message.c:1139 #, no-c-format msgid "" " --memlimit-compress=LIMIT\n" " --memlimit-decompress=LIMIT\n" " -M, --memlimit=LIMIT\n" -" set memory usage limit for compression, " -"decompression,\n" +" set memory usage limit for compression, decompression,\n" " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" msgstr "" " --memlimit-compress=LIMIT\n" " --memlimit-decompress=LIMIT\n" " -M, --memlimit=LIMIT\n" " nastaví omezení použitelné pamÄ›ti pro komprimaci,\n" -" dekomprimaci nebo obojí; LIMIT je v bajtech, % z " -"pamÄ›ti\n" +" dekomprimaci nebo obojí; LIMIT je v bajtech, % z pamÄ›ti\n" " RAM nebo 0 pro výchozí" -#: src/xz/message.c:1151 +#: src/xz/message.c:1146 msgid "" -" --no-adjust if compression settings exceed the memory usage " -"limit,\n" -" give an error instead of adjusting the settings " -"downwards" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" msgstr "" -" --no-adjust pokud nastavení komprimace pÅ™esáhne omezení " -"použitelné\n" +" --no-adjust pokud nastavení komprimace pÅ™esáhne omezení použitelné\n" " pamÄ›ti, pÅ™edat chybu namísto snížení nastavení" -#: src/xz/message.c:1157 +#: src/xz/message.c:1152 msgid "" "\n" " Custom filter chain for compression (alternative for using presets):" msgstr "" "\n" -"Vlastní omezující filtr pro komprimaci (alternativa k použití " -"pÅ™ednastavených):" +"Vlastní omezující filtr pro komprimaci (alternativa k použití pÅ™ednastavených):" -#: src/xz/message.c:1166 +#: src/xz/message.c:1161 msgid "" "\n" -" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero " -"or\n" -" --lzma2[=OPTS] more of the following options (valid values; " -"default):\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" " preset=PRE reset options to a preset (0-9[e])\n" " dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" " lc=NUM number of literal context bits (0-4; 3)\n" @@ -647,33 +604,24 @@ msgid "" " pb=NUM number of position bits (0-4; 2)\n" " mode=MODE compression mode (fast, normal; normal)\n" " nice=NUM nice length of a match (2-273; 64)\n" -" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; " -"bt4)\n" -" depth=NUM maximum search depth; 0=automatic " -"(default)" -msgstr "" -"\n" -" --lzma1[=VOLBY] LZMA1 nebo LZMA2; VOLBY je Äárkou oddÄ›lovaný seznam " -"žádné\n" -" --lzma2[=VOLBY] nebo více následujících voleb (platné hodnoty; " -"výchozí):\n" -" preset=PŘE zmÄ›nit volby na PŘEdnastavené (0 – 9" -"[e])\n" -" dict=POÄŒ velikost slovníku (4 KiB – 1536 MiB; 8 " -"MiB)\n" -" lc=POÄŒ poÄet kontextových bitů literálu (0 – 4; " -"3)\n" -" lp=POÄŒ poÄet poziÄních bitů literálu (0 – 4; " -"0)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=VOLBY] LZMA1 nebo LZMA2; VOLBY je Äárkou oddÄ›lovaný seznam žádné\n" +" --lzma2[=VOLBY] nebo více následujících voleb (platné hodnoty; výchozí):\n" +" preset=PŘE zmÄ›nit volby na PŘEdnastavené (0 – 9[e])\n" +" dict=POÄŒ velikost slovníku (4 KiB – 1536 MiB; 8 MiB)\n" +" lc=POÄŒ poÄet kontextových bitů literálu (0 – 4; 3)\n" +" lp=POÄŒ poÄet poziÄních bitů literálu (0 – 4; 0)\n" " pb=POÄŒ poÄet poziÄních bitů (0 – 4; 2)\n" " mode=REŽIM režim komprimace (fast, normal; normal)\n" " nice=NUM příznivá délka shody (2 – 273; 64)\n" -" mf=NÃZEV hledání shod (hc3, hc4, bt2, bt3, bt4; " -"bt4)\n" +" mf=NÃZEV hledání shod (hc3, hc4, bt2, bt3, bt4; bt4)\n" " depth=POÄŒ maximální hloubka prohledávání;\n" " 0 = automaticky (výchozí)" -#: src/xz/message.c:1181 +#: src/xz/message.c:1176 msgid "" "\n" " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" @@ -695,7 +643,7 @@ msgstr "" " Platné volby pro vÅ¡echny filtry BCJ:\n" " start=POÄŒ poÄáteÄní posun pro pÅ™evody (výchozí=0)" -#: src/xz/message.c:1193 +#: src/xz/message.c:1188 msgid "" "\n" " --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" @@ -704,11 +652,10 @@ msgid "" msgstr "" "\n" " --delta[=VOLBY] Filtr Delta; platné VOLBY (platné hodnoty; výchozí):\n" -" dist=POÄŒ vzdálenost mezi bajty, které jsou " -"odeÄítány\n" +" dist=POÄŒ vzdálenost mezi bajty, které jsou odeÄítány\n" " jeden od druhého (1 – 256; 1)" -#: src/xz/message.c:1201 +#: src/xz/message.c:1196 msgid "" "\n" " Other options:\n" @@ -716,79 +663,71 @@ msgstr "" "\n" " Ostatní pÅ™epínaÄe:\n" -#: src/xz/message.c:1204 +#: src/xz/message.c:1199 msgid "" -" -q, --quiet suppress warnings; specify twice to suppress errors " -"too\n" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" " -v, --verbose be verbose; specify twice for even more verbose" msgstr "" -" -q, --quiet potlaÄit varování; zadáním dvakrát, potlaÄíte i " -"chyby\n" +" -q, --quiet potlaÄit varování; zadáním dvakrát, potlaÄíte i chyby\n" " -v, --verbose podrobnÄ›jší zprávy; zadáním dvakrát, budou jeÅ¡tÄ›\n" " podrobnÄ›jší" -#: src/xz/message.c:1209 +#: src/xz/message.c:1204 msgid " -Q, --no-warn make warnings not affect the exit status" msgstr " -Q, --no-warn způsobí, že varování neovlivní stav ukonÄení" -#: src/xz/message.c:1211 -msgid "" -" --robot use machine-parsable messages (useful for scripts)" +#: src/xz/message.c:1206 +msgid " --robot use machine-parsable messages (useful for scripts)" msgstr "" " --robot použít strojovÄ› analyzovatelné zprávy (užiteÄné pro\n" " skripty)" -#: src/xz/message.c:1214 +#: src/xz/message.c:1209 msgid "" -" --info-memory display the total amount of RAM and the currently " -"active\n" +" --info-memory display the total amount of RAM and the currently active\n" " memory usage limits, and exit" msgstr "" -" --info-memory zobrazit celkové množství pamÄ›ti RAM a souÄasné " -"aktivní\n" +" --info-memory zobrazit celkové množství pamÄ›ti RAM a souÄasné aktivní\n" " omezení použitelné pamÄ›ti a skonÄit" -#: src/xz/message.c:1217 +#: src/xz/message.c:1212 msgid "" " -h, --help display the short help (lists only the basic options)\n" " -H, --long-help display this long help and exit" msgstr "" -" -h, --help zobrazit krátkou nápovÄ›du (vypíše jen základní " -"pÅ™epínaÄe)\n" +" -h, --help zobrazit krátkou nápovÄ›du (vypíše jen základní pÅ™epínaÄe)\n" " -H, --long-help zobrazit tuto úplnou nápovÄ›du a skonÄit" -#: src/xz/message.c:1221 +#: src/xz/message.c:1216 msgid "" " -h, --help display this short help and exit\n" " -H, --long-help display the long help (lists also the advanced options)" msgstr "" " -h, --help zobrazit tuto zkrácenou nápovÄ›du a skonÄit\n" -" -H, --long-help zobrazit úplnou nápovÄ›du (vypíše i pokroÄilé " -"pÅ™epínaÄe)" +" -H, --long-help zobrazit úplnou nápovÄ›du (vypíše i pokroÄilé pÅ™epínaÄe)" -#: src/xz/message.c:1226 +#: src/xz/message.c:1221 msgid " -V, --version display the version number and exit" msgstr " -V, --version zobrazit Äíslo verze a skonÄit" -#: src/xz/message.c:1228 +#: src/xz/message.c:1223 msgid "" "\n" "With no FILE, or when FILE is -, read standard input.\n" msgstr "" "\n" -"Pokud SOUBOR není zadán nebo pokud je -, bude se Äíst ze standardního " -"vstupu.\n" +"Pokud SOUBOR není zadán nebo pokud je -, bude se Äíst ze standardního vstupu.\n" #. TRANSLATORS: This message indicates the bug reporting address #. for this package. Please add _another line_ saying #. "Report translation bugs to <...>\n" with the email or WWW #. address for translation bugs. Thanks. -#: src/xz/message.c:1234 +#: src/xz/message.c:1229 #, c-format msgid "Report bugs to <%s> (in English or Finnish).\n" msgstr "Chyby hlaste na <%s> (v angliÄtinÄ› nebo finÅ¡tinÄ›).\n" -#: src/xz/message.c:1236 +#: src/xz/message.c:1231 #, c-format msgid "%s home page: <%s>\n" msgstr "Domovská stránka %s: <%s>\n" @@ -824,11 +763,8 @@ msgstr "Vybraný vyhledávaÄ shod vyža #: src/xz/suffix.c:79 src/xz/suffix.c:164 #, c-format -msgid "" -"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" -msgstr "" -"%s: S pÅ™epínaÄem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do " -"standardního výstupu" +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: S pÅ™epínaÄem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do standardního výstupu" #: src/xz/suffix.c:99 #, c-format @@ -857,9 +793,7 @@ msgstr "%s: Neplatná jednotka s pÅ™edpo #: src/xz/util.c:105 msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." -msgstr "" -"Platné jednotky s pÅ™edponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a " -"„GiB“ (2^30 B)." +msgstr "Platné jednotky s pÅ™edponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a „GiB“ (2^30 B)." #: src/xz/util.c:122 #, c-format @@ -893,49 +827,37 @@ msgstr "Neznámá chyba" #~ msgstr "%s MiB (%s bajtů)\n" #~ msgid "" -#~ " -e, --extreme use more CPU time when encoding to increase " -#~ "compression\n" +#~ " -e, --extreme use more CPU time when encoding to increase compression\n" #~ " ratio without increasing memory usage of the decoder" #~ msgstr "" -#~ " -e, --extreme využít více procesorového Äasu pro kódování, Äímž " -#~ "se\n" -#~ " zvýší kompresní pomÄ›r bez zvýšení pamÄ›ti použité " -#~ "kodérem" +#~ " -e, --extreme využít více procesorového Äasu pro kódování, Äímž se\n" +#~ " zvýší kompresní pomÄ›r bez zvýšení pamÄ›ti použité kodérem" #~ msgid "" -#~ " -M, --memory=NUM use roughly NUM bytes of memory at maximum; 0 " -#~ "indicates\n" +#~ " -M, --memory=NUM use roughly NUM bytes of memory at maximum; 0 indicates\n" #~ " the default setting, which is 40 % of total RAM" #~ msgstr "" -#~ " -M, --memory=POÄŒ použít zhruba POÄŒ bajtů pamÄ›ti jako maximum; 0 " -#~ "znamená\n" -#~ " výchozí nastavení, což je 40% celkového množství " -#~ "pamÄ›ti" +#~ " -M, --memory=POÄŒ použít zhruba POÄŒ bajtů pamÄ›ti jako maximum; 0 znamená\n" +#~ " výchozí nastavení, což je 40% celkového množství pamÄ›ti" #~ msgid "" #~ "\n" -#~ " --subblock[=OPTS] Subblock filter; valid OPTS (valid values; " -#~ "default):\n" +#~ " --subblock[=OPTS] Subblock filter; valid OPTS (valid values; default):\n" #~ " size=NUM number of bytes of data per subblock\n" #~ " (1 - 256Mi; 4Ki)\n" -#~ " rle=NUM run-length encoder chunk size (0-256; " -#~ "0)" +#~ " rle=NUM run-length encoder chunk size (0-256; 0)" #~ msgstr "" #~ "\n" -#~ " --subblock[=VOLBY] Subblokový filtr; platné VOLBY (platné hodnoty; " -#~ "výchozí):\n" +#~ " --subblock[=VOLBY] Subblokový filtr; platné VOLBY (platné hodnoty; výchozí):\n" #~ " size=POÄŒ poÄet bajtů dat na subblok\n" #~ " (1 - 256 Mi; 4 Ki)\n" -#~ " rle=POÄŒ velikost dávky pro kodér run-length " -#~ "(0-256; 0)" +#~ " rle=POÄŒ velikost dávky pro kodér run-length (0-256; 0)" #~ msgid "" -#~ "On this system and configuration, this program will use a maximum of " -#~ "roughly\n" +#~ "On this system and configuration, this program will use a maximum of roughly\n" #~ "%s MiB RAM and " #~ msgstr "" -#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze " -#~ "zhruba\n" +#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze zhruba\n" #~ "%s MiB RAM a " #~ msgid "" Modified: vendor/xz/dist/po/de.po ============================================================================== --- vendor/xz/dist/po/de.po Thu Nov 11 21:53:46 2010 (r215145) +++ vendor/xz/dist/po/de.po Thu Nov 11 22:21:30 2010 (r215146) @@ -6,10 +6,11 @@ msgid "" msgstr "" "Project-Id-Version: XZ Utils 4.999.9beta\n" "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" -"POT-Creation-Date: 2010-09-11 17:07+0200\n" +"POT-Creation-Date: 2010-10-23 17:48+0300\n" "PO-Revision-Date: 2010-09-07 20:27+0200\n" "Last-Translator: \n" "Language-Team: German\n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -27,8 +28,7 @@ msgstr "%s: Integritäts-Check Typ nicht #: src/xz/args.c:382 msgid "Only one file can be specified with `--files' or `--files0'." -msgstr "" -"Nur ein file kann als Argument für --files oder --files0 angegeben werden." +msgstr "Nur ein file kann als Argument für --files oder --files0 angegeben werden." #: src/xz/args.c:445 #, c-format @@ -41,8 +41,7 @@ msgstr "Maximal vier Filter möglich" #: src/xz/coder.c:108 msgid "Memory usage limit is too low for the given filter setup." -msgstr "" -"Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration." +msgstr "Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration." #: src/xz/coder.c:129 msgid "Using a preset in raw mode is discouraged." @@ -50,9 +49,7 @@ msgstr "Verwendung der Voreinstellung im #: src/xz/coder.c:131 msgid "The exact options of the presets may vary between software versions." -msgstr "" -"Die genauen Optionen der Voreinstellung können zwischen Software Versionen " -"variieren." +msgstr "Die genauen Optionen der Voreinstellung können zwischen Software Versionen variieren." #: src/xz/coder.c:157 msgid "The .lzma format supports only the LZMA1 filter" @@ -73,12 +70,8 @@ msgstr "Dekompression wird %s MiB Speich #: src/xz/coder.c:247 #, c-format -msgid "" -"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the " -"memory usage limit of %s MiB" -msgstr "" -"Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das " -"Speicher Nutzungslimit von %s MiB zu übersteigen" +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das Speicher Nutzungslimit von %s MiB zu übersteigen" #. TRANSLATORS: When compression or decompression finishes, #. and xz is going to remove the source file, xz first checks @@ -93,8 +86,7 @@ msgstr "" #: src/xz/file_io.c:137 #, c-format msgid "%s: File seems to have been moved, not removing" -msgstr "" -"%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht" +msgstr "%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht" #: src/xz/file_io.c:144 src/xz/file_io.c:590 #, c-format @@ -149,8 +141,7 @@ msgstr "%s: Eingabedatei hat mehr als ei #: src/xz/file_io.c:714 #, c-format msgid "Error restoring the O_APPEND flag to standard output: %s" -msgstr "" -"Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s" +msgstr "Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s" #: src/xz/file_io.c:726 #, c-format @@ -160,8 +151,7 @@ msgstr "%s: Fehler beim Schießen der Da #: src/xz/file_io.c:762 src/xz/file_io.c:946 #, c-format msgid "%s: Seeking failed when trying to create a sparse file: %s" -msgstr "" -"%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s" +msgstr "%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s" #: src/xz/file_io.c:821 #, c-format @@ -212,7 +202,7 @@ msgstr "Kein" #. but the Check ID is known (here 2). This and other "Unknown-N" #. strings are used in tables, so the width must not exceed ten #. columns with a fixed-width font. It's OK to omit the dash if -#. you need space for one extra letter. +#. you need space for one extra letter, but don't use spaces. #: src/xz/list.c:69 msgid "Unknown-2" msgstr "Unbek.2" @@ -320,12 +310,10 @@ msgstr " Strom Auffüllung: %s\n" #: src/xz/list.c:693 msgid "" " Streams:\n" -" Stream Blocks CompOffset UncompOffset CompSize " -"UncompSize Ratio Check Padding" +" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" msgstr "" " Ströme:\n" -" Strom Blöcke KompOffset UnkompOffset KompGröße " -"UnkompGröße Verh. Check Auffüllung" +" Strom Blöcke KompOffset UnkompOffset KompGröße UnkompGröße Verh. Check Auffüllung" #. TRANSLATORS: The second line is column headings. All #. except Check are right aligned; Check is left aligned. @@ -333,12 +321,10 @@ msgstr "" #, c-format msgid "" " Blocks:\n" -" Stream Block CompOffset UncompOffset TotalSize " -"UncompSize Ratio Check" +" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" msgstr "" " Blöcke:\n" -" Strom Block KompOffset UnkompOffset TotalGröße " -"UnkompGröße Verh. Check" +" Strom Block KompOffset UnkompOffset TotalGröße UnkompGröße Verh. Check" #. TRANSLATORS: These are additional column headings #. for the most verbose listing mode. CheckVal @@ -390,8 +376,7 @@ msgstr " Anzahl Dateien: %s\n" #: src/xz/list.c:1072 msgid "--list works only on .xz files (--format=xz or --format=auto)" -msgstr "" -"--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)" +msgstr "--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)" #: src/xz/list.c:1078 msgid "--list does not support reading from standard input" @@ -409,79 +394,69 @@ msgstr "%s: Unerwartetes Ende beim Lesen #: src/xz/main.c:120 #, c-format -msgid "" -"%s: Null character found when reading filenames; maybe you meant to use `--" -"files0' instead of `--files'?" -msgstr "" -"%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--" -"files0' statt `--files'?" +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--files0' statt `--files'?" #: src/xz/main.c:174 msgid "Compression and decompression with --robot are not supported yet." msgstr "Kompression und Dekompression mit --robot ist noch nicht unterstützt." #: src/xz/main.c:231 -msgid "" -"Cannot read data from standard input when reading filenames from standard " -"input" -msgstr "" -"Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von " -"der Standardeingabe gelesen werden" +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von der Standardeingabe gelesen werden" -#: src/xz/message.c:800 src/xz/message.c:844 +#: src/xz/message.c:792 src/xz/message.c:842 msgid "Internal error (bug)" msgstr "Interner Fehler (Bug)" -#: src/xz/message.c:807 +#: src/xz/message.c:799 msgid "Cannot establish signal handlers" msgstr "Kann Signal Routine nicht setzen" -#: src/xz/message.c:816 +#: src/xz/message.c:808 msgid "No integrity check; not verifying file integrity" msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen" -#: src/xz/message.c:819 +#: src/xz/message.c:811 msgid "Unsupported type of integrity check; not verifying file integrity" -msgstr "" -"Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht " -"überprüfen" +msgstr "Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht überprüfen" -#: src/xz/message.c:826 +#: src/xz/message.c:818 msgid "Memory usage limit reached" msgstr "Speicher-Limit erreicht" -#: src/xz/message.c:829 +#: src/xz/message.c:821 msgid "File format not recognized" msgstr "Datei Format nicht erkannt" -#: src/xz/message.c:832 +#: src/xz/message.c:824 msgid "Unsupported options" msgstr "Optionen nicht unterstützt" -#: src/xz/message.c:835 +#: src/xz/message.c:827 msgid "Compressed data is corrupt" msgstr "Komprimierte Daten sind korrupt" -#: src/xz/message.c:838 +#: src/xz/message.c:830 msgid "Unexpected end of input" msgstr "Unerwartetes Eingabe Ende" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 22:35:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27D7A106564A; Thu, 11 Nov 2010 22:35:43 +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 17D288FC1C; Thu, 11 Nov 2010 22:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABMZghY086882; Thu, 11 Nov 2010 22:35:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABMZgoS086878; Thu, 11 Nov 2010 22:35:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011112235.oABMZgoS086878@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Nov 2010 22:35: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: r215147 - head/lib/libc/powerpc64/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 22:35:43 -0000 Author: dim Date: Thu Nov 11 22:35:42 2010 New Revision: 215147 URL: http://svn.freebsd.org/changeset/base/215147 Log: Make sure to specify the alignment of minbrk and curbrk. They were correctly aligned by accident with earlier binutils, but no longer are, causing link failures. Submitted by: nwhitehorn Obtained from: projects/binutils-2.17 Modified: head/lib/libc/powerpc64/sys/brk.S head/lib/libc/powerpc64/sys/sbrk.S Modified: head/lib/libc/powerpc64/sys/brk.S ============================================================================== --- head/lib/libc/powerpc64/sys/brk.S Thu Nov 11 22:21:30 2010 (r215146) +++ head/lib/libc/powerpc64/sys/brk.S Thu Nov 11 22:35:42 2010 (r215147) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); .globl CNAME(_end) .data + .align 3 HIDENAME(minbrk): .llong CNAME(_end) Modified: head/lib/libc/powerpc64/sys/sbrk.S ============================================================================== --- head/lib/libc/powerpc64/sys/sbrk.S Thu Nov 11 22:21:30 2010 (r215146) +++ head/lib/libc/powerpc64/sys/sbrk.S Thu Nov 11 22:35:42 2010 (r215147) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); .globl CNAME(_end) .data + .align 3 HIDENAME(curbrk): .llong CNAME(_end) From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 22:52:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67F24106564A; Thu, 11 Nov 2010 22:52:42 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id CB6FF8FC18; Thu, 11 Nov 2010 22:52:41 +0000 (UTC) Received: by qyk5 with SMTP id 5so1334127qyk.13 for ; Thu, 11 Nov 2010 14:52:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.2.202 with SMTP id 10mr1310787qak.60.1289515961072; Thu, 11 Nov 2010 14:52:41 -0800 (PST) Received: by 10.220.16.199 with HTTP; Thu, 11 Nov 2010 14:52:41 -0800 (PST) X-Originating-IP: [128.95.133.119] In-Reply-To: <20101111214810.GH17566@michelle.cdnetworks.com> References: <201011111808.oABI8olX079570@svn.freebsd.org> <20101111183409.GA1011@pluto.vnode.local> <20101111191900.GC17566@michelle.cdnetworks.com> <20101111211808.GE17566@michelle.cdnetworks.com> <20101111214810.GH17566@michelle.cdnetworks.com> Date: Thu, 11 Nov 2010 14:52:41 -0800 Message-ID: From: Rob Farmer To: pyunyh@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon , Joel Dahl Subject: Re: svn commit: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 22:52:42 -0000 On Thu, Nov 11, 2010 at 13:48, Pyun YongHyeon wrote: > I believe you're the first one that reported real issue. Could you > give me more details about bogus traffic? I don't know what PHY I don't know how to get more info about it, but basically the switch's activity lights blink extremely fast and activity on all of the other systems times out (can't ping anything, do dns lookups, etc.). > was used with the controller but e1000phy(4) may have advertised > flow-control so the bogus traffic could be a kind of flow-control > storm triggered nfe(4)/e1000phy(4). Maybe opening a PR with > dmesg/pciconf output would be better. I have sent PR 152150 about the rest. -- Rob Farmer From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 22:53:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A38931065674; Thu, 11 Nov 2010 22:53:55 +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 939928FC17; Thu, 11 Nov 2010 22:53:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABMrtUU087323; Thu, 11 Nov 2010 22:53:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABMrtn8087321; Thu, 11 Nov 2010 22:53:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011112253.oABMrtn8087321@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Nov 2010 22:53: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: r215148 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 22:53:55 -0000 Author: dim Date: Thu Nov 11 22:53:55 2010 New Revision: 215148 URL: http://svn.freebsd.org/changeset/base/215148 Log: Use -fPIC to build libexec/rtld-elf on sparc64, so it will also be able to link with newer binutils, without overflowing the GOT. Obtained from: projects/binutils-2.17 Modified: head/libexec/rtld-elf/Makefile Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Thu Nov 11 22:35:42 2010 (r215147) +++ head/libexec/rtld-elf/Makefile Thu Nov 11 22:53:55 2010 (r215148) @@ -29,7 +29,12 @@ SYMLINKS= ${BINDIR}/${PROG} /usr/libexec MLINKS= rtld.1 ld-elf.so.1.1 \ rtld.1 ld.so.1 -CFLAGS+= -fpic -DPIC +.if ${MACHINE_CPUARCH} == "sparc64" +CFLAGS+= -fPIC +.else +CFLAGS+= -fpic +.endif +CFLAGS+= -DPIC LDFLAGS+= -shared -Wl,-Bsymbolic DPADD= ${LIBC_PIC} LDADD= -lc_pic -lssp_nonshared From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 23:00:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DB581065672; Thu, 11 Nov 2010 23:00:38 +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 0DB098FC0C; Thu, 11 Nov 2010 23:00:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABN0bNY087555; Thu, 11 Nov 2010 23:00:37 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABN0bxD087553; Thu, 11 Nov 2010 23:00:37 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011112300.oABN0bxD087553@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Nov 2010 23:00: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: r215149 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 23:00:38 -0000 Author: dim Date: Thu Nov 11 23:00:37 2010 New Revision: 215149 URL: http://svn.freebsd.org/changeset/base/215149 Log: Fix typo, and re-wrap paragraph. Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Nov 11 22:53:55 2010 (r215148) +++ head/share/mk/sys.mk Thu Nov 11 23:00:37 2010 (r215149) @@ -7,11 +7,11 @@ unix ?= We run FreeBSD, not UNIX. .if !defined(%POSIX) # # MACHINE_CPUARCH defines a collection of MACHINE_ARCH. Machines with -# the same MACHINE_ARCH can run reach-other's binaries, so it -# necessarily has word size and endian swizzled in. However, support -# files for these machines often are shared amongst all combinations -# of size and/or endian. This is called MACHINE_CPU in NetBSD, but -# that's used for something different in FreeBSD. +# the same MACHINE_ARCH can run each other's binaries, so it necessarily +# has word size and endian swizzled in. However, support files for +# these machines often are shared amongst all combinations of size +# and/or endian. This is called MACHINE_CPU in NetBSD, but that's used +# for something different in FreeBSD. # MACHINE_CPUARCH=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} .endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 23:41:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D36F51065693; Thu, 11 Nov 2010 23:41:36 +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 C342F8FC16; Thu, 11 Nov 2010 23:41:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABNfaP2088541; Thu, 11 Nov 2010 23:41:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABNfaus088538; Thu, 11 Nov 2010 23:41:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011112341.oABNfaus088538@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Nov 2010 23:41: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: r215150 - in head: . gnu/usr.bin/binutils/doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 23:41:36 -0000 Author: dim Date: Thu Nov 11 23:41:36 2010 New Revision: 215150 URL: http://svn.freebsd.org/changeset/base/215150 Log: Do not build or install gasp.info anymore, as gasp has not been built or installed for more than 6 years. Obtained from: projects/binutils-2.17 Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/binutils/doc/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Nov 11 23:00:37 2010 (r215149) +++ head/ObsoleteFiles.inc Thu Nov 11 23:41:36 2010 (r215150) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101112: removed gasp.info +OLD_FILES+=usr/share/info/gasp.info.gz # 20101109: headers moved to machine/ to x86/ .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/mptable.h Modified: head/gnu/usr.bin/binutils/doc/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/doc/Makefile Thu Nov 11 23:00:37 2010 (r215149) +++ head/gnu/usr.bin/binutils/doc/Makefile Thu Nov 11 23:41:36 2010 (r215150) @@ -4,10 +4,9 @@ .PATH: ${SRCDIR}/gas/doc ${SRCDIR}/ld ${SRCDIR}/bfd/doc -INFO= as ld gasp binutils +INFO= as ld binutils INFOSECTION= "Programming & development tools." INFOENTRY_as= "* As: (as). The GNU assembler." -INFOENTRY_gasp= "* Gasp: (gasp). The GNU Assembler Macro Preprocessor." INFOENTRY_ld= "* Ld: (ld). The GNU linker." INFOENTRY_binutils= "* Binutils: (binutils). The GNU Binary Utilities." From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 23:45:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 958D51065670; Thu, 11 Nov 2010 23:45:19 +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 6B32C8FC14; Thu, 11 Nov 2010 23:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABNjJBD088679; Thu, 11 Nov 2010 23:45:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABNjJTH088678; Thu, 11 Nov 2010 23:45:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011112345.oABNjJTH088678@svn.freebsd.org> From: Dimitry Andric Date: Thu, 11 Nov 2010 23:45: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: r215151 - in head/gnu/usr.bin/binutils: gasp gdb gdbreplay X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 23:45:19 -0000 Author: dim Date: Thu Nov 11 23:45:19 2010 New Revision: 215151 URL: http://svn.freebsd.org/changeset/base/215151 Log: Garbage collect gnu/usr.bin/binutils/{gasp,gdb,gdbreplay}, as these have not been connected to the build for more than 6 years. Obtained from: projects/binutils-2.17 Deleted: head/gnu/usr.bin/binutils/gasp/ head/gnu/usr.bin/binutils/gdb/ head/gnu/usr.bin/binutils/gdbreplay/ From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 00:01:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D5DA1065695; Fri, 12 Nov 2010 00:01:34 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5858FC08; Fri, 12 Nov 2010 00:01:34 +0000 (UTC) Received: by pzk30 with SMTP id 30so118934pzk.13 for ; Thu, 11 Nov 2010 16:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=dlt4HF1B1WvzUmeKQxRc+lp4SVGFzrtXegcvzdoWLfM=; b=YNRnTlVCPccR/mdX8PXrsK3popM7WkHc3PMNFMWxvSZtsVfSVyzvDfC06EEIQVgkcF U5jgRoPC6lYSnODsJgFbpoJJ8se3Sz1E7XBleV2WJwBkok/cJj5GqvmeZzK9ShKI29L6 x1OtV9xG7gDU4PKvAlXt4Zn4wsfAv4FRXVs8c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=wSlNdW26ZCEwHabi1lD6wuZISl8J9wsNbpSS9QtEnOuNdM4+id9nLi/d4atSFrP7uk EKStfIV7VgN/fNNwgeoQhXMZbaMYb7cNb2Xg+ynFLwHFw8Gsq5QE+odca8uVQcxDEMdU 2uaKnVdVTK5KFsbU523wqOk0FPHe+4w93HFM4= Received: by 10.142.171.20 with SMTP id t20mr1080098wfe.242.1289520093725; Thu, 11 Nov 2010 16:01:33 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id x18sm3018085wfa.23.2010.11.11.16.01.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Nov 2010 16:01:32 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 11 Nov 2010 16:00:36 -0800 From: Pyun YongHyeon Date: Thu, 11 Nov 2010 16:00:36 -0800 To: Rob Farmer Message-ID: <20101112000036.GM17566@michelle.cdnetworks.com> References: <201011111808.oABI8olX079570@svn.freebsd.org> <20101111183409.GA1011@pluto.vnode.local> <20101111191900.GC17566@michelle.cdnetworks.com> <20101111211808.GE17566@michelle.cdnetworks.com> <20101111214810.GH17566@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon , Joel Dahl Subject: Re: svn commit: r215132 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 00:01:34 -0000 On Thu, Nov 11, 2010 at 02:52:41PM -0800, Rob Farmer wrote: > On Thu, Nov 11, 2010 at 13:48, Pyun YongHyeon wrote: > > I believe you're the first one that reported real issue. Could you > > give me more details about bogus traffic? I don't know what PHY > > I don't know how to get more info about it, but basically the switch's > activity lights blink extremely fast and activity on all of the other > systems times out (can't ping anything, do dns lookups, etc.). > > > was used with the controller but e1000phy(4) may have advertised > > flow-control so the bogus traffic could be a kind of flow-control > > storm triggered nfe(4)/e1000phy(4). Maybe opening a PR with > > dmesg/pciconf output would be better. > > I have sent PR 152150 about the rest. > Got it. > -- > Rob Farmer From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 00:19:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8681A1065673; Fri, 12 Nov 2010 00:19:42 +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 5B6738FC0C; Fri, 12 Nov 2010 00:19:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC0JgWl089678; Fri, 12 Nov 2010 00:19:42 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC0JgqQ089674; Fri, 12 Nov 2010 00:19:42 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011120019.oAC0JgqQ089674@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 12 Nov 2010 00:19: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: r215152 - in head/sys/netinet: . libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 00:19:42 -0000 Author: lstewart Date: Fri Nov 12 00:19:42 2010 New Revision: 215152 URL: http://svn.freebsd.org/changeset/base/215152 Log: The university does not require that its CRICOS number be included in source code. Remove all references from the tree. MFC after: 3 days Modified: head/sys/netinet/libalias/alias_sctp.c head/sys/netinet/libalias/alias_sctp.h head/sys/netinet/siftr.c Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Thu Nov 11 23:45:19 2010 (r215151) +++ head/sys/netinet/libalias/alias_sctp.c Fri Nov 12 00:19:42 2010 (r215152) @@ -1,8 +1,7 @@ /** * @file alias_sctp.c * Copyright (c) 2008, Centre for Advanced Internet Architectures - * Swinburne University of Technology, Melbourne, Australia - * (CRICOS number 00111D). + * Swinburne University of Technology, Melbourne, Australia. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/netinet/libalias/alias_sctp.h ============================================================================== --- head/sys/netinet/libalias/alias_sctp.h Thu Nov 11 23:45:19 2010 (r215151) +++ head/sys/netinet/libalias/alias_sctp.h Fri Nov 12 00:19:42 2010 (r215152) @@ -1,8 +1,7 @@ /** * @file alias_sctp.h * Copyright (c) 2008, Centre for Advanced Internet Architectures - * Swinburne University of Technology, Melbourne, Australia - * (CRICOS number 00111D). + * Swinburne University of Technology, Melbourne, Australia. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Thu Nov 11 23:45:19 2010 (r215151) +++ head/sys/netinet/siftr.c Fri Nov 12 00:19:42 2010 (r215152) @@ -1,7 +1,6 @@ /*- * Copyright (c) 2007-2009, Centre for Advanced Internet Architectures - * Swinburne University of Technology, Melbourne, Australia - * (CRICOS number 00111D). + * Swinburne University of Technology, Melbourne, Australia. * Copyright (c) 2009-2010, The FreeBSD Foundation * All rights reserved. * From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 00:44:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B781065693; Fri, 12 Nov 2010 00:44:18 +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 669DD8FC19; Fri, 12 Nov 2010 00:44:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC0iIcF090281; Fri, 12 Nov 2010 00:44:18 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC0iIY5090277; Fri, 12 Nov 2010 00:44:18 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011120044.oAC0iIY5090277@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 12 Nov 2010 00:44: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: r215153 - in head/sys/netinet: . libalias X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 00:44:18 -0000 Author: lstewart Date: Fri Nov 12 00:44:18 2010 New Revision: 215153 URL: http://svn.freebsd.org/changeset/base/215153 Log: Standardise all Swinburne related copyright/licence statements throughout the tree in preparation for another large code import. Swinburne University is the legal entity that owns copyright and the 2-clause BSD licence is acceptable. Modified: head/sys/netinet/libalias/alias_sctp.c head/sys/netinet/libalias/alias_sctp.h head/sys/netinet/siftr.c Modified: head/sys/netinet/libalias/alias_sctp.c ============================================================================== --- head/sys/netinet/libalias/alias_sctp.c Fri Nov 12 00:19:42 2010 (r215152) +++ head/sys/netinet/libalias/alias_sctp.c Fri Nov 12 00:44:18 2010 (r215153) @@ -1,8 +1,7 @@ -/** - * @file alias_sctp.c - * Copyright (c) 2008, Centre for Advanced Internet Architectures - * Swinburne University of Technology, Melbourne, Australia. - * +/*- + * Copyright (c) 2008 + * Swinburne University of Technology, Melbourne, Australia. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The names of the authors, the "Centre for Advanced Internet Architectures" - * and "Swinburne University of Technology" may not be used to endorse - * or promote products derived from this software without specific - * prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 @@ -27,7 +22,9 @@ * 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. - * + */ + +/* * Alias_sctp forms part of the libalias kernel module to handle * Network Address Translation (NAT) for the SCTP protocol. * Modified: head/sys/netinet/libalias/alias_sctp.h ============================================================================== --- head/sys/netinet/libalias/alias_sctp.h Fri Nov 12 00:19:42 2010 (r215152) +++ head/sys/netinet/libalias/alias_sctp.h Fri Nov 12 00:44:18 2010 (r215153) @@ -1,8 +1,7 @@ -/** - * @file alias_sctp.h - * Copyright (c) 2008, Centre for Advanced Internet Architectures - * Swinburne University of Technology, Melbourne, Australia. - * +/*- + * Copyright (c) 2008 + * Swinburne University of Technology, Melbourne, Australia. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -11,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The names of the authors, the "Centre for Advanced Internet Architectures" - * and "Swinburne University of Technology" may not be used to endorse - * or promote products derived from this software without specific - * prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 @@ -27,7 +22,9 @@ * 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. - * + */ + +/* * Alias_sctp forms part of the libalias kernel module to handle * Network Address Translation (NAT) for the SCTP protocol. * Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Fri Nov 12 00:19:42 2010 (r215152) +++ head/sys/netinet/siftr.c Fri Nov 12 00:44:18 2010 (r215153) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2007-2009, Centre for Advanced Internet Architectures - * Swinburne University of Technology, Melbourne, Australia. + * Copyright (c) 2007-2009 + * Swinburne University of Technology, Melbourne, Australia. * Copyright (c) 2009-2010, The FreeBSD Foundation * All rights reserved. * From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 01:40:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1651A106566B; Fri, 12 Nov 2010 01:40:30 +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 05B048FC0A; Fri, 12 Nov 2010 01:40:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC1eTfS091496; Fri, 12 Nov 2010 01:40:29 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC1eTdB091494; Fri, 12 Nov 2010 01:40:29 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011120140.oAC1eTdB091494@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 12 Nov 2010 01:40: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: r215154 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 01:40:30 -0000 Author: lstewart Date: Fri Nov 12 01:40:29 2010 New Revision: 215154 URL: http://svn.freebsd.org/changeset/base/215154 Log: The first releases SIFTR will ship in will be 7.4 and 8.2. MFC after: 3 days Modified: head/share/man/man4/siftr.4 Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Fri Nov 12 00:44:18 2010 (r215153) +++ head/share/man/man4/siftr.4 Fri Nov 12 01:40:29 2010 (r215154) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 25, 2010 +.Dd November 12, 2010 .Dt SIFTR 4 .Os .Sh NAME @@ -610,7 +610,9 @@ and the FreeBSD Foundation. .Sh HISTORY .Nm first appeared in -.Fx 9.0 . +.Fx 7.4 +and +.Fx 8.2 . .Pp .Nm was first released in 2007 by Lawrence Stewart and James Healy whilst working on From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 01:45:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E293C106564A; Fri, 12 Nov 2010 01:45:29 +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 B573A8FC0C; Fri, 12 Nov 2010 01:45:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC1jTZJ091654; Fri, 12 Nov 2010 01:45:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC1jTQY091652; Fri, 12 Nov 2010 01:45:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011120145.oAC1jTQY091652@svn.freebsd.org> From: Xin LI Date: Fri, 12 Nov 2010 01:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215155 - in stable: 7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 01:45:30 -0000 Author: delphij Date: Fri Nov 12 01:45:29 2010 New Revision: 215155 URL: http://svn.freebsd.org/changeset/base/215155 Log: MFC r214854: Validate whether the zfs_cmd_t submitted from userland is not smaller than what we have. Without the check the kernel could accessing memory that does not belong to the request struct. Note that we do not test if the struct equals in size at this time, which may faciliate forward compatibility with newer binaries. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 12 01:40:29 2010 (r215154) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 12 01:45:29 2010 (r215155) @@ -3621,6 +3621,14 @@ zfsdev_ioctl(struct cdev *dev, u_long cm uint_t vec; int error; + /* + * Check if we have sufficient kernel memory allocated + * for the zfs_cmd_t request. Bail out if not so we + * will not access undefined memory region. + */ + if (IOCPARM_LEN(cmd) < sizeof(zfs_cmd_t)) + return (EINVAL); + vec = ZFS_IOC(cmd); if (vec >= sizeof (zfs_ioc_vec) / sizeof (zfs_ioc_vec[0])) From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 01:45:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B1C1106566B; Fri, 12 Nov 2010 01:45:30 +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 E1FA58FC12; Fri, 12 Nov 2010 01:45:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC1jTvv091660; Fri, 12 Nov 2010 01:45:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC1jTSp091658; Fri, 12 Nov 2010 01:45:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011120145.oAC1jTSp091658@svn.freebsd.org> From: Xin LI Date: Fri, 12 Nov 2010 01:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215155 - in stable: 7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 01:45:30 -0000 Author: delphij Date: Fri Nov 12 01:45:29 2010 New Revision: 215155 URL: http://svn.freebsd.org/changeset/base/215155 Log: MFC r214854: Validate whether the zfs_cmd_t submitted from userland is not smaller than what we have. Without the check the kernel could accessing memory that does not belong to the request struct. Note that we do not test if the struct equals in size at this time, which may faciliate forward compatibility with newer binaries. Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 12 01:40:29 2010 (r215154) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Nov 12 01:45:29 2010 (r215155) @@ -2989,6 +2989,14 @@ zfsdev_ioctl(struct cdev *dev, u_long cm uint_t vec; int error; + /* + * Check if we have sufficient kernel memory allocated + * for the zfs_cmd_t request. Bail out if not so we + * will not access undefined memory region. + */ + if (IOCPARM_LEN(cmd) < sizeof(zfs_cmd_t)) + return (EINVAL); + vec = ZFS_IOC(cmd); if (vec >= sizeof (zfs_ioc_vec) / sizeof (zfs_ioc_vec[0])) From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 03:43:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CB43106567A; Fri, 12 Nov 2010 03:43: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 480B98FC12; Fri, 12 Nov 2010 03:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC3hNJV094347; Fri, 12 Nov 2010 03:43:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC3hNtm094343; Fri, 12 Nov 2010 03:43:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011120343.oAC3hNtm094343@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 12 Nov 2010 03:43: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: r215157 - in head/sys/powerpc: aim booke powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 03:43:23 -0000 Author: nwhitehorn Date: Fri Nov 12 03:43:22 2010 New Revision: 215157 URL: http://svn.freebsd.org/changeset/base/215157 Log: Centralize CPU idle routines into powerpc/cpu.c and use the same cpu_idle_hook mechanism that x86 uses for overriding the idle routine. This is required for supporting ilding the CPU under PowerPC hypervisors. Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Fri Nov 12 02:35:21 2010 (r215156) +++ head/sys/powerpc/aim/machdep.c Fri Nov 12 03:43:22 2010 (r215157) @@ -639,64 +639,6 @@ cpu_halt(void) OF_exit(); } -void -cpu_idle(int busy) -{ - register_t msr; - uint16_t vers; - - msr = mfmsr(); - vers = mfpvr() >> 16; - -#ifdef INVARIANTS - if ((msr & PSL_EE) != PSL_EE) { - struct thread *td = curthread; - printf("td msr %#lx\n", (u_long)td->td_md.md_saved_msr); - panic("ints disabled in idleproc!"); - } -#endif - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", - busy, curcpu); - if (powerpc_pow_enabled) { - if (!busy) { - critical_enter(); - cpu_idleclock(); - } - switch (vers) { - case IBM970: - case IBM970FX: - case IBM970MP: - case MPC7447A: - case MPC7448: - case MPC7450: - case MPC7455: - case MPC7457: - __asm __volatile("\ - dssall; sync; mtmsr %0; isync" - :: "r"(msr | PSL_POW)); - break; - default: - powerpc_sync(); - mtmsr(msr | PSL_POW); - isync(); - break; - } - if (!busy) { - cpu_activeclock(); - critical_exit(); - } - } - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", - busy, curcpu); -} - -int -cpu_idle_wakeup(int cpu) -{ - - return (0); -} - int ptrace_set_pc(struct thread *td, unsigned long addr) { Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Fri Nov 12 02:35:21 2010 (r215156) +++ head/sys/powerpc/booke/machdep.c Fri Nov 12 03:43:22 2010 (r215157) @@ -468,50 +468,6 @@ cpu_flush_dcache(void *ptr, size_t len) /* TBD */ } -/* - * cpu_idle - * - * Set Wait state enable. - */ -void -cpu_idle (int busy) -{ - register_t msr; - - msr = mfmsr(); - -#ifdef INVARIANTS - if ((msr & PSL_EE) != PSL_EE) { - struct thread *td = curthread; - printf("td msr %x\n", td->td_md.md_saved_msr); - panic("ints disabled in idleproc!"); - } -#endif - - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", - busy, curcpu); - if (!busy) { - critical_enter(); - cpu_idleclock(); - } - /* Freescale E500 core RM section 6.4.1. */ - msr = msr | PSL_WE; - __asm __volatile("msync; mtmsr %0; isync" :: "r" (msr)); - if (!busy) { - cpu_activeclock(); - critical_exit(); - } - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", - busy, curcpu); -} - -int -cpu_idle_wakeup(int cpu) -{ - - return (0); -} - void spinlock_enter(void) { Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Fri Nov 12 02:35:21 2010 (r215156) +++ head/sys/powerpc/powerpc/cpu.c Fri Nov 12 03:43:22 2010 (r215157) @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -73,12 +74,15 @@ #include #include -int powerpc_pow_enabled; - static void cpu_6xx_setup(int cpuid, uint16_t vers); static void cpu_e500_setup(int cpuid, uint16_t vers); static void cpu_970_setup(int cpuid, uint16_t vers); +int powerpc_pow_enabled; +void (*cpu_idle_hook)(void) = NULL; +static void cpu_idle_60x(void); +static void cpu_idle_e500(void); + struct cputab { const char *name; uint16_t version; @@ -374,6 +378,9 @@ cpu_6xx_setup(int cpuid, uint16_t vers) } printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, bitmask); + + if (cpu_idle_hook == NULL) + cpu_idle_hook = cpu_idle_60x; } @@ -441,6 +448,9 @@ cpu_e500_setup(int cpuid, uint16_t vers) mtspr(SPR_HID0, hid0); printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK); + + if (cpu_idle_hook == NULL) + cpu_idle_hook = cpu_idle_e500; } static void @@ -478,6 +488,8 @@ cpu_970_setup(int cpuid, uint16_t vers) : "=r" (hid0_hi) : "K" (SPR_HID0)); printf("cpu%d: HID0 %b\n", cpuid, (int)(hid0_hi), HID0_970_BITMASK); #endif + + cpu_idle_hook = cpu_idle_60x; } static int @@ -490,3 +502,87 @@ cpu_feature_bit(SYSCTL_HANDLER_ARGS) return (sysctl_handle_int(oidp, &result, 0, req)); } +void +cpu_idle(int busy) +{ + +#ifdef INVARIANTS + if ((mfmsr() & PSL_EE) != PSL_EE) { + struct thread *td = curthread; + printf("td msr %#lx\n", (u_long)td->td_md.md_saved_msr); + panic("ints disabled in idleproc!"); + } +#endif + + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", + busy, curcpu); + if (cpu_idle_hook != NULL) { + if (!busy) { + critical_enter(); + cpu_idleclock(); + } + cpu_idle_hook(); + if (!busy) { + cpu_activeclock(); + critical_exit(); + } + } + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", + busy, curcpu); +} + +int +cpu_idle_wakeup(int cpu) +{ + return (0); +} + +static void +cpu_idle_60x(void) +{ + register_t msr; + uint16_t vers; + + if (!powerpc_pow_enabled) + return; + + msr = mfmsr(); + vers = mfpvr() >> 16; + +#ifdef AIM + switch (vers) { + case IBM970: + case IBM970FX: + case IBM970MP: + case MPC7447A: + case MPC7448: + case MPC7450: + case MPC7455: + case MPC7457: + __asm __volatile("\ + dssall; sync; mtmsr %0; isync" + :: "r"(msr | PSL_POW)); + break; + default: + powerpc_sync(); + mtmsr(msr | PSL_POW); + isync(); + break; + } +#endif +} + +static void +cpu_idle_e500(void) +{ + register_t msr; + + msr = mfmsr(); + +#ifdef E500 + /* Freescale E500 core RM section 6.4.1. */ + __asm __volatile("msync; mtmsr %0; isync" :: + "r" (msr | PSL_WE)); +#endif +} + From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 04:13:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DD891065670; Fri, 12 Nov 2010 04:13:49 +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 3B4748FC18; Fri, 12 Nov 2010 04:13:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC4DnnN095059; Fri, 12 Nov 2010 04:13:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC4DnFn095057; Fri, 12 Nov 2010 04:13:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011120413.oAC4DnFn095057@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 12 Nov 2010 04:13: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: r215158 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 04:13:49 -0000 Author: nwhitehorn Date: Fri Nov 12 04:13:48 2010 New Revision: 215158 URL: http://svn.freebsd.org/changeset/base/215158 Log: Fix an error in r215067. An existing /chosen/mmu but missing translations property just means we shouldn't add any translations, not that we should panic. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Nov 12 03:43:22 2010 (r215157) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Nov 12 04:13:48 2010 (r215158) @@ -1126,14 +1126,14 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t ofw_pmap.pm_sr[i] = kernel_pmap->pm_sr[i]; #endif - if ((mmu = OF_instance_to_package(mmui)) == -1) - panic("moea64_bootstrap: can't get mmu package"); - if ((sz = OF_getproplen(mmu, "translations")) == -1) - panic("moea64_bootstrap: can't get ofw translation count"); + mmu = OF_instance_to_package(mmui); + if (mmu == -1 || (sz = OF_getproplen(mmu, "translations")) == -1) + sz = 0; if (sz > 6144 /* tmpstksz - 2 KB headroom */) panic("moea64_bootstrap: too many ofw translations"); - moea64_add_ofw_mappings(mmup, mmu, sz); + if (sz > 0) + moea64_add_ofw_mappings(mmup, mmu, sz); } #ifdef SMP From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 04:18:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B9301065673; Fri, 12 Nov 2010 04:18:20 +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 36EE58FC15; Fri, 12 Nov 2010 04:18:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC4IKjH095204; Fri, 12 Nov 2010 04:18:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC4IKJE095194; Fri, 12 Nov 2010 04:18:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011120418.oAC4IKJE095194@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 12 Nov 2010 04:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215159 - in head/sys: powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 04:18:20 -0000 Author: nwhitehorn Date: Fri Nov 12 04:18:19 2010 New Revision: 215159 URL: http://svn.freebsd.org/changeset/base/215159 Log: Add some platform KOBJ extensions and continue integrating PowerPC hypervisor infrastructure support: - Fix coexistence of multiple platform modules in the same kernel - Allow platform modules to provide an SMP topology - PowerPC hypervisors limit the amount of memory accessible in real mode. Allow the platform modules to specify the maximum real-mode address, and modify the bits of the kernel that need to allocate real-mode-accessible buffers to respect this limits. Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/ofw_machdep.c head/sys/powerpc/aim/slb.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/include/platform.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/powerpc/platform.c head/sys/powerpc/powerpc/platform_if.m head/sys/sys/smp.h Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Nov 12 04:18:19 2010 (r215159) @@ -2385,6 +2385,9 @@ moea64_bootstrap_alloc(vm_size_t size, u if (s < phys_avail[i] || e > phys_avail[i + 1]) continue; + if (s + size > platform_real_maxaddr()) + continue; + if (s == phys_avail[i]) { phys_avail[i] += size; } else if (e == phys_avail[i + 1]) { Modified: head/sys/powerpc/aim/ofw_machdep.c ============================================================================== --- head/sys/powerpc/aim/ofw_machdep.c Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/powerpc/aim/ofw_machdep.c Fri Nov 12 04:18:19 2010 (r215159) @@ -692,16 +692,3 @@ OF_decode_addr(phandle_t dev, int regno, return (bus_space_map(*tag, addr, size, 0, handle)); } -int -mem_valid(vm_offset_t addr, int len) -{ - int i; - - for (i = 0; i < nOFmem; i++) - if ((addr >= OFmem[i].mr_start) - && (addr + len < OFmem[i].mr_start + OFmem[i].mr_size)) - return (0); - - return (EFAULT); -} - Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/powerpc/aim/slb.c Fri Nov 12 04:18:19 2010 (r215159) @@ -36,9 +36,14 @@ #include #include #include +#include #include +#include +#include +#include #include +#include #include #include @@ -474,6 +479,51 @@ slb_insert_user(pmap_t pm, struct slb *s pm->pm_slb[i] = slb; } +static void * +slb_uma_real_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) +{ + static vm_offset_t realmax = 0; + void *va; + vm_page_t m; + int pflags; + + if (realmax == 0) + realmax = platform_real_maxaddr(); + + *flags = UMA_SLAB_PRIV; + if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; + else + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; + if (wait & M_ZERO) + pflags |= VM_ALLOC_ZERO; + + for (;;) { + m = vm_phys_alloc_contig(1, 0, realmax, PAGE_SIZE, + PAGE_SIZE); + if (m == NULL) { + if (wait & M_NOWAIT) + return (NULL); + VM_WAIT; + } else + break; + } + + va = (void *) VM_PAGE_TO_PHYS(m); + + if (!hw_direct_map) + pmap_kenter((vm_offset_t)va, VM_PAGE_TO_PHYS(m)); + + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) + bzero(va, PAGE_SIZE); + + /* vm_phys_alloc_contig does not track wiring */ + atomic_add_int(&cnt.v_wire_count, 1); + m->wire_count = 1; + + return (va); +} + static void slb_zone_init(void *dummy) { @@ -482,6 +532,11 @@ slb_zone_init(void *dummy) NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); slb_cache_zone = uma_zcreate("SLB cache", 64*sizeof(struct slb *), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM); + + if (platform_real_maxaddr() != VM_MAX_ADDRESS) { + uma_zone_set_allocf(slb_cache_zone, slb_uma_real_alloc); + uma_zone_set_allocf(slbt_zone, slb_uma_real_alloc); + } } struct slb ** Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/powerpc/booke/machdep.c Fri Nov 12 04:18:19 2010 (r215159) @@ -597,12 +597,3 @@ bzero(void *buf, size_t len) } } -/* - * XXX what is the better/proper place for this routine? - */ -int -mem_valid(vm_offset_t addr, int len) -{ - - return (1); -} Modified: head/sys/powerpc/include/platform.h ============================================================================== --- head/sys/powerpc/include/platform.h Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/powerpc/include/platform.h Fri Nov 12 04:18:19 2010 (r215159) @@ -44,6 +44,7 @@ struct mem_region { }; void mem_regions(struct mem_region **, int *, struct mem_region **, int *); +vm_offset_t platform_real_maxaddr(void); u_long platform_timebase_freq(struct cpuref *); Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Nov 12 04:18:19 2010 (r215159) @@ -98,13 +98,6 @@ machdep_ap_bootstrap(void) sched_throw(NULL); } -struct cpu_group * -cpu_topo(void) -{ - - return (smp_topo_none()); -} - void cpu_mp_setmaxid(void) { Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/powerpc/powerpc/platform.c Fri Nov 12 04:18:19 2010 (r215159) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -47,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -62,11 +64,45 @@ static char plat_name[64] = ""; SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RD | CTLFLAG_TUN, plat_name, 0, "Platform currently in use"); +static struct mem_region *pregions = NULL; +static struct mem_region *aregions = NULL; +static int npregions, naregions; + void mem_regions(struct mem_region **phys, int *physsz, struct mem_region **avail, int *availsz) { - PLATFORM_MEM_REGIONS(plat_obj, phys, physsz, avail, availsz); + if (pregions == NULL) + PLATFORM_MEM_REGIONS(plat_obj, &pregions, &npregions, + &aregions, &naregions); + + *phys = pregions; + *avail = aregions; + *physsz = npregions; + *availsz = naregions; +} + +int +mem_valid(vm_offset_t addr, int len) +{ + int i; + + if (pregions == NULL) + PLATFORM_MEM_REGIONS(plat_obj, &pregions, &npregions, + &aregions, &naregions); + + for (i = 0; i < npregions; i++) + if ((addr >= pregions[i].mr_start) + && (addr + len < pregions[i].mr_start + pregions[i].mr_size)) + return (0); + + return (EFAULT); +} + +vm_offset_t +platform_real_maxaddr(void) +{ + return (PLATFORM_REAL_MAXADDR(plat_obj)); } const char * @@ -105,6 +141,14 @@ platform_smp_start_cpu(struct pcpu *cpu) return (PLATFORM_SMP_START_CPU(plat_obj, cpu)); } +#ifdef SMP +struct cpu_group * +cpu_topo(void) +{ + return (PLATFORM_SMP_TOPO(plat_obj)); +} +#endif + /* * Reset back to firmware. */ @@ -164,9 +208,10 @@ platform_probe_and_attach() } /* - * We can't free the KOBJ, since it is static. Luckily, - * this has no ill effects since it gets reset every time. + * We can't free the KOBJ, since it is static. Reset the ops + * member of this class so that we can come back later. */ + platp->ops = NULL; } if (plat_def_impl == NULL) Modified: head/sys/powerpc/powerpc/platform_if.m ============================================================================== --- head/sys/powerpc/powerpc/platform_if.m Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/powerpc/powerpc/platform_if.m Fri Nov 12 04:18:19 2010 (r215159) @@ -30,10 +30,12 @@ #include #include #include +#include #include #include #include +#include /** * @defgroup PLATFORM platform - KObj methods for PowerPC platform @@ -66,6 +68,18 @@ CODE { { return (ENOENT); } + static struct cpu_group *platform_null_smp_topo(platform_t plat) + { +#ifdef SMP + return (smp_topo_none()); +#else + return (NULL); +#endif + } + static vm_offset_t platform_null_real_maxaddr(platform_t plat) + { + return (VM_MAX_ADDRESS); + } }; /** @@ -109,6 +123,15 @@ METHOD void mem_regions { }; /** + * @brief Return the maximum address accessible in real mode + * (for use with hypervisors) + */ +METHOD vm_offset_t real_maxaddr { + platform_t _plat; +} DEFAULT platform_null_real_maxaddr; + + +/** * @brief Get the CPU's timebase frequency, in ticks per second. * * @param _cpu CPU whose timebase to query @@ -162,6 +185,13 @@ METHOD int smp_start_cpu { }; /** + * @brief Return SMP topology + */ +METHOD cpu_group_t smp_topo { + platform_t _plat; +} DEFAULT platform_null_smp_topo; + +/** * @brief Reset system */ METHOD void reset { Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Fri Nov 12 04:13:48 2010 (r215158) +++ head/sys/sys/smp.h Fri Nov 12 04:18:19 2010 (r215159) @@ -16,8 +16,6 @@ #ifndef LOCORE -#ifdef SMP - /* * Topology of a NUMA or HTT system. * @@ -41,6 +39,8 @@ struct cpu_group { int8_t cg_flags; /* Traversal modifiers. */ }; +typedef struct cpu_group *cpu_group_t; + /* * Defines common resources for CPUs in the group. The highest level * resource should be used when multiple are shared. @@ -60,6 +60,7 @@ struct cpu_group { /* * Convenience routines for building topologies. */ +#ifdef SMP struct cpu_group *smp_topo(void); struct cpu_group *smp_topo_none(void); struct cpu_group *smp_topo_1level(int l1share, int l1count, int l1flags); From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 04:22:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92D231065670; Fri, 12 Nov 2010 04:22:00 +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 7EFF38FC1C; Fri, 12 Nov 2010 04:22:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC4M0Sd095313; Fri, 12 Nov 2010 04:22:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC4M0Fs095310; Fri, 12 Nov 2010 04:22:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011120422.oAC4M0Fs095310@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 12 Nov 2010 04:22: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: r215160 - in head/sys/powerpc: aim powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 04:22:00 -0000 Author: nwhitehorn Date: Fri Nov 12 04:22:00 2010 New Revision: 215160 URL: http://svn.freebsd.org/changeset/base/215160 Log: Remove or conditionalize some hypervisor-unfriendly instruction sequences. Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Nov 12 04:18:19 2010 (r215159) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Nov 12 04:22:00 2010 (r215160) @@ -1136,10 +1136,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t moea64_add_ofw_mappings(mmup, mmu, sz); } -#ifdef SMP - TLBSYNC(); -#endif - /* * Calculate the last available physical address. */ Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Fri Nov 12 04:18:19 2010 (r215159) +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Nov 12 04:22:00 2010 (r215160) @@ -78,7 +78,13 @@ machdep_ap_bootstrap(void) ; /* Initialize DEC and TB, sync with the BSP values */ +#ifdef __powerpc64__ + /* Writing to the time base register is hypervisor-privileged */ + if (mfmsr() & PSL_HV) + mttb(ap_timebase); +#else mttb(ap_timebase); +#endif decr_ap_init(); /* Serialize console output and AP count increment */ @@ -240,7 +246,13 @@ cpu_mp_unleash(void *dummy) /* Let APs continue */ atomic_store_rel_int(&ap_letgo, 1); +#ifdef __powerpc64__ + /* Writing to the time base register is hypervisor-privileged */ + if (mfmsr() & PSL_HV) + mttb(ap_timebase); +#else mttb(ap_timebase); +#endif while (ap_awake < smp_cpus) ; From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 05:12:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ED8E1065675; Fri, 12 Nov 2010 05:12:39 +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 C7CEE8FC16; Fri, 12 Nov 2010 05:12:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC5CcxE096677; Fri, 12 Nov 2010 05:12:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC5CcB2096671; Fri, 12 Nov 2010 05:12:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011120512.oAC5CcB2096671@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 12 Nov 2010 05:12: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: r215163 - in head/sys: conf powerpc/aim powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 05:12:39 -0000 Author: nwhitehorn Date: Fri Nov 12 05:12:38 2010 New Revision: 215163 URL: http://svn.freebsd.org/changeset/base/215163 Log: Remove use of a separate ofw_pmap on 32-bit CPUs. Many Open Firmware mappings need to end up in the kernel anyway since the kernel begins executing in OF context. Separating them adds needless complexity, especially since the powerpc64 and mmu_oea64 code gave up on it a long time ago. As a side effect, the PPC ofw_machdep code is no longer AIM-specific, so move it to powerpc/ofw. Added: head/sys/powerpc/ofw/ofw_machdep.c - copied, changed from r215159, head/sys/powerpc/aim/ofw_machdep.c Deleted: head/sys/powerpc/aim/ofw_machdep.c Modified: head/sys/conf/files.powerpc head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Nov 12 05:09:47 2010 (r215162) +++ head/sys/conf/files.powerpc Fri Nov 12 05:12:38 2010 (r215163) @@ -85,7 +85,6 @@ powerpc/aim/mmu_oea.c optional aim powe powerpc/aim/mmu_oea64.c optional aim powerpc/aim/mp_cpudep.c optional aim smp powerpc/aim/nexus.c optional aim -powerpc/aim/ofw_machdep.c optional aim powerpc/aim/ofwmagic.S optional aim powerpc/aim/slb.c optional aim powerpc64 powerpc/aim/swtch32.S optional aim powerpc @@ -131,6 +130,7 @@ powerpc/mpc85xx/nexus.c optional mpc85x powerpc/mpc85xx/openpic_fdt.c optional fdt powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim +powerpc/ofw/ofw_machdep.c optional aim powerpc/ofw/ofw_pcibus.c optional pci aim powerpc/ofw/ofw_pcib_pci.c optional pci aim powerpc/ofw/ofw_real.c optional aim Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Fri Nov 12 05:09:47 2010 (r215162) +++ head/sys/powerpc/aim/machdep.c Fri Nov 12 05:12:38 2010 (r215163) @@ -159,8 +159,6 @@ int setfault(faultbuf); long Maxmem = 0; long realmem = 0; -struct pmap ofw_pmap; - #ifndef __powerpc64__ struct bat battable[16]; #endif Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Nov 12 05:09:47 2010 (r215162) +++ head/sys/powerpc/aim/mmu_oea.c Fri Nov 12 05:12:38 2010 (r215163) @@ -197,8 +197,6 @@ static u_int phys_avail_count; static int regions_sz, pregions_sz; static struct ofw_map *translations; -extern struct pmap ofw_pmap; - /* * Lock for the pteg and pvo tables. */ @@ -669,10 +667,7 @@ moea_cpu_bootstrap(mmu_t mmup, int ap) isync(); for (i = 0; i < 16; i++) - mtsrin(i << ADDR_SR_SHFT, EMPTY_SEGMENT); - - __asm __volatile("mtsr %0,%1" :: "n"(KERNEL_SR), "r"(KERNEL_SEGMENT)); - __asm __volatile("mtsr %0,%1" :: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT)); + mtsrin(i << ADDR_SR_SHFT, kernel_pmap->pm_sr[i]); powerpc_sync(); sdr = (u_int)moea_pteg_table | (moea_pteg_mask >> 10); @@ -859,11 +854,16 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k moea_vsid_bitmap[0] |= 1; /* - * Set up the Open Firmware pmap and add it's mappings. + * Initialize the kernel pmap (which is statically allocated). + */ + PMAP_LOCK_INIT(kernel_pmap); + for (i = 0; i < 16; i++) + kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i; + kernel_pmap->pm_active = ~0; + + /* + * Set up the Open Firmware mappings */ - moea_pinit(mmup, &ofw_pmap); - ofw_pmap.pm_sr[KERNEL_SR] = KERNEL_SEGMENT; - ofw_pmap.pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT; if ((chosen = OF_finddevice("/chosen")) == -1) panic("moea_bootstrap: can't find /chosen"); OF_getprop(chosen, "mmu", &mmui, 4); @@ -900,16 +900,8 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k /* Enter the pages */ for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) { - struct vm_page m; - - m.phys_addr = translations[i].om_pa + off; - m.md.mdpg_cache_attrs = VM_MEMATTR_DEFAULT; - m.oflags = VPO_BUSY; - PMAP_LOCK(&ofw_pmap); - moea_enter_locked(&ofw_pmap, - translations[i].om_va + off, &m, - VM_PROT_ALL, 1); - PMAP_UNLOCK(&ofw_pmap); + moea_kenter(mmup, translations[i].om_va + off, + translations[i].om_pa + off); ofw_mappings++; } } @@ -921,17 +913,6 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k ; Maxmem = powerpc_btop(phys_avail[i + 1]); - /* - * Initialize the kernel pmap (which is statically allocated). - */ - PMAP_LOCK_INIT(kernel_pmap); - for (i = 0; i < 16; i++) { - kernel_pmap->pm_sr[i] = EMPTY_SEGMENT; - } - kernel_pmap->pm_sr[KERNEL_SR] = KERNEL_SEGMENT; - kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT; - kernel_pmap->pm_active = ~0; - moea_cpu_bootstrap(mmup,0); pmap_bootstrapped++; Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Fri Nov 12 05:09:47 2010 (r215162) +++ head/sys/powerpc/aim/mmu_oea64.c Fri Nov 12 05:12:38 2010 (r215163) @@ -275,8 +275,6 @@ static struct mem_region *pregions; static u_int phys_avail_count; static int regions_sz, pregions_sz; -extern struct pmap ofw_pmap; - extern void bs_remap_earlyboot(void); @@ -1119,13 +1117,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t chosen = OF_finddevice("/chosen"); if (chosen != -1 && OF_getprop(chosen, "mmu", &mmui, 4) != -1) { - #ifndef __powerpc64__ - moea64_pinit(mmup, &ofw_pmap); - - for (i = 0; i < 16; i++) - ofw_pmap.pm_sr[i] = kernel_pmap->pm_sr[i]; - #endif - mmu = OF_instance_to_package(mmui); if (mmu == -1 || (sz = OF_getproplen(mmu, "translations")) == -1) sz = 0; Copied and modified: head/sys/powerpc/ofw/ofw_machdep.c (from r215159, head/sys/powerpc/aim/ofw_machdep.c) ============================================================================== --- head/sys/powerpc/aim/ofw_machdep.c Fri Nov 12 04:18:19 2010 (r215159, copy source) +++ head/sys/powerpc/ofw/ofw_machdep.c Fri Nov 12 05:12:38 2010 (r215163) @@ -66,7 +66,6 @@ static struct mem_region OFfree[OFMEM_RE static int nOFmem; extern register_t ofmsr[5]; -extern struct pmap ofw_pmap; static int (*ofwcall)(void *); static void *fdt; int ofw_real_mode; @@ -417,59 +416,27 @@ openfirmware_core(void *args) { int result; register_t oldmsr; - #ifndef __powerpc64__ - register_t srsave[16]; - u_int i; - #endif /* * Turn off exceptions - we really don't want to end up - * anywhere unexpected with PCPU set to something strange, - * the stack pointer wrong, or the OFW mapping enabled. + * anywhere unexpected with PCPU set to something strange + * or the stack pointer wrong. */ oldmsr = intr_disable(); ofw_sprg_prepare(); - #ifndef __powerpc64__ - if (pmap_bootstrapped && !ofw_real_mode) { - /* - * Swap the kernel's address space with Open Firmware's - */ - - for (i = 0; i < 16; i++) { - srsave[i] = mfsrin(i << ADDR_SR_SHFT); - mtsrin(i << ADDR_SR_SHFT, ofw_pmap.pm_sr[i]); - } - - /* - * Clear battable[] translations - */ - if (!(cpu_features & PPC_FEATURE_64)) { - __asm __volatile("mtdbatu 2, %0\n" - "mtdbatu 3, %0" : : "r" (0)); - } - isync(); - } - #endif +#if defined(AIM) && !defined(__powerpc64__) + /* + * Clear battable[] translations + */ + if (!(cpu_features & PPC_FEATURE_64)) + __asm __volatile("mtdbatu 2, %0\n" + "mtdbatu 3, %0" : : "r" (0)); + isync(); +#endif result = ofwcall(args); - - #ifndef __powerpc64__ - if (pmap_bootstrapped && !ofw_real_mode) { - /* - * Restore the kernel's addr space. The isync() doesn;t - * work outside the loop unless mtsrin() is open-coded - * in an asm statement :( - */ - - for (i = 0; i < 16; i++) { - mtsrin(i << ADDR_SR_SHFT, srsave[i]); - isync(); - } - } - #endif - ofw_sprg_restore(); intr_restore(oldmsr); From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 06:41:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B0C2106566C; Fri, 12 Nov 2010 06:41:56 +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 35D778FC0A; Fri, 12 Nov 2010 06:41:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAC6fuHB098593; Fri, 12 Nov 2010 06:41:56 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAC6fui3098584; Fri, 12 Nov 2010 06:41:56 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011120641.oAC6fui3098584@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 12 Nov 2010 06:41: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: r215166 - in head: . sys/conf sys/netinet sys/netinet/cc sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 06:41:56 -0000 Author: lstewart Date: Fri Nov 12 06:41:55 2010 New Revision: 215166 URL: http://svn.freebsd.org/changeset/base/215166 Log: This commit marks the first formal contribution of the "Five New TCP Congestion Control Algorithms for FreeBSD" FreeBSD Foundation funded project. More details about the project are available at: http://caia.swin.edu.au/freebsd/5cc/ - Add a KPI and supporting infrastructure to allow modular congestion control algorithms to be used in the net stack. Algorithms can maintain per-connection state if required, and connections maintain their own algorithm pointer, which allows different connections to concurrently use different algorithms. The TCP_CONGESTION socket option can be used with getsockopt()/setsockopt() to programmatically query or change the congestion control algorithm respectively from within an application at runtime. - Integrate the framework with the TCP stack in as least intrusive a manner as possible. Care was also taken to develop the framework in a way that should allow integration with other congestion aware transport protocols (e.g. SCTP) in the future. The hope is that we will one day be able to share a single set of congestion control algorithm modules between all congestion aware transport protocols. - Introduce a new congestion recovery (TF_CONGRECOVERY) state into the TCP stack and use it to decouple the meaning of recovery from a congestion event and recovery from packet loss (TF_FASTRECOVERY) a la RFC2581. ECN and delay based congestion control protocols don't generally need to recover from packet loss and need a different way to note a congestion recovery episode within the stack. - Remove the net.inet.tcp.newreno sysctl, which simplifies some portions of code and ensures the stack always uses the appropriate mechanisms for recovering from packet loss during a congestion recovery episode. - Extract the NewReno congestion control algorithm from the TCP stack and massage it into module form. NewReno is always built into the kernel and will remain the default algorithm for the forseeable future. Implementations of additional different algorithms will become available in the near future. - Bump __FreeBSD_version to 900025 and note in UPDATING that rebuilding code that relies on the size of "struct tcpcb" is required. Many thanks go to the Cisco University Research Program Fund at Community Foundation Silicon Valley and the FreeBSD Foundation. Their support of our work at the Centre for Advanced Internet Architectures, Swinburne University of Technology is greatly appreciated. In collaboration with: David Hayes and Grenville Armitage Sponsored by: Cisco URP, FreeBSD Foundation Reviewed by: rpaulo Tested by: David Hayes (and many others over the years) MFC after: 3 months Added: head/sys/netinet/cc/ head/sys/netinet/cc.h (contents, props changed) head/sys/netinet/cc/cc.c (contents, props changed) head/sys/netinet/cc/cc_module.h (contents, props changed) head/sys/netinet/cc/cc_newreno.c (contents, props changed) Modified: head/UPDATING head/sys/conf/files head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Nov 12 05:22:27 2010 (r215165) +++ head/UPDATING Fri Nov 12 06:41:55 2010 (r215166) @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20101111: + The TCP stack has received a significant update to add support for + modularised congestion control and generally improve the clarity of + congestion control decisions. Bump __FreeBSD_version to 900025. User + space tools that rely on the size of struct tcpcb in tcp_var.h (e.g. + sockstat) need to be recompiled. + 20101002: The man(1) utility has been replaced by a new version that no longer uses /etc/manpath.config. Please consult man.conf(5) for how to Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 12 05:22:27 2010 (r215165) +++ head/sys/conf/files Fri Nov 12 06:41:55 2010 (r215166) @@ -2598,6 +2598,8 @@ netinet/ip_mroute.c optional mrouting i netinet/ip_options.c optional inet netinet/ip_output.c optional inet netinet/raw_ip.c optional inet +netinet/cc/cc.c optional inet +netinet/cc/cc_newreno.c optional inet netinet/sctp_asconf.c optional inet sctp netinet/sctp_auth.c optional inet sctp netinet/sctp_bsd_addr.c optional inet sctp Added: head/sys/netinet/cc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/cc.h Fri Nov 12 06:41:55 2010 (r215166) @@ -0,0 +1,161 @@ +/*- + * Copyright (c) 2007-2008 + * Swinburne University of Technology, Melbourne, Australia. + * Copyright (c) 2009-2010 Lawrence Stewart + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart and James Healy, + * made possible in part by a grant from the Cisco University Research Program + * Fund at Community Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This software was first released in 2007 by James Healy and Lawrence Stewart + * whilst working on the NewTCP research project at Swinburne University's + * Centre for Advanced Internet Architectures, Melbourne, Australia, which was + * made possible in part by a grant from the Cisco University Research Program + * Fund at Community Foundation Silicon Valley. More details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#ifndef _NETINET_CC_H_ +#define _NETINET_CC_H_ + +/* XXX: TCP_CA_NAME_MAX define lives in tcp.h for compat reasons. */ +#include + +/* Global CC vars. */ +extern STAILQ_HEAD(cc_head, cc_algo) cc_list; +extern const int tcprexmtthresh; +extern struct cc_algo newreno_cc_algo; + +/* Define the new net.inet.tcp.cc sysctl tree. */ +SYSCTL_DECL(_net_inet_tcp_cc); + +/* CC housekeeping functions. */ +void cc_init(void); +int cc_register_algo(struct cc_algo *add_cc); +int cc_deregister_algo(struct cc_algo *remove_cc); + +/* + * Wrapper around transport structs that contain same-named congestion + * control variables. Allows algos to be shared amongst multiple CC aware + * transprots. + */ +struct cc_var { + void *cc_data; /* Per-connection private CC algorithm data. */ + int bytes_this_ack; /* # bytes acked by the current ACK. */ + tcp_seq curack; /* Most recent ACK. */ + uint32_t flags; /* Flags for cc_var (see below) */ + int type; /* Indicates which ptr is valid in ccvc. */ + union ccv_container { + struct tcpcb *tcp; + struct sctp_nets *sctp; + } ccvc; +}; + +/* cc_var flags. */ +#define CCF_ABC_SENTAWND 0x0001 /* ABC counted cwnd worth of bytes? */ +#define CCF_CWND_LIMITED 0x0002 /* Are we currently cwnd limited? */ + +/* ACK types passed to the ack_received() hook. */ +#define CC_ACK 0x0001 /* Regular in sequence ACK. */ +#define CC_DUPACK 0x0002 /* Duplicate ACK. */ +#define CC_PARTIALACK 0x0004 /* Not yet. */ +#define CC_SACK 0x0008 /* Not yet. */ + +/* + * Congestion signal types passed to the cong_signal() hook. The highest order 8 + * bits (0x01000000 - 0x80000000) are reserved for CC algos to declare their own + * congestion signal types. + */ +#define CC_ECN 0x000001/* ECN marked packet received. */ +#define CC_RTO 0x000002/* RTO fired. */ +#define CC_RTO_ERR 0x000004/* RTO fired in error. */ +#define CC_NDUPACK 0x000008/* Threshold of dupack's reached. */ + +/* + * Structure to hold data and function pointers that together represent a + * congestion control algorithm. + */ +struct cc_algo { + char name[TCP_CA_NAME_MAX]; + + /* Init global module state on kldload. */ + int (*mod_init)(void); + + /* Cleanup global module state on kldunload. */ + int (*mod_destroy)(void); + + /* Init CC state for a new control block. */ + int (*cb_init)(struct cc_var *ccv); + + /* Cleanup CC state for a terminating control block. */ + void (*cb_destroy)(struct cc_var *ccv); + + /* Init variables for a newly established connection. */ + void (*conn_init)(struct cc_var *ccv); + + /* Called on receipt of an ack. */ + void (*ack_received)(struct cc_var *ccv, uint16_t type); + + /* Called on detection of a congestion signal. */ + void (*cong_signal)(struct cc_var *ccv, uint32_t type); + + /* Called after exiting congestion recovery. */ + void (*post_recovery)(struct cc_var *ccv); + + /* Called when data transfer resumes after an idle period. */ + void (*after_idle)(struct cc_var *ccv); + + STAILQ_ENTRY (cc_algo) entries; +}; + +/* Macro to obtain the CC algo's struct ptr. */ +#define CC_ALGO(tp) ((tp)->cc_algo) + +/* Macro to obtain the CC algo's data ptr. */ +#define CC_DATA(tp) ((tp)->ccv->cc_data) + +/* Macro to obtain the system default CC algo's struct ptr. */ +#define CC_DEFAULT() STAILQ_FIRST(&cc_list) + +extern struct rwlock cc_list_lock; +#define CC_LIST_LOCK_INIT() rw_init(&cc_list_lock, "cc_list") +#define CC_LIST_LOCK_DESTROY() rw_destroy(&cc_list_lock) +#define CC_LIST_RLOCK() rw_rlock(&cc_list_lock) +#define CC_LIST_RUNLOCK() rw_runlock(&cc_list_lock) +#define CC_LIST_WLOCK() rw_wlock(&cc_list_lock) +#define CC_LIST_WUNLOCK() rw_wunlock(&cc_list_lock) +#define CC_LIST_WLOCK_ASSERT() rw_assert(&cc_list_lock, RA_WLOCKED) + +#endif /* _NETINET_CC_H_ */ Added: head/sys/netinet/cc/cc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/cc/cc.c Fri Nov 12 06:41:55 2010 (r215166) @@ -0,0 +1,340 @@ +/*- + * Copyright (c) 2007-2008 + * Swinburne University of Technology, Melbourne, Australia. + * Copyright (c) 2009-2010 Lawrence Stewart + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart and James Healy, + * made possible in part by a grant from the Cisco University Research Program + * Fund at Community Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This software was first released in 2007 by James Healy and Lawrence Stewart + * whilst working on the NewTCP research project at Swinburne University's + * Centre for Advanced Internet Architectures, Melbourne, Australia, which was + * made possible in part by a grant from the Cisco University Research Program + * Fund at Community Foundation Silicon Valley. More details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +/* + * List of available cc algorithms on the current system. First element + * is used as the system default CC algorithm. + */ +struct cc_head cc_list = STAILQ_HEAD_INITIALIZER(cc_list); + +/* Protects the cc_list TAILQ. */ +struct rwlock cc_list_lock; + +/* + * Set the default CC algorithm to new_default. The default is identified + * by being the first element in the cc_list TAILQ. + */ +static void +cc_set_default(struct cc_algo *new_default) +{ + CC_LIST_WLOCK_ASSERT(); + + /* + * Make the requested system default CC algorithm the first element in + * the list if it isn't already. + */ + if (new_default != CC_DEFAULT()) { + STAILQ_REMOVE(&cc_list, new_default, cc_algo, entries); + STAILQ_INSERT_HEAD(&cc_list, new_default, entries); + } +} + +/* + * Sysctl handler to show and change the default CC algorithm. + */ +static int +cc_default_algo(SYSCTL_HANDLER_ARGS) +{ + struct cc_algo *funcs; + int err, found; + + err = found = 0; + + if (req->newptr == NULL) { + char default_cc[TCP_CA_NAME_MAX]; + + /* Just print the current default. */ + CC_LIST_RLOCK(); + strlcpy(default_cc, CC_DEFAULT()->name, TCP_CA_NAME_MAX); + CC_LIST_RUNLOCK(); + err = sysctl_handle_string(oidp, default_cc, 1, req); + } else { + /* Find algo with specified name and set it to default. */ + CC_LIST_WLOCK(); + STAILQ_FOREACH(funcs, &cc_list, entries) { + if (strncmp((char *)req->newptr, funcs->name, + TCP_CA_NAME_MAX) == 0) { + found = 1; + cc_set_default(funcs); + } + } + CC_LIST_WUNLOCK(); + + if (!found) + err = ESRCH; + } + + return (err); +} + +/* + * Sysctl handler to display the list of available CC algorithms. + */ +static int +cc_list_available(SYSCTL_HANDLER_ARGS) +{ + struct cc_algo *algo; + struct sbuf *s; + int err, first; + + err = 0; + first = 1; + s = sbuf_new(NULL, NULL, TCP_CA_NAME_MAX, SBUF_AUTOEXTEND); + + if (s == NULL) + return (ENOMEM); + + CC_LIST_RLOCK(); + STAILQ_FOREACH(algo, &cc_list, entries) { + err = sbuf_printf(s, first ? "%s" : ", %s", algo->name); + if (err) + break; + first = 0; + } + CC_LIST_RUNLOCK(); + + if (!err) { + sbuf_finish(s); + err = sysctl_handle_string(oidp, sbuf_data(s), 1, req); + } + + sbuf_delete(s); + return (err); +} + +/* + * Initialise CC subsystem on system boot. + */ +void +cc_init() +{ + CC_LIST_LOCK_INIT(); + STAILQ_INIT(&cc_list); +} + +/* + * Returns non-zero on success, 0 on failure. + */ +int +cc_deregister_algo(struct cc_algo *remove_cc) +{ + struct cc_algo *funcs, *tmpfuncs; + struct tcpcb *tp; + struct inpcb *inp; + int err; + + err = ENOENT; + + /* Never allow newreno to be deregistered. */ + if (&newreno_cc_algo == remove_cc) + return (EPERM); + + /* Remove algo from cc_list so that new connections can't use it. */ + CC_LIST_WLOCK(); + STAILQ_FOREACH_SAFE(funcs, &cc_list, entries, tmpfuncs) { + if (funcs == remove_cc) { + /* + * If we're removing the current system default, + * reset the default to newreno. + */ + if (strncmp(CC_DEFAULT()->name, remove_cc->name, + TCP_CA_NAME_MAX) == 0) + cc_set_default(&newreno_cc_algo); + + STAILQ_REMOVE(&cc_list, funcs, cc_algo, entries); + err = 0; + break; + } + } + CC_LIST_WUNLOCK(); + + if (!err) { + /* + * Check all active control blocks and change any that are + * using this algorithm back to newreno. If the algorithm that + * was in use requires cleanup code to be run, call it. + * + * New connections already part way through being initialised + * with the CC algo we're removing will not race with this code + * because the INP_INFO_WLOCK is held during initialisation. + * We therefore don't enter the loop below until the connection + * list has stabilised. + */ + INP_INFO_RLOCK(&V_tcbinfo); + LIST_FOREACH(inp, &V_tcb, inp_list) { + INP_WLOCK(inp); + /* Important to skip tcptw structs. */ + if (!(inp->inp_flags & INP_TIMEWAIT) && + (tp = intotcpcb(inp)) != NULL) { + /* + * By holding INP_WLOCK here, we are + * assured that the connection is not + * currently executing inside the CC + * module's functions i.e. it is safe to + * make the switch back to newreno. + */ + if (CC_ALGO(tp) == remove_cc) { + tmpfuncs = CC_ALGO(tp); + /* Newreno does not require any init. */ + CC_ALGO(tp) = &newreno_cc_algo; + if (tmpfuncs->cb_destroy != NULL) + tmpfuncs->cb_destroy(tp->ccv); + } + } + INP_WUNLOCK(inp); + } + INP_INFO_RUNLOCK(&V_tcbinfo); + } + + return (err); +} + +/* + * Returns 0 on success, non-zero on failure. + */ +int +cc_register_algo(struct cc_algo *add_cc) +{ + struct cc_algo *funcs; + int err; + + err = 0; + + /* + * Iterate over list of registered CC algorithms and make sure + * we're not trying to add a duplicate. + */ + CC_LIST_WLOCK(); + STAILQ_FOREACH(funcs, &cc_list, entries) { + if (funcs == add_cc || strncmp(funcs->name, add_cc->name, + TCP_CA_NAME_MAX) == 0) + err = EEXIST; + } + + if (!err) + STAILQ_INSERT_TAIL(&cc_list, add_cc, entries); + + CC_LIST_WUNLOCK(); + + return (err); +} + +/* + * Handles kld related events. Returns 0 on success, non-zero on failure. + */ +int +cc_modevent(module_t mod, int event_type, void *data) +{ + struct cc_algo *algo; + int err; + + err = 0; + algo = (struct cc_algo *)data; + + switch(event_type) { + case MOD_LOAD: + if (algo->mod_init != NULL) + err = algo->mod_init(); + if (!err) + err = cc_register_algo(algo); + break; + + case MOD_QUIESCE: + case MOD_SHUTDOWN: + case MOD_UNLOAD: + err = cc_deregister_algo(algo); + if (!err && algo->mod_destroy != NULL) + algo->mod_destroy(); + if (err == ENOENT) + err = 0; + break; + + default: + err = EINVAL; + break; + } + + return (err); +} + +/* Declare sysctl tree and populate it. */ +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, cc, CTLFLAG_RW, NULL, + "congestion control related settings"); + +SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, algorithm, CTLTYPE_STRING|CTLFLAG_RW, + NULL, 0, cc_default_algo, "A", "default congestion control algorithm"); + +SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, available, CTLTYPE_STRING|CTLFLAG_RD, + NULL, 0, cc_list_available, "A", + "list available congestion control algorithms"); Added: head/sys/netinet/cc/cc_module.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/cc/cc_module.h Fri Nov 12 06:41:55 2010 (r215166) @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 2009-2010 Lawrence Stewart + * All rights reserved. + * + * This software was developed by Lawrence Stewart while studying at the Centre + * for Advanced Internet Architectures, Swinburne University, made possible in + * part by a grant from the Cisco University Research Program Fund at Community + * Foundation Silicon Valley. + * + * 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$ + */ + +/* + * This software was first released in 2009 by Lawrence Stewart as part of the + * NewTCP research project at Swinburne University's Centre for Advanced + * Internet Architectures, Melbourne, Australia, which was made possible in part + * by a grant from the Cisco University Research Program Fund at Community + * Foundation Silicon Valley. More details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#ifndef _NETINET_CC_MODULE_H_ +#define _NETINET_CC_MODULE_H_ + +/* + * Allows a CC algorithm to manipulate a commonly named CC variable regardless + * of the transport protocol and associated C struct. + * XXXLAS: Out of action until the work to support SCTP is done. + * +#define CCV(ccv, what) \ +(*( \ + (ccv)->type == IPPROTO_TCP ? &(ccv)->ccvc.tcp->what : \ + &(ccv)->ccvc.sctp->what \ +)) + */ +#define CCV(ccv, what) (ccv)->ccvc.tcp->what + +#define DECLARE_CC_MODULE(ccname, ccalgo) \ + static moduledata_t cc_##ccname = { \ + .name = #ccname, \ + .evhand = cc_modevent, \ + .priv = ccalgo \ + }; \ + DECLARE_MODULE(ccname, cc_##ccname, \ + SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY) + +int cc_modevent(module_t mod, int type, void *data); + +#endif /* _NETINET_CC_MODULE_H_ */ Added: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/cc/cc_newreno.c Fri Nov 12 06:41:55 2010 (r215166) @@ -0,0 +1,231 @@ +/*- + * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995 + * The Regents of the University of California. + * Copyright (c) 2007-2008,2010 + * Swinburne University of Technology, Melbourne, Australia. + * Copyright (c) 2009-2010 Lawrence Stewart + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart, James Healy and + * David Hayes, made possible in part by a grant from the Cisco University + * Research Program Fund at Community Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This software was first released in 2007 by James Healy and Lawrence Stewart + * whilst working on the NewTCP research project at Swinburne University's + * Centre for Advanced Internet Architectures, Melbourne, Australia, which was + * made possible in part by a grant from the Cisco University Research Program + * Fund at Community Foundation Silicon Valley. More details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +void newreno_ack_received(struct cc_var *ccv, uint16_t type); +void newreno_cong_signal(struct cc_var *ccv, uint32_t type); +void newreno_post_recovery(struct cc_var *ccv); +void newreno_after_idle(struct cc_var *ccv); + +struct cc_algo newreno_cc_algo = { + .name = "newreno", + .ack_received = newreno_ack_received, + .cong_signal = newreno_cong_signal, + .post_recovery = newreno_post_recovery, + .after_idle = newreno_after_idle +}; + +/* + * Increase cwnd on receipt of a successful ACK: + * if cwnd <= ssthresh, increases by 1 MSS per ACK + * if cwnd > ssthresh, increase by ~1 MSS per RTT + */ +void +newreno_ack_received(struct cc_var *ccv, uint16_t type) +{ + if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && + (ccv->flags & CCF_CWND_LIMITED)) { + u_int cw = CCV(ccv, snd_cwnd); + u_int incr = CCV(ccv, t_maxseg); + + /* + * Regular in-order ACK, open the congestion window. + * Method depends on which congestion control state we're + * in (slow start or cong avoid) and if ABC (RFC 3465) is + * enabled. + * + * slow start: cwnd <= ssthresh + * cong avoid: cwnd > ssthresh + * + * slow start and ABC (RFC 3465): + * Grow cwnd exponentially by the amount of data + * ACKed capping the max increment per ACK to + * (abc_l_var * maxseg) bytes. + * + * slow start without ABC (RFC 5681): + * Grow cwnd exponentially by maxseg per ACK. + * + * cong avoid and ABC (RFC 3465): + * Grow cwnd linearly by maxseg per RTT for each + * cwnd worth of ACKed data. + * + * cong avoid without ABC (RFC 5681): + * Grow cwnd linearly by approximately maxseg per RTT using + * maxseg^2 / cwnd per ACK as the increment. + * If cwnd > maxseg^2, fix the cwnd increment at 1 byte to + * avoid capping cwnd. + */ + if (cw > CCV(ccv, snd_ssthresh)) { + if (V_tcp_do_rfc3465) { + if (ccv->flags & CCF_ABC_SENTAWND) + ccv->flags &= ~CCF_ABC_SENTAWND; + else + incr = 0; + } else + incr = max((incr * incr / cw), 1); + } else if (V_tcp_do_rfc3465) { + /* + * In slow-start with ABC enabled and no RTO in sight? + * (Must not use abc_l_var > 1 if slow starting after + * an RTO. On RTO, snd_nxt = snd_una, so the + * snd_nxt == snd_max check is sufficient to + * handle this). + * + * XXXLAS: Find a way to signal SS after RTO that + * doesn't rely on tcpcb vars. + */ + if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) + incr = min(ccv->bytes_this_ack, + V_tcp_abc_l_var * CCV(ccv, t_maxseg)); + else + incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); + } + /* ABC is on by default, so incr equals 0 frequently. */ + if (incr > 0) + CCV(ccv, snd_cwnd) = min(cw + incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); + } +} + +/* + * manage congestion signals + */ +void +newreno_cong_signal(struct cc_var *ccv, uint32_t type) +{ + u_int win; + + win = max(CCV(ccv, snd_cwnd) / 2 / CCV(ccv, t_maxseg), 2) * + CCV(ccv, t_maxseg); + + switch (type) { + case CC_NDUPACK: + if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) + CCV(ccv, snd_ssthresh) = win; + ENTER_RECOVERY(CCV(ccv, t_flags)); + } + break; + case CC_ECN: + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { + CCV(ccv, snd_ssthresh) = win; + CCV(ccv, snd_cwnd) = win; + ENTER_CONGRECOVERY(CCV(ccv, t_flags)); + } + break; + } +} + +/* + * decrease the cwnd in response to packet loss or a transmit timeout. + * th can be null, in which case cwnd will be set according to reno instead + * of new reno. + */ +void +newreno_post_recovery(struct cc_var *ccv) +{ + if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { + /* + * Fast recovery will conclude after returning from this + * function. Window inflation should have left us with + * approximately snd_ssthresh outstanding data. But in case we + * would be inclined to send a burst, better to do it via the + * slow start mechanism. + * + * XXXLAS: Find a way to do this without needing curack + */ + if (SEQ_GT(ccv->curack + CCV(ccv, snd_ssthresh), + CCV(ccv, snd_max))) + CCV(ccv, snd_cwnd) = CCV(ccv, snd_max) - + ccv->curack + CCV(ccv, t_maxseg); + else + CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + } +} + +/* + * if a connection has been idle for a while and more data is ready to be sent, + * reset cwnd + */ +void +newreno_after_idle(struct cc_var *ccv) +{ + /* + * We have been idle for "a while" and no acks are expected to clock out + * any data we send -- slow start to get ack "clock" running again. + */ + if (V_tcp_do_rfc3390) + CCV(ccv, snd_cwnd) = min(4 * CCV(ccv, t_maxseg), + max(2 * CCV(ccv, t_maxseg), 4380)); + else + CCV(ccv, snd_cwnd) = CCV(ccv, t_maxseg) * 2; +} + + +DECLARE_CC_MODULE(newreno, &newreno_cc_algo); Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Nov 12 05:22:27 2010 (r215165) +++ head/sys/netinet/tcp_input.c Fri Nov 12 06:41:55 2010 (r215166) @@ -1,6 +1,20 @@ /*- * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2007-2008,2010 + * Swinburne University of Technology, Melbourne, Australia. + * Copyright (c) 2009-2010 Lawrence Stewart + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart, James Healy and + * David Hayes, made possible in part by a grant from the Cisco University + * Research Program Fund at Community Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,6 +75,7 @@ __FBSDID("$FreeBSD$"); #define TCPSTATES /* for logging */ +#include #include #include #include @@ -75,7 +90,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -96,7 +110,7 @@ __FBSDID("$FreeBSD$"); #include -static const int tcprexmtthresh = 3; +const int tcprexmtthresh = 3; VNET_DEFINE(struct tcpstat, tcpstat); SYSCTL_VNET_STRUCT(_net_inet_tcp, TCPCTL_STATS, stats, CTLFLAG_RW, @@ -132,19 +146,16 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, "Enable RFC 3042 (Limited Transmit)"); VNET_DEFINE(int, tcp_do_rfc3390) = 1; -#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); VNET_DEFINE(int, tcp_do_rfc3465) = 1; -#define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3465), 0, "Enable RFC 3465 (Appropriate Byte Counting)"); VNET_DEFINE(int, tcp_abc_l_var) = 2; -#define V_tcp_abc_l_var VNET(tcp_abc_l_var) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_RW, &VNET_NAME(tcp_abc_l_var), 2, "Cap the max cwnd increment during slow-start to this number of segments"); @@ -203,8 +214,10 @@ static void tcp_pulloutofband(struct so struct tcphdr *, struct mbuf *, int); static void tcp_xmit_timer(struct tcpcb *, int); static void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); -static void inline - tcp_congestion_exp(struct tcpcb *); +static void inline cc_ack_received(struct tcpcb *tp, struct tcphdr *th, + uint16_t type); +static void inline cc_conn_init(struct tcpcb *tp); +static void inline cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); /* * Kernel module interface for updating tcpstat. The argument is an index @@ -220,20 +233,188 @@ kmod_tcpstat_inc(int statnum) (*((u_long *)&V_tcpstat + statnum))++; } +/* + * CC wrapper hook functions + */ static void inline -tcp_congestion_exp(struct tcpcb *tp) +cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t type) { - u_int win; - - win = min(tp->snd_wnd, tp->snd_cwnd) / - 2 / tp->t_maxseg; - if (win < 2) - win = 2; - tp->snd_ssthresh = win * tp->t_maxseg; - ENTER_FASTRECOVERY(tp); - tp->snd_recover = tp->snd_max; - if (tp->t_flags & TF_ECN_PERMIT) - tp->t_flags |= TF_ECN_SND_CWR; + INP_WLOCK_ASSERT(tp->t_inpcb); + + tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th); + if (tp->snd_cwnd == min(tp->snd_cwnd, tp->snd_wnd)) + tp->ccv->flags |= CCF_CWND_LIMITED; + else + tp->ccv->flags &= ~CCF_CWND_LIMITED; + + if (type == CC_ACK) { + if (tp->snd_cwnd > tp->snd_ssthresh) { + tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, + V_tcp_abc_l_var * tp->t_maxseg); + if (tp->t_bytes_acked >= tp->snd_cwnd) { + tp->t_bytes_acked -= tp->snd_cwnd; + tp->ccv->flags |= CCF_ABC_SENTAWND; + } + } else { + tp->ccv->flags &= ~CCF_ABC_SENTAWND; + tp->t_bytes_acked = 0; + } + } + + if (CC_ALGO(tp)->ack_received != NULL) { + /* XXXLAS: Find a way to live without this */ + tp->ccv->curack = th->th_ack; + CC_ALGO(tp)->ack_received(tp->ccv, type); + } +} + +static void inline +cc_conn_init(struct tcpcb *tp) +{ + struct hc_metrics_lite metrics; + struct inpcb *inp = tp->t_inpcb; + int rtt; +#ifdef INET6 + int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; +#endif + + INP_WLOCK_ASSERT(tp->t_inpcb); + + tcp_hc_get(&inp->inp_inc, &metrics); + + if (tp->t_srtt == 0 && (rtt = metrics.rmx_rtt)) { + tp->t_srtt = rtt; + tp->t_rttbest = tp->t_srtt + TCP_RTT_SCALE; + TCPSTAT_INC(tcps_usedrtt); + if (metrics.rmx_rttvar) { + tp->t_rttvar = metrics.rmx_rttvar; + TCPSTAT_INC(tcps_usedrttvar); + } else { + /* default variation is +- 1 rtt */ + tp->t_rttvar = + tp->t_srtt * TCP_RTTVAR_SCALE / TCP_RTT_SCALE; + } + TCPT_RANGESET(tp->t_rxtcur, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 06:58:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B86F91065670; Fri, 12 Nov 2010 06:58:05 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id 714CD8FC0C; Fri, 12 Nov 2010 06:58:05 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 7D43128F7A7; Fri, 12 Nov 2010 00:58:04 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 84bL43tidDJq; Fri, 12 Nov 2010 00:58:04 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id E9B6D28F7AA; Fri, 12 Nov 2010 00:58:03 -0600 (CST) Message-ID: <4CDCE57B.3000602@rice.edu> Date: Fri, 12 Nov 2010 00:58:03 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Bernhard Schmidt References: <201011111843.oABIhV9d080688@svn.freebsd.org> In-Reply-To: <201011111843.oABIhV9d080688@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: r215135 - head/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 06:58:05 -0000 Bernhard Schmidt wrote: > Author: bschmidt > Date: Thu Nov 11 18:43:31 2010 > New Revision: 215135 > URL: http://svn.freebsd.org/changeset/base/215135 > > Log: > According to specs for MmAllocateContiguousMemorySpecifyCache() physically > contiguous memory with requested restrictions must be allocated. > > It appears to me that these functions should be using kmem_alloc_contig() and kmem_free() instead of contigmalloc() and contigfree(). Then, the "cachetype" parameter could be correctly implemented rather than ignored. It just requires mapping the cachetype values to their corresponding vm_memattr_t values. Regards, Alan > Submitted by: Paul B Mahol > > Modified: > head/sys/compat/ndis/subr_ntoskrnl.c > > Modified: head/sys/compat/ndis/subr_ntoskrnl.c > ============================================================================== > --- head/sys/compat/ndis/subr_ntoskrnl.c Thu Nov 11 18:41:03 2010 (r215134) > +++ head/sys/compat/ndis/subr_ntoskrnl.c Thu Nov 11 18:43:31 2010 (r215135) > @@ -2426,12 +2426,9 @@ MmAllocateContiguousMemorySpecifyCache(s > uint64_t boundary; > uint32_t cachetype; > { > - void *addr; > - size_t pagelength = roundup(size, PAGE_SIZE); > > - addr = ExAllocatePoolWithTag(NonPagedPool, pagelength, 0); > - > - return (addr); > + return (contigmalloc(size, M_DEVBUF, M_ZERO|M_NOWAIT, lowest, > + highest, PAGE_SIZE, boundary)); > } > > static void > @@ -2447,7 +2444,7 @@ MmFreeContiguousMemorySpecifyCache(base, > uint32_t size; > uint32_t cachetype; > { > - ExFreePool(base); > + contigfree(base, size, M_DEVBUF); > } > > static uint32_t > > From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 06:59:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9036B1065672; Fri, 12 Nov 2010 06:59:13 +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 40F0A8FC0C; Fri, 12 Nov 2010 06:59:11 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA24173; Fri, 12 Nov 2010 08:59:10 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PGnbK-000I8i-Fs; Fri, 12 Nov 2010 08:59:10 +0200 Message-ID: <4CDCE56D.9050007@freebsd.org> Date: Fri, 12 Nov 2010 08:57:49 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Dimitry Andric References: <201011111918.oABJIqvH081681@svn.freebsd.org> <4CDC43FE.6060401@freebsd.org> <4CDC45F7.8060506@FreeBSD.org> In-Reply-To: <4CDC45F7.8060506@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215138 - in head/sys: net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 06:59:13 -0000 on 11/11/2010 21:37 Dimitry Andric said the following: > On 2010-11-11 20:29, Andriy Gapon wrote: >> Do I understand it correctly that set_pcpu section itself would not be >> produced if >> DPCPU_DEFINE() is not actually used? > > Yes, although currently this does not occur in any kernel module (I > tested using make universe). But indeed, if you would include e.g. > vnet.h or pcpu.h, but did not use any VNET_DEFINE or DPCPU_DEFINE > macros, you would get an error during linking. Either I am confused or there is something wrong. I think that we have plenty of modules that do not use DPCPU_DEFINE, but source files of which do include pcpu.h. > The proper fix for this is to use the __GLOBL macros only when actually > invoking the VNET_DEFINE or DPCPU_DEFINE macros, just as with the > __MAKE_SET macro. But this is made more difficult by the fact that many > invocations of VNET_DEFINE and DPCPU_DEFINE are either prefixed with > 'static', or postfixed with '= literal_value'. > > Maybe we could use separate VNET_DEFINE_STATIC and DPCPU_DEFINE_STATIC > macros for this, since it looks like some of the definitions actually > define public variables... -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 09:17:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65779106566C; Fri, 12 Nov 2010 09:17:25 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7BC518FC14; Fri, 12 Nov 2010 09:17:24 +0000 (UTC) Received: by wya21 with SMTP id 21so614998wya.13 for ; Fri, 12 Nov 2010 01:17:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=KUZj1MzRGqUFIY2r3x5ZZfITFH0w29nIeviS84myCmQ=; b=IM1fuSTP6UXq+pZYf+gfH2bZSYK+B0HwmaI61fhQ401WZMsUnX6VVGhL3RhQJ9gH+m NNUuJitM5Wv7HRRPD3Wlx9xIFNKa++ZJ5q+d4vijxvLHo02q9dRgofLOzPKPENtJUn/C GBZpBBtw+zkJOV+ay0JFUmkregyWeNz7nKEUw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=N6YzSRCrwrxo0G2ZY3k4DyQ+yU/qecwFWCo9d5KwF7FuZz/X0T/vXLUh6lx3MIH6Bg B/hDMQHtKgkvkU4DQZatJNDi3n1JVAGhogkwKF+b2EdkA9mc0n6oKXLXavCRpbRJ4Xfg R4KW9dFSk5mpL6sJB7ngSwCpLW1/g5905bKvQ= MIME-Version: 1.0 Received: by 10.216.155.68 with SMTP id i46mr1649313wek.92.1289553442943; Fri, 12 Nov 2010 01:17:22 -0800 (PST) Received: by 10.216.234.82 with HTTP; Fri, 12 Nov 2010 01:17:22 -0800 (PST) In-Reply-To: <4CDCE57B.3000602@rice.edu> References: <201011111843.oABIhV9d080688@svn.freebsd.org> <4CDCE57B.3000602@rice.edu> Date: Fri, 12 Nov 2010 09:17:22 +0000 Message-ID: From: Paul B Mahol To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bernhard Schmidt Subject: Re: svn commit: r215135 - head/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 09:17:25 -0000 On 11/12/10, Alan Cox wrote: > Bernhard Schmidt wrote: >> Author: bschmidt >> Date: Thu Nov 11 18:43:31 2010 >> New Revision: 215135 >> URL: http://svn.freebsd.org/changeset/base/215135 >> >> Log: >> According to specs for MmAllocateContiguousMemorySpecifyCache() >> physically >> contiguous memory with requested restrictions must be allocated. >> >> > > It appears to me that these functions should be using > kmem_alloc_contig() and kmem_free() instead of contigmalloc() and > contigfree(). Then, the "cachetype" parameter could be correctly > implemented rather than ignored. It just requires mapping the cachetype > values to their corresponding vm_memattr_t values. Well, even if mapping is possible, I can't recognize every type in Windows, some of them are not documented: 0 MmNonCached 1 MmCached 2 MmWriteCombined 3 MmHardwareCoherentCached 4 MmNonCachedUnordered 5 MmUSWCCached 0 UNCACHEABLE 1 WRITE_COMBINING 2 WRITE_THROUGH 3 WRITE_PROTECTED 4 WRITE_BACK 5 UNCACHED From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 11:22:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 845B7106564A; Fri, 12 Nov 2010 11:22:59 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FE388FC18; Fri, 12 Nov 2010 11:22:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACBMx2v006791; Fri, 12 Nov 2010 11:22:59 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACBMxX3006787; Fri, 12 Nov 2010 11:22:59 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011121122.oACBMxX3006787@svn.freebsd.org> From: Bruce Cran Date: Fri, 12 Nov 2010 11:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215173 - in stable/8: share/man/man4 sys/cam sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 11:22:59 -0000 Author: brucec Date: Fri Nov 12 11:22:59 2010 New Revision: 215173 URL: http://svn.freebsd.org/changeset/base/215173 Log: MFC r214279: Mostly revert r203420, and add similar functionality into ada(4) since the existing code caused problems with some SCSI controllers. A new sysctl kern.cam.ada.spindown_shutdown has been added that controls whether or not to spin-down disks when shutting down. Spinning down the disks unloads/parks the heads - this is much better than removing power when the disk is still spinning because otherwise an Emergency Unload occurs which may cause damage to the actuator. The FLUSH_CACHE + STANDBY_IMMEDIATE commands are issued following the procedure documented in Fujitsu's MHW series product documentation under section 1.10.1, "Recommended power-off sequence". PR: kern/140752 Submitted by: olli Modified: stable/8/share/man/man4/ada.4 stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/ada.4 ============================================================================== --- stable/8/share/man/man4/ada.4 Fri Nov 12 09:52:56 2010 (r215172) +++ stable/8/share/man/man4/ada.4 Fri Nov 12 11:22:59 2010 (r215173) @@ -118,6 +118,9 @@ This variable determines how long the driver will wait before timing out an outstanding command. The units for this value are seconds, and the default is currently 30 seconds. +.It kern.cam.ada.spindown_shutdown +.Pp +This variable determines whether to spin-down disks when shutting down. .El .Sh FILES .Bl -tag -width ".Pa /dev/ada*" -compact Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Fri Nov 12 09:52:56 2010 (r215172) +++ stable/8/sys/cam/ata/ata_da.c Fri Nov 12 11:22:59 2010 (r215173) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #endif /* _KERNEL */ @@ -79,7 +80,8 @@ typedef enum { ADA_FLAG_CAN_TRIM = 0x080, ADA_FLAG_OPEN = 0x100, ADA_FLAG_SCTX_INIT = 0x200, - ADA_FLAG_CAN_CFA = 0x400 + ADA_FLAG_CAN_CFA = 0x400, + ADA_FLAG_CAN_POWERMGT = 0x800 } ada_flags; typedef enum { @@ -180,6 +182,10 @@ static void adashutdown(void *arg, int #define ADA_DEFAULT_SEND_ORDERED 1 #endif +#ifndef ADA_DEFAULT_SPINDOWN_SHUTDOWN +#define ADA_DEFAULT_SPINDOWN_SHUTDOWN 1 +#endif + /* * Most platforms map firmware geometry to actual, but some don't. If * not overridden, default to nothing. @@ -191,6 +197,7 @@ static void adashutdown(void *arg, int static int ada_retry_count = ADA_DEFAULT_RETRY; static int ada_default_timeout = ADA_DEFAULT_TIMEOUT; static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED; +static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOWN_SHUTDOWN; SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -203,6 +210,9 @@ TUNABLE_INT("kern.cam.ada.default_timeou SYSCTL_INT(_kern_cam_ada, OID_AUTO, ada_send_ordered, CTLFLAG_RW, &ada_send_ordered, 0, "Send Ordered Tags"); TUNABLE_INT("kern.cam.ada.ada_send_ordered", &ada_send_ordered); +SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW, + &ada_spindown_shutdown, 0, "Spin down upon shutdown"); +TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown); /* * ADA_ORDEREDTAG_INTERVAL determines how often, relative @@ -665,6 +675,8 @@ adaregister(struct cam_periph *periph, v softc->flags |= ADA_FLAG_CAN_48BIT; if (cgd->ident_data.support.command2 & ATA_SUPPORT_FLUSHCACHE) softc->flags |= ADA_FLAG_CAN_FLUSHCACHE; + if (cgd->ident_data.support.command1 & ATA_SUPPORT_POWERMGT) + softc->flags |= ADA_FLAG_CAN_POWERMGT; if (cgd->ident_data.satacapabilities & ATA_SUPPORT_NCQ && cgd->inq_flags & SID_CmdQue) softc->flags |= ADA_FLAG_CAN_NCQ; @@ -1223,6 +1235,56 @@ adashutdown(void * arg, int howto) /*getcount_only*/0); cam_periph_unlock(periph); } + + if (ada_spindown_shutdown == 0 || + (howto & (RB_HALT | RB_POWEROFF)) == 0) + return; + + TAILQ_FOREACH(periph, &adadriver.units, unit_links) { + union ccb ccb; + + /* If we paniced with lock held - not recurse here. */ + if (cam_periph_owned(periph)) + continue; + cam_periph_lock(periph); + softc = (struct ada_softc *)periph->softc; + /* + * We only spin-down the drive if it is capable of it.. + */ + if ((softc->flags & ADA_FLAG_CAN_POWERMGT) == 0) { + cam_periph_unlock(periph); + continue; + } + + if (bootverbose) + xpt_print(periph->path, "spin-down\n"); + + xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + + ccb.ccb_h.ccb_state = ADA_CCB_DUMP; + cam_fill_ataio(&ccb.ataio, + 1, + adadone, + CAM_DIR_NONE, + 0, + NULL, + 0, + ada_default_timeout*1000); + + ata_28bit_cmd(&ccb.ataio, ATA_STANDBY_IMMEDIATE, 0, 0, 0); + xpt_polled_action(&ccb); + + if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + xpt_print(periph->path, "Spin-down disk failed\n"); + + if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(ccb.ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + cam_periph_unlock(periph); + } } #endif /* _KERNEL */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Fri Nov 12 09:52:56 2010 (r215172) +++ stable/8/sys/cam/cam_xpt.c Fri Nov 12 11:22:59 2010 (r215173) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 11:36:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D002106564A; Fri, 12 Nov 2010 11:36:13 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0952A8FC16; Fri, 12 Nov 2010 11:36:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACBaCqG007125; Fri, 12 Nov 2010 11:36:12 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACBaCFQ007123; Fri, 12 Nov 2010 11:36:12 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011121136.oACBaCFQ007123@svn.freebsd.org> From: Bruce Cran Date: Fri, 12 Nov 2010 11:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215174 - stable/8/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 11:36:13 -0000 Author: brucec Date: Fri Nov 12 11:36:12 2010 New Revision: 215174 URL: http://svn.freebsd.org/changeset/base/215174 Log: MFC r214781, r214807: Improve rounding of standby timer. 22-29 minutes can't be encoded so must be rounded up to 30. PR: bin/151871 Modified: stable/8/sbin/camcontrol/camcontrol.c Directory Properties: stable/8/sbin/camcontrol/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Fri Nov 12 11:22:59 2010 (r215173) +++ stable/8/sbin/camcontrol/camcontrol.c Fri Nov 12 11:36:12 2010 (r215174) @@ -4302,14 +4302,19 @@ atapm(struct cam_device *device, int arg cmd = ATA_SLEEP; t = -1; } + if (t < 0) sc = 0; else if (t <= (240 * 5)) - sc = t / 5; + sc = (t + 4) / 5; + else if (t <= (252 * 5)) + /* special encoding for 21 minutes */ + sc = 252; else if (t <= (11 * 30 * 60)) - sc = t / (30 * 60) + 241; + sc = (t - 1) / (30 * 60) + 241; else sc = 253; + cam_fill_ataio(&ccb->ataio, retry_count, NULL, From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 12:00:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E92E1065695; Fri, 12 Nov 2010 12:00:00 +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 7A3928FC14; Fri, 12 Nov 2010 11:59:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACBxx6H007624; Fri, 12 Nov 2010 11:59:59 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACBxx3M007620; Fri, 12 Nov 2010 11:59:59 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201011121159.oACBxx3M007620@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 12 Nov 2010 11:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215175 - in stable/8/sys: net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 12:00:00 -0000 Author: pluknet Date: Fri Nov 12 11:59:59 2010 New Revision: 215175 URL: http://svn.freebsd.org/changeset/base/215175 Log: MFC r214136: Reshuffle SIOCGIFCONF32 handler. Approved by: kib (mentor) Modified: stable/8/sys/net/if.c stable/8/sys/net/if.h stable/8/sys/sys/sockio.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Fri Nov 12 11:36:12 2010 (r215174) +++ stable/8/sys/net/if.c Fri Nov 12 11:59:59 2010 (r215175) @@ -87,6 +87,11 @@ #include +#ifdef COMPAT_FREEBSD32 +#include +#include +#endif + struct ifindex_entry { struct ifnet *ife_ifnet; }; @@ -2459,6 +2464,17 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (error); } +#ifdef COMPAT_FREEBSD32 +struct ifconf32 { + int32_t ifc_len; + union { + uint32_t ifcu_buf; + uint32_t ifcu_req; + } ifc_ifcu; +}; +#define SIOCGIFCONF32 _IOWR('i', 36, struct ifconf32) +#endif + /* * Interface ioctls. */ @@ -2473,10 +2489,21 @@ ifioctl(struct socket *so, u_long cmd, c switch (cmd) { case SIOCGIFCONF: case OSIOCGIFCONF: -#ifdef __amd64__ + return (ifconf(cmd, data)); + +#ifdef COMPAT_FREEBSD32 case SIOCGIFCONF32: + { + struct ifconf32 *ifc32; + struct ifconf ifc; + + ifc32 = (struct ifconf32 *)data; + ifc.ifc_len = ifc32->ifc_len; + ifc.ifc_buf = PTRIN(ifc32->ifc_buf); + + return (ifconf(SIOCGIFCONF, (void *)&ifc)); + } #endif - return (ifconf(cmd, data)); } ifr = (struct ifreq *)data; @@ -2703,23 +2730,12 @@ static int ifconf(u_long cmd, caddr_t data) { struct ifconf *ifc = (struct ifconf *)data; -#ifdef __amd64__ - struct ifconf32 *ifc32 = (struct ifconf32 *)data; - struct ifconf ifc_swab; -#endif struct ifnet *ifp; struct ifaddr *ifa; struct ifreq ifr; struct sbuf *sb; int error, full = 0, valid_len, max_len; -#ifdef __amd64__ - if (cmd == SIOCGIFCONF32) { - ifc_swab.ifc_len = ifc32->ifc_len; - ifc_swab.ifc_buf = (caddr_t)(uintptr_t)ifc32->ifc_buf; - ifc = &ifc_swab; - } -#endif /* Limit initial buffer size to MAXPHYS to avoid DoS from userspace. */ max_len = MAXPHYS - 1; @@ -2809,10 +2825,6 @@ again: } ifc->ifc_len = valid_len; -#ifdef __amd64__ - if (cmd == SIOCGIFCONF32) - ifc32->ifc_len = valid_len; -#endif sbuf_finish(sb); error = copyout(sbuf_data(sb), ifc->ifc_req, ifc->ifc_len); sbuf_delete(sb); Modified: stable/8/sys/net/if.h ============================================================================== --- stable/8/sys/net/if.h Fri Nov 12 11:36:12 2010 (r215174) +++ stable/8/sys/net/if.h Fri Nov 12 11:59:59 2010 (r215175) @@ -391,16 +391,6 @@ struct ifconf { #define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */ }; -#if defined (__amd64__) -struct ifconf32 { - int ifc_len; /* size of associated buffer */ - union { - u_int ifcu_buf; - u_int ifcu_req; - } ifc_ifcu; -}; -#endif - /* * interface groups */ Modified: stable/8/sys/sys/sockio.h ============================================================================== --- stable/8/sys/sys/sockio.h Fri Nov 12 11:36:12 2010 (r215174) +++ stable/8/sys/sys/sockio.h Fri Nov 12 11:59:59 2010 (r215175) @@ -62,9 +62,6 @@ #define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */ #define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */ #define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */ -#if defined (__amd64__) -#define SIOCGIFCONF32 _IOWR('i', 36, struct ifconf32) /* get ifnet list */ -#endif #define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */ #define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */ #define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 12:07:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE9E0106566C; Fri, 12 Nov 2010 12:07:36 +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 AB2048FC15; Fri, 12 Nov 2010 12:07:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACC7aQV007837; Fri, 12 Nov 2010 12:07:36 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACC7axR007832; Fri, 12 Nov 2010 12:07:36 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201011121207.oACC7axR007832@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 12 Nov 2010 12:07: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: r215176 - in head: . share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 12:07:36 -0000 Author: pluknet Date: Fri Nov 12 12:07:36 2010 New Revision: 215176 URL: http://svn.freebsd.org/changeset/base/215176 Log: Stop documenting vgonel() after its converting to the static function: svn r147332 (by jeff): "Don't make vgonel() globally visible". While here, specify the vnode locking scheme for vgone(). Discussed on: freebsd-hackers@ Approved by: kib (mentor) MFC after: 10 days Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/vflush.9 head/share/man/man9/vgone.9 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Nov 12 11:59:59 2010 (r215175) +++ head/ObsoleteFiles.inc Fri Nov 12 12:07:36 2010 (r215176) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101112: vgonel(9) has gone to private API a while ago +OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101112: removed gasp.info OLD_FILES+=usr/share/info/gasp.info.gz # 20101109: headers moved to machine/ to x86/ Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Nov 12 11:59:59 2010 (r215175) +++ head/share/man/man9/Makefile Fri Nov 12 12:07:36 2010 (r215176) @@ -1318,7 +1318,6 @@ MLINKS+=vfs_getopt.9 vfs_copyopt.9 \ vfs_getopt.9 vfs_setopt_part.9 \ vfs_getopt.9 vfs_setopts.9 MLINKS+=VFS_LOCK_GIANT.9 VFS_UNLOCK_GIANT.9 -MLINKS+=vgone.9 vgonel.9 MLINKS+=vhold.9 vdrop.9 \ vhold.9 vdropl.9 \ vhold.9 vholdl.9 Modified: head/share/man/man9/vflush.9 ============================================================================== --- head/share/man/man9/vflush.9 Fri Nov 12 11:59:59 2010 (r215175) +++ head/share/man/man9/vflush.9 Fri Nov 12 12:07:36 2010 (r215176) @@ -75,7 +75,6 @@ A value of 0 is returned if the flush is will be returned. .Sh SEE ALSO .Xr vgone 9 , -.Xr vgonel 9 , .Xr vrele 9 .Sh AUTHORS This manual page was written by Modified: head/share/man/man9/vgone.9 ============================================================================== --- head/share/man/man9/vgone.9 Fri Nov 12 11:59:59 2010 (r215175) +++ head/share/man/man9/vgone.9 Fri Nov 12 12:07:36 2010 (r215176) @@ -26,24 +26,21 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2001 +.Dd November 12, 2010 .Dt VGONE 9 .Os .Sh NAME -.Nm vgone , vgonel +.Nm vgone .Nd "prepare a vnode for reuse" .Sh SYNOPSIS .In sys/param.h .In sys/vnode.h .Ft void .Fn vgone "struct vnode *vp" -.Ft void -.Fn vgonel "struct vnode *vp" "struct thread *td" .Sh DESCRIPTION +The .Fn vgone -and -.Fn vgonel -prepare a vnode for reuse by another file system. +function prepares the vnode to be destroyed. The preparation includes the cleaning of all file system specific data and the removal from its mount point vnode list. .Pp @@ -55,17 +52,12 @@ flag is not set, it is moved to the head as in most cases the vnode is about to be reused, or its file system is being unmounted. .Pp -The difference between -.Fn vgone -and -.Fn vgonel -is that +The .Fn vgone -locks the vnode interlock and then calls -.Fn vgonel -while -.Fn vgonel -expects the interlock to already be locked. +function takes an exclusively locked vnode, and returns with the vnode +exclusively locked. +.Sh SEE ALSO +.Xr vnode 9 .Sh AUTHORS This manual page was written by .An Chad David Aq davidc@acns.ab.ca . From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 12:48:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C9D106566B; Fri, 12 Nov 2010 12:48:42 +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 43E7C8FC12; Fri, 12 Nov 2010 12:48:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACCmg3A008867; Fri, 12 Nov 2010 12:48:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACCmgUD008865; Fri, 12 Nov 2010 12:48:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201011121248.oACCmgUD008865@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 12 Nov 2010 12:48: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: r215177 - head/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 12:48:42 -0000 Author: luigi Date: Fri Nov 12 12:48:41 2010 New Revision: 215177 URL: http://svn.freebsd.org/changeset/base/215177 Log: move the initialization of BINMAKE earler, so it is available throughout the entire build process. Submitted by: Matteo Landi MFC after: 3 days Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Fri Nov 12 12:07:36 2010 (r215176) +++ head/release/picobsd/build/picobsd Fri Nov 12 12:48:41 2010 (r215177) @@ -297,11 +297,6 @@ build_image() { PICO_OBJ=${l_objtree}/picobsd/${THETYPE} log "PICO_OBJ is ${PICO_OBJ}" - if [ ${OSVERSION} -ge 500035 ] ; then - export MAKEOBJDIRPREFIX=${l_objtree} - eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" - eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` - fi # create build directory and subtree mkdir -p ${BUILDDIR}/crunch # remove any old stuff @@ -979,10 +974,17 @@ set_build_parameters() { l_usrtree=${USR:-${SRC}/../usr} fi l_objtree=${l_usrtree}/obj-pico + PICO_TREE=${PICO_TREE:-${SRC}/release/picobsd} set `grep "#define[\t ]__FreeBSD_version" ${SRC}/sys/sys/param.h` OSVERSION=$3 log "OSVERSION is ${OSVERSION}" + if [ ${OSVERSION} -ge 500035 ] ; then + export MAKEOBJDIRPREFIX=${l_objtree} + eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" + eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` + fi + if [ "${o_init_src}" != "" ] ; then if [ ${OSVERSION} -lt 500035 ] ; then create_includes_and_libraries From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 13:02:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DBFE106566B; Fri, 12 Nov 2010 13:02:27 +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 09EF88FC14; Fri, 12 Nov 2010 13:02:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACD2QHU009390; Fri, 12 Nov 2010 13:02:26 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACD2Qjt009385; Fri, 12 Nov 2010 13:02:26 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201011121302.oACD2Qjt009385@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 12 Nov 2010 13:02: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: r215178 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 13:02:27 -0000 Author: luigi Date: Fri Nov 12 13:02:26 2010 New Revision: 215178 URL: http://svn.freebsd.org/changeset/base/215178 Log: This commit implements the SO_USER_COOKIE socket option, which lets you tag a socket with an uint32_t value. The cookie can then be used by the kernel for various purposes, e.g. setting the skipto rule or pipe number in ipfw (this is the reason SO_USER_COOKIE has been implemented; however there is nothing ipfw-specific in its implementation). The ipfw-related code that uses the optopn will be committed separately. This change adds a field to 'struct socket', but the struct is not part of any driver or userland-visible ABI so the change should be harmless. See the discussion at http://lists.freebsd.org/pipermail/freebsd-ipfw/2009-October/004001.html Idea and code from Paul Joe, small modifications and manpage changes by myself. Submitted by: Paul Joe MFC after: 1 week Modified: head/lib/libc/sys/getsockopt.2 head/sys/kern/uipc_socket.c head/sys/sys/socket.h head/sys/sys/socketvar.h Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Fri Nov 12 12:48:41 2010 (r215177) +++ head/lib/libc/sys/getsockopt.2 Fri Nov 12 13:02:26 2010 (r215178) @@ -184,15 +184,18 @@ The following options are recognized in .It Dv SO_LISTENQLIMIT Ta "get backlog limit of the socket (get only)" .It Dv SO_LISTENQLEN Ta "get complete queue length of the socket (get only)" .It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)" +.It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)" .El .Pp .Dv SO_DEBUG enables debugging in the underlying protocol modules. +.Pp .Dv SO_REUSEADDR indicates that the rules used in validating addresses supplied in a .Xr bind 2 system call should allow reuse of local addresses. +.Pp .Dv SO_REUSEPORT allows completely duplicate bindings by multiple processes if they all set @@ -200,6 +203,7 @@ if they all set before binding the port. This option permits multiple instances of a program to each receive UDP/IP multicast or broadcast datagrams destined for the bound port. +.Pp .Dv SO_KEEPALIVE enables the periodic transmission of messages on a connected socket. @@ -208,6 +212,7 @@ connected party fail to respond to these considered broken and processes using the socket are notified via a .Dv SIGPIPE signal when attempting to send data. +.Pp .Dv SO_DONTROUTE indicates that outgoing messages should bypass the standard routing facilities. @@ -244,6 +249,7 @@ The option requests permission to send broadcast datagrams on the socket. Broadcast was a privileged operation in earlier versions of the system. +.Pp With protocols that support out-of-band data, the .Dv SO_OOBINLINE option @@ -256,6 +262,7 @@ calls without the .Dv MSG_OOB flag. Some protocols always behave as if this option is set. +.Pp .Dv SO_SNDBUF and .Dv SO_RCVBUF @@ -285,6 +292,7 @@ only if the low water mark amount could The default value for .Dv SO_SNDLOWAT is set to a convenient size for network efficiency, often 1024. +.Pp .Dv SO_RCVLOWAT is an option to set the minimum count for input operations. In general, receive calls will block until any (non-zero) amount of data @@ -317,6 +325,7 @@ In the current implementation, this time data are delivered to the protocol, implying that the limit applies to output portions ranging in size from the low water mark to the high water mark for output. +.Pp .Dv SO_RCVTIMEO is an option to set a timeout value for input operations. It accepts a @@ -338,6 +347,15 @@ The value must be from 0 to one less tha the sysctl .Em net.fibs . .Pp +.Dv SO_USER_COOKIE +can be used to set the uint32_t so_user_cookie field in the socket. +The value is an uint32_t, and can be used in the kernel code that +manipulates traffic related to the socket. +The default value for the field is 0. +As an example, the value can be used as the skipto target or +pipe number in +.Nm ipfw/dummynet . +.Pp .Dv SO_ACCEPTFILTER places an .Xr accept_filter 9 Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Nov 12 12:48:41 2010 (r215177) +++ head/sys/kern/uipc_socket.c Fri Nov 12 13:02:26 2010 (r215178) @@ -2386,6 +2386,7 @@ sosetopt(struct socket *so, struct socko struct linger l; struct timeval tv; u_long val; + uint32_t val32; #ifdef MAC struct mac extmac; #endif @@ -2461,6 +2462,15 @@ sosetopt(struct socket *so, struct socko so->so_fibnum = 0; } break; + + case SO_USER_COOKIE: + error = sooptcopyin(sopt, &val32, sizeof val32, + sizeof val32); + if (error) + goto bad; + so->so_user_cookie = val32; + break; + case SO_SNDBUF: case SO_RCVBUF: case SO_SNDLOWAT: Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Fri Nov 12 12:48:41 2010 (r215177) +++ head/sys/sys/socket.h Fri Nov 12 13:02:26 2010 (r215178) @@ -137,6 +137,7 @@ typedef __uid_t uid_t; #define SO_LISTENQLEN 0x1012 /* socket's complete queue length */ #define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ #define SO_SETFIB 0x1014 /* use this FIB to route */ +#define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ #endif /* Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Fri Nov 12 12:48:41 2010 (r215177) +++ head/sys/sys/socketvar.h Fri Nov 12 13:02:26 2010 (r215178) @@ -117,7 +117,14 @@ struct socket { void *so_accept_filter_arg; /* saved filter args */ char *so_accept_filter_str; /* saved user args */ } *so_accf; + /* + * so_fibnum, so_user_cookie and friends can be used to attach + * some user-specified metadata to a socket, which then can be + * used by the kernel for various actions. + * so_user_cookie is used by ipfw/dummynet. + */ int so_fibnum; /* routing domain for this socket */ + uint32_t so_user_cookie; }; /* From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 13:05:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB34E106566C; Fri, 12 Nov 2010 13:05:17 +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 AC78C8FC13; Fri, 12 Nov 2010 13:05:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACD5HjB009491; Fri, 12 Nov 2010 13:05:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACD5Htm009484; Fri, 12 Nov 2010 13:05:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201011121305.oACD5Htm009484@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 12 Nov 2010 13:05: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: r215179 - in head: sbin/ipfw sys/netinet sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 13:05:17 -0000 Author: luigi Date: Fri Nov 12 13:05:17 2010 New Revision: 215179 URL: http://svn.freebsd.org/changeset/base/215179 Log: The first customer of the SO_USER_COOKIE option: the "sockarg" ipfw option matches packets associated to a local socket and with a non-zero so_user_cookie value. The value is made available as tablearg, so it can be used as a skipto target or pipe number in ipfw/dummynet rules. Code by Paul Joe, manpage by me. Submitted by: Paul Joe MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sys/netinet/ip_fw.h head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Nov 12 13:02:26 2010 (r215178) +++ head/sbin/ipfw/ipfw.8 Fri Nov 12 13:05:17 2010 (r215179) @@ -1510,6 +1510,17 @@ interface. Matches TCP packets that have the SYN bit set but no ACK bit. This is the short form of .Dq Li tcpflags\ syn,!ack . +.It Cm sockarg +Matches packets that are associated to a local socket and +for which the SO_USER_COOKIE socket option has been set +to a non-zero value. As a side effect, the value of the +option is made available as +.Cm tablearg +value, which in turn can be used as +.Cm skipto +or +.Cm pipe +number. .It Cm src-ip Ar ip-address Matches IPv4 packets whose source IP is one of the address(es) specified as an argument. Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Nov 12 13:02:26 2010 (r215178) +++ head/sbin/ipfw/ipfw2.c Fri Nov 12 13:05:17 2010 (r215179) @@ -266,6 +266,7 @@ static struct _s_x rule_options[] = { { "estab", TOK_ESTAB }, { "established", TOK_ESTAB }, { "setup", TOK_SETUP }, + { "sockarg", TOK_SOCKARG }, { "tcpdatalen", TOK_TCPDATALEN }, { "tcpflags", TOK_TCPFLAGS }, { "tcpflgs", TOK_TCPFLAGS }, @@ -1338,6 +1339,9 @@ show_ipfw(struct ip_fw *rule, int pcwidt case O_FIB: printf(" fib %u", cmd->arg1 ); break; + case O_SOCKARG: + printf(" sockarg"); + break; case O_IN: printf(cmd->len & F_NOT ? " out" : " in"); @@ -3531,6 +3535,9 @@ read_options: fill_cmd(cmd, O_FIB, 0, strtoul(*av, NULL, 0)); av++; break; + case TOK_SOCKARG: + fill_cmd(cmd, O_SOCKARG, 0, 0); + break; case TOK_LOOKUP: { ipfw_insn_u32 *c = (ipfw_insn_u32 *)cmd; Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Fri Nov 12 13:02:26 2010 (r215178) +++ head/sbin/ipfw/ipfw2.h Fri Nov 12 13:05:17 2010 (r215179) @@ -199,6 +199,7 @@ enum tokens { TOK_FIB, TOK_SETFIB, TOK_LOOKUP, + TOK_SOCKARG, }; /* * the following macro returns an error message if we run out of Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Fri Nov 12 13:02:26 2010 (r215178) +++ head/sys/netinet/ip_fw.h Fri Nov 12 13:05:17 2010 (r215179) @@ -192,10 +192,13 @@ enum ipfw_opcodes { /* arguments (4 byt O_SETFIB, /* arg1=FIB number */ O_FIB, /* arg1=FIB desired fib number */ + + O_SOCKARG, /* socket argument */ O_LAST_OPCODE /* not an opcode! */ }; + /* * The extension header are filtered only for presence using a bit * vector with a flag for each header. Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Fri Nov 12 13:02:26 2010 (r215178) +++ head/sys/netinet/ipfw/ip_fw2.c Fri Nov 12 13:05:17 2010 (r215179) @@ -1801,6 +1801,39 @@ do { \ match = 1; break; + case O_SOCKARG: { + struct inpcb *inp = args->inp; + struct inpcbinfo *pi; + + if (is_ipv6) /* XXX can we remove this ? */ + break; + + if (proto == IPPROTO_TCP) + pi = &V_tcbinfo; + else if (proto == IPPROTO_UDP) + pi = &V_udbinfo; + else + break; + + /* For incomming packet, lookup up the + inpcb using the src/dest ip/port tuple */ + if (inp == NULL) { + INP_INFO_RLOCK(pi); + inp = in_pcblookup_hash(pi, + src_ip, htons(src_port), + dst_ip, htons(dst_port), + 0, NULL); + INP_INFO_RUNLOCK(pi); + } + + if (inp && inp->inp_socket) { + tablearg = inp->inp_socket->so_user_cookie; + if (tablearg) + match = 1; + } + break; + } + case O_TAGGED: { struct m_tag *mtag; uint32_t tag = (cmd->arg1 == IP_FW_TABLEARG) ? Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Fri Nov 12 13:02:26 2010 (r215178) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Fri Nov 12 13:05:17 2010 (r215179) @@ -572,6 +572,7 @@ check_ipfw_struct(struct ip_fw *rule, in case O_IPTOS: case O_IPPRECEDENCE: case O_IPVER: + case O_SOCKARG: case O_TCPWIN: case O_TCPFLAGS: case O_TCPOPTS: From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 13:59:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71751065675; Fri, 12 Nov 2010 13:59:48 +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 BA6A28FC25; Fri, 12 Nov 2010 13:59:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACDxmfQ010749; Fri, 12 Nov 2010 13:59:48 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACDxmux010748; Fri, 12 Nov 2010 13:59:48 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201011121359.oACDxmux010748@svn.freebsd.org> From: Martin Matuska Date: Fri, 12 Nov 2010 13:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215180 - vendor/xz/5.0.0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 13:59:49 -0000 Author: mm Date: Fri Nov 12 13:59:48 2010 New Revision: 215180 URL: http://svn.freebsd.org/changeset/base/215180 Log: Tag xz as 5.0.0 (git revision e45929260cd902036efd40c5610a8d0a50d5712b) Approved by: delphij (mentor) Added: vendor/xz/5.0.0/ - copied from r215179, vendor/xz/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 14:40:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 702401065694; Fri, 12 Nov 2010 14:40:20 +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 5D8F38FC18; Fri, 12 Nov 2010 14:40:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACEeKio011823; Fri, 12 Nov 2010 14:40:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACEeKOD011821; Fri, 12 Nov 2010 14:40:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011121440.oACEeKOD011821@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 12 Nov 2010 14:40: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: r215181 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 14:40:20 -0000 Author: jilles Date: Fri Nov 12 14:40:20 2010 New Revision: 215181 URL: http://svn.freebsd.org/changeset/base/215181 Log: sh(1): Modernize the introduction a bit. In particular, remove the text about ksh-like features, which are usually taken for granted nowadays. The original Bourne shell is fading away and for most users our /bin/sh is one of the most minimalistic they know. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Nov 12 13:59:48 2010 (r215180) +++ head/bin/sh/sh.1 Fri Nov 12 14:40:20 2010 (r215181) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd October 31, 2010 +.Dd November 12, 2010 .Dt SH 1 .Os .Sh NAME @@ -65,20 +65,13 @@ The utility is the standard command interpreter for the system. The current version of .Nm -is in the process of being changed to -conform with the -.St -p1003.2 +is close to the +.St -p1003.1 specification for the shell. -This version has many features which make -it appear -similar in some respects to the Korn shell, but it is not a Korn -shell clone like -.Nm pdksh . -Only features +It only supports features designated by .Tn POSIX , -plus a few Berkeley extensions, are being -incorporated into this shell. +plus a few Berkeley extensions. This man page is not intended to be a tutorial nor a complete specification of the shell. .Ss Overview From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 15:20:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42A99106566B; Fri, 12 Nov 2010 15:20:11 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F3E78FC1B; Fri, 12 Nov 2010 15:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACFKB6M012877; Fri, 12 Nov 2010 15:20:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACFKAlp012872; Fri, 12 Nov 2010 15:20:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011121520.oACFKAlp012872@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 12 Nov 2010 15:20: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: r215182 - in head/sys/powerpc: aim include powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 15:20:11 -0000 Author: nwhitehorn Date: Fri Nov 12 15:20:10 2010 New Revision: 215182 URL: http://svn.freebsd.org/changeset/base/215182 Log: Add CPU support code for the IBM Cell Broadband Engine. Modified: head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/include/cpufunc.h head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Fri Nov 12 14:40:20 2010 (r215181) +++ head/sys/powerpc/aim/mp_cpudep.c Fri Nov 12 15:20:10 2010 (r215182) @@ -228,6 +228,21 @@ cpudep_save_config(void *dummy) powerpc_sync(); break; +#ifdef __powerpc64__ + case IBMCELLBE: + if (mfmsr() & PSL_HV) { + bsp_state[0] = mfspr(SPR_HID0); + bsp_state[1] = mfspr(SPR_HID1); + bsp_state[2] = mfspr(SPR_HID4); + bsp_state[3] = mfspr(SPR_HID6); + + bsp_state[4] = mfspr(SPR_CELL_TSCR); + } + + bsp_state[5] = mfspr(SPR_CELL_TSRL); + + break; +#endif case MPC7450: case MPC7455: case MPC7457: @@ -288,6 +303,21 @@ cpudep_ap_setup() powerpc_sync(); break; +#ifdef __powerpc64__ + case IBMCELLBE: + if (mfmsr() & PSL_HV) { + mtspr(SPR_HID0, bsp_state[0]); + mtspr(SPR_HID1, bsp_state[1]); + mtspr(SPR_HID4, bsp_state[2]); + mtspr(SPR_HID6, bsp_state[3]); + + mtspr(SPR_CELL_TSCR, bsp_state[4]); + } + + mtspr(SPR_CELL_TSRL, bsp_state[5]); + + break; +#endif case MPC7450: case MPC7455: case MPC7457: Modified: head/sys/powerpc/include/cpufunc.h ============================================================================== --- head/sys/powerpc/include/cpufunc.h Fri Nov 12 14:40:20 2010 (r215181) +++ head/sys/powerpc/include/cpufunc.h Fri Nov 12 15:20:10 2010 (r215182) @@ -106,6 +106,17 @@ mfsrin(vm_offset_t va) } #endif +static __inline register_t +mfctrl(void) +{ + register_t value; + + __asm __volatile ("mfspr %0,136" : "=r"(value)); + + return (value); +} + + static __inline void mtdec(register_t value) { Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Fri Nov 12 14:40:20 2010 (r215181) +++ head/sys/powerpc/include/spr.h Fri Nov 12 15:20:10 2010 (r215182) @@ -420,6 +420,10 @@ #define SPR_HID1 0x3f1 /* ..8 Hardware Implementation Register 1 */ #define SPR_HID4 0x3f4 /* ..8 Hardware Implementation Register 4 */ #define SPR_HID5 0x3f6 /* ..8 Hardware Implementation Register 5 */ +#define SPR_HID6 0x3f9 /* ..8 Hardware Implementation Register 6 */ + +#define SPR_CELL_TSRL 0x380 /* ... Cell BE Thread Status Register */ +#define SPR_CELL_TSCR 0x399 /* ... Cell BE Thread Switch Register */ #if defined(AIM) #define SPR_DBSR 0x3f0 /* 4.. Debug Status Register */ Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Fri Nov 12 14:40:20 2010 (r215181) +++ head/sys/powerpc/powerpc/cpu.c Fri Nov 12 15:20:10 2010 (r215182) @@ -149,6 +149,9 @@ static const struct cputab models[] = { 0, cpu_e500_setup }, { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN, 0, cpu_e500_setup }, + { "IBM Cell Broadband Engine", IBMCELLBE, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + NULL}, { "Unknown PowerPC CPU", 0, REVFMT_HEX, 0, NULL }, }; From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 15:28:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A1701065670; Fri, 12 Nov 2010 15:28:46 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8DE0D8FC08; Fri, 12 Nov 2010 15:28:45 +0000 (UTC) Received: by fxm19 with SMTP id 19so2301476fxm.13 for ; Fri, 12 Nov 2010 07:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=UK+Kli9ngDchtwlm+gJz6xieY5WO2opedpQgSaI8aTk=; b=KEXStZaexmfyNUbjk2+riSwK/hsp7NrdsBEzpIJd6b2uQeiaylVurZLzRHdZonWDym GGbSitpU+nl4d9gyag0dgYmo4eBlDOOE6p8qJRwDTkGZZITzF/gKp+j/YUV6xukzcnUX /4PGLf8XOyuBxGsVlXpM0SmCAtwMyvtg1jRqI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=aJ1ZQ8RlluCQ8MvUNmuhQVrhK/1E8Ik12EAYfLTvCy0FiOREzRmaw4qqElSRNda3ZB AVhjkvf9eCOgXt1614TNITAkNIQNwifbwEKNci3ifZ++7GKn0ZkAamxDRnczORnnO/on IFn3NzsFHBNHyiPZ8UE5W8fON9X3Wowk9E1y0= MIME-Version: 1.0 Received: by 10.204.73.4 with SMTP id o4mr2928453bkj.156.1289575724127; Fri, 12 Nov 2010 07:28:44 -0800 (PST) Received: by 10.204.73.207 with HTTP; Fri, 12 Nov 2010 07:28:44 -0800 (PST) In-Reply-To: <201011121207.oACC7axR007832@svn.freebsd.org> References: <201011121207.oACC7axR007832@svn.freebsd.org> Date: Fri, 12 Nov 2010 10:28:44 -0500 Message-ID: From: Ben Kaduk To: Sergey Kandaurov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215176 - in head: . share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 15:28:46 -0000 On Fri, Nov 12, 2010 at 7:07 AM, Sergey Kandaurov wro= te: > Author: pluknet > Date: Fri Nov 12 12:07:36 2010 > New Revision: 215176 > URL: http://svn.freebsd.org/changeset/base/215176 > > Log: > =A0Stop documenting vgonel() after its converting to the static function: > =A0 svn r147332 (by jeff): "Don't make vgonel() globally visible". > =A0While here, specify the vnode locking scheme for vgone(). Thanks! (I was going to send a follow-up to -hackers in a few days, otherw= ise.) -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 15:30:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11CC1106566B; Fri, 12 Nov 2010 15:30:50 +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 F39C28FC1D; Fri, 12 Nov 2010 15:30:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACFUndN013159; Fri, 12 Nov 2010 15:30:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACFUnkF013157; Fri, 12 Nov 2010 15:30:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011121530.oACFUnkF013157@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 12 Nov 2010 15:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215183 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 15:30:50 -0000 Author: jilles Date: Fri Nov 12 15:30:49 2010 New Revision: 215183 URL: http://svn.freebsd.org/changeset/base/215183 Log: Make POLL_ERR and POLL_HUP different. The kernel currently does not generate any of the POLL_* constants, but some applications use them and break if they are not all distinct. PR: kern/126076 MFC after: 1 week Modified: head/sys/sys/signal.h Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Fri Nov 12 15:20:10 2010 (r215182) +++ head/sys/sys/signal.h Fri Nov 12 15:30:49 2010 (r215183) @@ -284,7 +284,7 @@ typedef struct __siginfo { #define POLL_MSG 3 /* Input message available */ #define POLL_ERR 4 /* I/O Error */ #define POLL_PRI 5 /* High priority input available */ -#define POLL_HUP 4 /* Device disconnected */ +#define POLL_HUP 6 /* Device disconnected */ #endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 15:40:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0CB0106566B; Fri, 12 Nov 2010 15:40:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EFC58FC12; Fri, 12 Nov 2010 15:40:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACFe0pG013415; Fri, 12 Nov 2010 15:40:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACFe0af013414; Fri, 12 Nov 2010 15:40:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011121540.oACFe0af013414@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 12 Nov 2010 15:40: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: r215184 - head/bin/sh/bltin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 15:40:00 -0000 Author: jilles Date: Fri Nov 12 15:40:00 2010 New Revision: 215184 URL: http://svn.freebsd.org/changeset/base/215184 Log: sh: Remove unused man page for echo builtin. The information in sh(1) about the echo builtin is equivalent, though less extensive. The echo(1) man page (bin/echo/echo.1) is different. Unfortunately, sh's echo builtin and /bin/echo have gone out of sync and this probably cannot be fixed any more. Reported by: uqs (list of untouched files) MFC after: 1 week Deleted: head/bin/sh/bltin/echo.1 From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 15:42:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7406A1065670; Fri, 12 Nov 2010 15:42:36 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7103D8FC19; Fri, 12 Nov 2010 15:42:35 +0000 (UTC) Received: by bwz2 with SMTP id 2so3130477bwz.13 for ; Fri, 12 Nov 2010 07:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=5h/LiojPW06ZRq7gMmIMP0pCnFWBoJiP0R8PZdYl4/A=; b=x3KxDbSp3Z+KydQ/M9bmcG85fsnoSOsm2sAUmwKvfrQC0EGF6LZCK+5DL5ID1VpOtD GD+guI/5AJsaKdlLHn5TtofLIQgichUhaaYtVMQV3EiZxn2xK8xR3EfBDMWaIIlnEEBm /lDFA1iUJF4wiI4MAtViE0rcxFUs5OhHMUKME= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=YXeTvXpnbCDx5M58v94zB3nhbsuayoIA9ktsO4+EN7KaJWejlI5nVnPZIko5ostbVX 4ciZ/rrUUIej+FFUCd9A7QiEHR/BpFHK8oevvEDryfZ8LgpCR6gqCrizrEDCzuOc0eYN tID4Hof7470+MUmU1vkemOpMHXfOkb/rZDIEg= MIME-Version: 1.0 Received: by 10.204.62.73 with SMTP id w9mr194038bkh.48.1289576554299; Fri, 12 Nov 2010 07:42:34 -0800 (PST) Received: by 10.204.73.207 with HTTP; Fri, 12 Nov 2010 07:42:34 -0800 (PST) In-Reply-To: <201011121302.oACD2Qjt009385@svn.freebsd.org> References: <201011121302.oACD2Qjt009385@svn.freebsd.org> Date: Fri, 12 Nov 2010 10:42:34 -0500 Message-ID: From: Ben Kaduk To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215178 - in head: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 15:42:36 -0000 On Fri, Nov 12, 2010 at 8:02 AM, Luigi Rizzo wrote: > Author: luigi > Date: Fri Nov 12 13:02:26 2010 > New Revision: 215178 > URL: http://svn.freebsd.org/changeset/base/215178 > > > =A0This change adds a field to 'struct socket', but the struct is not > =A0part of any driver or userland-visible ABI so the change should be > =A0harmless. It changes the KBI, though. I maintain a third-party kernel module that uses sockets (it will hopefully hit the Ports Collection this week); since this addition is at the end of the struct, it is probable that this module will not need to be recompiled, but I haven't yet checked. That said, I hear __FreeBSD_version bumps are cheap. -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 15:52:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 512F91065679; Fri, 12 Nov 2010 15:52:28 +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 3DDE98FC0C; Fri, 12 Nov 2010 15:52:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACFqSfu013722; Fri, 12 Nov 2010 15:52:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACFqSWN013719; Fri, 12 Nov 2010 15:52:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201011121552.oACFqSWN013719@svn.freebsd.org> From: Ed Schouten Date: Fri, 12 Nov 2010 15:52: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: r215185 - in head: gnu/lib/libgcc lib/libcompiler_rt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 15:52:28 -0000 Author: ed Date: Fri Nov 12 15:52:27 2010 New Revision: 215185 URL: http://svn.freebsd.org/changeset/base/215185 Log: Revert to libgcc for sparc64. I've had a report of a sparc64 system where cc1 generates illegal instructions. We still have to diagnose this properly, but instead of hosing all sparc64 boxes out there, fall back to libgcc to prevent more damage. Reported by: Florian Smeets Modified: head/gnu/lib/libgcc/Makefile head/lib/libcompiler_rt/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Fri Nov 12 15:40:00 2010 (r215184) +++ head/gnu/lib/libgcc/Makefile Fri Nov 12 15:52:27 2010 (r215185) @@ -15,6 +15,10 @@ MK_SSP= no .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" +.if ${TARGET_CPUARCH} == "sparc64" +LIB= gcc +.endif + .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}/config ${GCCDIR} CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Fri Nov 12 15:40:00 2010 (r215184) +++ head/lib/libcompiler_rt/Makefile Fri Nov 12 15:52:27 2010 (r215185) @@ -147,11 +147,13 @@ SRCS+= ${file}.c . endif .endfor -.if ${MK_INSTALLLIB} != "no" +.if ${MACHINE_CPUARCH} != "sparc64" +. if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a -.endif -.if ${MK_PROFILE} != "no" +. endif +. if ${MK_PROFILE} != "no" SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a +. endif .endif .include From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 16:50:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 197F61065675; Fri, 12 Nov 2010 16:50:12 +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 070BF8FC1A; Fri, 12 Nov 2010 16:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACGoBNk015837; Fri, 12 Nov 2010 16:50:11 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACGoBb5015835; Fri, 12 Nov 2010 16:50:11 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201011121650.oACGoBb5015835@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 12 Nov 2010 16:50: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: r215186 - head/contrib/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 16:50:12 -0000 Author: pluknet Date: Fri Nov 12 16:50:11 2010 New Revision: 215186 URL: http://svn.freebsd.org/changeset/base/215186 Log: Add 'jid' as a possible sort order to the help screen. PR: bin/150992 Submitted by: Frederic Culot Approved by: avg (mentor) MFC after: 5 days Modified: head/contrib/top/commands.c Modified: head/contrib/top/commands.c ============================================================================== --- head/contrib/top/commands.c Fri Nov 12 15:52:27 2010 (r215185) +++ head/contrib/top/commands.c Fri Nov 12 16:50:11 2010 (r215186) @@ -80,10 +80,12 @@ n or # - change number of processes to #ifdef ORDER if (displaymode == DISP_CPU) fputs("\ -o - specify sort order (pri, size, res, cpu, time, threads)\n", stdout); +o - specify sort order (pri, size, res, cpu, time, threads, jid)\n", + stdout); else fputs("\ -o - specify sort order (vcsw, ivcsw, read, write, fault, total)\n", stdout); +o - specify sort order (vcsw, ivcsw, read, write, fault, total, jid)\n", + stdout); #endif fputs("\ r - renice a process\n\ From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 16:53:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0867106566C; Fri, 12 Nov 2010 16:53: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 CA39B8FC1B; Fri, 12 Nov 2010 16:53:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACGrHAl015975; Fri, 12 Nov 2010 16:53:17 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACGrH4p015969; Fri, 12 Nov 2010 16:53:17 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201011121653.oACGrH4p015969@svn.freebsd.org> From: Martin Matuska Date: Fri, 12 Nov 2010 16:53: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: r215187 - in head: contrib/xz contrib/xz/po contrib/xz/src/common contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/common contrib/xz/src/liblzma/lzma co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 16:53:18 -0000 Author: mm Date: Fri Nov 12 16:53:17 2010 New Revision: 215187 URL: http://svn.freebsd.org/changeset/base/215187 Log: Update xz to release 5.0.0 Approved by: delphij (mentor) MFC after: 1 week Added: head/contrib/xz/po/xz.pot - copied unchanged from r215146, vendor/xz/dist/po/xz.pot Modified: head/contrib/xz/ChangeLog head/contrib/xz/TODO head/contrib/xz/po/cs.po head/contrib/xz/po/de.po head/contrib/xz/po/it.po head/contrib/xz/src/common/sysdefs.h head/contrib/xz/src/liblzma/api/lzma.h head/contrib/xz/src/liblzma/api/lzma/base.h head/contrib/xz/src/liblzma/api/lzma/bcj.h head/contrib/xz/src/liblzma/api/lzma/block.h head/contrib/xz/src/liblzma/api/lzma/container.h head/contrib/xz/src/liblzma/api/lzma/filter.h head/contrib/xz/src/liblzma/api/lzma/hardware.h head/contrib/xz/src/liblzma/api/lzma/index.h head/contrib/xz/src/liblzma/api/lzma/index_hash.h head/contrib/xz/src/liblzma/api/lzma/lzma.h head/contrib/xz/src/liblzma/api/lzma/stream_flags.h head/contrib/xz/src/liblzma/api/lzma/version.h head/contrib/xz/src/liblzma/api/lzma/vli.h head/contrib/xz/src/liblzma/common/common.c head/contrib/xz/src/liblzma/common/filter_encoder.c head/contrib/xz/src/liblzma/common/filter_encoder.h head/contrib/xz/src/liblzma/common/index.c head/contrib/xz/src/liblzma/common/index_decoder.c head/contrib/xz/src/liblzma/common/index_encoder.c head/contrib/xz/src/liblzma/lzma/lzma2_decoder.c head/contrib/xz/src/liblzma/lzma/lzma_decoder.c head/contrib/xz/src/liblzma/lzma/lzma_encoder.c head/contrib/xz/src/xz/message.c head/contrib/xz/src/xz/message.h head/contrib/xz/src/xz/signals.c head/lib/liblzma/config.h Directory Properties: head/contrib/xz/ (props changed) Modified: head/contrib/xz/ChangeLog ============================================================================== --- head/contrib/xz/ChangeLog Fri Nov 12 16:50:11 2010 (r215186) +++ head/contrib/xz/ChangeLog Fri Nov 12 16:53:17 2010 (r215187) @@ -1,3 +1,114 @@ +commit e45929260cd902036efd40c5610a8d0a50d5712b +Author: Lasse Collin +Date: Sat Oct 23 17:25:52 2010 +0300 + + Build: Fix mydist rule when .git doesn't exist. + +commit 6e1326fcdf6b6209949be57cfe3ad4b781b65168 +Author: Lasse Collin +Date: Sat Oct 23 14:15:35 2010 +0300 + + Add NEWS for 5.0.0. + +commit b667a3ef6338a2c1db7b7706b1f6c99ea392221c +Author: Lasse Collin +Date: Sat Oct 23 14:02:53 2010 +0300 + + Bump version to 5.0.0 and liblzma version-info to 5:0:0. + +commit 8c947e9291691629714dafb4536c718b6cc24fbd +Author: Lasse Collin +Date: Sat Oct 23 12:30:54 2010 +0300 + + liblzma: Make lzma_code() check the reserved members in lzma_stream. + + If any of the reserved members in lzma_stream are non-zero + or non-NULL, LZMA_OPTIONS_ERROR is returned. It is possible + that a new feature in the future is indicated by just setting + a reserved member to some other value, so the old liblzma + version need to catch it as an unsupported feature. + +commit e61d85e082743ebd2dd0ff28fc0a82482ede0538 +Author: Lasse Collin +Date: Sat Oct 23 12:26:33 2010 +0300 + + Windows: Use MinGW's stdio functions. + + The non-standard ones from msvcrt.dll appear to work + most of the time with XZ Utils, but there are some + corner cases where things may go very wrong. So it's + good to use the better replacements provided by + MinGW(-w64) runtime. + +commit 23e23f1dc029146714c9a98313ab3ea93d71a2fc +Author: Lasse Collin +Date: Sat Oct 23 12:21:32 2010 +0300 + + liblzma: Use 512 as INDEX_GROUP_SIZE. + + This lets compiler use shifting instead of 64-bit division. + +commit 613939fc82603b75b59eee840871a05bc8dd08e0 +Author: Lasse Collin +Date: Sat Oct 23 12:20:11 2010 +0300 + + liblzma: A few ABI tweaks to reserve space in structures. + +commit 68b83f252df3d27480a9f6f03445d16f6506fef1 +Author: Lasse Collin +Date: Thu Oct 21 23:16:11 2010 +0300 + + xz: Make sure that message_strm() can never return NULL. + +commit d09c5753e33ff96ee57edb6d1e98e34041203695 +Author: Lasse Collin +Date: Thu Oct 21 23:06:31 2010 +0300 + + liblzma: Update the comments in the API headers. + + Adding support for LZMA_FINISH for Index encoding and + decoding needed tiny additions to the relevant .c files too. + +commit 33c1c0e102eb529588503b8beea0903a45488fad +Author: Lasse Collin +Date: Tue Oct 19 12:08:30 2010 +0300 + + Update INSTALL.generic. + +commit 0076e03641f201c4b77dddd5a6db5880be19a78c +Author: Lasse Collin +Date: Tue Oct 19 11:44:37 2010 +0300 + + Clean up a few FIXMEs and TODOs. + + lzma_chunk_size() was commented out because it is + currently useless. + +commit ce34ec4f54ff8b753da236f371ad8dd23c8135c9 +Author: Lasse Collin +Date: Tue Oct 19 10:21:08 2010 +0300 + + Update docs. + +commit f0fa880d247e73264d2c04fe31fb3412318a0026 +Author: Lasse Collin +Date: Tue Oct 12 15:13:30 2010 +0300 + + xz: Avoid raise() also on OpenVMS. + + This is similar to DOS/DJGPP that killing the program + with a signal will print a backtrace or a similar message. + +commit ac462b1c47c451f5c62e428306314c4bdad8ae7f +Author: Lasse Collin +Date: Mon Oct 11 21:26:19 2010 +0300 + + xz: Avoid SA_RESTART for portability reasons. + + SA_RESTART is not as portable as I had hoped. It's missing + at least from OpenVMS, QNX, and DJGPP). Luckily we can do + fine without SA_RESTART. + commit d52b411716a614c202e89ba732492efb9916cd3f Author: Lasse Collin Date: Sun Oct 10 17:58:58 2010 +0300 Modified: head/contrib/xz/TODO ============================================================================== --- head/contrib/xz/TODO Fri Nov 12 16:50:11 2010 (r215186) +++ head/contrib/xz/TODO Fri Nov 12 16:53:17 2010 (r215187) @@ -18,15 +18,20 @@ Known bugs XZ Utils compress some files significantly worse than LZMA Utils. This is due to faster compression presets used by XZ Utils, and - can be worked around by using "xz --extreme". However, the presets - need some tweaking and maybe this issue can be minimized without - making the typical case too much slower. + can often be worked around by using "xz --extreme". With some files + --extreme isn't enough though: it's most likely with files that + compress extremely well, so going from compression ratio of 0.003 + to 0.004 means big relative increase in the compressed file size. xz doesn't quote unprintable characters when it displays file names given on the command line. tuklib_exit() doesn't block signals => EINTR is possible. + SIGTSTP is not handled. If xz is stopped, the estimated remaining + time and calculated (de)compression speed won't make sense in the + progress indicator (xz --verbose). + Missing features ---------------- @@ -41,11 +46,13 @@ Missing features Buffer-to-buffer coding could use less RAM (especially when decompressing LZMA1 or LZMA2). - I/O library is not implemented. It will possibly be named libzzf. + I/O library is not implemented (similar to gzopen() in zlib). + It will be a separate library that supports uncompressed, .gz, + .bz2, .lzma, and .xz files. lzma_strerror() to convert lzma_ret to human readable form? This is tricky, because the same error codes are used with - slightly different meanings. + slightly different meanings, and this cannot be fixed anymore. Documentation Modified: head/contrib/xz/po/cs.po ============================================================================== --- head/contrib/xz/po/cs.po Fri Nov 12 16:50:11 2010 (r215186) +++ head/contrib/xz/po/cs.po Fri Nov 12 16:53:17 2010 (r215187) @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: xz-utils\n" "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" -"POT-Creation-Date: 2010-09-17 18:33+0200\n" +"POT-Creation-Date: 2010-10-23 17:48+0300\n" "PO-Revision-Date: 2010-09-17 18:54+0200\n" "Last-Translator: Marek ÄŒernocký \n" "Language-Team: Czech \n" @@ -30,8 +30,7 @@ msgstr "%s: Neznámý typ kontroly integ #: src/xz/args.c:382 msgid "Only one file can be specified with `--files' or `--files0'." -msgstr "" -"Spolu s pÅ™epínaÄi „--files“ nebo „--files0“ může být zadán pouze jeden soubor" +msgstr "Spolu s pÅ™epínaÄi „--files“ nebo „--files0“ může být zadán pouze jeden soubor" #: src/xz/args.c:445 #, c-format @@ -52,8 +51,7 @@ msgstr "Použití pÅ™ednastavení v rež #: src/xz/coder.c:131 msgid "The exact options of the presets may vary between software versions." -msgstr "" -"PÅ™esné volby u pÅ™ednastavení se mohou liÅ¡it mezi různými verzemi softwaru." +msgstr "PÅ™esné volby u pÅ™ednastavení se mohou liÅ¡it mezi různými verzemi softwaru." #: src/xz/coder.c:157 msgid "The .lzma format supports only the LZMA1 filter" @@ -74,12 +72,8 @@ msgstr "Dekomprimace bude vyžadovat %s #: src/xz/coder.c:247 #, c-format -msgid "" -"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the " -"memory usage limit of %s MiB" -msgstr "" -"PÅ™izpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo " -"pÅ™ekroÄeno omezení použitelné pamÄ›ti %s MiB" +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "PÅ™izpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo pÅ™ekroÄeno omezení použitelné pamÄ›ti %s MiB" #. TRANSLATORS: When compression or decompression finishes, #. and xz is going to remove the source file, xz first checks @@ -159,8 +153,7 @@ msgstr "%s: Selhalo zavÅ™ení souboru: % #: src/xz/file_io.c:762 src/xz/file_io.c:946 #, c-format msgid "%s: Seeking failed when trying to create a sparse file: %s" -msgstr "" -"%s: Selhalo nastavení pozice pÅ™i pokusu o vytvoÅ™ení záložního souboru: %s" +msgstr "%s: Selhalo nastavení pozice pÅ™i pokusu o vytvoÅ™ení záložního souboru: %s" #: src/xz/file_io.c:821 #, c-format @@ -319,12 +312,10 @@ msgstr " Zarovnání proudu: %s\ #: src/xz/list.c:693 msgid "" " Streams:\n" -" Stream Blocks CompOffset UncompOffset CompSize " -"UncompSize Ratio Check Padding" +" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" msgstr "" " Proudy:\n" -" Proud Bloky KomprPozice NekomprPozice KomprVelikost " -"NekomprVelikost PomÄ›r Kontrola Zarovnání" +" Proud Bloky KomprPozice NekomprPozice KomprVelikost NekomprVelikost PomÄ›r Kontrola Zarovnání" #. TRANSLATORS: The second line is column headings. All #. except Check are right aligned; Check is left aligned. @@ -332,12 +323,10 @@ msgstr "" #, c-format msgid "" " Blocks:\n" -" Stream Block CompOffset UncompOffset TotalSize " -"UncompSize Ratio Check" +" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" msgstr "" " Bloky:\n" -" Proud Blok KomprPozice NekomprPozice CelkVelikost " -"NekomprVelikost PomÄ›r Kontrola" +" Proud Blok KomprPozice NekomprPozice CelkVelikost NekomprVelikost PomÄ›r Kontrola" #. TRANSLATORS: These are additional column headings #. for the most verbose listing mode. CheckVal @@ -408,78 +397,69 @@ msgstr "%s: NeoÄekávaný konec vstupu #: src/xz/main.c:120 #, c-format -msgid "" -"%s: Null character found when reading filenames; maybe you meant to use `--" -"files0' instead of `--files'?" -msgstr "" -"%s: Byl nalezen nulový znak pÅ™i Ätení názvů souborů; nechtÄ›li jste náhodou " -"použít „--files0“ místo „--files“?" +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Byl nalezen nulový znak pÅ™i Ätení názvů souborů; nechtÄ›li jste náhodou použít „--files0“ místo „--files“?" #: src/xz/main.c:174 msgid "Compression and decompression with --robot are not supported yet." msgstr "Komprimace a dekomprimace s pÅ™epínaÄem --robot není zatím podporovaná." #: src/xz/main.c:231 -msgid "" -"Cannot read data from standard input when reading filenames from standard " -"input" -msgstr "" -"Ze standardního vstupu nelze Äíst data, když se ze standardního vstupu " -"naÄítají názvy souborů" +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Ze standardního vstupu nelze Äíst data, když se ze standardního vstupu naÄítají názvy souborů" -#: src/xz/message.c:800 src/xz/message.c:844 +#: src/xz/message.c:792 src/xz/message.c:842 msgid "Internal error (bug)" msgstr "Interní chyba" -#: src/xz/message.c:807 +#: src/xz/message.c:799 msgid "Cannot establish signal handlers" msgstr "Nelze ustanovit ovladaÄ signálu" -#: src/xz/message.c:816 +#: src/xz/message.c:808 msgid "No integrity check; not verifying file integrity" msgstr "Žádná kontrola integrity; integrita souboru se nebude ověřovat" -#: src/xz/message.c:819 +#: src/xz/message.c:811 msgid "Unsupported type of integrity check; not verifying file integrity" -msgstr "" -"Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat" +msgstr "Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat" -#: src/xz/message.c:826 +#: src/xz/message.c:818 msgid "Memory usage limit reached" msgstr "Dosaženo omezení použitelné pamÄ›ti" -#: src/xz/message.c:829 +#: src/xz/message.c:821 msgid "File format not recognized" msgstr "Formát souboru nebyl rozpoznán" -#: src/xz/message.c:832 +#: src/xz/message.c:824 msgid "Unsupported options" msgstr "Nepodporovaná volba" -#: src/xz/message.c:835 +#: src/xz/message.c:827 msgid "Compressed data is corrupt" msgstr "Komprimovaná data jsou poÅ¡kozená" -#: src/xz/message.c:838 +#: src/xz/message.c:830 msgid "Unexpected end of input" msgstr "NeoÄekávaný konec vstupu" -#: src/xz/message.c:886 +#: src/xz/message.c:881 #, c-format msgid "%s MiB of memory is required. The limit is %s." msgstr "Je vyžadováno %s MiB pamÄ›ti. Limit je %s." -#: src/xz/message.c:1053 +#: src/xz/message.c:1048 #, c-format msgid "%s: Filter chain: %s\n" msgstr "%s: Omezující filtr: %s\n" -#: src/xz/message.c:1063 +#: src/xz/message.c:1058 #, c-format msgid "Try `%s --help' for more information." msgstr "Zkuste „%s --help“ pro více informací" -#: src/xz/message.c:1089 +#: src/xz/message.c:1084 #, c-format msgid "" "Usage: %s [OPTION]... [FILE]...\n" @@ -490,18 +470,15 @@ msgstr "" "Komprimuje nebo dekomprimuje SOUBORy ve formátu xz.\n" "\n" -#: src/xz/message.c:1096 -msgid "" -"Mandatory arguments to long options are mandatory for short options too.\n" -msgstr "" -"Povinné argumenty pro dlouhé pÅ™epínaÄe jsou povinné rovněž pro krátké " -"pÅ™epínaÄe.\n" +#: src/xz/message.c:1091 +msgid "Mandatory arguments to long options are mandatory for short options too.\n" +msgstr "Povinné argumenty pro dlouhé pÅ™epínaÄe jsou povinné rovněž pro krátké pÅ™epínaÄe.\n" -#: src/xz/message.c:1100 +#: src/xz/message.c:1095 msgid " Operation mode:\n" msgstr "OperaÄní režim:\n" -#: src/xz/message.c:1103 +#: src/xz/message.c:1098 msgid "" " -z, --compress force compression\n" " -d, --decompress force decompression\n" @@ -513,7 +490,7 @@ msgstr "" " -t, --test testovat integritu komprimovaného souboru\n" " -l, --list vypsat informace o souborech .xz" -#: src/xz/message.c:1109 +#: src/xz/message.c:1104 msgid "" "\n" " Operation modifiers:\n" @@ -521,39 +498,33 @@ msgstr "" "\n" "Modifikátory operací:\n" -#: src/xz/message.c:1112 +#: src/xz/message.c:1107 msgid "" " -k, --keep keep (don't delete) input files\n" " -f, --force force overwrite of output file and (de)compress links\n" " -c, --stdout write to standard output and don't delete input files" msgstr "" " -k, --keep zachovat (nemazat) vstupní soubory\n" -" -f, --force vynutit pÅ™epis výstupního souboru a de/komprimovat " -"odkazy\n" -" -c, --stdout zapisovat na standardní výstup a nemazat vstupní " -"soubory" +" -f, --force vynutit pÅ™epis výstupního souboru a de/komprimovat odkazy\n" +" -c, --stdout zapisovat na standardní výstup a nemazat vstupní soubory" -#: src/xz/message.c:1118 +#: src/xz/message.c:1113 msgid "" " --no-sparse do not create sparse files when decompressing\n" " -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" " --files[=FILE] read filenames to process from FILE; if FILE is\n" " omitted, filenames are read from the standard input;\n" -" filenames must be terminated with the newline " -"character\n" +" filenames must be terminated with the newline character\n" " --files0[=FILE] like --files but use the null character as terminator" msgstr "" " --no-sparse nevytvářet pÅ™i dekomprimaci záložní soubory\n" " -S, --suffix=.PRIP použít u komprimovaných souborů příponu „.PRIP“\n" -" --files[=SOUBOR] Äíst názvy souborů, které se mají zpracovat, ze " -"SOUBORu;\n" -" pokud není SOUBOR zadán, Äte se ze standardního " -"vstupu;\n" +" --files[=SOUBOR] Äíst názvy souborů, které se mají zpracovat, ze SOUBORu;\n" +" pokud není SOUBOR zadán, Äte se ze standardního vstupu;\n" " názvy souborů musí být zakonÄeny znakem nového řádku\n" -" --files0[=SOUBOR] stejné jako --files, ale použít k zakonÄování nulový " -"znak" +" --files0[=SOUBOR] stejné jako --files, ale použít k zakonÄování nulový znak" -#: src/xz/message.c:1126 +#: src/xz/message.c:1121 msgid "" "\n" " Basic file format and compression options:\n" @@ -561,7 +532,7 @@ msgstr "" "\n" "Základní pÅ™epínaÄe pro formát souboru a komprimaci:\n" -#: src/xz/message.c:1128 +#: src/xz/message.c:1123 msgid "" " -F, --format=FMT file format to encode or decode; possible values are\n" " `auto' (default), `xz', `lzma', and `raw'\n" @@ -570,76 +541,62 @@ msgid "" msgstr "" " -F, --format=FORMÃT formát souboru k zakódování nebo dekódování; možné\n" " hodnoty jsou „auto“ (výchozí), „xz“, „lzma“ a „raw“\n" -" -C, --check=KONTROLA typ kontroly integrity: „none“ (používejte s " -"rozmyslem),\n" +" -C, --check=KONTROLA typ kontroly integrity: „none“ (používejte s rozmyslem),\n" " „crc32“, „crc64“ (výchozí) nebo „sha256“" -#: src/xz/message.c:1135 +#: src/xz/message.c:1130 msgid "" -" -0 ... -9 compression preset; default is 6; take compressor " -"*and*\n" -" decompressor memory usage into account before using " -"7-9!" -msgstr "" -" -0 .. -9 pÅ™ednastavení komprimace; výchozí je 6; než " -"použijete\n" -" hodnoty 7 – 9, vezmÄ›te do úvahy množství použité " -"pamÄ›ti" +" -0 ... -9 compression preset; default is 6; take compressor *and*\n" +" decompressor memory usage into account before using 7-9!" +msgstr "" +" -0 .. -9 pÅ™ednastavení komprimace; výchozí je 6; než použijete\n" +" hodnoty 7 – 9, vezmÄ›te do úvahy množství použité pamÄ›ti" -#: src/xz/message.c:1139 +#: src/xz/message.c:1134 msgid "" -" -e, --extreme try to improve compression ratio by using more CPU " -"time;\n" +" -e, --extreme try to improve compression ratio by using more CPU time;\n" " does not affect decompressor memory requirements" msgstr "" " -e, --extreme zkusit zlepÅ¡it pomÄ›r komprimace využitím více Äasu\n" " procesoru; nemá vliv na paměťové nároky dekomprimace" -#: src/xz/message.c:1144 +#: src/xz/message.c:1139 #, no-c-format msgid "" " --memlimit-compress=LIMIT\n" " --memlimit-decompress=LIMIT\n" " -M, --memlimit=LIMIT\n" -" set memory usage limit for compression, " -"decompression,\n" +" set memory usage limit for compression, decompression,\n" " or both; LIMIT is in bytes, % of RAM, or 0 for defaults" msgstr "" " --memlimit-compress=LIMIT\n" " --memlimit-decompress=LIMIT\n" " -M, --memlimit=LIMIT\n" " nastaví omezení použitelné pamÄ›ti pro komprimaci,\n" -" dekomprimaci nebo obojí; LIMIT je v bajtech, % z " -"pamÄ›ti\n" +" dekomprimaci nebo obojí; LIMIT je v bajtech, % z pamÄ›ti\n" " RAM nebo 0 pro výchozí" -#: src/xz/message.c:1151 +#: src/xz/message.c:1146 msgid "" -" --no-adjust if compression settings exceed the memory usage " -"limit,\n" -" give an error instead of adjusting the settings " -"downwards" +" --no-adjust if compression settings exceed the memory usage limit,\n" +" give an error instead of adjusting the settings downwards" msgstr "" -" --no-adjust pokud nastavení komprimace pÅ™esáhne omezení " -"použitelné\n" +" --no-adjust pokud nastavení komprimace pÅ™esáhne omezení použitelné\n" " pamÄ›ti, pÅ™edat chybu namísto snížení nastavení" -#: src/xz/message.c:1157 +#: src/xz/message.c:1152 msgid "" "\n" " Custom filter chain for compression (alternative for using presets):" msgstr "" "\n" -"Vlastní omezující filtr pro komprimaci (alternativa k použití " -"pÅ™ednastavených):" +"Vlastní omezující filtr pro komprimaci (alternativa k použití pÅ™ednastavených):" -#: src/xz/message.c:1166 +#: src/xz/message.c:1161 msgid "" "\n" -" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero " -"or\n" -" --lzma2[=OPTS] more of the following options (valid values; " -"default):\n" +" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n" +" --lzma2[=OPTS] more of the following options (valid values; default):\n" " preset=PRE reset options to a preset (0-9[e])\n" " dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n" " lc=NUM number of literal context bits (0-4; 3)\n" @@ -647,33 +604,24 @@ msgid "" " pb=NUM number of position bits (0-4; 2)\n" " mode=MODE compression mode (fast, normal; normal)\n" " nice=NUM nice length of a match (2-273; 64)\n" -" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; " -"bt4)\n" -" depth=NUM maximum search depth; 0=automatic " -"(default)" -msgstr "" -"\n" -" --lzma1[=VOLBY] LZMA1 nebo LZMA2; VOLBY je Äárkou oddÄ›lovaný seznam " -"žádné\n" -" --lzma2[=VOLBY] nebo více následujících voleb (platné hodnoty; " -"výchozí):\n" -" preset=PŘE zmÄ›nit volby na PŘEdnastavené (0 – 9" -"[e])\n" -" dict=POÄŒ velikost slovníku (4 KiB – 1536 MiB; 8 " -"MiB)\n" -" lc=POÄŒ poÄet kontextových bitů literálu (0 – 4; " -"3)\n" -" lp=POÄŒ poÄet poziÄních bitů literálu (0 – 4; " -"0)\n" +" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n" +" depth=NUM maximum search depth; 0=automatic (default)" +msgstr "" +"\n" +" --lzma1[=VOLBY] LZMA1 nebo LZMA2; VOLBY je Äárkou oddÄ›lovaný seznam žádné\n" +" --lzma2[=VOLBY] nebo více následujících voleb (platné hodnoty; výchozí):\n" +" preset=PŘE zmÄ›nit volby na PŘEdnastavené (0 – 9[e])\n" +" dict=POÄŒ velikost slovníku (4 KiB – 1536 MiB; 8 MiB)\n" +" lc=POÄŒ poÄet kontextových bitů literálu (0 – 4; 3)\n" +" lp=POÄŒ poÄet poziÄních bitů literálu (0 – 4; 0)\n" " pb=POÄŒ poÄet poziÄních bitů (0 – 4; 2)\n" " mode=REŽIM režim komprimace (fast, normal; normal)\n" " nice=NUM příznivá délka shody (2 – 273; 64)\n" -" mf=NÃZEV hledání shod (hc3, hc4, bt2, bt3, bt4; " -"bt4)\n" +" mf=NÃZEV hledání shod (hc3, hc4, bt2, bt3, bt4; bt4)\n" " depth=POÄŒ maximální hloubka prohledávání;\n" " 0 = automaticky (výchozí)" -#: src/xz/message.c:1181 +#: src/xz/message.c:1176 msgid "" "\n" " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" @@ -695,7 +643,7 @@ msgstr "" " Platné volby pro vÅ¡echny filtry BCJ:\n" " start=POÄŒ poÄáteÄní posun pro pÅ™evody (výchozí=0)" -#: src/xz/message.c:1193 +#: src/xz/message.c:1188 msgid "" "\n" " --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" @@ -704,11 +652,10 @@ msgid "" msgstr "" "\n" " --delta[=VOLBY] Filtr Delta; platné VOLBY (platné hodnoty; výchozí):\n" -" dist=POÄŒ vzdálenost mezi bajty, které jsou " -"odeÄítány\n" +" dist=POÄŒ vzdálenost mezi bajty, které jsou odeÄítány\n" " jeden od druhého (1 – 256; 1)" -#: src/xz/message.c:1201 +#: src/xz/message.c:1196 msgid "" "\n" " Other options:\n" @@ -716,79 +663,71 @@ msgstr "" "\n" " Ostatní pÅ™epínaÄe:\n" -#: src/xz/message.c:1204 +#: src/xz/message.c:1199 msgid "" -" -q, --quiet suppress warnings; specify twice to suppress errors " -"too\n" +" -q, --quiet suppress warnings; specify twice to suppress errors too\n" " -v, --verbose be verbose; specify twice for even more verbose" msgstr "" -" -q, --quiet potlaÄit varování; zadáním dvakrát, potlaÄíte i " -"chyby\n" +" -q, --quiet potlaÄit varování; zadáním dvakrát, potlaÄíte i chyby\n" " -v, --verbose podrobnÄ›jší zprávy; zadáním dvakrát, budou jeÅ¡tÄ›\n" " podrobnÄ›jší" -#: src/xz/message.c:1209 +#: src/xz/message.c:1204 msgid " -Q, --no-warn make warnings not affect the exit status" msgstr " -Q, --no-warn způsobí, že varování neovlivní stav ukonÄení" -#: src/xz/message.c:1211 -msgid "" -" --robot use machine-parsable messages (useful for scripts)" +#: src/xz/message.c:1206 +msgid " --robot use machine-parsable messages (useful for scripts)" msgstr "" " --robot použít strojovÄ› analyzovatelné zprávy (užiteÄné pro\n" " skripty)" -#: src/xz/message.c:1214 +#: src/xz/message.c:1209 msgid "" -" --info-memory display the total amount of RAM and the currently " -"active\n" +" --info-memory display the total amount of RAM and the currently active\n" " memory usage limits, and exit" msgstr "" -" --info-memory zobrazit celkové množství pamÄ›ti RAM a souÄasné " -"aktivní\n" +" --info-memory zobrazit celkové množství pamÄ›ti RAM a souÄasné aktivní\n" " omezení použitelné pamÄ›ti a skonÄit" -#: src/xz/message.c:1217 +#: src/xz/message.c:1212 msgid "" " -h, --help display the short help (lists only the basic options)\n" " -H, --long-help display this long help and exit" msgstr "" -" -h, --help zobrazit krátkou nápovÄ›du (vypíše jen základní " -"pÅ™epínaÄe)\n" +" -h, --help zobrazit krátkou nápovÄ›du (vypíše jen základní pÅ™epínaÄe)\n" " -H, --long-help zobrazit tuto úplnou nápovÄ›du a skonÄit" -#: src/xz/message.c:1221 +#: src/xz/message.c:1216 msgid "" " -h, --help display this short help and exit\n" " -H, --long-help display the long help (lists also the advanced options)" msgstr "" " -h, --help zobrazit tuto zkrácenou nápovÄ›du a skonÄit\n" -" -H, --long-help zobrazit úplnou nápovÄ›du (vypíše i pokroÄilé " -"pÅ™epínaÄe)" +" -H, --long-help zobrazit úplnou nápovÄ›du (vypíše i pokroÄilé pÅ™epínaÄe)" -#: src/xz/message.c:1226 +#: src/xz/message.c:1221 msgid " -V, --version display the version number and exit" msgstr " -V, --version zobrazit Äíslo verze a skonÄit" -#: src/xz/message.c:1228 +#: src/xz/message.c:1223 msgid "" "\n" "With no FILE, or when FILE is -, read standard input.\n" msgstr "" "\n" -"Pokud SOUBOR není zadán nebo pokud je -, bude se Äíst ze standardního " -"vstupu.\n" +"Pokud SOUBOR není zadán nebo pokud je -, bude se Äíst ze standardního vstupu.\n" #. TRANSLATORS: This message indicates the bug reporting address #. for this package. Please add _another line_ saying #. "Report translation bugs to <...>\n" with the email or WWW #. address for translation bugs. Thanks. -#: src/xz/message.c:1234 +#: src/xz/message.c:1229 #, c-format msgid "Report bugs to <%s> (in English or Finnish).\n" msgstr "Chyby hlaste na <%s> (v angliÄtinÄ› nebo finÅ¡tinÄ›).\n" -#: src/xz/message.c:1236 +#: src/xz/message.c:1231 #, c-format msgid "%s home page: <%s>\n" msgstr "Domovská stránka %s: <%s>\n" @@ -824,11 +763,8 @@ msgstr "Vybraný vyhledávaÄ shod vyža #: src/xz/suffix.c:79 src/xz/suffix.c:164 #, c-format -msgid "" -"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" -msgstr "" -"%s: S pÅ™epínaÄem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do " -"standardního výstupu" +msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" +msgstr "%s: S pÅ™epínaÄem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do standardního výstupu" #: src/xz/suffix.c:99 #, c-format @@ -857,9 +793,7 @@ msgstr "%s: Neplatná jednotka s pÅ™edpo #: src/xz/util.c:105 msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)." -msgstr "" -"Platné jednotky s pÅ™edponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a " -"„GiB“ (2^30 B)." +msgstr "Platné jednotky s pÅ™edponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a „GiB“ (2^30 B)." #: src/xz/util.c:122 #, c-format @@ -893,49 +827,37 @@ msgstr "Neznámá chyba" #~ msgstr "%s MiB (%s bajtů)\n" #~ msgid "" -#~ " -e, --extreme use more CPU time when encoding to increase " -#~ "compression\n" +#~ " -e, --extreme use more CPU time when encoding to increase compression\n" #~ " ratio without increasing memory usage of the decoder" #~ msgstr "" -#~ " -e, --extreme využít více procesorového Äasu pro kódování, Äímž " -#~ "se\n" -#~ " zvýší kompresní pomÄ›r bez zvýšení pamÄ›ti použité " -#~ "kodérem" +#~ " -e, --extreme využít více procesorového Äasu pro kódování, Äímž se\n" +#~ " zvýší kompresní pomÄ›r bez zvýšení pamÄ›ti použité kodérem" #~ msgid "" -#~ " -M, --memory=NUM use roughly NUM bytes of memory at maximum; 0 " -#~ "indicates\n" +#~ " -M, --memory=NUM use roughly NUM bytes of memory at maximum; 0 indicates\n" #~ " the default setting, which is 40 % of total RAM" #~ msgstr "" -#~ " -M, --memory=POÄŒ použít zhruba POÄŒ bajtů pamÄ›ti jako maximum; 0 " -#~ "znamená\n" -#~ " výchozí nastavení, což je 40% celkového množství " -#~ "pamÄ›ti" +#~ " -M, --memory=POÄŒ použít zhruba POÄŒ bajtů pamÄ›ti jako maximum; 0 znamená\n" +#~ " výchozí nastavení, což je 40% celkového množství pamÄ›ti" #~ msgid "" #~ "\n" -#~ " --subblock[=OPTS] Subblock filter; valid OPTS (valid values; " -#~ "default):\n" +#~ " --subblock[=OPTS] Subblock filter; valid OPTS (valid values; default):\n" #~ " size=NUM number of bytes of data per subblock\n" #~ " (1 - 256Mi; 4Ki)\n" -#~ " rle=NUM run-length encoder chunk size (0-256; " -#~ "0)" +#~ " rle=NUM run-length encoder chunk size (0-256; 0)" #~ msgstr "" #~ "\n" -#~ " --subblock[=VOLBY] Subblokový filtr; platné VOLBY (platné hodnoty; " -#~ "výchozí):\n" +#~ " --subblock[=VOLBY] Subblokový filtr; platné VOLBY (platné hodnoty; výchozí):\n" #~ " size=POÄŒ poÄet bajtů dat na subblok\n" #~ " (1 - 256 Mi; 4 Ki)\n" -#~ " rle=POÄŒ velikost dávky pro kodér run-length " -#~ "(0-256; 0)" +#~ " rle=POÄŒ velikost dávky pro kodér run-length (0-256; 0)" #~ msgid "" -#~ "On this system and configuration, this program will use a maximum of " -#~ "roughly\n" +#~ "On this system and configuration, this program will use a maximum of roughly\n" #~ "%s MiB RAM and " #~ msgstr "" -#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze " -#~ "zhruba\n" +#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze zhruba\n" #~ "%s MiB RAM a " #~ msgid "" Modified: head/contrib/xz/po/de.po ============================================================================== --- head/contrib/xz/po/de.po Fri Nov 12 16:50:11 2010 (r215186) +++ head/contrib/xz/po/de.po Fri Nov 12 16:53:17 2010 (r215187) @@ -6,10 +6,11 @@ msgid "" msgstr "" "Project-Id-Version: XZ Utils 4.999.9beta\n" "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" -"POT-Creation-Date: 2010-09-11 17:07+0200\n" +"POT-Creation-Date: 2010-10-23 17:48+0300\n" "PO-Revision-Date: 2010-09-07 20:27+0200\n" "Last-Translator: \n" "Language-Team: German\n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -27,8 +28,7 @@ msgstr "%s: Integritäts-Check Typ nicht #: src/xz/args.c:382 msgid "Only one file can be specified with `--files' or `--files0'." -msgstr "" -"Nur ein file kann als Argument für --files oder --files0 angegeben werden." +msgstr "Nur ein file kann als Argument für --files oder --files0 angegeben werden." #: src/xz/args.c:445 #, c-format @@ -41,8 +41,7 @@ msgstr "Maximal vier Filter möglich" #: src/xz/coder.c:108 msgid "Memory usage limit is too low for the given filter setup." -msgstr "" -"Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration." +msgstr "Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration." #: src/xz/coder.c:129 msgid "Using a preset in raw mode is discouraged." @@ -50,9 +49,7 @@ msgstr "Verwendung der Voreinstellung im #: src/xz/coder.c:131 msgid "The exact options of the presets may vary between software versions." -msgstr "" -"Die genauen Optionen der Voreinstellung können zwischen Software Versionen " -"variieren." +msgstr "Die genauen Optionen der Voreinstellung können zwischen Software Versionen variieren." #: src/xz/coder.c:157 msgid "The .lzma format supports only the LZMA1 filter" @@ -73,12 +70,8 @@ msgstr "Dekompression wird %s MiB Speich #: src/xz/coder.c:247 #, c-format -msgid "" -"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the " -"memory usage limit of %s MiB" -msgstr "" -"Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das " -"Speicher Nutzungslimit von %s MiB zu übersteigen" +msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB" +msgstr "Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das Speicher Nutzungslimit von %s MiB zu übersteigen" #. TRANSLATORS: When compression or decompression finishes, #. and xz is going to remove the source file, xz first checks @@ -93,8 +86,7 @@ msgstr "" #: src/xz/file_io.c:137 #, c-format msgid "%s: File seems to have been moved, not removing" -msgstr "" -"%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht" +msgstr "%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht" #: src/xz/file_io.c:144 src/xz/file_io.c:590 #, c-format @@ -149,8 +141,7 @@ msgstr "%s: Eingabedatei hat mehr als ei #: src/xz/file_io.c:714 #, c-format msgid "Error restoring the O_APPEND flag to standard output: %s" -msgstr "" -"Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s" +msgstr "Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s" #: src/xz/file_io.c:726 #, c-format @@ -160,8 +151,7 @@ msgstr "%s: Fehler beim Schießen der Da #: src/xz/file_io.c:762 src/xz/file_io.c:946 #, c-format msgid "%s: Seeking failed when trying to create a sparse file: %s" -msgstr "" -"%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s" +msgstr "%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s" #: src/xz/file_io.c:821 #, c-format @@ -212,7 +202,7 @@ msgstr "Kein" #. but the Check ID is known (here 2). This and other "Unknown-N" #. strings are used in tables, so the width must not exceed ten #. columns with a fixed-width font. It's OK to omit the dash if -#. you need space for one extra letter. +#. you need space for one extra letter, but don't use spaces. #: src/xz/list.c:69 msgid "Unknown-2" msgstr "Unbek.2" @@ -320,12 +310,10 @@ msgstr " Strom Auffüllung: %s\n" #: src/xz/list.c:693 msgid "" " Streams:\n" -" Stream Blocks CompOffset UncompOffset CompSize " -"UncompSize Ratio Check Padding" +" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding" msgstr "" " Ströme:\n" -" Strom Blöcke KompOffset UnkompOffset KompGröße " -"UnkompGröße Verh. Check Auffüllung" +" Strom Blöcke KompOffset UnkompOffset KompGröße UnkompGröße Verh. Check Auffüllung" #. TRANSLATORS: The second line is column headings. All #. except Check are right aligned; Check is left aligned. @@ -333,12 +321,10 @@ msgstr "" #, c-format msgid "" " Blocks:\n" -" Stream Block CompOffset UncompOffset TotalSize " -"UncompSize Ratio Check" +" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check" msgstr "" " Blöcke:\n" -" Strom Block KompOffset UnkompOffset TotalGröße " -"UnkompGröße Verh. Check" +" Strom Block KompOffset UnkompOffset TotalGröße UnkompGröße Verh. Check" #. TRANSLATORS: These are additional column headings #. for the most verbose listing mode. CheckVal @@ -390,8 +376,7 @@ msgstr " Anzahl Dateien: %s\n" #: src/xz/list.c:1072 msgid "--list works only on .xz files (--format=xz or --format=auto)" -msgstr "" -"--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)" +msgstr "--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)" #: src/xz/list.c:1078 msgid "--list does not support reading from standard input" @@ -409,79 +394,69 @@ msgstr "%s: Unerwartetes Ende beim Lesen #: src/xz/main.c:120 #, c-format -msgid "" -"%s: Null character found when reading filenames; maybe you meant to use `--" -"files0' instead of `--files'?" -msgstr "" -"%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--" -"files0' statt `--files'?" +msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?" +msgstr "%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--files0' statt `--files'?" #: src/xz/main.c:174 msgid "Compression and decompression with --robot are not supported yet." msgstr "Kompression und Dekompression mit --robot ist noch nicht unterstützt." #: src/xz/main.c:231 -msgid "" -"Cannot read data from standard input when reading filenames from standard " -"input" -msgstr "" -"Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von " -"der Standardeingabe gelesen werden" +msgid "Cannot read data from standard input when reading filenames from standard input" +msgstr "Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von der Standardeingabe gelesen werden" -#: src/xz/message.c:800 src/xz/message.c:844 +#: src/xz/message.c:792 src/xz/message.c:842 msgid "Internal error (bug)" msgstr "Interner Fehler (Bug)" -#: src/xz/message.c:807 +#: src/xz/message.c:799 msgid "Cannot establish signal handlers" msgstr "Kann Signal Routine nicht setzen" -#: src/xz/message.c:816 +#: src/xz/message.c:808 msgid "No integrity check; not verifying file integrity" msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen" -#: src/xz/message.c:819 +#: src/xz/message.c:811 msgid "Unsupported type of integrity check; not verifying file integrity" -msgstr "" -"Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht " -"überprüfen" +msgstr "Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht überprüfen" -#: src/xz/message.c:826 +#: src/xz/message.c:818 msgid "Memory usage limit reached" msgstr "Speicher-Limit erreicht" -#: src/xz/message.c:829 +#: src/xz/message.c:821 msgid "File format not recognized" msgstr "Datei Format nicht erkannt" -#: src/xz/message.c:832 +#: src/xz/message.c:824 msgid "Unsupported options" msgstr "Optionen nicht unterstützt" -#: src/xz/message.c:835 +#: src/xz/message.c:827 msgid "Compressed data is corrupt" msgstr "Komprimierte Daten sind korrupt" -#: src/xz/message.c:838 +#: src/xz/message.c:830 msgid "Unexpected end of input" msgstr "Unerwartetes Eingabe Ende" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 17:10:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF360106564A; Fri, 12 Nov 2010 17:10:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 829388FC13; Fri, 12 Nov 2010 17:10:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACHACVJ016660; Fri, 12 Nov 2010 17:10:12 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACHACM7016658; Fri, 12 Nov 2010 17:10:12 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011121710.oACHACM7016658@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 12 Nov 2010 17:10: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: r215188 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 17:10:12 -0000 Author: jkim Date: Fri Nov 12 17:10:12 2010 New Revision: 215188 URL: http://svn.freebsd.org/changeset/base/215188 Log: Create C1 state when _CST is valid but _CST does not have one. Some BIOSes do not report C1 state in _CST object, probably because it is a mandatory state with or without existence of the optional _CST. Reviewed by: avg Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Fri Nov 12 16:53:17 2010 (r215187) +++ head/sys/dev/acpica/acpi_cpu.c Fri Nov 12 17:10:12 2010 (r215188) @@ -668,9 +668,19 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s count = MAX_CX_STATES; } - /* Set up all valid states. */ + sc->cpu_non_c3 = 0; sc->cpu_cx_count = 0; cx_ptr = sc->cpu_cx_states; + + /* + * C1 has been required since just after ACPI 1.0. + * Reserve the first slot for it. + */ + cx_ptr->type = ACPI_STATE_C0; + cx_ptr++; + sc->cpu_cx_count++; + + /* Set up all valid states. */ for (i = 0; i < count; i++) { pkg = &top->Package.Elements[i + 1]; if (!ACPI_PKG_VALID(pkg, 4) || @@ -685,9 +695,14 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s /* Validate the state to see if we should use it. */ switch (cx_ptr->type) { case ACPI_STATE_C1: - sc->cpu_non_c3 = i; - cx_ptr++; - sc->cpu_cx_count++; + if (sc->cpu_cx_states[0].type == ACPI_STATE_C0) { + /* This is the first C1 state. Use the reserved slot. */ + sc->cpu_cx_states[0] = *cx_ptr; + } else { + sc->cpu_non_c3 = i; + cx_ptr++; + sc->cpu_cx_count++; + } continue; case ACPI_STATE_C2: sc->cpu_non_c3 = i; @@ -726,6 +741,13 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s } AcpiOsFree(buf.Pointer); + /* If C1 state was not found, we need one now. */ + cx_ptr = sc->cpu_cx_states; + if (cx_ptr->type == ACPI_STATE_C0) { + cx_ptr->type = ACPI_STATE_C1; + cx_ptr->trans_lat = 0; + } + return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 18:09:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB6061065672; Fri, 12 Nov 2010 18:09:06 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B84568FC14; Fri, 12 Nov 2010 18:09:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACI96PI018543; Fri, 12 Nov 2010 18:09:06 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACI96Mr018541; Fri, 12 Nov 2010 18:09:06 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201011121809.oACI96Mr018541@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 12 Nov 2010 18:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215190 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 18:09:06 -0000 Author: mdf Date: Fri Nov 12 18:09:06 2010 New Revision: 215190 URL: http://svn.freebsd.org/changeset/base/215190 Log: MFC r213813. This is a direct commit because the diff is against several non-MFC'd changes. Use a safer mechanism for determining if a task is currently running, that does not rely on the lifetime of pointers being the same. This also restores the task KBI. Modified: stable/8/sys/kern/subr_taskqueue.c Modified: stable/8/sys/kern/subr_taskqueue.c ============================================================================== --- stable/8/sys/kern/subr_taskqueue.c Fri Nov 12 17:20:18 2010 (r215189) +++ stable/8/sys/kern/subr_taskqueue.c Fri Nov 12 18:09:06 2010 (r215190) @@ -46,12 +46,17 @@ static MALLOC_DEFINE(M_TASKQUEUE, "taskq static void *taskqueue_giant_ih; static void *taskqueue_ih; +struct taskqueue_busy { + struct task *tb_running; + TAILQ_ENTRY(taskqueue_busy) tb_link; +}; + struct taskqueue { STAILQ_HEAD(, task) tq_queue; const char *tq_name; taskqueue_enqueue_fn tq_enqueue; void *tq_context; - struct task *tq_running; + TAILQ_HEAD(, taskqueue_busy) tq_active; struct mtx tq_mutex; struct thread **tq_threads; int tq_tcount; @@ -63,6 +68,8 @@ struct taskqueue { #define TQ_FLAGS_BLOCKED (1 << 1) #define TQ_FLAGS_PENDING (1 << 2) +static void taskqueue_run_locked(struct taskqueue *); + static __inline void TQ_LOCK(struct taskqueue *tq) { @@ -102,6 +109,7 @@ _taskqueue_create(const char *name, int return NULL; STAILQ_INIT(&queue->tq_queue); + TAILQ_INIT(&queue->tq_active); queue->tq_name = name; queue->tq_enqueue = enqueue; queue->tq_context = context; @@ -139,8 +147,9 @@ taskqueue_free(struct taskqueue *queue) TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_ACTIVE; - taskqueue_run(queue); + taskqueue_run_locked(queue); taskqueue_terminate(queue->tq_threads, queue); + KASSERT(TAILQ_EMPTY(&queue->tq_active), ("Tasks still running?")); mtx_destroy(&queue->tq_mutex); free(queue->tq_threads, M_TASKQUEUE); free(queue, M_TASKQUEUE); @@ -215,15 +224,17 @@ taskqueue_unblock(struct taskqueue *queu TQ_UNLOCK(queue); } -void -taskqueue_run(struct taskqueue *queue) +static void +taskqueue_run_locked(struct taskqueue *queue) { + struct taskqueue_busy tb; struct task *task; - int owned, pending; + int pending; + + mtx_assert(&queue->tq_mutex, MA_OWNED); + tb.tb_running = NULL; + TAILQ_INSERT_TAIL(&queue->tq_active, &tb, tb_link); - owned = mtx_owned(&queue->tq_mutex); - if (!owned) - TQ_LOCK(queue); while (STAILQ_FIRST(&queue->tq_queue)) { /* * Carefully remove the first task from the queue and @@ -233,22 +244,38 @@ taskqueue_run(struct taskqueue *queue) STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); pending = task->ta_pending; task->ta_pending = 0; - queue->tq_running = task; + tb.tb_running = task; TQ_UNLOCK(queue); task->ta_func(task->ta_context, pending); TQ_LOCK(queue); - queue->tq_running = NULL; + tb.tb_running = NULL; wakeup(task); } + TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); +} - /* - * For compatibility, unlock on return if the queue was not locked - * on entry, although this opens a race window. - */ - if (!owned) - TQ_UNLOCK(queue); +void +taskqueue_run(struct taskqueue *queue) +{ + + TQ_LOCK(queue); + taskqueue_run_locked(queue); + TQ_UNLOCK(queue); +} + +static int +task_is_running(struct taskqueue *queue, struct task *task) +{ + struct taskqueue_busy *tb; + + mtx_assert(&queue->tq_mutex, MA_OWNED); + TAILQ_FOREACH(tb, &queue->tq_active, tb_link) { + if (tb->tb_running == task) + return (1); + } + return (0); } void @@ -256,14 +283,14 @@ taskqueue_drain(struct taskqueue *queue, { if (queue->tq_spin) { /* XXX */ mtx_lock_spin(&queue->tq_mutex); - while (task->ta_pending != 0 || task == queue->tq_running) + while (task->ta_pending != 0 || task_is_running(queue, task)) msleep_spin(task, &queue->tq_mutex, "-", 0); mtx_unlock_spin(&queue->tq_mutex); } else { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); mtx_lock(&queue->tq_mutex); - while (task->ta_pending != 0 || task == queue->tq_running) + while (task->ta_pending != 0 || task_is_running(queue, task)) msleep(task, &queue->tq_mutex, PWAIT, "-", 0); mtx_unlock(&queue->tq_mutex); } @@ -357,7 +384,7 @@ taskqueue_thread_loop(void *arg) tq = *tqp; TQ_LOCK(tq); while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { - taskqueue_run(tq); + taskqueue_run_locked(tq); /* * Because taskqueue_run() can drop tq_mutex, we need to * check if the TQ_FLAGS_ACTIVE flag wasn't removed in the From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 18:10:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 602831065693; Fri, 12 Nov 2010 18:10:27 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE208FC1C; Fri, 12 Nov 2010 18:10:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACIARW7018654; Fri, 12 Nov 2010 18:10:27 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACIAR1x018652; Fri, 12 Nov 2010 18:10:27 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201011121810.oACIAR1x018652@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 12 Nov 2010 18:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215191 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 18:10:27 -0000 Author: mdf Date: Fri Nov 12 18:10:27 2010 New Revision: 215191 URL: http://svn.freebsd.org/changeset/base/215191 Log: MFC r213813. This is a direct commit because the diff is against several non-MFC'd changes. Use a safer mechanism for determining if a task is currently running, that does not rely on the lifetime of pointers being the same. This also restores the task KBI. Modified: stable/7/sys/kern/subr_taskqueue.c Modified: stable/7/sys/kern/subr_taskqueue.c ============================================================================== --- stable/7/sys/kern/subr_taskqueue.c Fri Nov 12 18:09:06 2010 (r215190) +++ stable/7/sys/kern/subr_taskqueue.c Fri Nov 12 18:10:27 2010 (r215191) @@ -48,13 +48,18 @@ static void *taskqueue_ih; static STAILQ_HEAD(taskqueue_list, taskqueue) taskqueue_queues; static struct mtx taskqueue_queues_mutex; +struct taskqueue_busy { + struct task *tb_running; + TAILQ_ENTRY(taskqueue_busy) tb_link; +}; + struct taskqueue { STAILQ_ENTRY(taskqueue) tq_link; STAILQ_HEAD(, task) tq_queue; const char *tq_name; taskqueue_enqueue_fn tq_enqueue; void *tq_context; - struct task *tq_running; + TAILQ_HEAD(, taskqueue_busy) tq_active; struct mtx tq_mutex; struct proc **tq_pproc; int tq_pcount; @@ -66,6 +71,8 @@ struct taskqueue { #define TQ_FLAGS_BLOCKED (1 << 1) #define TQ_FLAGS_PENDING (1 << 2) +static void taskqueue_run_locked(struct taskqueue *); + static __inline void TQ_LOCK(struct taskqueue *tq) { @@ -117,6 +124,7 @@ _taskqueue_create(const char *name, int return 0; STAILQ_INIT(&queue->tq_queue); + TAILQ_INIT(&queue->tq_active); queue->tq_name = name; queue->tq_enqueue = enqueue; queue->tq_context = context; @@ -162,8 +170,9 @@ taskqueue_free(struct taskqueue *queue) TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_ACTIVE; - taskqueue_run(queue); + taskqueue_run_locked(queue); taskqueue_terminate(queue->tq_pproc, queue); + KASSERT(TAILQ_EMPTY(&queue->tq_active), ("Tasks still running?")); mtx_destroy(&queue->tq_mutex); free(queue->tq_pproc, M_TASKQUEUE); free(queue, M_TASKQUEUE); @@ -258,15 +267,17 @@ taskqueue_unblock(struct taskqueue *queu TQ_UNLOCK(queue); } -void -taskqueue_run(struct taskqueue *queue) +static void +taskqueue_run_locked(struct taskqueue *queue) { + struct taskqueue_busy tb; struct task *task; - int owned, pending; + int pending; + + mtx_assert(&queue->tq_mutex, MA_OWNED); + tb.tb_running = NULL; + TAILQ_INSERT_TAIL(&queue->tq_active, &tb, tb_link); - owned = mtx_owned(&queue->tq_mutex); - if (!owned) - TQ_LOCK(queue); while (STAILQ_FIRST(&queue->tq_queue)) { /* * Carefully remove the first task from the queue and @@ -276,22 +287,38 @@ taskqueue_run(struct taskqueue *queue) STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); pending = task->ta_pending; task->ta_pending = 0; - queue->tq_running = task; + tb.tb_running = task; TQ_UNLOCK(queue); task->ta_func(task->ta_context, pending); TQ_LOCK(queue); - queue->tq_running = NULL; + tb.tb_running = NULL; wakeup(task); } + TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); +} - /* - * For compatibility, unlock on return if the queue was not locked - * on entry, although this opens a race window. - */ - if (!owned) - TQ_UNLOCK(queue); +void +taskqueue_run(struct taskqueue *queue) +{ + + TQ_LOCK(queue); + taskqueue_run_locked(queue); + TQ_UNLOCK(queue); +} + +static int +task_is_running(struct taskqueue *queue, struct task *task) +{ + struct taskqueue_busy *tb; + + mtx_assert(&queue->tq_mutex, MA_OWNED); + TAILQ_FOREACH(tb, &queue->tq_active, tb_link) { + if (tb->tb_running == task) + return (1); + } + return (0); } void @@ -299,14 +326,14 @@ taskqueue_drain(struct taskqueue *queue, { if (queue->tq_spin) { /* XXX */ mtx_lock_spin(&queue->tq_mutex); - while (task->ta_pending != 0 || task == queue->tq_running) + while (task->ta_pending != 0 || task_is_running(queue, task)) msleep_spin(task, &queue->tq_mutex, "-", 0); mtx_unlock_spin(&queue->tq_mutex); } else { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); mtx_lock(&queue->tq_mutex); - while (task->ta_pending != 0 || task == queue->tq_running) + while (task->ta_pending != 0 || task_is_running(queue, task)) msleep(task, &queue->tq_mutex, PWAIT, "-", 0); mtx_unlock(&queue->tq_mutex); } @@ -398,7 +425,7 @@ taskqueue_thread_loop(void *arg) tq = *tqp; TQ_LOCK(tq); while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { - taskqueue_run(tq); + taskqueue_run_locked(tq); TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 19:33:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FEE8106566B; Fri, 12 Nov 2010 19:33:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E00E8FC1F; Fri, 12 Nov 2010 19:33:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACJXENV021195; Fri, 12 Nov 2010 19:33:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACJXEY2021193; Fri, 12 Nov 2010 19:33:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011121933.oACJXEY2021193@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 12 Nov 2010 19:33: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: r215194 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 19:33:14 -0000 Author: yongari Date: Fri Nov 12 19:33:13 2010 New Revision: 215194 URL: http://svn.freebsd.org/changeset/base/215194 Log: Fix regression introduced in r215132. Caller always holds a driver lock before accessing mii, so locking is not needed here. Reported by: Rob Farmer (rfarmer <> predatorlabs dot net) Modified: head/sys/dev/nfe/if_nfe.c Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Fri Nov 12 19:25:11 2010 (r215193) +++ head/sys/dev/nfe/if_nfe.c Fri Nov 12 19:33:13 2010 (r215194) @@ -817,8 +817,6 @@ nfe_miibus_statchg(device_t dev) sc = device_get_softc(dev); - NFE_LOCK(sc); - mii = device_get_softc(sc->nfe_miibus); ifp = sc->nfe_ifp; @@ -848,8 +846,6 @@ nfe_miibus_statchg(device_t dev) } NFE_WRITE(sc, NFE_TX_CTL, txctl); NFE_WRITE(sc, NFE_RX_CTL, rxctl); - - NFE_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 19:43:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6014106566B; Fri, 12 Nov 2010 19:43:12 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1FCF8FC08; Fri, 12 Nov 2010 19:43:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACJhCQP021440; Fri, 12 Nov 2010 19:43:12 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACJhC0j021434; Fri, 12 Nov 2010 19:43:12 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201011121943.oACJhC0j021434@svn.freebsd.org> From: Maksim Yevmenkin Date: Fri, 12 Nov 2010 19:43: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: r215195 - in head: etc usr.sbin/bluetooth usr.sbin/bluetooth/ath3kfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 19:43:12 -0000 Author: emax Date: Fri Nov 12 19:43:12 2010 New Revision: 215195 URL: http://svn.freebsd.org/changeset/base/215195 Log: Add firmware downloader for Atheros AR3011 based USB Bluetooth devices. Hardware donated by: Rusty Nejdl rnejdl at ringofsaturn dot com Tested by: Rusty Nejdl rnejdl at ringofsaturn dot com Tested by: Andrzej Tobola ato at iem dot pw dot edu dot pl MFC after: 3 weeks Added: head/usr.sbin/bluetooth/ath3kfw/ head/usr.sbin/bluetooth/ath3kfw/Makefile (contents, props changed) head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8 (contents, props changed) head/usr.sbin/bluetooth/ath3kfw/ath3kfw.c (contents, props changed) Modified: head/etc/devd.conf head/usr.sbin/bluetooth/Makefile Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Fri Nov 12 19:33:13 2010 (r215194) +++ head/etc/devd.conf Fri Nov 12 19:43:12 2010 (r215195) @@ -97,6 +97,13 @@ detach 100 { action "/etc/rc.d/bluetooth quietstop $device-name"; }; +# Firmware downloader for Atheros AR3011 based USB Bluetooth devices +#attach 100 { +# match "vendor" "0x0cf3"; +# match "product" "0x3000"; +# action "sleep 2 && /usr/sbin/ath3kfw -d $device-name -f /usr/local/etc/ath3k-1.fw"; +#}; + # When a USB keyboard arrives, attach it as the console keyboard. attach 100 { device-name "ukbd0"; Modified: head/usr.sbin/bluetooth/Makefile ============================================================================== --- head/usr.sbin/bluetooth/Makefile Fri Nov 12 19:33:13 2010 (r215194) +++ head/usr.sbin/bluetooth/Makefile Fri Nov 12 19:43:12 2010 (r215195) @@ -2,6 +2,7 @@ # $FreeBSD$ SUBDIR= \ + ath3kfw \ bcmfw \ bt3cfw \ bthidcontrol \ Added: head/usr.sbin/bluetooth/ath3kfw/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/Makefile Fri Nov 12 19:43:12 2010 (r215195) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= ath3kfw +MAN= ath3kfw.8 +WARNS?= 6 +DPADD+= ${LIBUSB} +LDADD+= -lusb + +.include Added: head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8 Fri Nov 12 19:43:12 2010 (r215195) @@ -0,0 +1,78 @@ +.\" Copyright (c) 2010 Maksim Yevmenkin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Novermber 9, 2010 +.Dt ATH3KFW 8 +.Os +.Sh NAME +.Nm ath3kfw +.Nd firmware download utility for Atheros AR3011 chip based Bluetooth USB devices +.Sh SYNOPSIS +.Nm +.Fl d Ar device_name +.Fl f Ar firmware_file_name +.Nm +.Fl h +.Sh DESCRIPTION +The +.Nm +utility downloads the specified firmware file to the specified +.Xr ugen 4 +device. +.Pp +This utility will +.Em only +work with Atheros AR3011 chip based Bluetooth USB devices. +The identification is currently based on USB vendor ID/product ID pair. +The vendor ID should be 0x0cf3 +.Pq Dv USB_VENDOR_ATHEROS2 +and the product ID should be 0x3000. +.Pp +Firmware files ath3k-1.fw and ath3k-2.fw can be obtained from the +linux-firmware RPM. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl d Ar device_name +Specify +.Xr ugen 4 +device name. +.It Fl f Ar firmware_file_name +Specify firmware file name for download. +.It Fl h +Display usage message and exit. +.El +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr libusb 3 , +.Xr ugen 4 , +.Xr devd 8 +.Sh AUTHORS +.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com +.Sh BUGS +Most likely. +Please report if found. Added: head/usr.sbin/bluetooth/ath3kfw/ath3kfw.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/ath3kfw/ath3kfw.c Fri Nov 12 19:43:12 2010 (r215195) @@ -0,0 +1,287 @@ +/* + * ath3kfw.c + */ + +/*- + * Copyright (c) 2010 Maksim Yevmenkin + * 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$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ATH3KFW "ath3kfw" +#define ATH3KFW_VENDOR_ID 0x0cf3 +#define ATH3KFW_PRODUCT_ID 0x3000 +#define ATH3KFW_FW "/usr/local/etc/ath3k-1.fw" +#define ATH3KFW_BULK_EP 0x02 +#define ATH3KFW_REQ_DFU_DNLOAD 1 +#define ATH3KFW_MAX_BSIZE 4096 + +static int parse_ugen_name (char const *ugen, uint8_t *bus, + uint8_t *addr); +static int find_device (struct libusb20_backend *be, + uint8_t bus, uint8_t addr, + struct libusb20_device **dev); +static int download_firmware (struct libusb20_device *dev, + char const *firmware); +static void usage (void); + +/* + * Firmware downloader for Atheros AR3011 based USB Bluetooth devices + */ + +int +main(int argc, char **argv) +{ + uint8_t bus, addr; + char const *firmware; + struct libusb20_backend *be; + struct libusb20_device *dev; + int n; + + openlog(ATH3KFW, LOG_NDELAY|LOG_PERROR|LOG_PID, LOG_USER); + + bus = 0; + addr = 0; + firmware = ATH3KFW_FW; + + while ((n = getopt(argc, argv, "d:f:h")) != -1) { + switch (n) { + case 'd': /* ugen device name */ + if (parse_ugen_name(optarg, &bus, &addr) < 0) + usage(); + break; + + case 'f': /* firmware file */ + firmware = optarg; + break; + + case 'h': + default: + usage(); + break; + /* NOT REACHED */ + } + } + + be = libusb20_be_alloc_default(); + if (be == NULL) { + syslog(LOG_ERR, "libusb20_be_alloc_default() failed"); + return (-1); + } + + if (find_device(be, bus, addr, &dev) < 0) { + syslog(LOG_ERR, "ugen%d.%d is not recognized as " \ + "Atheros AR3011 based device " \ + "(possibly caused by lack of permissions)", bus, addr); + return (-1); + } + + if (download_firmware(dev, firmware) < 0) { + syslog(LOG_ERR, "could not download %s firmare to ugen%d.%d", + firmware, bus, addr); + return (-1); + } + + libusb20_be_free(be); + closelog(); + + return (0); +} + +/* + * Parse ugen name and extract device's bus and address + */ + +static int +parse_ugen_name(char const *ugen, uint8_t *bus, uint8_t *addr) +{ + char *ep; + + if (strncmp(ugen, "ugen", 4) != 0) + return (-1); + + *bus = (uint8_t) strtoul(ugen + 4, &ep, 10); + if (*ep != '.') + return (-1); + + *addr = (uint8_t) strtoul(ep + 1, &ep, 10); + if (*ep != '\0') + return (-1); + + return (0); +} + +/* + * Find USB device + */ + +static int +find_device(struct libusb20_backend *be, uint8_t bus, uint8_t addr, + struct libusb20_device **dev) +{ + struct LIBUSB20_DEVICE_DESC_DECODED *desc; + + *dev = NULL; + + while ((*dev = libusb20_be_device_foreach(be, *dev)) != NULL) { + if (libusb20_dev_get_bus_number(*dev) != bus || + libusb20_dev_get_address(*dev) != addr) + continue; + + desc = libusb20_dev_get_device_desc(*dev); + if (desc == NULL) + continue; + + if (desc->idVendor != ATH3KFW_VENDOR_ID || + desc->idProduct != ATH3KFW_PRODUCT_ID) + continue; + + break; + } + + return ((*dev == NULL)? -1 : 0); +} + +/* + * Download firmware + */ + +static int +download_firmware(struct libusb20_device *dev, char const *firmware) +{ + struct libusb20_transfer *bulk; + struct LIBUSB20_CONTROL_SETUP_DECODED req; + int fd, n, error; + uint8_t buf[ATH3KFW_MAX_BSIZE]; + + error = -1; + + if (libusb20_dev_open(dev, 1) != 0) { + syslog(LOG_ERR, "libusb20_dev_open() failed"); + return (error); + } + + if ((bulk = libusb20_tr_get_pointer(dev, 0)) == NULL) { + syslog(LOG_ERR, "libusb20_tr_get_pointer() failed"); + goto out; + } + + if (libusb20_tr_open(bulk, ATH3KFW_MAX_BSIZE, 1, ATH3KFW_BULK_EP) != 0) { + syslog(LOG_ERR, "libusb20_tr_open(%d, 1, %d) failed", + ATH3KFW_MAX_BSIZE, ATH3KFW_BULK_EP); + goto out; + } + + if ((fd = open(firmware, O_RDONLY)) < 0) { + syslog(LOG_ERR, "open(%s) failed. %s", + firmware, strerror(errno)); + goto out1; + } + + n = read(fd, buf, 20); + if (n != 20) { + syslog(LOG_ERR, "read(%s, 20) failed. %s", + firmware, strerror(errno)); + goto out2; + } + + LIBUSB20_INIT(LIBUSB20_CONTROL_SETUP, &req); + req.bmRequestType = LIBUSB20_REQUEST_TYPE_VENDOR; + req.bRequest = ATH3KFW_REQ_DFU_DNLOAD; + req.wLength = 20; + + if (libusb20_dev_request_sync(dev, &req, buf, NULL, 5000, 0) != 0) { + syslog(LOG_ERR, "libusb20_dev_request_sync() failed"); + goto out2; + } + + for (;;) { + n = read(fd, buf, sizeof(buf)); + if (n < 0) { + syslog(LOG_ERR, "read(%s, %d) failed. %s", + firmware, (int) sizeof(buf), strerror(errno)); + goto out2; + } + if (n == 0) + break; + + libusb20_tr_setup_bulk(bulk, buf, n, 3000); + libusb20_tr_start(bulk); + + while (libusb20_dev_process(dev) == 0) { + if (libusb20_tr_pending(bulk) == 0) + break; + + libusb20_dev_wait_process(dev, -1); + } + + if (libusb20_tr_get_status(bulk) != 0) { + syslog(LOG_ERR, "bulk transfer failed with status %d", + libusb20_tr_get_status(bulk)); + goto out2; + } + } + + error = 0; +out2: + close(fd); +out1: + libusb20_tr_close(bulk); +out: + libusb20_dev_close(dev); + + return (error); +} + +/* + * Display usage and exit + */ + +static void +usage(void) +{ + printf( +"Usage: %s -d ugenX.Y -f firmware_file\n" +"Usage: %s -h\n" \ +"Where:\n" \ +"\t-d ugenX.Y ugen device name\n" \ +"\t-f firmware image firmware image file name for download\n" \ +"\t-h display this message\n", ATH3KFW, ATH3KFW); + + exit(255); +} + From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 20:26:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25E7310656A3; Fri, 12 Nov 2010 20:26:35 +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 13DA18FC20; Fri, 12 Nov 2010 20:26:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACKQYRT022375; Fri, 12 Nov 2010 20:26:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACKQYwf022373; Fri, 12 Nov 2010 20:26:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201011122026.oACKQYwf022373@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 12 Nov 2010 20:26: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: r215197 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 20:26:35 -0000 Author: nwhitehorn Date: Fri Nov 12 20:26:34 2010 New Revision: 215197 URL: http://svn.freebsd.org/changeset/base/215197 Log: Partially revert r215182. There appears to be a silicon bug on the 970 that causes AP bringup to fail if some of the Cell HID-register code is anywhere in the instruction stream. Pending a better solution, cache performance on SMP Cell systems running without a hypervisor will be suboptimal. Modified: head/sys/powerpc/aim/mp_cpudep.c Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Fri Nov 12 20:01:53 2010 (r215196) +++ head/sys/powerpc/aim/mp_cpudep.c Fri Nov 12 20:26:34 2010 (r215197) @@ -228,8 +228,8 @@ cpudep_save_config(void *dummy) powerpc_sync(); break; -#ifdef __powerpc64__ case IBMCELLBE: + #ifdef NOTYET /* Causes problems if in instruction stream on 970 */ if (mfmsr() & PSL_HV) { bsp_state[0] = mfspr(SPR_HID0); bsp_state[1] = mfspr(SPR_HID1); @@ -238,11 +238,11 @@ cpudep_save_config(void *dummy) bsp_state[4] = mfspr(SPR_CELL_TSCR); } + #endif bsp_state[5] = mfspr(SPR_CELL_TSRL); break; -#endif case MPC7450: case MPC7455: case MPC7457: @@ -303,8 +303,8 @@ cpudep_ap_setup() powerpc_sync(); break; -#ifdef __powerpc64__ case IBMCELLBE: + #ifdef NOTYET /* Causes problems if in instruction stream on 970 */ if (mfmsr() & PSL_HV) { mtspr(SPR_HID0, bsp_state[0]); mtspr(SPR_HID1, bsp_state[1]); @@ -313,11 +313,11 @@ cpudep_ap_setup() mtspr(SPR_CELL_TSCR, bsp_state[4]); } + #endif mtspr(SPR_CELL_TSRL, bsp_state[5]); break; -#endif case MPC7450: case MPC7455: case MPC7457: From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 20:45:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BCE4106564A; Fri, 12 Nov 2010 20:45:22 +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 49E058FC15; Fri, 12 Nov 2010 20:45:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACKjMYR022869; Fri, 12 Nov 2010 20:45:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACKjMT3022867; Fri, 12 Nov 2010 20:45:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011122045.oACKjMT3022867@svn.freebsd.org> From: Michael Tuexen Date: Fri, 12 Nov 2010 20:45: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: r215198 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 20:45:22 -0000 Author: tuexen Date: Fri Nov 12 20:45:21 2010 New Revision: 215198 URL: http://svn.freebsd.org/changeset/base/215198 Log: Fix more issues with the SACK/NR-SACK generation code. MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Nov 12 20:26:34 2010 (r215197) +++ head/sys/netinet/sctp_output.c Fri Nov 12 20:45:21 2010 (r215198) @@ -9927,13 +9927,14 @@ sctp_send_sack(struct sctp_tcb *stcb) caddr_t limit; uint32_t *dup; int limit_reached = 0; - unsigned int i, sel_start, siz, j; + unsigned int i, siz, j; unsigned int num_gap_blocks = 0, num_nr_gap_blocks = 0, space; int num_dups = 0; int space_req; uint32_t highest_tsn; uint8_t flags; uint8_t type; + uint8_t tsn_map; if ((stcb->asoc.sctp_nr_sack_on_off == 1) && (stcb->asoc.peer_supports_nr_sack == 1)) { @@ -10123,24 +10124,24 @@ sctp_send_sack(struct sctp_tcb *stcb) } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } - if ((offset == 1) || - ((type == SCTP_NR_SELECTIVE_ACK) && - ((asoc->mapping_array[0] & (1 << (1 - offset))) == 0))) { - sel_start = 0; - } else { - sel_start = 1; - } if (((type == SCTP_SELECTIVE_ACK) && compare_with_wrap(highest_tsn, asoc->cumulative_tsn, MAX_TSN)) || ((type == SCTP_NR_SELECTIVE_ACK) && compare_with_wrap(asoc->highest_tsn_inside_map, asoc->cumulative_tsn, MAX_TSN))) { /* we have a gap .. maybe */ for (i = 0; i < siz; i++) { + tsn_map = asoc->mapping_array[i]; if (type == SCTP_SELECTIVE_ACK) { - selector = &sack_array[asoc->mapping_array[i] | asoc->nr_mapping_array[i]]; - } else { - selector = &sack_array[asoc->mapping_array[i]]; + tsn_map |= asoc->nr_mapping_array[i]; + } + if (i == 0) { + /* + * Clear all bits corresponding to TSNs + * smaller or equal to the cumulative TSN. + */ + tsn_map &= (~0 << (1 - offset)); } + selector = &sack_array[tsn_map]; if (mergeable && selector->right_edge) { /* * Backup, left and right edges were ok to @@ -10152,7 +10153,7 @@ sctp_send_sack(struct sctp_tcb *stcb) if (selector->num_entries == 0) mergeable = 0; else { - for (j = sel_start; j < selector->num_entries; j++) { + for (j = 0; j < selector->num_entries; j++) { if (mergeable && selector->right_edge) { /* * do a merge by NOT setting @@ -10184,7 +10185,6 @@ sctp_send_sack(struct sctp_tcb *stcb) /* Reached the limit stop */ break; } - sel_start = 0; offset += 8; } } @@ -10199,11 +10199,6 @@ sctp_send_sack(struct sctp_tcb *stcb) siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + asoc->highest_tsn_inside_nr_map + 7) / 8; } - if ((asoc->nr_mapping_array[0] & (1 << (1 - offset))) == 0) { - sel_start = 0; - } else { - sel_start = 1; - } if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { offset = 1; } else { @@ -10212,7 +10207,16 @@ sctp_send_sack(struct sctp_tcb *stcb) if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn, MAX_TSN)) { /* we have a gap .. maybe */ for (i = 0; i < siz; i++) { - selector = &sack_array[asoc->nr_mapping_array[i]]; + tsn_map = asoc->nr_mapping_array[i]; + if (i == 0) { + /* + * Clear all bits corresponding to + * TSNs smaller or equal to the + * cumulative TSN. + */ + tsn_map &= (~0 << (1 - offset)); + } + selector = &sack_array[tsn_map]; if (mergeable && selector->right_edge) { /* * Backup, left and right edges were @@ -10224,7 +10228,7 @@ sctp_send_sack(struct sctp_tcb *stcb) if (selector->num_entries == 0) mergeable = 0; else { - for (j = sel_start; j < selector->num_entries; j++) { + for (j = 0; j < selector->num_entries; j++) { if (mergeable && selector->right_edge) { /* * do a merge by NOT @@ -10257,7 +10261,6 @@ sctp_send_sack(struct sctp_tcb *stcb) /* Reached the limit stop */ break; } - sel_start = 0; offset += 8; } } From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 20:46:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 066501065673; Fri, 12 Nov 2010 20:46:34 +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 E8BBF8FC26; Fri, 12 Nov 2010 20:46:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACKkX60022932; Fri, 12 Nov 2010 20:46:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACKkXK8022930; Fri, 12 Nov 2010 20:46:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011122046.oACKkXK8022930@svn.freebsd.org> From: Michael Tuexen Date: Fri, 12 Nov 2010 20:46: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: r215199 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 20:46:34 -0000 Author: tuexen Date: Fri Nov 12 20:46:33 2010 New Revision: 215199 URL: http://svn.freebsd.org/changeset/base/215199 Log: Don't print an empty line when printing mapping arrays. MFC after: 3 days. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Nov 12 20:45:21 2010 (r215198) +++ head/sys/netinet/sctputil.c Fri Nov 12 20:46:33 2010 (r215199) @@ -1212,8 +1212,6 @@ sctp_print_mapping_array(struct sctp_ass printf("Renegable mapping array (last %d entries are zero):\n", asoc->mapping_array_size - limit); for (i = 0; i < limit; i++) { printf("%2.2x%c", asoc->mapping_array[i], ((i + 1) % 16) ? ' ' : '\n'); - if (((i + 1) % 16) == 0) - printf("\n"); } if (limit % 16) printf("\n"); From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 20:55:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 083691065674; Fri, 12 Nov 2010 20:55:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E99468FC18; Fri, 12 Nov 2010 20:55:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACKtE4Y023175; Fri, 12 Nov 2010 20:55:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACKtEjQ023170; Fri, 12 Nov 2010 20:55:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011122055.oACKtEjQ023170@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 12 Nov 2010 20:55: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: r215200 - in head/sys: conf i386/acpica modules/acpi/acpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 20:55:15 -0000 Author: jkim Date: Fri Nov 12 20:55:14 2010 New Revision: 215200 URL: http://svn.freebsd.org/changeset/base/215200 Log: MFamd64: (based on) r209957 Move logic of building ACPI headers for acpi_wakeup.c into better places, remove intermediate makefile and shell script, and reduce diff between i386 and amd64. Deleted: head/sys/i386/acpica/Makefile head/sys/i386/acpica/genwakecode.sh Modified: head/sys/conf/files.i386 head/sys/i386/acpica/acpi_wakecode.S head/sys/i386/acpica/acpi_wakeup.c head/sys/modules/acpi/acpi/Makefile Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Nov 12 20:46:33 2010 (r215199) +++ head/sys/conf/files.i386 Fri Nov 12 20:55:14 2010 (r215200) @@ -239,13 +239,28 @@ dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/wpi/if_wpi.c optional wpi i386/acpica/acpi_machdep.c optional acpi -i386/acpica/acpi_wakeup.c optional acpi -acpi_wakecode.h optional acpi \ - dependency "$S/i386/acpica/acpi_wakecode.S assym.s" \ - compile-with "${MAKE} -f $S/i386/acpica/Makefile MAKESRCPATH=$S/i386/acpica" \ +acpi_wakecode.o optional acpi \ + dependency "$S/i386/acpica/acpi_wakecode.S assym.s" \ + compile-with "${NORMAL_S}" \ no-obj no-implicit-rule before-depend \ - clean "acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin" + clean "acpi_wakecode.o" +acpi_wakecode.bin optional acpi \ + dependency "acpi_wakecode.o" \ + compile-with "objcopy -S -O binary acpi_wakecode.o ${.TARGET}" \ + no-obj no-implicit-rule before-depend \ + clean "acpi_wakecode.bin" +acpi_wakecode.h optional acpi \ + dependency "acpi_wakecode.bin" \ + compile-with "file2c -sx 'static char wakecode[] = {' '};' < acpi_wakecode.bin > ${.TARGET}" \ + no-obj no-implicit-rule before-depend \ + clean "acpi_wakecode.h" +acpi_wakedata.h optional acpi \ + dependency "acpi_wakecode.o" \ + compile-with '${NM} -n --defined-only acpi_wakecode.o | while read offset dummy what; do echo "#define $${what} 0x$${offset}"; done > ${.TARGET}' \ + no-obj no-implicit-rule before-depend \ + clean "acpi_wakedata.h" # +i386/acpica/acpi_wakeup.c optional acpi i386/bios/apm.c optional apm i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi Modified: head/sys/i386/acpica/acpi_wakecode.S ============================================================================== --- head/sys/i386/acpica/acpi_wakecode.S Fri Nov 12 20:46:33 2010 (r215199) +++ head/sys/i386/acpica/acpi_wakecode.S Fri Nov 12 20:55:14 2010 (r215200) @@ -27,8 +27,6 @@ * $FreeBSD$ */ -#define LOCORE - #include #include Modified: head/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- head/sys/i386/acpica/acpi_wakeup.c Fri Nov 12 20:46:33 2010 (r215199) +++ head/sys/i386/acpica/acpi_wakeup.c Fri Nov 12 20:55:14 2010 (r215200) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include "acpi_wakecode.h" +#include "acpi_wakedata.h" /* Make sure the code is less than one page and leave room for the stack. */ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); Modified: head/sys/modules/acpi/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/acpi/Makefile Fri Nov 12 20:46:33 2010 (r215199) +++ head/sys/modules/acpi/acpi/Makefile Fri Nov 12 20:55:14 2010 (r215200) @@ -96,23 +96,24 @@ opt_ddb.h: Makefile .endif # Machine-specific code such as sleep/wakeup -SRCS+= acpi_apm.c acpi_machdep.c acpi_wakecode.h acpi_wakeup.c +SRCS+= acpi_apm.c acpi_machdep.c acpi_wakecode.h acpi_wakedata.h acpi_wakeup.c SRCS+= assym.s madt.c -CLEANFILES+= acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o +CLEANFILES+=acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o acpi_wakedata.h SRCS+= opt_global.h +ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} +NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} +NM?= nm + .if ${MACHINE_CPUARCH} == "amd64" .if !defined(KERNBUILDDIR) CFLAGS+=-DSMP .endif -SRCS+= acpi_switch.S acpi_wakedata.h -CLEANFILES+= acpi_wakedata.h -ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} -NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} -NM?= nm +SRCS+= acpi_switch.S acpi_switch.o: acpi_switch.S ${NORMAL_S} +.endif acpi_wakecode.o: acpi_wakecode.S assym.s ${NORMAL_S} acpi_wakecode.bin: acpi_wakecode.o @@ -125,10 +126,5 @@ acpi_wakedata.h: acpi_wakecode.o while read offset dummy what; do \ echo "#define $${what} 0x$${offset}"; \ done > ${.TARGET} -.else -acpi_wakecode.h: acpi_wakecode.S assym.s - ${MAKE} -f ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica/Makefile \ - MAKESRCPATH=${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica -.endif .include From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 21:11:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 032B710656D5; Fri, 12 Nov 2010 21:11:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E59A08FC0A; Fri, 12 Nov 2010 21:11:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACLBnrt023599; Fri, 12 Nov 2010 21:11:49 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACLBnui023597; Fri, 12 Nov 2010 21:11:49 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011122111.oACLBnui023597@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 12 Nov 2010 21:11: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: r215201 - head/sys/modules/acpi/acpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 21:11:50 -0000 Author: jkim Date: Fri Nov 12 21:11:49 2010 New Revision: 215201 URL: http://svn.freebsd.org/changeset/base/215201 Log: Warn users that acpi.ko is deprecated and exit immediately unless the user set FORCE_BUILD. This is to avoid foot-shooting while making MFC to stable branches easier. Discussed with: jhb Modified: head/sys/modules/acpi/acpi/Makefile Modified: head/sys/modules/acpi/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/acpi/Makefile Fri Nov 12 20:55:14 2010 (r215200) +++ head/sys/modules/acpi/acpi/Makefile Fri Nov 12 21:11:49 2010 (r215201) @@ -1,5 +1,9 @@ # $FreeBSD$ +.if !defined(FORCE_BUILD) +.error "The ACPI module is deprecated, set FORCE_BUILD to force it" +.endif + .if ${MACHINE_CPUARCH} == "ia64" .error "ACPI can only be compiled into the kernel on the ia64 platform" .endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 22:03:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54BFD1065673; Fri, 12 Nov 2010 22:03:02 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40DC08FC16; Fri, 12 Nov 2010 22:03:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACM32NO024947; Fri, 12 Nov 2010 22:03:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACM32cN024939; Fri, 12 Nov 2010 22:03:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201011122203.oACM32cN024939@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 12 Nov 2010 22:03: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: r215207 - in head: sys/net sys/netinet tools/regression/netinet/arphold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 22:03:02 -0000 Author: gnn Date: Fri Nov 12 22:03:02 2010 New Revision: 215207 URL: http://svn.freebsd.org/changeset/base/215207 Log: Add a queue to hold packets while we await an ARP reply. When a fast machine first brings up some non TCP networking program it is quite possible that we will drop packets due to the fact that only one packet can be held per ARP entry. This leads to packets being missed when a program starts or restarts if the ARP data is not currently in the ARP cache. This code adds a new sysctl, net.link.ether.inet.maxhold, which defines a system wide maximum number of packets to be held in each ARP entry. Up to maxhold packets are queued until an ARP reply is received or the ARP times out. The default setting is the old value of 1 which has been part of the BSD networking code since time immemorial. Expose the time we hold an incomplete ARP entry by adding the sysctl net.link.ether.inet.wait, which defaults to 20 seconds, the value used when the new ARP code was added.. Reviewed by: bz, rpaulo MFC after: 3 weeks Added: head/tools/regression/netinet/arphold/ head/tools/regression/netinet/arphold/Makefile (contents, props changed) head/tools/regression/netinet/arphold/arphold.c (contents, props changed) head/tools/regression/netinet/arphold/arphold.t (contents, props changed) Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/netinet/if_ether.c head/sys/netinet/in.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Fri Nov 12 21:47:36 2010 (r215206) +++ head/sys/net/if_llatbl.c Fri Nov 12 22:03:02 2010 (r215207) @@ -100,18 +100,34 @@ done: * This function is called by the timer functions * such as arptimer() and nd6_llinfo_timer(), and * the caller does the locking. + * + * Returns the number of held packets, if any, that were dropped. */ -void +size_t llentry_free(struct llentry *lle) { - + size_t pkts_dropped; + struct mbuf *next; + + pkts_dropped = 0; LLE_WLOCK_ASSERT(lle); LIST_REMOVE(lle, lle_next); - if (lle->la_hold != NULL) + while ((lle->la_numheld > 0) && (lle->la_hold != NULL)) { + next = lle->la_hold->m_nextpkt; m_freem(lle->la_hold); + lle->la_hold = next; + lle->la_numheld--; + pkts_dropped++; + } + + KASSERT(lle->la_numheld == 0, + ("%s: la_numheld %d > 0, pkts_droped %ld", __func__, + lle->la_numheld, pkts_dropped)); LLE_FREE_LOCKED(lle); + + return (pkts_dropped); } /* @@ -412,6 +428,7 @@ llatbl_lle_show(struct llentry_sa *la) db_printf(" lle_tbl=%p\n", lle->lle_tbl); db_printf(" lle_head=%p\n", lle->lle_head); db_printf(" la_hold=%p\n", lle->la_hold); + db_printf(" la_numheld=%d\n", lle->la_numheld); db_printf(" la_expire=%ju\n", (uintmax_t)lle->la_expire); db_printf(" la_flags=0x%04x\n", lle->la_flags); db_printf(" la_asked=%u\n", lle->la_asked); Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Fri Nov 12 21:47:36 2010 (r215206) +++ head/sys/net/if_llatbl.h Fri Nov 12 22:03:02 2010 (r215207) @@ -58,6 +58,7 @@ struct llentry { struct lltable *lle_tbl; struct llentries *lle_head; struct mbuf *la_hold; + int la_numheld; /* # of packets currently held */ time_t la_expire; uint16_t la_flags; uint16_t la_asked; @@ -191,7 +192,7 @@ void lltable_drain(int); #endif int lltable_sysctl_dumparp(int, struct sysctl_req *); -void llentry_free(struct llentry *); +size_t llentry_free(struct llentry *); int llentry_update(struct llentry **, struct lltable *, struct sockaddr_storage *, struct ifnet *); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Nov 12 21:47:36 2010 (r215206) +++ head/sys/netinet/if_ether.c Fri Nov 12 22:03:02 2010 (r215207) @@ -89,13 +89,16 @@ VNET_DEFINE(int, useloopback) = 1; /* us static VNET_DEFINE(int, arp_proxyall) = 0; static VNET_DEFINE(int, arpt_down) = 20; /* keep incomplete entries for * 20 seconds */ -static VNET_DEFINE(struct arpstat, arpstat); /* ARP statistics, see if_arp.h */ +VNET_DEFINE(struct arpstat, arpstat); /* ARP statistics, see if_arp.h */ + +static VNET_DEFINE(int, arp_maxhold) = 1; #define V_arpt_keep VNET(arpt_keep) #define V_arpt_down VNET(arpt_down) #define V_arp_maxtries VNET(arp_maxtries) #define V_arp_proxyall VNET(arp_proxyall) #define V_arpstat VNET(arpstat) +#define V_arp_maxhold VNET(arp_maxhold) SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW, &VNET_NAME(arpt_keep), 0, @@ -109,9 +112,15 @@ SYSCTL_VNET_INT(_net_link_ether_inet, OI SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW, &VNET_NAME(arp_proxyall), 0, "Enable proxy ARP for all suitable requests"); +SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, wait, CTLFLAG_RW, + &VNET_NAME(arpt_down), 0, + "Incomplete ARP entry lifetime in seconds"); SYSCTL_VNET_STRUCT(_net_link_ether_arp, OID_AUTO, stats, CTLFLAG_RW, &VNET_NAME(arpstat), arpstat, "ARP statistics (struct arpstat, net/if_arp.h)"); +SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, maxhold, CTLFLAG_RW, + &VNET_NAME(arp_maxhold), 0, + "Number of packets to hold per ARP entry"); static void arp_init(void); void arprequest(struct ifnet *, @@ -162,6 +171,7 @@ arptimer(void *arg) { struct ifnet *ifp; struct llentry *lle; + int pkts_dropped; KASSERT(arg != NULL, ("%s: arg NULL", __func__)); lle = (struct llentry *)arg; @@ -176,7 +186,8 @@ arptimer(void *arg) callout_active(&lle->la_timer)) { callout_stop(&lle->la_timer); LLE_REMREF(lle); - (void) llentry_free(lle); + pkts_dropped = llentry_free(lle); + ARPSTAT_ADD(dropped, pkts_dropped); ARPSTAT_INC(timeouts); } else { #ifdef DIAGNOSTIC @@ -275,6 +286,8 @@ arpresolve(struct ifnet *ifp, struct rte { struct llentry *la = 0; u_int flags = 0; + struct mbuf *curr = NULL; + struct mbuf *next = NULL; int error, renew; *lle = NULL; @@ -348,15 +361,28 @@ retry: } /* * There is an arptab entry, but no ethernet address - * response yet. Replace the held mbuf with this - * latest one. + * response yet. Add the mbuf to the list, dropping + * the oldest packet if we have exceeded the system + * setting. */ if (m != NULL) { + if (la->la_numheld >= V_arp_maxhold) { + if (la->la_hold != NULL) { + next = la->la_hold->m_nextpkt; + m_freem(la->la_hold); + la->la_hold = next; + la->la_numheld--; + ARPSTAT_INC(dropped); + } + } if (la->la_hold != NULL) { - m_freem(la->la_hold); - ARPSTAT_INC(dropped); - } - la->la_hold = m; + curr = la->la_hold; + while (curr->m_nextpkt != NULL) + curr = curr->m_nextpkt; + curr->m_nextpkt = m; + } else + la->la_hold = m; + la->la_numheld++; if (renew == 0 && (flags & LLE_EXCLUSIVE)) { flags &= ~LLE_EXCLUSIVE; LLE_DOWNGRADE(la); @@ -483,7 +509,6 @@ in_arpinput(struct mbuf *m) struct rtentry *rt; struct ifaddr *ifa; struct in_ifaddr *ia; - struct mbuf *hold; struct sockaddr sa; struct in_addr isaddr, itaddr, myaddr; u_int8_t *enaddr = NULL; @@ -698,15 +723,29 @@ match: } la->la_asked = 0; la->la_preempt = V_arp_maxtries; - hold = la->la_hold; - if (hold != NULL) { - la->la_hold = NULL; + /* + * The packets are all freed within the call to the output + * routine. + * + * NB: The lock MUST be released before the call to the + * output routine. + */ + if (la->la_hold != NULL) { + struct mbuf *m_hold, *m_hold_next; + memcpy(&sa, L3_ADDR(la), sizeof(sa)); - } - LLE_WUNLOCK(la); - if (hold != NULL) - (*ifp->if_output)(ifp, hold, &sa, NULL); - } + LLE_WUNLOCK(la); + for (m_hold = la->la_hold, la->la_hold = NULL; + m_hold != NULL; m_hold = m_hold_next) { + m_hold_next = m_hold->m_nextpkt; + m_hold->m_nextpkt = NULL; + (*ifp->if_output)(ifp, m_hold, &sa, NULL); + } + } else + LLE_WUNLOCK(la); + la->la_hold = NULL; + la->la_numheld = 0; + } /* end of FIB loop */ reply: if (op != ARPOP_REQUEST) goto drop; Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri Nov 12 21:47:36 2010 (r215206) +++ head/sys/netinet/in.c Fri Nov 12 22:03:02 2010 (r215207) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -89,6 +90,9 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, VNET_DECLARE(struct inpcbinfo, ripcbinfo); #define V_ripcbinfo VNET(ripcbinfo) +VNET_DECLARE(struct arpstat, arpstat); /* ARP statistics, see if_arp.h */ +#define V_arpstat VNET(arpstat) + /* * Return 1 if an internet address is for a ``local'' host * (one to which we have a connection). If subnetsarelocal @@ -1363,6 +1367,7 @@ in_lltable_prefix_free(struct lltable *l const struct sockaddr_in *msk = (const struct sockaddr_in *)mask; struct llentry *lle, *next; register int i; + size_t pkts_dropped; for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { @@ -1375,7 +1380,8 @@ in_lltable_prefix_free(struct lltable *l LLE_WLOCK(lle); if (canceled) LLE_REMREF(lle); - llentry_free(lle); + pkts_dropped = llentry_free(lle); + ARPSTAT_ADD(dropped, pkts_dropped); } } } Added: head/tools/regression/netinet/arphold/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/netinet/arphold/Makefile Fri Nov 12 22:03:02 2010 (r215207) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= arphold +NO_MAN= +CFLAGS+= -Wall + +.include Added: head/tools/regression/netinet/arphold/arphold.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/netinet/arphold/arphold.c Fri Nov 12 22:03:02 2010 (r215207) @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2010 Advanced Computing Technologies LLC + * Written by George Neville-Neil gnn@freebsd.org + * 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. + * + * Description: The following is a test of the arp entry packet queues + * which replaced the single packet hold entry that existed in the BSDs + * since time immemorial. The test process is: + * + * 1) Find out the current system limit (maxhold) + * 2) Using an IP address for which we do not yet have an entry + * load up an ARP entry packet queue with exactly that many packets. + * 3) Check the arp dropped stat to make sure that we have not dropped + * any packets as yet. + * 4) Add one more packet to the queue. + * 5) Make sure that only one packet was dropped. + * + * CAVEAT: The ARP timer will flush the queue after 1 second so it is + * important not to run this code in a fast loop or the test will + * fail. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MSG_SIZE 1024 +#define PORT 6969 + +int +main(int argc, char **argv) +{ + + int sock; + int maxhold; + int wait; + size_t size = sizeof(maxhold); + struct sockaddr_in dest; + char message[MSG_SIZE]; + struct arpstat arpstat; + size_t len = sizeof(arpstat); + unsigned long dropped = 0; + + memset(&message, 1, sizeof(message)); + + if (sysctlbyname("net.link.ether.inet.maxhold", &maxhold, &size, + NULL, 0) < 0) { + perror("not ok 1 - sysctlbyname failed"); + exit(1); + } + +#ifdef DEBUG + printf("maxhold is %d\n", maxhold); +#endif /* DEBUG */ + + if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { + perror("not ok 1 - could not open socket"); + exit(1); + } + + bzero(&dest, sizeof(dest)); + if (inet_pton(AF_INET, argv[1], &dest.sin_addr.s_addr) != 1) { + perror("not ok 1 - could not parse address"); + exit(1); + } + dest.sin_len = sizeof(dest); + dest.sin_family = AF_INET; + dest.sin_port = htons(PORT); + + if (sysctlbyname("net.link.ether.arp.stats", &arpstat, &len, + NULL, 0) < 0) { + perror("not ok 1 - could not get initial arp stats"); + exit(1); + } + + dropped = arpstat.dropped; +#ifdef DEBUG + printf("dropped before %ld\n", dropped); +#endif /* DEBUG */ + + /* + * Load up the queue in the ARP entry to the maximum. + * We should not drop any packets at this point. + */ + + while (maxhold > 0) { + if (sendto(sock, message, sizeof(message), 0, + (struct sockaddr *)&dest, sizeof(dest)) < 0) { + perror("not ok 1 - could not send packet"); + exit(1); + } + maxhold--; + } + + if (sysctlbyname("net.link.ether.arp.stats", &arpstat, &len, + NULL, 0) < 0) { + perror("not ok 1 - could not get new arp stats"); + exit(1); + } + +#ifdef DEBUG + printf("dropped after %ld\n", arpstat.dropped); +#endif /* DEBUG */ + + if (arpstat.dropped != dropped) { + printf("not ok 1 - Failed, drops changed:" + "before %ld after %ld\n", dropped, arpstat.dropped); + exit(1); + } + + dropped = arpstat.dropped; + + /* Now add one extra and make sure it is dropped. */ + if (sendto(sock, message, sizeof(message), 0, + (struct sockaddr *)&dest, sizeof(dest)) < 0) { + perror("not ok 1 - could not send packet"); + exit(1); + } + + if (sysctlbyname("net.link.ether.arp.stats", &arpstat, &len, + NULL, 0) < 0) { + perror("not ok 1 - could not get new arp stats"); + exit(1); + } + + if (arpstat.dropped != (dropped + 1)) { + printf("not ok 1 - Failed to drop one packet: before" + " %ld after %ld\n", dropped, arpstat.dropped); + exit(1); + } + + printf("ok\n"); + return (0); +} Added: head/tools/regression/netinet/arphold/arphold.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/netinet/arphold/arphold.t Fri Nov 12 22:03:02 2010 (r215207) @@ -0,0 +1,7 @@ +#!/bin/sh +# +# $FreeBSD$ + +make arphold 2>&1 > /dev/null + +./arphold 192.168.1.222 From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 22:28:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A49A5106566C; Fri, 12 Nov 2010 22:28:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C648FC0C; Fri, 12 Nov 2010 22:28:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACMSl48025786; Fri, 12 Nov 2010 22:28:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACMSlb3025784; Fri, 12 Nov 2010 22:28:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011122228.oACMSlb3025784@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 12 Nov 2010 22:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215209 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 22:28:47 -0000 Author: jilles Date: Fri Nov 12 22:28:47 2010 New Revision: 215209 URL: http://svn.freebsd.org/changeset/base/215209 Log: sh(1): Update for r214492. "${v+"hi}there"}". The part hi}there is not a quoted string but nevertheless the closing brace does not terminate the expansion. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Nov 12 22:10:19 2010 (r215208) +++ head/bin/sh/sh.1 Fri Nov 12 22:28:47 2010 (r215209) @@ -1268,19 +1268,22 @@ consists of all characters until the mat .Ql } . Any .Ql } -escaped by a backslash or within a single-quoted string, and characters in +escaped by a backslash or within a single-quoted or double-quoted +string, and characters in embedded arithmetic expansions, command substitutions, and variable expansions, are not examined in determining the matching .Ql } . -Except for the variants with +If the variants with .Ql + , .Ql - , .Ql = or -.Ql ?\& , -any +.Ql ?\& +occur within a double-quoted string, +as an extension there may be unquoted parts +(via double-quotes inside the expansion); .Ql } -within a double-quoted string is also not examined in determining the matching +within such parts are also not examined in determining the matching .Ql } . .Pp The simplest form for parameter expansion is: From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 22:40:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 294781065675; Fri, 12 Nov 2010 22:40:19 +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 1779E8FC13; Fri, 12 Nov 2010 22:40:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACMeIsR026130; Fri, 12 Nov 2010 22:40:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACMeIeO026128; Fri, 12 Nov 2010 22:40:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011122240.oACMeIeO026128@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 12 Nov 2010 22:40: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: r215210 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 22:40:19 -0000 Author: jilles Date: Fri Nov 12 22:40:18 2010 New Revision: 215210 URL: http://svn.freebsd.org/changeset/base/215210 Log: sh(1): Document r214304 (special builtin is illegal function name). Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Nov 12 22:28:47 2010 (r215209) +++ head/bin/sh/sh.1 Fri Nov 12 22:40:18 2010 (r215210) @@ -626,6 +626,7 @@ There are two kinds of built-in commands Assignments before special builtins persist after they finish executing and assignment errors, redirection errors and certain operand errors cause a script to be aborted. +Special builtins cannot be overridden with a function. Both regular and special builtins can affect the shell in ways normal programs cannot. .Pp From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 22:43:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C5231065670; Fri, 12 Nov 2010 22:43:40 +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 4A6228FC12; Fri, 12 Nov 2010 22:43:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACMhebR026265; Fri, 12 Nov 2010 22:43:40 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACMheEO026263; Fri, 12 Nov 2010 22:43:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011122243.oACMheEO026263@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 12 Nov 2010 22: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: r215211 - head/bin/echo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 22:43:40 -0000 Author: jilles Date: Fri Nov 12 22:43:40 2010 New Revision: 215211 URL: http://svn.freebsd.org/changeset/base/215211 Log: echo(1): Clarify portability and mention literal "--" handling. MFC after: 1 week Modified: head/bin/echo/echo.1 Modified: head/bin/echo/echo.1 ============================================================================== --- head/bin/echo/echo.1 Fri Nov 12 22:40:18 2010 (r215210) +++ head/bin/echo/echo.1 Fri Nov 12 22:43:40 2010 (r215211) @@ -32,7 +32,7 @@ .\" @(#)echo.1 8.1 (Berkeley) 7/22/93 .\" $FreeBSD$ .\" -.Dd April 12, 2003 +.Dd November 12, 2010 .Dt ECHO 1 .Os .Sh NAME @@ -56,24 +56,37 @@ The following option is available: .Bl -tag -width flag .It Fl n Do not print the trailing newline character. -This may also be achieved by appending +.El +.Pp +The end-of-options marker +.Fl Fl +is not recognized and written literally. +.Pp +The newline may also be suppressed by appending .Ql \ec to the end of the string, as is done by iBCS2 compatible systems. -Note that this option as well as the effect of +Note that the +.Fl n +option as well as the effect of .Ql \ec are implementation-defined in .St -p1003.1-2001 as amended by Cor.\& 1-2002. -Applications aiming for maximum -portability are strongly encouraged to use +For portability, +.Nm +should only be used if the first argument does not start with a hyphen +.Pq Ql "-" +and does not contain any backslashes +.Pq Ql "\e" . +If this is not sufficient, .Xr printf 1 -to suppress the newline character. -.El +should be used. .Pp -Some shells may provide a builtin +Most shells provide a builtin .Nm -command which is similar or identical to this utility. +command which tends to differ from this utility +in the treatment of options and backslashes. Consult the .Xr builtin 1 manual page. From owner-svn-src-all@FreeBSD.ORG Fri Nov 12 22:59:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07C3C10656C2; Fri, 12 Nov 2010 22:59:51 +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 EA3D98FC14; Fri, 12 Nov 2010 22:59:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oACMxomw026902; Fri, 12 Nov 2010 22:59:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oACMxoIV026900; Fri, 12 Nov 2010 22:59:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201011122259.oACMxoIV026900@svn.freebsd.org> From: Dimitry Andric Date: Fri, 12 Nov 2010 22:59: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: r215212 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 22:59:51 -0000 Author: dim Date: Fri Nov 12 22:59:50 2010 New Revision: 215212 URL: http://svn.freebsd.org/changeset/base/215212 Log: Similar to r212647, remove the workaround in sys/net/vnet.h for an ld bug (incorrect placement of __start_SECNAME in some cases) that was fixed in r210245. There is already an UPDATING entry about needing a recent ld. MFC after: 1 month Modified: head/sys/net/vnet.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Fri Nov 12 22:43:40 2010 (r215211) +++ head/sys/net/vnet.h Fri Nov 12 22:59:50 2010 (r215212) @@ -193,15 +193,6 @@ extern struct sx vnet_sxlock; * Virtual network stack memory allocator, which allows global variables to * be automatically instantiated for each network stack instance. */ -__asm__( -#if defined(__arm__) - ".section " VNET_SETNAME ", \"aw\", %progbits\n" -#else - ".section " VNET_SETNAME ", \"aw\", @progbits\n" -#endif - "\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n" - "\t.previous"); - #define VNET_NAME(n) vnet_entry_##n #define VNET_DECLARE(t, n) extern t VNET_NAME(n) #define VNET_DEFINE(t, n) t VNET_NAME(n) __section(VNET_SETNAME) __used From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 00:40:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 305B91065672; Sat, 13 Nov 2010 00:40:44 +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 1D1E38FC1F; Sat, 13 Nov 2010 00:40:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD0ei0n029105; Sat, 13 Nov 2010 00:40:44 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD0ehWw029100; Sat, 13 Nov 2010 00:40:43 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201011130040.oAD0ehWw029100@svn.freebsd.org> From: Brooks Davis Date: Sat, 13 Nov 2010 00:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215213 - in head: etc/defaults etc/periodic/security share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 00:40:44 -0000 Author: brooks Date: Sat Nov 13 00:40:43 2010 New Revision: 215213 URL: http://svn.freebsd.org/changeset/base/215213 Log: Add an (off by default) check for negative permissions (where the group on a object has less permissions that everyone). These permissions will not work reliably over NFS if you have more than 14 supplemental groups and are usually not what you mean. MFC after: 1 week Added: head/etc/periodic/security/110.neggrpperm - copied, changed from r213358, head/etc/periodic/security/100.chksetuid Modified: head/etc/defaults/periodic.conf head/etc/periodic/security/Makefile head/share/man/man5/periodic.conf.5 Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Fri Nov 12 22:59:50 2010 (r215212) +++ head/etc/defaults/periodic.conf Sat Nov 13 00:40:43 2010 (r215213) @@ -160,6 +160,9 @@ daily_status_security_diff_flags="-b -u" # 100.chksetuid daily_status_security_chksetuid_enable="YES" +# 110.neggrpperm +daily_status_security_neggrpperm_enable="NO" + # 200.chkmounts daily_status_security_chkmounts_enable="YES" #daily_status_security_chkmounts_ignore="^amd:" # Don't check matching Copied and modified: head/etc/periodic/security/110.neggrpperm (from r213358, head/etc/periodic/security/100.chksetuid) ============================================================================== --- head/etc/periodic/security/100.chksetuid Sat Oct 2 11:45:18 2010 (r213358, copy source) +++ head/etc/periodic/security/110.neggrpperm Sat Nov 13 00:40:43 2010 (r215213) @@ -35,23 +35,19 @@ then source_periodic_confs fi -. /etc/periodic/security/security.functions - rc=0 -case "$daily_status_security_chksetuid_enable" in +case "$daily_status_security_neggrpperm_enable" in [Yy][Ee][Ss]) echo "" - echo 'Checking setuid files and devices:' + echo 'Checking negative group permissions:' MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'` - find -sx $MP /dev/null -type f \ - \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \ - \( -perm -u+s -or -perm -g+s \) -exec ls -liTd \{\} \+ | - check_diff setuid - "${host} setuid diffs:" - rc=$? - ;; - *) - rc=0 + n=$(find -sx $MP /dev/null -type f \ + \( \( ! -perm +010 -and -perm +001 \) -or \ + \( ! -perm +020 -and -perm +002 \) -or \ + \( ! -perm +040 -and -perm +004 \) \) \ + -exec ls -liTd \{\} \+ | tee /dev/stderr | wc -l) + [ $n -gt 0 ] && rc=1 || rc=0 ;; esac Modified: head/etc/periodic/security/Makefile ============================================================================== --- head/etc/periodic/security/Makefile Fri Nov 12 22:59:50 2010 (r215212) +++ head/etc/periodic/security/Makefile Sat Nov 13 00:40:43 2010 (r215213) @@ -3,6 +3,7 @@ .include FILES= 100.chksetuid \ + 110.neggrpperm \ 200.chkmounts \ 300.chkuid0 \ 400.passwdless \ Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Fri Nov 12 22:59:50 2010 (r215212) +++ head/share/man/man5/periodic.conf.5 Sat Nov 13 00:40:43 2010 (r215213) @@ -482,6 +482,14 @@ Set to .Dq Li YES to compare the modes and modification times of setuid executables with the previous day's values. +.It Va daily_status_security_neggrpperm_enable +.Pq Vt bool +Set to +.Dq Li YES +to check for files where the group of a file has less permissions than +the world at large. +When users are in more than 14 supplemental groups these negative +permissions may not be enforced via NFS shares. .It Va daily_status_security_chkmounts_enable .Pq Vt bool Set to From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 00:46:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2AF4106564A; Sat, 13 Nov 2010 00:46:07 +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 BF5438FC12; Sat, 13 Nov 2010 00:46:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD0k72g029263; Sat, 13 Nov 2010 00:46:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD0k7Ii029261; Sat, 13 Nov 2010 00:46:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130046.oAD0k7Ii029261@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 00:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215214 - stable/8/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 00:46:07 -0000 Author: yongari Date: Sat Nov 13 00:46:07 2010 New Revision: 215214 URL: http://svn.freebsd.org/changeset/base/215214 Log: MFC r214898: If we got an invalid station address, generate random address. This might be caused by broken BIOS. Reported by: "Mikhail T." aldan.algebra.com> Modified: stable/8/sys/dev/sk/if_sk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sk/if_sk.c ============================================================================== --- stable/8/sys/dev/sk/if_sk.c Sat Nov 13 00:40:43 2010 (r215213) +++ stable/8/sys/dev/sk/if_sk.c Sat Nov 13 00:46:07 2010 (r215214) @@ -1319,8 +1319,10 @@ sk_attach(dev) struct sk_softc *sc; struct sk_if_softc *sc_if; struct ifnet *ifp; + u_int32_t r; int error, i, phy, port; u_char eaddr[6]; + u_char inv_mac[] = {0, 0, 0, 0, 0, 0}; if (dev == NULL) return(EINVAL); @@ -1400,6 +1402,23 @@ sk_attach(dev) eaddr[i] = sk_win_read_1(sc, SK_MAC0_0 + (port * 8) + i); + /* Verify whether the station address is invalid or not. */ + if (bcmp(eaddr, inv_mac, sizeof(inv_mac)) == 0) { + device_printf(sc_if->sk_if_dev, + "Generating random ethernet address\n"); + r = arc4random(); + /* + * Set OUI to convenient locally assigned address. 'b' + * is 0x62, which has the locally assigned bit set, and + * the broadcast/multicast bit clear. + */ + eaddr[0] = 'b'; + eaddr[1] = 's'; + eaddr[2] = 'd'; + eaddr[3] = (r >> 16) & 0xff; + eaddr[4] = (r >> 8) & 0xff; + eaddr[5] = (r >> 0) & 0xff; + } /* * Set up RAM buffer addresses. The NIC will have a certain * amount of SRAM on it, somewhere between 512K and 2MB. We From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 00:54:00 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C386E106564A; Sat, 13 Nov 2010 00:54:00 +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 2B9948FC15; Sat, 13 Nov 2010 00:53:59 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 5EB177E853; Sat, 13 Nov 2010 11:35:20 +1100 (EST) Message-ID: <4CDDDD44.9070907@freebsd.org> Date: Sat, 13 Nov 2010 11:35:16 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.9) Gecko/20101006 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: src-committers@FreeBSD.org References: <201011120641.oAC6fui3098584@svn.freebsd.org> In-Reply-To: <201011120641.oAC6fui3098584@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=T_FRT_STOCK2, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Andre Oppermann Subject: Re: svn commit: r215166 - in head: . sys/conf sys/netinet sys/netinet/cc sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 00:54:00 -0000 On 11/12/10 17:41, Lawrence Stewart wrote: > Author: lstewart > Date: Fri Nov 12 06:41:55 2010 > New Revision: 215166 > URL: http://svn.freebsd.org/changeset/base/215166 > > Log: > This commit marks the first formal contribution of the "Five New TCP Congestion > Control Algorithms for FreeBSD" FreeBSD Foundation funded project. More details > about the project are available at: http://caia.swin.edu.au/freebsd/5cc/ > > - Add a KPI and supporting infrastructure to allow modular congestion control > algorithms to be used in the net stack. Algorithms can maintain per-connection > state if required, and connections maintain their own algorithm pointer, which > allows different connections to concurrently use different algorithms. The > TCP_CONGESTION socket option can be used with getsockopt()/setsockopt() to > programmatically query or change the congestion control algorithm respectively > from within an application at runtime. > > - Integrate the framework with the TCP stack in as least intrusive a manner as > possible. Care was also taken to develop the framework in a way that should > allow integration with other congestion aware transport protocols (e.g. SCTP) > in the future. The hope is that we will one day be able to share a single set > of congestion control algorithm modules between all congestion aware transport > protocols. > > - Introduce a new congestion recovery (TF_CONGRECOVERY) state into the TCP stack > and use it to decouple the meaning of recovery from a congestion event and > recovery from packet loss (TF_FASTRECOVERY) a la RFC2581. ECN and delay based > congestion control protocols don't generally need to recover from packet loss > and need a different way to note a congestion recovery episode within the > stack. > > - Remove the net.inet.tcp.newreno sysctl, which simplifies some portions of code > and ensures the stack always uses the appropriate mechanisms for recovering > from packet loss during a congestion recovery episode. > > - Extract the NewReno congestion control algorithm from the TCP stack and > massage it into module form. NewReno is always built into the kernel and will > remain the default algorithm for the forseeable future. Implementations of > additional different algorithms will become available in the near future. > > - Bump __FreeBSD_version to 900025 and note in UPDATING that rebuilding code > that relies on the size of "struct tcpcb" is required. > > Many thanks go to the Cisco University Research Program Fund at Community > Foundation Silicon Valley and the FreeBSD Foundation. Their support of our work > at the Centre for Advanced Internet Architectures, Swinburne University of > Technology is greatly appreciated. > > In collaboration with: David Hayes and > Grenville Armitage > Sponsored by: Cisco URP, FreeBSD Foundation > Reviewed by: rpaulo > Tested by: David Hayes (and many others over the years) > MFC after: 3 months > > Added: > head/sys/netinet/cc/ > head/sys/netinet/cc.h (contents, props changed) > head/sys/netinet/cc/cc.c (contents, props changed) > head/sys/netinet/cc/cc_module.h (contents, props changed) > head/sys/netinet/cc/cc_newreno.c (contents, props changed) > Modified: > head/UPDATING > head/sys/conf/files > head/sys/netinet/tcp_input.c > head/sys/netinet/tcp_output.c > head/sys/netinet/tcp_sack.c > head/sys/netinet/tcp_subr.c > head/sys/netinet/tcp_timer.c > head/sys/netinet/tcp_usrreq.c > head/sys/netinet/tcp_var.h > head/sys/sys/param.h I screwed up a bit, and this commit also includes a diff to disable seeding cwnd from the hostcache. Details about the issue and the diff are here: http://lists.freebsd.org/pipermail/freebsd-net/2010-November/026865.html I should have gotten Andre to commit his patch first before committing the modular CC patch, but I had pulled his patch into my development tree and it all got rolled into one. To avoid a lot of mucking about, I plan to do a direct commit MFC to the stable branches of only Andre's patch in a week's time so that it makes it into 7.4/8.2. The MFC schedule for the remainder of the modular CC patch will stay as it was at 3 months. Once the modular CC work is MFC'd, the mergeinfo will go back to being properly in sync and life will be good again. Apologies for the mess. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 00:55:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 010DE1065672; Sat, 13 Nov 2010 00:55:17 +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 E1D1A8FC16; Sat, 13 Nov 2010 00:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD0tGQ6029488; Sat, 13 Nov 2010 00:55:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD0tGLR029486; Sat, 13 Nov 2010 00:55:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130055.oAD0tGLR029486@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 00:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215215 - stable/7/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 00:55:17 -0000 Author: yongari Date: Sat Nov 13 00:55:16 2010 New Revision: 215215 URL: http://svn.freebsd.org/changeset/base/215215 Log: MFC r214898: If we got an invalid station address, generate random address. This might be caused by broken BIOS. Reported by: "Mikhail T." aldan.algebra.com> Modified: stable/7/sys/dev/sk/if_sk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sk/if_sk.c ============================================================================== --- stable/7/sys/dev/sk/if_sk.c Sat Nov 13 00:46:07 2010 (r215214) +++ stable/7/sys/dev/sk/if_sk.c Sat Nov 13 00:55:16 2010 (r215215) @@ -1319,8 +1319,10 @@ sk_attach(dev) struct sk_softc *sc; struct sk_if_softc *sc_if; struct ifnet *ifp; + u_int32_t r; int error, i, phy, port; u_char eaddr[6]; + u_char inv_mac[] = {0, 0, 0, 0, 0, 0}; if (dev == NULL) return(EINVAL); @@ -1402,6 +1404,23 @@ sk_attach(dev) eaddr[i] = sk_win_read_1(sc, SK_MAC0_0 + (port * 8) + i); + /* Verify whether the station address is invalid or not. */ + if (bcmp(eaddr, inv_mac, sizeof(inv_mac)) == 0) { + device_printf(sc_if->sk_if_dev, + "Generating random ethernet address\n"); + r = arc4random(); + /* + * Set OUI to convenient locally assigned address. 'b' + * is 0x62, which has the locally assigned bit set, and + * the broadcast/multicast bit clear. + */ + eaddr[0] = 'b'; + eaddr[1] = 's'; + eaddr[2] = 'd'; + eaddr[3] = (r >> 16) & 0xff; + eaddr[4] = (r >> 8) & 0xff; + eaddr[5] = (r >> 0) & 0xff; + } /* * Set up RAM buffer addresses. The NIC will have a certain * amount of SRAM on it, somewhere between 512K and 2MB. We From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 00:58:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FAF410656A5; Sat, 13 Nov 2010 00:58:35 +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 E67958FC1D; Sat, 13 Nov 2010 00:58:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD0wYgj029608; Sat, 13 Nov 2010 00:58:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD0wYhD029606; Sat, 13 Nov 2010 00:58:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130058.oAD0wYhD029606@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 00:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215216 - stable/8/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 00:58:35 -0000 Author: yongari Date: Sat Nov 13 00:58:34 2010 New Revision: 215216 URL: http://svn.freebsd.org/changeset/base/215216 Log: MFC r214899: Fix a long standing bug in programming station address for Yukon controllers. sk(4) never reprogrammed station address for Yukon controllers so overriding station address with ifconfig(8) was not possible. Fix the bug by reprogramming all registers that control station address, flow-control and virtual station address. Virtual station address has no use at this moment since driver does not make use of fail over feature. Tested by: "Mikhail T." aldan.algebra.com> Modified: stable/8/sys/dev/sk/if_sk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sk/if_sk.c ============================================================================== --- stable/8/sys/dev/sk/if_sk.c Sat Nov 13 00:55:16 2010 (r215215) +++ stable/8/sys/dev/sk/if_sk.c Sat Nov 13 00:58:34 2010 (r215216) @@ -3356,6 +3356,7 @@ sk_init_yukon(sc_if) u_int16_t reg; struct sk_softc *sc; struct ifnet *ifp; + u_int8_t *eaddr; int i; SK_IF_LOCK_ASSERT(sc_if); @@ -3431,19 +3432,19 @@ sk_init_yukon(sc_if) reg |= YU_SMR_MFL_JUMBO; SK_YU_WRITE_2(sc_if, YUKON_SMR, reg); - /* Setup Yukon's address */ - for (i = 0; i < 3; i++) { - /* Write Source Address 1 (unicast filter) */ + /* Setup Yukon's station address */ + eaddr = IF_LLADDR(sc_if->sk_ifp); + for (i = 0; i < 3; i++) + SK_YU_WRITE_2(sc_if, SK_MAC0_0 + i * 4, + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); + /* Set GMAC source address of flow control. */ + for (i = 0; i < 3; i++) SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4, - IF_LLADDR(sc_if->sk_ifp)[i * 2] | - IF_LLADDR(sc_if->sk_ifp)[i * 2 + 1] << 8); - } - - for (i = 0; i < 3; i++) { - reg = sk_win_read_2(sc_if->sk_softc, - SK_MAC1_0 + i * 2 + sc_if->sk_port * 8); - SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, reg); - } + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); + /* Set GMAC virtual address. */ + for (i = 0; i < 3; i++) + SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); /* Set Rx filter */ sk_rxfilter_yukon(sc_if); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:00:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22EFB1065670; Sat, 13 Nov 2010 01:00:01 +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 D9E6B8FC0A; Sat, 13 Nov 2010 01:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD100QS029687; Sat, 13 Nov 2010 01:00:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD100q2029685; Sat, 13 Nov 2010 01:00:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130100.oAD100q2029685@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 01:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215217 - stable/7/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:00:01 -0000 Author: yongari Date: Sat Nov 13 01:00:00 2010 New Revision: 215217 URL: http://svn.freebsd.org/changeset/base/215217 Log: MFC r214899: Fix a long standing bug in programming station address for Yukon controllers. sk(4) never reprogrammed station address for Yukon controllers so overriding station address with ifconfig(8) was not possible. Fix the bug by reprogramming all registers that control station address, flow-control and virtual station address. Virtual station address has no use at this moment since driver does not make use of fail over feature. Tested by: "Mikhail T." aldan.algebra.com> Modified: stable/7/sys/dev/sk/if_sk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sk/if_sk.c ============================================================================== --- stable/7/sys/dev/sk/if_sk.c Sat Nov 13 00:58:34 2010 (r215216) +++ stable/7/sys/dev/sk/if_sk.c Sat Nov 13 01:00:00 2010 (r215217) @@ -3358,6 +3358,7 @@ sk_init_yukon(sc_if) u_int16_t reg; struct sk_softc *sc; struct ifnet *ifp; + u_int8_t *eaddr; int i; SK_IF_LOCK_ASSERT(sc_if); @@ -3433,19 +3434,19 @@ sk_init_yukon(sc_if) reg |= YU_SMR_MFL_JUMBO; SK_YU_WRITE_2(sc_if, YUKON_SMR, reg); - /* Setup Yukon's address */ - for (i = 0; i < 3; i++) { - /* Write Source Address 1 (unicast filter) */ + /* Setup Yukon's station address */ + eaddr = IF_LLADDR(sc_if->sk_ifp); + for (i = 0; i < 3; i++) + SK_YU_WRITE_2(sc_if, SK_MAC0_0 + i * 4, + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); + /* Set GMAC source address of flow control. */ + for (i = 0; i < 3; i++) SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4, - IF_LLADDR(sc_if->sk_ifp)[i * 2] | - IF_LLADDR(sc_if->sk_ifp)[i * 2 + 1] << 8); - } - - for (i = 0; i < 3; i++) { - reg = sk_win_read_2(sc_if->sk_softc, - SK_MAC1_0 + i * 2 + sc_if->sk_port * 8); - SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, reg); - } + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); + /* Set GMAC virtual address. */ + for (i = 0; i < 3; i++) + SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, + eaddr[i * 2] | eaddr[i * 2 + 1] << 8); /* Set Rx filter */ sk_rxfilter_yukon(sc_if); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:02:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34FD41065674; Sat, 13 Nov 2010 01:02:10 +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 21CCF8FC0A; Sat, 13 Nov 2010 01:02:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD12AMj029815; Sat, 13 Nov 2010 01:02:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD12Agi029813; Sat, 13 Nov 2010 01:02:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130102.oAD12Agi029813@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 01:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215218 - stable/8/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:02:10 -0000 Author: yongari Date: Sat Nov 13 01:02:09 2010 New Revision: 215218 URL: http://svn.freebsd.org/changeset/base/215218 Log: MFC r214840: Enable 64bit DMA addressing for RTL810xE/RTL8168/RTL8111 PCIe controllers. Some old PCI controllers may work with DAC but it was known to be buggy so 64bit DMA addressing is used only on PCIe controllers. Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Sat Nov 13 01:00:00 2010 (r215217) +++ stable/8/sys/dev/re/if_re.c Sat Nov 13 01:02:09 2010 (r215218) @@ -934,6 +934,7 @@ re_dma_map_addr(void *arg, bus_dma_segme static int re_allocmem(device_t dev, struct rl_softc *sc) { + bus_addr_t lowaddr; bus_size_t rx_list_size, tx_list_size; int error; int i; @@ -947,10 +948,13 @@ re_allocmem(device_t dev, struct rl_soft * register should be set. However some RealTek chips are known * to be buggy on DAC handling, therefore disable DAC by limiting * DMA address space to 32bit. PCIe variants of RealTek chips - * may not have the limitation but I took safer path. + * may not have the limitation. */ + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->rl_flags & RL_FLAG_PCIE) == 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->rl_parent_tag); if (error) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:03:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AB69106566C; Sat, 13 Nov 2010 01:03:34 +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 2777F8FC1B; Sat, 13 Nov 2010 01:03:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD13Yxu029889; Sat, 13 Nov 2010 01:03:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD13YUZ029887; Sat, 13 Nov 2010 01:03:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130103.oAD13YUZ029887@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 01:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215219 - stable/7/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:03:34 -0000 Author: yongari Date: Sat Nov 13 01:03:33 2010 New Revision: 215219 URL: http://svn.freebsd.org/changeset/base/215219 Log: MFC r214840: Enable 64bit DMA addressing for RTL810xE/RTL8168/RTL8111 PCIe controllers. Some old PCI controllers may work with DAC but it was known to be buggy so 64bit DMA addressing is used only on PCIe controllers. Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Sat Nov 13 01:02:09 2010 (r215218) +++ stable/7/sys/dev/re/if_re.c Sat Nov 13 01:03:33 2010 (r215219) @@ -935,6 +935,7 @@ re_dma_map_addr(void *arg, bus_dma_segme static int re_allocmem(device_t dev, struct rl_softc *sc) { + bus_addr_t lowaddr; bus_size_t rx_list_size, tx_list_size; int error; int i; @@ -948,10 +949,13 @@ re_allocmem(device_t dev, struct rl_soft * register should be set. However some RealTek chips are known * to be buggy on DAC handling, therefore disable DAC by limiting * DMA address space to 32bit. PCIe variants of RealTek chips - * may not have the limitation but I took safer path. + * may not have the limitation. */ + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->rl_flags & RL_FLAG_PCIE) == 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->rl_parent_tag); if (error) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:05:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B8321065696; Sat, 13 Nov 2010 01:05:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F24D78FC14; Sat, 13 Nov 2010 01:05:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD15lLN029995; Sat, 13 Nov 2010 01:05:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD15lXT029993; Sat, 13 Nov 2010 01:05:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130105.oAD15lXT029993@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 01:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215220 - stable/8/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:05:48 -0000 Author: yongari Date: Sat Nov 13 01:05:47 2010 New Revision: 215220 URL: http://svn.freebsd.org/changeset/base/215220 Log: MFC r214841-214842: r214841: Remove extra white spaces. r214842: style(9). Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Sat Nov 13 01:03:33 2010 (r215219) +++ stable/8/sys/dev/re/if_re.c Sat Nov 13 01:05:47 2010 (r215220) @@ -880,7 +880,7 @@ re_probe(device_t dev) uint16_t devid, vendor; uint16_t revid, sdevid; int i; - + vendor = pci_get_vendor(dev); devid = pci_get_device(dev); revid = pci_get_revid(dev); @@ -1121,7 +1121,7 @@ re_attach(device_t dev) /* * Prefer memory space register mapping over IO space. * Because RTL8169SC does not seem to work when memory mapping - * is used always activate io mapping. + * is used always activate io mapping. */ if (devid == RT_DEVICEID_8169SC) prefer_iomap = 1; @@ -2020,9 +2020,9 @@ re_rxeof(struct rl_softc *sc, int *rx_np if (rx_npktsp != NULL) *rx_npktsp = rx_npkts; if (maxpkt) - return(EAGAIN); + return (EAGAIN); - return(0); + return (0); } static void @@ -2111,7 +2111,7 @@ re_tick(void *xsc) * Reclaim transmitted frames here. Technically it is not * necessary to do here but it ensures periodic reclamation * regardless of Tx completion interrupt which seems to be - * lost on PCIe based controllers under certain situations. + * lost on PCIe based controllers under certain situations. */ re_txeof(sc); re_watchdog(sc); @@ -2839,7 +2839,7 @@ re_ioctl(struct ifnet *ifp, u_long comma if (ifr->ifr_reqcap & IFCAP_POLLING) { error = ether_poll_register(re_poll, ifp); if (error) - return(error); + return (error); RL_LOCK(sc); /* Disable interrupts */ CSR_WRITE_2(sc, RL_IMR, 0x0000); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:07:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46CA8106564A; Sat, 13 Nov 2010 01:07:46 +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 193F78FC08; Sat, 13 Nov 2010 01:07:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD17jm3030097; Sat, 13 Nov 2010 01:07:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD17jRB030095; Sat, 13 Nov 2010 01:07:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130107.oAD17jRB030095@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 01:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215221 - stable/7/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:07:46 -0000 Author: yongari Date: Sat Nov 13 01:07:45 2010 New Revision: 215221 URL: http://svn.freebsd.org/changeset/base/215221 Log: MFC r214841-214842: r214841: Remove extra white spaces. r214842: style(9). Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Sat Nov 13 01:05:47 2010 (r215220) +++ stable/7/sys/dev/re/if_re.c Sat Nov 13 01:07:45 2010 (r215221) @@ -881,7 +881,7 @@ re_probe(device_t dev) uint16_t devid, vendor; uint16_t revid, sdevid; int i; - + vendor = pci_get_vendor(dev); devid = pci_get_device(dev); revid = pci_get_revid(dev); @@ -1122,7 +1122,7 @@ re_attach(device_t dev) /* * Prefer memory space register mapping over IO space. * Because RTL8169SC does not seem to work when memory mapping - * is used always activate io mapping. + * is used always activate io mapping. */ if (devid == RT_DEVICEID_8169SC) prefer_iomap = 1; @@ -2018,9 +2018,9 @@ re_rxeof(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = i; if (maxpkt) - return(EAGAIN); + return (EAGAIN); - return(0); + return (0); } static void @@ -2109,7 +2109,7 @@ re_tick(void *xsc) * Reclaim transmitted frames here. Technically it is not * necessary to do here but it ensures periodic reclamation * regardless of Tx completion interrupt which seems to be - * lost on PCIe based controllers under certain situations. + * lost on PCIe based controllers under certain situations. */ re_txeof(sc); re_watchdog(sc); @@ -2833,7 +2833,7 @@ re_ioctl(struct ifnet *ifp, u_long comma if (ifr->ifr_reqcap & IFCAP_POLLING) { error = ether_poll_register(re_poll, ifp); if (error) - return(error); + return (error); RL_LOCK(sc); /* Disable interrupts */ CSR_WRITE_2(sc, RL_IMR, 0x0000); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:09:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 122E0106564A; Sat, 13 Nov 2010 01:09:45 +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 F1D868FC14; Sat, 13 Nov 2010 01:09:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD19iW3030183; Sat, 13 Nov 2010 01:09:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD19iI5030180; Sat, 13 Nov 2010 01:09:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130109.oAD19iI5030180@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 01:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215222 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:09:45 -0000 Author: yongari Date: Sat Nov 13 01:09:44 2010 New Revision: 215222 URL: http://svn.freebsd.org/changeset/base/215222 Log: MFC r214844: Add simple MAC statistics counter reading support. Unfortunately useful counters like rl_missed_pkts is 16 bits quantity which is too small to hold meaningful information happened in a second. This means driver should frequently read these counters in order not to lose accuracy and that approach is too inefficient in driver's view. Moreover it seems there is no way to trigger an interrupt to detect counter near-full or wraparound event as well as lacking clearing the MAC counters. Another limitation of reading the counters from RealTek controllers is lack of interrupt firing at the end of DMA cycle of MAC counter read request such that driver have to poll the end of the DMA which is a time consuming process as well as inefficient. The more severe issue of the MAC counter read request is it takes too long to complete the DMA. All these limitation made maintaining MAC counters in driver impractical. For now, just provide simple sysctl interface to trigger reading the MAC counters. These counters could be used to track down driver issues. Users can read MAC counters maintained in controller with the following command. #sysctl dev.re.0.stats=1 While I'm here add check for validity of dma map and allocated memory before unloading/freeing them. Tested by: rmacklem Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Sat Nov 13 01:07:45 2010 (r215221) +++ stable/8/sys/dev/re/if_re.c Sat Nov 13 01:09:44 2010 (r215222) @@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -281,6 +282,9 @@ static void re_clrwol (struct rl_softc static int re_diag (struct rl_softc *); #endif +static void re_add_sysctls (struct rl_softc *); +static int re_sysctl_stats (SYSCTL_HANDLER_ARGS); + static device_method_t re_methods[] = { /* Device interface */ DEVMETHOD(device_probe, re_probe), @@ -1084,6 +1088,35 @@ re_allocmem(device_t dev, struct rl_soft } } + /* Create DMA map for statistics. */ + error = bus_dma_tag_create(sc->rl_parent_tag, RL_DUMP_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + sizeof(struct rl_stats), 1, sizeof(struct rl_stats), 0, NULL, NULL, + &sc->rl_ldata.rl_stag); + if (error) { + device_printf(dev, "could not create statistics DMA tag\n"); + return (error); + } + /* Allocate DMA'able memory for statistics. */ + error = bus_dmamem_alloc(sc->rl_ldata.rl_stag, + (void **)&sc->rl_ldata.rl_stats, + BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, + &sc->rl_ldata.rl_smap); + if (error) { + device_printf(dev, + "could not allocate statistics DMA memory\n"); + return (error); + } + /* Load the map for statistics. */ + sc->rl_ldata.rl_stats_addr = 0; + error = bus_dmamap_load(sc->rl_ldata.rl_stag, sc->rl_ldata.rl_smap, + sc->rl_ldata.rl_stats, sizeof(struct rl_stats), re_dma_map_addr, + &sc->rl_ldata.rl_stats_addr, BUS_DMA_NOWAIT); + if (error != 0 || sc->rl_ldata.rl_stats_addr == 0) { + device_printf(dev, "could not load statistics DMA memory\n"); + return (ENOMEM); + } + return (0); } @@ -1374,6 +1407,7 @@ re_attach(device_t dev) error = re_allocmem(dev, sc); if (error) goto fail; + re_add_sysctls(sc); ifp = sc->rl_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1603,22 +1637,26 @@ re_detach(device_t dev) /* Unload and free the RX DMA ring memory and map */ if (sc->rl_ldata.rl_rx_list_tag) { - bus_dmamap_unload(sc->rl_ldata.rl_rx_list_tag, - sc->rl_ldata.rl_rx_list_map); - bus_dmamem_free(sc->rl_ldata.rl_rx_list_tag, - sc->rl_ldata.rl_rx_list, - sc->rl_ldata.rl_rx_list_map); + if (sc->rl_ldata.rl_rx_list_map) + bus_dmamap_unload(sc->rl_ldata.rl_rx_list_tag, + sc->rl_ldata.rl_rx_list_map); + if (sc->rl_ldata.rl_rx_list_map && sc->rl_ldata.rl_rx_list) + bus_dmamem_free(sc->rl_ldata.rl_rx_list_tag, + sc->rl_ldata.rl_rx_list, + sc->rl_ldata.rl_rx_list_map); bus_dma_tag_destroy(sc->rl_ldata.rl_rx_list_tag); } /* Unload and free the TX DMA ring memory and map */ if (sc->rl_ldata.rl_tx_list_tag) { - bus_dmamap_unload(sc->rl_ldata.rl_tx_list_tag, - sc->rl_ldata.rl_tx_list_map); - bus_dmamem_free(sc->rl_ldata.rl_tx_list_tag, - sc->rl_ldata.rl_tx_list, - sc->rl_ldata.rl_tx_list_map); + if (sc->rl_ldata.rl_tx_list_map) + bus_dmamap_unload(sc->rl_ldata.rl_tx_list_tag, + sc->rl_ldata.rl_tx_list_map); + if (sc->rl_ldata.rl_tx_list_map && sc->rl_ldata.rl_tx_list) + bus_dmamem_free(sc->rl_ldata.rl_tx_list_tag, + sc->rl_ldata.rl_tx_list, + sc->rl_ldata.rl_tx_list_map); bus_dma_tag_destroy(sc->rl_ldata.rl_tx_list_tag); } @@ -1643,11 +1681,12 @@ re_detach(device_t dev) /* Unload and free the stats buffer and map */ if (sc->rl_ldata.rl_stag) { - bus_dmamap_unload(sc->rl_ldata.rl_stag, - sc->rl_ldata.rl_rx_list_map); - bus_dmamem_free(sc->rl_ldata.rl_stag, - sc->rl_ldata.rl_stats, - sc->rl_ldata.rl_smap); + if (sc->rl_ldata.rl_smap) + bus_dmamap_unload(sc->rl_ldata.rl_stag, + sc->rl_ldata.rl_smap); + if (sc->rl_ldata.rl_smap && sc->rl_ldata.rl_stats) + bus_dmamem_free(sc->rl_ldata.rl_stag, + sc->rl_ldata.rl_stats, sc->rl_ldata.rl_smap); bus_dma_tag_destroy(sc->rl_ldata.rl_stag); } @@ -3185,3 +3224,88 @@ re_clrwol(struct rl_softc *sc) v &= ~RL_CFG5_WOL_LANWAKE; CSR_WRITE_1(sc, RL_CFG5, v); } + +static void +re_add_sysctls(struct rl_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *children; + + ctx = device_get_sysctl_ctx(sc->rl_dev); + children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I", + "Statistics Information"); +} + +static int +re_sysctl_stats(SYSCTL_HANDLER_ARGS) +{ + struct rl_softc *sc; + struct rl_stats *stats; + int error, i, result; + + result = -1; + error = sysctl_handle_int(oidp, &result, 0, req); + if (error || req->newptr == NULL) + return (error); + + if (result == 1) { + sc = (struct rl_softc *)arg1; + RL_LOCK(sc); + bus_dmamap_sync(sc->rl_ldata.rl_stag, + sc->rl_ldata.rl_smap, BUS_DMASYNC_PREREAD); + CSR_WRITE_4(sc, RL_DUMPSTATS_HI, + RL_ADDR_HI(sc->rl_ldata.rl_stats_addr)); + CSR_WRITE_4(sc, RL_DUMPSTATS_LO, + RL_ADDR_LO(sc->rl_ldata.rl_stats_addr)); + CSR_WRITE_4(sc, RL_DUMPSTATS_LO, + RL_ADDR_LO(sc->rl_ldata.rl_stats_addr | + RL_DUMPSTATS_START)); + for (i = RL_TIMEOUT; i > 0; i--) { + if ((CSR_READ_4(sc, RL_DUMPSTATS_LO) & + RL_DUMPSTATS_START) == 0) + break; + DELAY(1000); + } + bus_dmamap_sync(sc->rl_ldata.rl_stag, + sc->rl_ldata.rl_smap, BUS_DMASYNC_POSTREAD); + RL_UNLOCK(sc); + if (i == 0) { + device_printf(sc->rl_dev, + "DUMP statistics request timedout\n"); + return (ETIMEDOUT); + } + stats = sc->rl_ldata.rl_stats; + printf("%s statistics:\n", device_get_nameunit(sc->rl_dev)); + printf("Tx frames : %ju\n", + (uintmax_t)le64toh(stats->rl_tx_pkts)); + printf("Rx frames : %ju\n", + (uintmax_t)le64toh(stats->rl_rx_pkts)); + printf("Tx errors : %ju\n", + (uintmax_t)le64toh(stats->rl_tx_errs)); + printf("Rx errors : %u\n", + le32toh(stats->rl_rx_errs)); + printf("Rx missed frames : %u\n", + (uint32_t)le16toh(stats->rl_missed_pkts)); + printf("Rx frame alignment errs : %u\n", + (uint32_t)le16toh(stats->rl_rx_framealign_errs)); + printf("Tx single collisions : %u\n", + le32toh(stats->rl_tx_onecoll)); + printf("Tx multiple collisions : %u\n", + le32toh(stats->rl_tx_multicolls)); + printf("Rx unicast frames : %ju\n", + (uintmax_t)le64toh(stats->rl_rx_ucasts)); + printf("Rx broadcast frames : %ju\n", + (uintmax_t)le64toh(stats->rl_rx_bcasts)); + printf("Rx multicast frames : %u\n", + le32toh(stats->rl_rx_mcasts)); + printf("Tx aborts : %u\n", + (uint32_t)le16toh(stats->rl_tx_aborts)); + printf("Tx underruns : %u\n", + (uint32_t)le16toh(stats->rl_rx_underruns)); + } + + return (error); +} Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Sat Nov 13 01:07:45 2010 (r215221) +++ stable/8/sys/pci/if_rlreg.h Sat Nov 13 01:09:44 2010 (r215222) @@ -723,19 +723,16 @@ struct rl_desc { * Statistics counter structure (8139C+ and 8169 only) */ struct rl_stats { - uint32_t rl_tx_pkts_lo; - uint32_t rl_tx_pkts_hi; - uint32_t rl_tx_errs_lo; - uint32_t rl_tx_errs_hi; - uint32_t rl_tx_errs; + uint64_t rl_tx_pkts; + uint64_t rl_rx_pkts; + uint64_t rl_tx_errs; + uint32_t rl_rx_errs; uint16_t rl_missed_pkts; uint16_t rl_rx_framealign_errs; uint32_t rl_tx_onecoll; uint32_t rl_tx_multicolls; - uint32_t rl_rx_ucasts_hi; - uint32_t rl_rx_ucasts_lo; - uint32_t rl_rx_bcasts_lo; - uint32_t rl_rx_bcasts_hi; + uint64_t rl_rx_ucasts; + uint64_t rl_rx_bcasts; uint32_t rl_rx_mcasts; uint16_t rl_tx_aborts; uint16_t rl_rx_underruns; @@ -769,6 +766,7 @@ struct rl_stats { #define RL_NTXSEGS 32 #define RL_RING_ALIGN 256 +#define RL_DUMP_ALIGN 64 #define RL_IFQ_MAXLEN 512 #define RL_TX_DESC_NXT(sc,x) ((x + 1) & ((sc)->rl_ldata.rl_tx_desc_cnt - 1)) #define RL_TX_DESC_PRV(sc,x) ((x - 1) & ((sc)->rl_ldata.rl_tx_desc_cnt - 1)) From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:11:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31D0B106566B; Sat, 13 Nov 2010 01:11:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB068FC12; Sat, 13 Nov 2010 01:11:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD1BE4t030280; Sat, 13 Nov 2010 01:11:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD1BDVk030277; Sat, 13 Nov 2010 01:11:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011130111.oAD1BDVk030277@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 13 Nov 2010 01:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215223 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:11:14 -0000 Author: yongari Date: Sat Nov 13 01:11:13 2010 New Revision: 215223 URL: http://svn.freebsd.org/changeset/base/215223 Log: MFC r214844: Add simple MAC statistics counter reading support. Unfortunately useful counters like rl_missed_pkts is 16 bits quantity which is too small to hold meaningful information happened in a second. This means driver should frequently read these counters in order not to lose accuracy and that approach is too inefficient in driver's view. Moreover it seems there is no way to trigger an interrupt to detect counter near-full or wraparound event as well as lacking clearing the MAC counters. Another limitation of reading the counters from RealTek controllers is lack of interrupt firing at the end of DMA cycle of MAC counter read request such that driver have to poll the end of the DMA which is a time consuming process as well as inefficient. The more severe issue of the MAC counter read request is it takes too long to complete the DMA. All these limitation made maintaining MAC counters in driver impractical. For now, just provide simple sysctl interface to trigger reading the MAC counters. These counters could be used to track down driver issues. Users can read MAC counters maintained in controller with the following command. #sysctl dev.re.0.stats=1 While I'm here add check for validity of dma map and allocated memory before unloading/freeing them. Tested by: rmacklem Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Sat Nov 13 01:09:44 2010 (r215222) +++ stable/7/sys/dev/re/if_re.c Sat Nov 13 01:11:13 2010 (r215223) @@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -281,6 +282,9 @@ static void re_clrwol (struct rl_softc static int re_diag (struct rl_softc *); #endif +static void re_add_sysctls (struct rl_softc *); +static int re_sysctl_stats (SYSCTL_HANDLER_ARGS); + static device_method_t re_methods[] = { /* Device interface */ DEVMETHOD(device_probe, re_probe), @@ -1085,6 +1089,35 @@ re_allocmem(device_t dev, struct rl_soft } } + /* Create DMA map for statistics. */ + error = bus_dma_tag_create(sc->rl_parent_tag, RL_DUMP_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + sizeof(struct rl_stats), 1, sizeof(struct rl_stats), 0, NULL, NULL, + &sc->rl_ldata.rl_stag); + if (error) { + device_printf(dev, "could not create statistics DMA tag\n"); + return (error); + } + /* Allocate DMA'able memory for statistics. */ + error = bus_dmamem_alloc(sc->rl_ldata.rl_stag, + (void **)&sc->rl_ldata.rl_stats, + BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, + &sc->rl_ldata.rl_smap); + if (error) { + device_printf(dev, + "could not allocate statistics DMA memory\n"); + return (error); + } + /* Load the map for statistics. */ + sc->rl_ldata.rl_stats_addr = 0; + error = bus_dmamap_load(sc->rl_ldata.rl_stag, sc->rl_ldata.rl_smap, + sc->rl_ldata.rl_stats, sizeof(struct rl_stats), re_dma_map_addr, + &sc->rl_ldata.rl_stats_addr, BUS_DMA_NOWAIT); + if (error != 0 || sc->rl_ldata.rl_stats_addr == 0) { + device_printf(dev, "could not load statistics DMA memory\n"); + return (ENOMEM); + } + return (0); } @@ -1375,6 +1408,7 @@ re_attach(device_t dev) error = re_allocmem(dev, sc); if (error) goto fail; + re_add_sysctls(sc); ifp = sc->rl_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1604,22 +1638,26 @@ re_detach(device_t dev) /* Unload and free the RX DMA ring memory and map */ if (sc->rl_ldata.rl_rx_list_tag) { - bus_dmamap_unload(sc->rl_ldata.rl_rx_list_tag, - sc->rl_ldata.rl_rx_list_map); - bus_dmamem_free(sc->rl_ldata.rl_rx_list_tag, - sc->rl_ldata.rl_rx_list, - sc->rl_ldata.rl_rx_list_map); + if (sc->rl_ldata.rl_rx_list_map) + bus_dmamap_unload(sc->rl_ldata.rl_rx_list_tag, + sc->rl_ldata.rl_rx_list_map); + if (sc->rl_ldata.rl_rx_list_map && sc->rl_ldata.rl_rx_list) + bus_dmamem_free(sc->rl_ldata.rl_rx_list_tag, + sc->rl_ldata.rl_rx_list, + sc->rl_ldata.rl_rx_list_map); bus_dma_tag_destroy(sc->rl_ldata.rl_rx_list_tag); } /* Unload and free the TX DMA ring memory and map */ if (sc->rl_ldata.rl_tx_list_tag) { - bus_dmamap_unload(sc->rl_ldata.rl_tx_list_tag, - sc->rl_ldata.rl_tx_list_map); - bus_dmamem_free(sc->rl_ldata.rl_tx_list_tag, - sc->rl_ldata.rl_tx_list, - sc->rl_ldata.rl_tx_list_map); + if (sc->rl_ldata.rl_tx_list_map) + bus_dmamap_unload(sc->rl_ldata.rl_tx_list_tag, + sc->rl_ldata.rl_tx_list_map); + if (sc->rl_ldata.rl_tx_list_map && sc->rl_ldata.rl_tx_list) + bus_dmamem_free(sc->rl_ldata.rl_tx_list_tag, + sc->rl_ldata.rl_tx_list, + sc->rl_ldata.rl_tx_list_map); bus_dma_tag_destroy(sc->rl_ldata.rl_tx_list_tag); } @@ -1644,11 +1682,12 @@ re_detach(device_t dev) /* Unload and free the stats buffer and map */ if (sc->rl_ldata.rl_stag) { - bus_dmamap_unload(sc->rl_ldata.rl_stag, - sc->rl_ldata.rl_rx_list_map); - bus_dmamem_free(sc->rl_ldata.rl_stag, - sc->rl_ldata.rl_stats, - sc->rl_ldata.rl_smap); + if (sc->rl_ldata.rl_smap) + bus_dmamap_unload(sc->rl_ldata.rl_stag, + sc->rl_ldata.rl_smap); + if (sc->rl_ldata.rl_smap && sc->rl_ldata.rl_stats) + bus_dmamem_free(sc->rl_ldata.rl_stag, + sc->rl_ldata.rl_stats, sc->rl_ldata.rl_smap); bus_dma_tag_destroy(sc->rl_ldata.rl_stag); } @@ -3179,3 +3218,88 @@ re_clrwol(struct rl_softc *sc) v &= ~RL_CFG5_WOL_LANWAKE; CSR_WRITE_1(sc, RL_CFG5, v); } + +static void +re_add_sysctls(struct rl_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *children; + + ctx = device_get_sysctl_ctx(sc->rl_dev); + children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I", + "Statistics Information"); +} + +static int +re_sysctl_stats(SYSCTL_HANDLER_ARGS) +{ + struct rl_softc *sc; + struct rl_stats *stats; + int error, i, result; + + result = -1; + error = sysctl_handle_int(oidp, &result, 0, req); + if (error || req->newptr == NULL) + return (error); + + if (result == 1) { + sc = (struct rl_softc *)arg1; + RL_LOCK(sc); + bus_dmamap_sync(sc->rl_ldata.rl_stag, + sc->rl_ldata.rl_smap, BUS_DMASYNC_PREREAD); + CSR_WRITE_4(sc, RL_DUMPSTATS_HI, + RL_ADDR_HI(sc->rl_ldata.rl_stats_addr)); + CSR_WRITE_4(sc, RL_DUMPSTATS_LO, + RL_ADDR_LO(sc->rl_ldata.rl_stats_addr)); + CSR_WRITE_4(sc, RL_DUMPSTATS_LO, + RL_ADDR_LO(sc->rl_ldata.rl_stats_addr | + RL_DUMPSTATS_START)); + for (i = RL_TIMEOUT; i > 0; i--) { + if ((CSR_READ_4(sc, RL_DUMPSTATS_LO) & + RL_DUMPSTATS_START) == 0) + break; + DELAY(1000); + } + bus_dmamap_sync(sc->rl_ldata.rl_stag, + sc->rl_ldata.rl_smap, BUS_DMASYNC_POSTREAD); + RL_UNLOCK(sc); + if (i == 0) { + device_printf(sc->rl_dev, + "DUMP statistics request timedout\n"); + return (ETIMEDOUT); + } + stats = sc->rl_ldata.rl_stats; + printf("%s statistics:\n", device_get_nameunit(sc->rl_dev)); + printf("Tx frames : %ju\n", + (uintmax_t)le64toh(stats->rl_tx_pkts)); + printf("Rx frames : %ju\n", + (uintmax_t)le64toh(stats->rl_rx_pkts)); + printf("Tx errors : %ju\n", + (uintmax_t)le64toh(stats->rl_tx_errs)); + printf("Rx errors : %u\n", + le32toh(stats->rl_rx_errs)); + printf("Rx missed frames : %u\n", + (uint32_t)le16toh(stats->rl_missed_pkts)); + printf("Rx frame alignment errs : %u\n", + (uint32_t)le16toh(stats->rl_rx_framealign_errs)); + printf("Tx single collisions : %u\n", + le32toh(stats->rl_tx_onecoll)); + printf("Tx multiple collisions : %u\n", + le32toh(stats->rl_tx_multicolls)); + printf("Rx unicast frames : %ju\n", + (uintmax_t)le64toh(stats->rl_rx_ucasts)); + printf("Rx broadcast frames : %ju\n", + (uintmax_t)le64toh(stats->rl_rx_bcasts)); + printf("Rx multicast frames : %u\n", + le32toh(stats->rl_rx_mcasts)); + printf("Tx aborts : %u\n", + (uint32_t)le16toh(stats->rl_tx_aborts)); + printf("Tx underruns : %u\n", + (uint32_t)le16toh(stats->rl_rx_underruns)); + } + + return (error); +} Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Sat Nov 13 01:09:44 2010 (r215222) +++ stable/7/sys/pci/if_rlreg.h Sat Nov 13 01:11:13 2010 (r215223) @@ -723,19 +723,16 @@ struct rl_desc { * Statistics counter structure (8139C+ and 8169 only) */ struct rl_stats { - uint32_t rl_tx_pkts_lo; - uint32_t rl_tx_pkts_hi; - uint32_t rl_tx_errs_lo; - uint32_t rl_tx_errs_hi; - uint32_t rl_tx_errs; + uint64_t rl_tx_pkts; + uint64_t rl_rx_pkts; + uint64_t rl_tx_errs; + uint32_t rl_rx_errs; uint16_t rl_missed_pkts; uint16_t rl_rx_framealign_errs; uint32_t rl_tx_onecoll; uint32_t rl_tx_multicolls; - uint32_t rl_rx_ucasts_hi; - uint32_t rl_rx_ucasts_lo; - uint32_t rl_rx_bcasts_lo; - uint32_t rl_rx_bcasts_hi; + uint64_t rl_rx_ucasts; + uint64_t rl_rx_bcasts; uint32_t rl_rx_mcasts; uint16_t rl_tx_aborts; uint16_t rl_rx_underruns; @@ -769,6 +766,7 @@ struct rl_stats { #define RL_NTXSEGS 32 #define RL_RING_ALIGN 256 +#define RL_DUMP_ALIGN 64 #define RL_IFQ_MAXLEN 512 #define RL_TX_DESC_NXT(sc,x) ((x + 1) & ((sc)->rl_ldata.rl_tx_desc_cnt - 1)) #define RL_TX_DESC_PRV(sc,x) ((x - 1) & ((sc)->rl_ldata.rl_tx_desc_cnt - 1)) From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:21:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC9FB1065670; Sat, 13 Nov 2010 01:21:55 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA06F8FC0A; Sat, 13 Nov 2010 01:21:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD1LtwS030528; Sat, 13 Nov 2010 01:21:55 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD1Ltf7030525; Sat, 13 Nov 2010 01:21:55 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011130121.oAD1Ltf7030525@svn.freebsd.org> From: Bruce Cran Date: Sat, 13 Nov 2010 01:21: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: r215224 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:21:55 -0000 Author: brucec Date: Sat Nov 13 01:21:55 2010 New Revision: 215224 URL: http://svn.freebsd.org/changeset/base/215224 Log: We still support PLIP devices, so mention them in addition to ethernet. Modified: head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Sat Nov 13 01:11:13 2010 (r215223) +++ head/usr.sbin/sysinstall/install.c Sat Nov 13 01:21:55 2010 (r215224) @@ -692,7 +692,7 @@ nodisks: "may do so by typing: /usr/sbin/sysinstall."); } if (mediaDevice->type != DEVICE_TYPE_FTP && mediaDevice->type != DEVICE_TYPE_NFS) { - if (!msgYesNo("Would you like to configure any Ethernet network devices?")) { + if (!msgYesNo("Would you like to configure any Ethernet or PLIP network devices?")) { Device *tmp = tcpDeviceSelect(); if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Sat Nov 13 01:11:13 2010 (r215223) +++ head/usr.sbin/sysinstall/menus.c Sat Nov 13 01:21:55 2010 (r215224) @@ -882,7 +882,7 @@ DMenu MenuMediaFTP = { DMenu MenuNetworkDevice = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Network interface information required", - "Please select the ethernet device to configure.\n\n" + "Please select the ethernet or PLIP device to configure.\n\n" "", "Press F1 to read network configuration manual", "network_device", From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 01:28:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C92ED106564A; Sat, 13 Nov 2010 01:28:56 +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 B5F9D8FC13; Sat, 13 Nov 2010 01:28:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD1SutY030709; Sat, 13 Nov 2010 01:28:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD1Sukc030707; Sat, 13 Nov 2010 01:28:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201011130128.oAD1Sukc030707@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 13 Nov 2010 01:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215225 - stable/8/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 01:28:56 -0000 Author: bz Date: Sat Nov 13 01:28:56 2010 New Revision: 215225 URL: http://svn.freebsd.org/changeset/base/215225 Log: MFC r214565: Announce both IPsec and UDP Encap (NAT-T) if available for feature_present(3) checks. This will help to run-time detect and conditionally handle specific optionas of either feature in user space (i.e. in libipsec). Descriptions read by: rwatson Modified: stable/8/sys/netipsec/ipsec.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/ipsec.c ============================================================================== --- stable/8/sys/netipsec/ipsec.c Sat Nov 13 01:21:55 2010 (r215224) +++ stable/8/sys/netipsec/ipsec.c Sat Nov 13 01:28:56 2010 (r215225) @@ -126,6 +126,11 @@ VNET_DEFINE(int, ip4_esp_randpad) = -1; */ VNET_DEFINE(int, crypto_support) = CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE; +FEATURE(ipsec, "Internet Protocol Security (IPsec)"); +#ifdef IPSEC_NAT_T +FEATURE(ipsec_natt, "UDP Encapsulation of IPsec ESP Packets ('NAT-T')"); +#endif + SYSCTL_DECL(_net_inet_ipsec); /* net.inet.ipsec */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 03:11:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 383381065670; Sat, 13 Nov 2010 03:11:28 +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 242218FC2A; Sat, 13 Nov 2010 03:11:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD3BS8t033198; Sat, 13 Nov 2010 03:11:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD3BSxX033195; Sat, 13 Nov 2010 03:11:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201011130311.oAD3BSxX033195@svn.freebsd.org> From: Adrian Chadd Date: Sat, 13 Nov 2010 03:11: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: r215226 - in head: rescue/rescue share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 03:11:28 -0000 Author: adrian Date: Sat Nov 13 03:11:27 2010 New Revision: 215226 URL: http://svn.freebsd.org/changeset/base/215226 Log: Break out the rules which generate crunchgen'ed binaries into a separate .mk file so they can be reused. Introduce a new option, CRUNCH_BUILDTOOLS, which lists the binaries that require tools built in the local architecture. sh and csh both require this. It was previously hardcoded in rescue/rescue/Makefile . Introduce a new option, CRUNCH_SHLIBS, which lists the shared libraries to link against. These override the static libraries listed in CRUNCH_LIBS. Some build environments may wish to use a handful of shared libraries (eg libc.so) so other small, dynamic binaries can be run in the environment. Remove the now-shared code from rescue/rescue/Makefile and introduce the CRUNCH_BUILDTOOLS option for the above shells. Added: head/share/mk/bsd.crunchgen.mk (contents, props changed) Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Sat Nov 13 01:28:56 2010 (r215225) +++ head/rescue/rescue/Makefile Sat Nov 13 03:11:27 2010 (r215226) @@ -22,27 +22,7 @@ dhclient_FIXED: ../../sbin/dhclient/dhcl sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET} CLEANFILES+= dhclient_FIXED -################################################################# -# -# General notes: -# -# A number of Make variables are used to generate the crunchgen config file. -# -# CRUNCH_SRCDIRS: lists directories to search for included programs -# CRUNCH_PROGS: lists programs to be included -# CRUNCH_LIBS: libraries to link with -# CRUNCH_BUILDOPTS: generic build options to be added to every program -# -# Special options can be specified for individual programs -# CRUNCH_SRCDIR_$(P): base source directory for program $(P) -# CRUNCH_BUILDOPTS_$(P): additional build options for $(P) -# CRUNCH_ALIAS_$(P): additional names to be used for $(P) -# -# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} -# will be used to generate a hard link to the resulting binary. -# Specific links can be suppressed by setting -# CRUNCH_SUPPRESS_LINK_$(NAME) to 1. -# +# The help which used to be here is now in mk/bsd.crunchgen.mk # Define Makefile variable RESCUE CRUNCH_BUILDOPTS+= -DRESCUE @@ -73,6 +53,7 @@ CRUNCH_PROGS_bin= cat chflags chio chmod ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil +CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs CRUNCH_ALIAS_test= [ @@ -91,6 +72,7 @@ CRUNCH_PROGS_bin+= rcp .if ${MK_TCSH} != "no" CRUNCH_PROGS_bin+= csh CRUNCH_ALIAS_csh= -csh tcsh -tcsh +CRUNCH_BUILDTOOLS+= bin/csh CRUNCH_SUPPRESS_LINK_-csh= 1 CRUNCH_SUPPRESS_LINK_-tcsh= 1 .endif @@ -236,132 +218,5 @@ CRUNCH_ALIAS_chown= chgrp ################################################################## CRUNCH_LIBS+= -lm -################################################################## -# The following is pretty nearly a generic crunchgen-handling makefile -# - -CONF= $(PROG).conf -OUTMK= $(PROG).mk -OUTC= $(PROG).c -OUTPUTS=$(OUTMK) $(OUTC) $(PROG).cache -CRUNCHOBJS= ${.OBJDIR} -.if defined(MAKEOBJDIRPREFIX) -CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} -.else -CANONICALOBJDIR:= /usr/obj${.CURDIR} -.endif - -CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h - -# Program names and their aliases contribute hardlinks to 'rescue' executable, -# except for those that get suppressed. -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) -.ifdef CRUNCH_SRCDIR_${P} -$(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefile -.else -$(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile -.endif -.ifndef CRUNCH_SUPPRESS_LINK_${P} -LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) -.endif -.for A in $(CRUNCH_ALIAS_$(P)) -.ifndef CRUNCH_SUPPRESS_LINK_${A} -LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) -.endif -.endfor -.endfor -.endfor - -all: $(PROG) -exe: $(PROG) - -$(CONF): Makefile - echo \# Auto-generated, do not edit >$(.TARGET) -.ifdef CRUNCH_BUILDOPTS - echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET) -.endif -.ifdef CRUNCH_LIBS - echo libs $(CRUNCH_LIBS) >>$(.TARGET) -.endif -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) - echo progs $(P) >>$(.TARGET) -.ifdef CRUNCH_SRCDIR_${P} - echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET) -.else - echo special $(P) srcdir $(.CURDIR)/../../$(D)/$(P) >>$(.TARGET) -.endif -.ifdef CRUNCH_BUILDOPTS_${P} - echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ \ - $(CRUNCH_BUILDOPTS_${P}) >>$(.TARGET) -.else - echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ >>$(.TARGET) -.endif -.for A in $(CRUNCH_ALIAS_$(P)) - echo ln $(P) $(A) >>$(.TARGET) -.endfor -.endfor -.endfor - -# XXX Make sure we don't pass -P to crunchgen(1). -.MAKEFLAGS:= ${.MAKEFLAGS:N-P} -.ORDER: $(OUTPUTS) objs -$(OUTPUTS): $(CONF) - MAKEOBJDIRPREFIX=${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) \ - -c $(OUTC) $(CONF) - -$(PROG): $(OUTPUTS) objs - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe - -objs: $(OUTMK) - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs - -# Someone should replace the bin/csh and bin/sh build-tools with -# shell scripts so we can remove this nonsense. -build-tools: -.for _tool in bin/csh bin/sh - cd $(.CURDIR)/../../${_tool}; \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools -.endfor - -# Use a separate build tree to hold files compiled for this crunchgen binary -# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't -# get that to cooperate with bsd.prog.mk. Besides, many of the standard -# targets should NOT be propagated into the components. -cleandepend cleandir obj objlink: -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) -.ifdef CRUNCH_SRCDIR_${P} - cd ${CRUNCH_SRCDIR_$(P)} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.else - cd $(.CURDIR)/../../${D}/${P} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.endif -.endfor -.endfor - -clean: - rm -f ${CLEANFILES} - if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ - fi -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) -.ifdef CRUNCH_SRCDIR_${P} - cd ${CRUNCH_SRCDIR_$(P)} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.else - cd $(.CURDIR)/../../${D}/${P} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.endif -.endfor -.endfor - +.include .include Added: head/share/mk/bsd.crunchgen.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.crunchgen.mk Sat Nov 13 03:11:27 2010 (r215226) @@ -0,0 +1,160 @@ +################################################################# +# +# General notes: +# +# A number of Make variables are used to generate the crunchgen config file. +# +# CRUNCH_SRCDIRS: lists directories to search for included programs +# CRUNCH_PROGS: lists programs to be included +# CRUNCH_LIBS: libraries to statically link with +# CRUNCH_SHLIBS: libraries to dynamically link with +# CRUNCH_BUILDOPTS: generic build options to be added to every program +# CRUNCH_BUILDTOOLS: lists programs that need build tools built in the +# local architecture. +# +# Special options can be specified for individual programs +# CRUNCH_SRCDIR_$(P): base source directory for program $(P) +# CRUNCH_BUILDOPTS_$(P): additional build options for $(P) +# CRUNCH_ALIAS_$(P): additional names to be used for $(P) +# +# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} +# will be used to generate a hard link to the resulting binary. +# Specific links can be suppressed by setting +# CRUNCH_SUPPRESS_LINK_$(NAME) to 1. +# + +# $FreeBSD$ + +################################################################## +# The following is pretty nearly a generic crunchgen-handling makefile +# + +CONF= $(PROG).conf +OUTMK= $(PROG).mk +OUTC= $(PROG).c +OUTPUTS=$(OUTMK) $(OUTC) $(PROG).cache +CRUNCHOBJS= ${.OBJDIR} +.if defined(MAKEOBJDIRPREFIX) +CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} +.else +CANONICALOBJDIR:= /usr/obj${.CURDIR} +.endif + +CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h + +# Program names and their aliases contribute hardlinks to 'rescue' executable, +# except for those that get suppressed. +.for D in $(CRUNCH_SRCDIRS) +.for P in $(CRUNCH_PROGS_$(D)) +.ifdef CRUNCH_SRCDIR_${P} +$(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefile +.else +$(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile +.endif +# Disable building links for bsdbox - whatever is installing the binaries into +# the embedded system should (for now) do the linking there. This may change +# in the future. -adrian +#.ifndef CRUNCH_SUPPRESS_LINK_${P} +#LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) +#.endif +#.for A in $(CRUNCH_ALIAS_$(P)) +#.ifndef CRUNCH_SUPPRESS_LINK_${A} +#LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) +#.endif +#.endfor +.endfor +.endfor + +all: $(PROG) +exe: $(PROG) + +$(CONF): Makefile + echo \# Auto-generated, do not edit >$(.TARGET) +.ifdef CRUNCH_BUILDOPTS + echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET) +.endif +.ifdef CRUNCH_LIBS + echo libs $(CRUNCH_LIBS) >>$(.TARGET) +.endif +.ifdef CRUNCH_SHLIBS + echo libs_so $(CRUNCH_SHLIBS) >>$(.TARGET) +.endif +.for D in $(CRUNCH_SRCDIRS) +.for P in $(CRUNCH_PROGS_$(D)) + echo progs $(P) >>$(.TARGET) +.ifdef CRUNCH_SRCDIR_${P} + echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET) +.else + echo special $(P) srcdir $(.CURDIR)/../../$(D)/$(P) >>$(.TARGET) +.endif +.ifdef CRUNCH_BUILDOPTS_${P} + echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ \ + $(CRUNCH_BUILDOPTS_${P}) >>$(.TARGET) +.else + echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ >>$(.TARGET) +.endif +.for A in $(CRUNCH_ALIAS_$(P)) + echo ln $(P) $(A) >>$(.TARGET) +.endfor +.endfor +.endfor + +# XXX Make sure we don't pass -P to crunchgen(1). +.MAKEFLAGS:= ${.MAKEFLAGS:N-P} +.ORDER: $(OUTPUTS) objs +$(OUTPUTS): $(CONF) + MAKEOBJDIRPREFIX=${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) \ + -c $(OUTC) $(CONF) + +$(PROG): $(OUTPUTS) objs + MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe + +objs: $(OUTMK) + MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs + +# Someone should replace the bin/csh and bin/sh build-tools with +# shell scripts so we can remove this nonsense. +build-tools: +.for _tool in $(CRUNCH_BUILDTOOLS) + cd $(.CURDIR)/../../${_tool}; \ + MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ + MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools +.endfor + +# Use a separate build tree to hold files compiled for this crunchgen binary +# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't +# get that to cooperate with bsd.prog.mk. Besides, many of the standard +# targets should NOT be propagated into the components. +cleandepend cleandir obj objlink: +.for D in $(CRUNCH_SRCDIRS) +.for P in $(CRUNCH_PROGS_$(D)) +.ifdef CRUNCH_SRCDIR_${P} + cd ${CRUNCH_SRCDIR_$(P)} && \ + MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +.else + cd $(.CURDIR)/../../${D}/${P} && \ + MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +.endif +.endfor +.endfor + +clean: + rm -f ${CLEANFILES} + if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ + MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ + fi +.for D in $(CRUNCH_SRCDIRS) +.for P in $(CRUNCH_PROGS_$(D)) +.ifdef CRUNCH_SRCDIR_${P} + cd ${CRUNCH_SRCDIR_$(P)} && \ + MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +.else + cd $(.CURDIR)/../../${D}/${P} && \ + MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +.endif +.endfor +.endfor From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 05:43:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4EC8106566B; Sat, 13 Nov 2010 05:43:58 +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 915A68FC0C; Sat, 13 Nov 2010 05:43:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD5hwW4036972; Sat, 13 Nov 2010 05:43:58 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD5hwko036969; Sat, 13 Nov 2010 05:43:58 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201011130543.oAD5hwko036969@svn.freebsd.org> From: Tim Kientzle Date: Sat, 13 Nov 2010 05:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215227 - in stable/8/usr.bin/tar: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 05:43:58 -0000 Author: kientzle Date: Sat Nov 13 05:43:58 2010 New Revision: 215227 URL: http://svn.freebsd.org/changeset/base/215227 Log: MFC some Makefile tweaks. Modified: stable/8/usr.bin/tar/Makefile stable/8/usr.bin/tar/test/Makefile Directory Properties: stable/8/usr.bin/tar/ (props changed) Modified: stable/8/usr.bin/tar/Makefile ============================================================================== --- stable/8/usr.bin/tar/Makefile Sat Nov 13 03:11:27 2010 (r215226) +++ stable/8/usr.bin/tar/Makefile Sat Nov 13 05:43:58 2010 (r215227) @@ -4,7 +4,6 @@ PROG= bsdtar BSDTAR_VERSION_STRING=2.7.0 SRCS= bsdtar.c cmdline.c getdate.c matching.c read.c siginfo.c subst.c tree.c util.c write.c -WARNS?= 5 DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} LDADD= -larchive -lbz2 -lz -lmd -llzma .if ${MK_OPENSSL} != "no" @@ -12,7 +11,7 @@ LDADD+= -lcrypto .endif CFLAGS+= -DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" -CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../lib/libarchive SYMLINKS= bsdtar ${BINDIR}/tar MLINKS= bsdtar.1 tar.1 DEBUG_FLAGS=-g Modified: stable/8/usr.bin/tar/test/Makefile ============================================================================== --- stable/8/usr.bin/tar/test/Makefile Sat Nov 13 03:11:27 2010 (r215226) +++ stable/8/usr.bin/tar/test/Makefile Sat Nov 13 05:43:58 2010 (r215227) @@ -45,7 +45,6 @@ CFLAGS+= -I${TAR_SRCDIR} # Uncomment to link against dmalloc #LDADD+= -L/usr/local/lib -ldmalloc #CFLAGS+= -I/usr/local/include -DUSE_DMALLOC -WARNS=6 check test: bsdtar_test ./bsdtar_test -p ${.OBJDIR}/../bsdtar -r ${.CURDIR} From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 05:50:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4AA9106566C; Sat, 13 Nov 2010 05:50:49 +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 9FCB58FC0A; Sat, 13 Nov 2010 05:50:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD5onxL037211; Sat, 13 Nov 2010 05:50:49 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD5on3V037198; Sat, 13 Nov 2010 05:50:49 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201011130550.oAD5on3V037198@svn.freebsd.org> From: Tim Kientzle Date: Sat, 13 Nov 2010 05:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215228 - stable/8/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 05:50:49 -0000 Author: kientzle Date: Sat Nov 13 05:50:49 2010 New Revision: 215228 URL: http://svn.freebsd.org/changeset/base/215228 Log: MFC r203557: Move program name into a global, eliminate an extra argument from the error-reporting routines. Added: stable/8/usr.bin/tar/err.c - copied unchanged from r203557, head/usr.bin/tar/err.c stable/8/usr.bin/tar/err.h - copied unchanged from r203557, head/usr.bin/tar/err.h Modified: stable/8/usr.bin/tar/Makefile stable/8/usr.bin/tar/bsdtar.c stable/8/usr.bin/tar/bsdtar.h stable/8/usr.bin/tar/cmdline.c stable/8/usr.bin/tar/matching.c stable/8/usr.bin/tar/read.c stable/8/usr.bin/tar/siginfo.c stable/8/usr.bin/tar/subst.c stable/8/usr.bin/tar/util.c stable/8/usr.bin/tar/write.c Directory Properties: stable/8/usr.bin/tar/ (props changed) Modified: stable/8/usr.bin/tar/Makefile ============================================================================== --- stable/8/usr.bin/tar/Makefile Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/Makefile Sat Nov 13 05:50:49 2010 (r215228) @@ -3,7 +3,7 @@ PROG= bsdtar BSDTAR_VERSION_STRING=2.7.0 -SRCS= bsdtar.c cmdline.c getdate.c matching.c read.c siginfo.c subst.c tree.c util.c write.c +SRCS= bsdtar.c cmdline.c err.c getdate.c matching.c read.c siginfo.c subst.c tree.c util.c write.c DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} LDADD= -larchive -lbz2 -lz -lmd -llzma .if ${MK_OPENSSL} != "no" Modified: stable/8/usr.bin/tar/bsdtar.c ============================================================================== --- stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:50:49 2010 (r215228) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #endif #include "bsdtar.h" +#include "err.h" /* * Per POSIX.1-1988, tar defaults to reading/writing archives to/from @@ -84,7 +85,7 @@ __FBSDID("$FreeBSD$"); /* External function to parse a date/time string (from getdate.y) */ time_t get_date(time_t, const char *); -static void long_help(struct bsdtar *); +static void long_help(void); static void only_mode(struct bsdtar *, const char *opt, const char *valid); static void set_mode(struct bsdtar *, char opt); @@ -120,25 +121,25 @@ main(int argc, char **argv) _set_fmode(_O_BINARY); #endif - /* Need bsdtar->progname before calling bsdtar_warnc. */ + /* Need bsdtar_progname before calling bsdtar_warnc. */ if (*argv == NULL) - bsdtar->progname = "bsdtar"; + bsdtar_progname = "bsdtar"; else { #if defined(_WIN32) && !defined(__CYGWIN__) - bsdtar->progname = strrchr(*argv, '\\'); + bsdtar_progname = strrchr(*argv, '\\'); #else - bsdtar->progname = strrchr(*argv, '/'); + bsdtar_progname = strrchr(*argv, '/'); #endif - if (bsdtar->progname != NULL) - bsdtar->progname++; + if (bsdtar_progname != NULL) + bsdtar_progname++; else - bsdtar->progname = *argv; + bsdtar_progname = *argv; } time(&now); if (setlocale(LC_ALL, "") == NULL) - bsdtar_warnc(bsdtar, 0, "Failed to set default locale"); + bsdtar_warnc(0, "Failed to set default locale"); #if defined(HAVE_NL_LANGINFO) && defined(HAVE_D_MD_ORDER) bsdtar->day_first = (*nl_langinfo(D_MD_ORDER) == 'd'); #endif @@ -186,7 +187,7 @@ main(int argc, char **argv) case 'b': /* SUSv2 */ t = atoi(bsdtar->optarg); if (t <= 0 || t > 1024) - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Argument to -b is out of range (1..1024)"); bsdtar->bytes_per_block = 512 * t; break; @@ -204,7 +205,7 @@ main(int argc, char **argv) break; case OPTION_EXCLUDE: /* GNU tar */ if (exclude(bsdtar, bsdtar->optarg)) - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Couldn't exclude %s\n", bsdtar->optarg); break; case OPTION_FORMAT: /* GNU tar, others */ @@ -227,7 +228,7 @@ main(int argc, char **argv) possible_help_request = 1; break; case OPTION_HELP: /* GNU tar, others */ - long_help(bsdtar); + long_help(); exit(0); break; case 'I': /* GNU tar */ @@ -250,34 +251,34 @@ main(int argc, char **argv) * when transforming archives. */ if (include(bsdtar, bsdtar->optarg)) - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Failed to add %s to inclusion list", bsdtar->optarg); break; case 'j': /* GNU tar */ #if HAVE_LIBBZ2 if (bsdtar->create_compression != '\0') - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; #else - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "bzip2 compression not supported by this version of bsdtar"); - usage(bsdtar); + usage(); #endif break; case 'J': /* GNU tar 1.21 and later */ #if HAVE_LIBLZMA if (bsdtar->create_compression != '\0') - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; #else - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "xz compression not supported by this version of bsdtar"); - usage(bsdtar); + usage(); #endif break; case 'k': /* GNU tar */ @@ -296,14 +297,14 @@ main(int argc, char **argv) case OPTION_LZMA: #if HAVE_LIBLZMA if (bsdtar->create_compression != '\0') - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; #else - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "lzma compression not supported by this version of bsdtar"); - usage(bsdtar); + usage(); #endif break; case 'm': /* SUSv2 */ @@ -326,7 +327,7 @@ main(int argc, char **argv) { struct stat st; if (stat(bsdtar->optarg, &st) != 0) - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't open file %s", bsdtar->optarg); bsdtar->newer_ctime_sec = st.st_ctime; bsdtar->newer_ctime_nsec = @@ -340,7 +341,7 @@ main(int argc, char **argv) { struct stat st; if (stat(bsdtar->optarg, &st) != 0) - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't open file %s", bsdtar->optarg); bsdtar->newer_mtime_sec = st.st_mtime; bsdtar->newer_mtime_nsec = @@ -411,9 +412,9 @@ main(int argc, char **argv) #if HAVE_REGEX_H add_substitution(bsdtar, bsdtar->optarg); #else - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "-s is not supported by this version of bsdtar"); - usage(bsdtar); + usage(); #endif break; case OPTION_SAME_OWNER: /* GNU tar */ @@ -458,7 +459,7 @@ main(int argc, char **argv) break; case 'X': /* GNU tar */ if (exclude_from_file(bsdtar, bsdtar->optarg)) - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "failed to process exclusions from file %s", bsdtar->optarg); break; @@ -468,19 +469,19 @@ main(int argc, char **argv) case 'y': /* FreeBSD version of GNU tar */ #if HAVE_LIBBZ2 if (bsdtar->create_compression != '\0') - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; #else - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "bzip2 compression not supported by this version of bsdtar"); - usage(bsdtar); + usage(); #endif break; case 'Z': /* GNU tar */ if (bsdtar->create_compression != '\0') - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; @@ -488,21 +489,21 @@ main(int argc, char **argv) case 'z': /* GNU tar, star, many others */ #if HAVE_LIBZ if (bsdtar->create_compression != '\0') - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; #else - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "gzip compression not supported by this version of bsdtar"); - usage(bsdtar); + usage(); #endif break; case OPTION_USE_COMPRESS_PROGRAM: bsdtar->compress_program = bsdtar->optarg; break; default: - usage(bsdtar); + usage(); } } @@ -512,13 +513,13 @@ main(int argc, char **argv) /* If no "real" mode was specified, treat -h as --help. */ if ((bsdtar->mode == '\0') && possible_help_request) { - long_help(bsdtar); + long_help(); exit(0); } /* Otherwise, a mode is required. */ if (bsdtar->mode == '\0') - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Must specify one of -c, -r, -t, -u, -x"); /* Check boolean options only permitted in certain modes. */ @@ -598,7 +599,7 @@ main(int argc, char **argv) #endif if (bsdtar->return_value != 0) - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "Error exit delayed from previous errors."); return (bsdtar->return_value); } @@ -607,7 +608,7 @@ static void set_mode(struct bsdtar *bsdtar, char opt) { if (bsdtar->mode != '\0' && bsdtar->mode != opt) - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->mode); bsdtar->mode = opt; } @@ -619,18 +620,18 @@ static void only_mode(struct bsdtar *bsdtar, const char *opt, const char *valid_modes) { if (strchr(valid_modes, bsdtar->mode) == NULL) - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "Option %s is not permitted in mode -%c", opt, bsdtar->mode); } void -usage(struct bsdtar *bsdtar) +usage(void) { const char *p; - p = bsdtar->progname; + p = bsdtar_progname; fprintf(stderr, "Usage:\n"); fprintf(stderr, " List: %s -tf \n", p); @@ -685,12 +686,12 @@ static const char *long_help_msg = * echo bsdtar; else echo not bsdtar; fi */ static void -long_help(struct bsdtar *bsdtar) +long_help(void) { const char *prog; const char *p; - prog = bsdtar->progname; + prog = bsdtar_progname; fflush(stderr); Modified: stable/8/usr.bin/tar/bsdtar.h ============================================================================== --- stable/8/usr.bin/tar/bsdtar.h Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/bsdtar.h Sat Nov 13 05:50:49 2010 (r215228) @@ -78,7 +78,6 @@ struct bsdtar { /* Miscellaneous state information */ struct archive *archive; - const char *progname; int argc; char **argv; const char *optarg; @@ -134,11 +133,7 @@ enum { OPTION_VERSION }; - -void bsdtar_errc(struct bsdtar *, int _eval, int _code, - const char *fmt, ...) __LA_DEAD; int bsdtar_getopt(struct bsdtar *); -void bsdtar_warnc(struct bsdtar *, int _code, const char *fmt, ...); void cleanup_exclusions(struct bsdtar *); void do_chdir(struct bsdtar *); int edit_pathname(struct bsdtar *, struct archive_entry *); @@ -164,7 +159,7 @@ void tar_mode_u(struct bsdtar *bsdtar); void tar_mode_x(struct bsdtar *bsdtar); int unmatched_inclusions(struct bsdtar *bsdtar); int unmatched_inclusions_warn(struct bsdtar *bsdtar, const char *msg); -void usage(struct bsdtar *); +void usage(void); int yes(const char *fmt, ...); #if HAVE_REGEX_H Modified: stable/8/usr.bin/tar/cmdline.c ============================================================================== --- stable/8/usr.bin/tar/cmdline.c Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/cmdline.c Sat Nov 13 05:50:49 2010 (r215228) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #endif #include "bsdtar.h" +#include "err.h" /* * Short options for tar. Please keep this sorted. @@ -220,7 +221,7 @@ bsdtar_getopt(struct bsdtar *bsdtar) if (p[1] == ':') { bsdtar->optarg = *bsdtar->argv; if (bsdtar->optarg == NULL) { - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "Option %c requires an argument", opt); return ('?'); @@ -287,7 +288,7 @@ bsdtar_getopt(struct bsdtar *bsdtar) /* Otherwise, pick up the next word. */ opt_word = *bsdtar->argv; if (opt_word == NULL) { - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "Option -%c requires an argument", opt); return ('?'); @@ -338,13 +339,13 @@ bsdtar_getopt(struct bsdtar *bsdtar) /* Fail if there wasn't a unique match. */ if (match == NULL) { - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "Option %s%s is not supported", long_prefix, opt_word); return ('?'); } if (match2 != NULL) { - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "Ambiguous option %s%s (matches --%s and --%s)", long_prefix, opt_word, match->name, match2->name); return ('?'); @@ -356,7 +357,7 @@ bsdtar_getopt(struct bsdtar *bsdtar) if (bsdtar->optarg == NULL) { bsdtar->optarg = *bsdtar->argv; if (bsdtar->optarg == NULL) { - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "Option %s%s requires an argument", long_prefix, match->name); return ('?'); @@ -367,7 +368,7 @@ bsdtar_getopt(struct bsdtar *bsdtar) } else { /* Argument forbidden: fail if there is one. */ if (bsdtar->optarg != NULL) { - bsdtar_warnc(bsdtar, 0, + bsdtar_warnc(0, "Option %s%s does not allow an argument", long_prefix, match->name); return ('?'); Copied: stable/8/usr.bin/tar/err.c (from r203557, head/usr.bin/tar/err.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/tar/err.c Sat Nov 13 05:50:49 2010 (r215228, copy of r203557, head/usr.bin/tar/err.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2003-2010 Tim Kientzle + * 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 + * in this position and unchanged. + * 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(S) ``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(S) 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 "bsdtar_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_STDARG_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "err.h" + +const char *bsdtar_progname; + +static void +bsdtar_vwarnc(int code, const char *fmt, va_list ap) +{ + fprintf(stderr, "%s: ", bsdtar_progname); + vfprintf(stderr, fmt, ap); + if (code != 0) + fprintf(stderr, ": %s", strerror(code)); + fprintf(stderr, "\n"); +} + +void +bsdtar_warnc(int code, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + bsdtar_vwarnc(code, fmt, ap); + va_end(ap); +} + +void +bsdtar_errc(int eval, int code, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + bsdtar_vwarnc(code, fmt, ap); + va_end(ap); + exit(eval); +} Copied: stable/8/usr.bin/tar/err.h (from r203557, head/usr.bin/tar/err.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.bin/tar/err.h Sat Nov 13 05:50:49 2010 (r215228, copy of r203557, head/usr.bin/tar/err.h) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2009 Joerg Sonnenberger + * 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(S) ``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(S) 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 LAFE_ERR_H +#define LAFE_ERR_H + +#if defined(__GNUC__) && (__GNUC__ > 2 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) +#define __LA_DEAD __attribute__((__noreturn__)) +#else +#define __LA_DEAD +#endif + +extern const char *bsdtar_progname; + +void bsdtar_warnc(int code, const char *fmt, ...); +void bsdtar_errc(int eval, int code, const char *fmt, ...) __LA_DEAD; + +#endif Modified: stable/8/usr.bin/tar/matching.c ============================================================================== --- stable/8/usr.bin/tar/matching.c Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/matching.c Sat Nov 13 05:50:49 2010 (r215228) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #endif #include "bsdtar.h" +#include "err.h" struct match { struct match *next; @@ -53,7 +54,7 @@ struct matching { }; -static void add_pattern(struct bsdtar *, struct match **list, +static void add_pattern(struct match **list, const char *pattern); static int bsdtar_fnmatch(const char *p, const char *s); static void initialize_matching(struct bsdtar *); @@ -80,7 +81,7 @@ exclude(struct bsdtar *bsdtar, const cha if (bsdtar->matching == NULL) initialize_matching(bsdtar); matching = bsdtar->matching; - add_pattern(bsdtar, &(matching->exclusions), pattern); + add_pattern(&(matching->exclusions), pattern); matching->exclusions_count++; return (0); } @@ -99,7 +100,7 @@ include(struct bsdtar *bsdtar, const cha if (bsdtar->matching == NULL) initialize_matching(bsdtar); matching = bsdtar->matching; - add_pattern(bsdtar, &(matching->inclusions), pattern); + add_pattern(&(matching->inclusions), pattern); matching->inclusions_count++; matching->inclusions_unmatched_count++; return (0); @@ -112,13 +113,13 @@ include_from_file(struct bsdtar *bsdtar, } static void -add_pattern(struct bsdtar *bsdtar, struct match **list, const char *pattern) +add_pattern(struct match **list, const char *pattern) { struct match *match; match = malloc(sizeof(*match) + strlen(pattern) + 1); if (match == NULL) - bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + bsdtar_errc(1, errno, "Out of memory"); strcpy(match->pattern, pattern); /* Both "foo/" and "foo" should match "foo/bar". */ if (match->pattern[strlen(match->pattern)-1] == '/') @@ -242,7 +243,7 @@ initialize_matching(struct bsdtar *bsdta { bsdtar->matching = malloc(sizeof(*bsdtar->matching)); if (bsdtar->matching == NULL) - bsdtar_errc(bsdtar, 1, errno, "No memory"); + bsdtar_errc(1, errno, "No memory"); memset(bsdtar->matching, 0, sizeof(*bsdtar->matching)); } @@ -272,7 +273,7 @@ unmatched_inclusions_warn(struct bsdtar while (p != NULL) { if (p->matches == 0) { bsdtar->return_value = 1; - bsdtar_warnc(bsdtar, 0, "%s: %s", + bsdtar_warnc(0, "%s: %s", p->pattern, msg); } p = p->next; Modified: stable/8/usr.bin/tar/read.c ============================================================================== --- stable/8/usr.bin/tar/read.c Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/read.c Sat Nov 13 05:50:49 2010 (r215228) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #endif #include "bsdtar.h" +#include "err.h" static void list_item_verbose(struct bsdtar *, FILE *, struct archive_entry *); @@ -128,11 +129,11 @@ read_archive(struct bsdtar *bsdtar, char archive_read_support_compression_all(a); archive_read_support_format_all(a); if (ARCHIVE_OK != archive_read_set_options(a, bsdtar->option_options)) - bsdtar_errc(bsdtar, 1, 0, archive_error_string(a)); + bsdtar_errc(1, 0, archive_error_string(a)); if (archive_read_open_file(a, bsdtar->filename, bsdtar->bytes_per_block != 0 ? bsdtar->bytes_per_block : DEFAULT_BYTES_PER_BLOCK)) - bsdtar_errc(bsdtar, 1, 0, "Error opening archive: %s", + bsdtar_errc(1, 0, "Error opening archive: %s", archive_error_string(a)); do_chdir(bsdtar); @@ -146,9 +147,9 @@ read_archive(struct bsdtar *bsdtar, char if (mode == 'x' && bsdtar->option_chroot) { #if HAVE_CHROOT if (chroot(".") != 0) - bsdtar_errc(bsdtar, 1, errno, "Can't chroot to \".\""); + bsdtar_errc(1, errno, "Can't chroot to \".\""); #else - bsdtar_errc(bsdtar, 1, 0, + bsdtar_errc(1, 0, "chroot isn't supported on this platform"); #endif } @@ -163,12 +164,12 @@ read_archive(struct bsdtar *bsdtar, char if (r == ARCHIVE_EOF) break; if (r < ARCHIVE_OK) - bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a)); + bsdtar_warnc(0, "%s", archive_error_string(a)); if (r <= ARCHIVE_WARN) bsdtar->return_value = 1; if (r == ARCHIVE_RETRY) { /* Retryable error: try again */ - bsdtar_warnc(bsdtar, 0, "Retrying..."); + bsdtar_warnc(0, "Retrying..."); continue; } if (r == ARCHIVE_FATAL) @@ -232,17 +233,17 @@ read_archive(struct bsdtar *bsdtar, char r = archive_read_data_skip(a); if (r == ARCHIVE_WARN) { fprintf(out, "\n"); - bsdtar_warnc(bsdtar, 0, "%s", + bsdtar_warnc(0, "%s", archive_error_string(a)); } if (r == ARCHIVE_RETRY) { fprintf(out, "\n"); - bsdtar_warnc(bsdtar, 0, "%s", + bsdtar_warnc(0, "%s", archive_error_string(a)); } if (r == ARCHIVE_FATAL) { fprintf(out, "\n"); - bsdtar_warnc(bsdtar, 0, "%s", + bsdtar_warnc(0, "%s", archive_error_string(a)); bsdtar->return_value = 1; break; @@ -297,7 +298,7 @@ read_archive(struct bsdtar *bsdtar, char r = archive_read_close(a); if (r != ARCHIVE_OK) - bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a)); + bsdtar_warnc(0, "%s", archive_error_string(a)); if (r <= ARCHIVE_WARN) bsdtar->return_value = 1; Modified: stable/8/usr.bin/tar/siginfo.c ============================================================================== --- stable/8/usr.bin/tar/siginfo.c Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/siginfo.c Sat Nov 13 05:50:49 2010 (r215228) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include "bsdtar.h" +#include "err.h" /* Is there a pending SIGINFO or SIGUSR1? */ static volatile sig_atomic_t siginfo_received = 0; @@ -73,7 +74,7 @@ siginfo_init(struct bsdtar *bsdtar) /* Allocate space for internal structure. */ if ((bsdtar->siginfo = malloc(sizeof(struct siginfo_data))) == NULL) - bsdtar_errc(bsdtar, 1, errno, "malloc failed"); + bsdtar_errc(1, errno, "malloc failed"); /* Set the strings to NULL so that free() is safe. */ bsdtar->siginfo->path = bsdtar->siginfo->oper = NULL; @@ -99,9 +100,9 @@ siginfo_setinfo(struct bsdtar *bsdtar, c /* Duplicate strings and store entry size. */ if ((bsdtar->siginfo->oper = strdup(oper)) == NULL) - bsdtar_errc(bsdtar, 1, errno, "Cannot strdup"); + bsdtar_errc(1, errno, "Cannot strdup"); if ((bsdtar->siginfo->path = strdup(path)) == NULL) - bsdtar_errc(bsdtar, 1, errno, "Cannot strdup"); + bsdtar_errc(1, errno, "Cannot strdup"); bsdtar->siginfo->size = size; } Modified: stable/8/usr.bin/tar/subst.c ============================================================================== --- stable/8/usr.bin/tar/subst.c Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/subst.c Sat Nov 13 05:50:49 2010 (r215228) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #if HAVE_REGEX_H #include "bsdtar.h" +#include "err.h" #include #include @@ -56,7 +57,7 @@ init_substitution(struct bsdtar *bsdtar) bsdtar->substitution = subst = malloc(sizeof(*subst)); if (subst == NULL) - bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + bsdtar_errc(1, errno, "Out of memory"); subst->first_rule = subst->last_rule = NULL; } @@ -76,7 +77,7 @@ add_substitution(struct bsdtar *bsdtar, rule = malloc(sizeof(*rule)); if (rule == NULL) - bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + bsdtar_errc(1, errno, "Out of memory"); rule->next = NULL; if (subst->last_rule == NULL) @@ -86,32 +87,32 @@ add_substitution(struct bsdtar *bsdtar, subst->last_rule = rule; if (*rule_text == '\0') - bsdtar_errc(bsdtar, 1, 0, "Empty replacement string"); + bsdtar_errc(1, 0, "Empty replacement string"); end_pattern = strchr(rule_text + 1, *rule_text); if (end_pattern == NULL) - bsdtar_errc(bsdtar, 1, 0, "Invalid replacement string"); + bsdtar_errc(1, 0, "Invalid replacement string"); pattern = malloc(end_pattern - rule_text); if (pattern == NULL) - bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + bsdtar_errc(1, errno, "Out of memory"); memcpy(pattern, rule_text + 1, end_pattern - rule_text - 1); pattern[end_pattern - rule_text - 1] = '\0'; if ((r = regcomp(&rule->re, pattern, REG_BASIC)) != 0) { char buf[80]; regerror(r, &rule->re, buf, sizeof(buf)); - bsdtar_errc(bsdtar, 1, 0, "Invalid regular expression: %s", buf); + bsdtar_errc(1, 0, "Invalid regular expression: %s", buf); } free(pattern); start_subst = end_pattern + 1; end_pattern = strchr(start_subst, *rule_text); if (end_pattern == NULL) - bsdtar_errc(bsdtar, 1, 0, "Invalid replacement string"); + bsdtar_errc(1, 0, "Invalid replacement string"); rule->result = malloc(end_pattern - start_subst + 1); if (rule->result == NULL) - bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + bsdtar_errc(1, errno, "Out of memory"); memcpy(rule->result, start_subst, end_pattern - start_subst); rule->result[end_pattern - start_subst] = '\0'; @@ -134,13 +135,13 @@ add_substitution(struct bsdtar *bsdtar, rule->symlink = 1; break; default: - bsdtar_errc(bsdtar, 1, 0, "Invalid replacement flag %c", *end_pattern); + bsdtar_errc(1, 0, "Invalid replacement flag %c", *end_pattern); } } } static void -realloc_strncat(struct bsdtar *bsdtar, char **str, const char *append, size_t len) +realloc_strncat(char **str, const char *append, size_t len) { char *new_str; size_t old_len; @@ -152,7 +153,7 @@ realloc_strncat(struct bsdtar *bsdtar, c new_str = malloc(old_len + len + 1); if (new_str == NULL) - bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + bsdtar_errc(1, errno, "Out of memory"); memcpy(new_str, *str, old_len); memcpy(new_str + old_len, append, len); new_str[old_len + len] = '\0'; @@ -161,7 +162,7 @@ realloc_strncat(struct bsdtar *bsdtar, c } static void -realloc_strcat(struct bsdtar *bsdtar, char **str, const char *append) +realloc_strcat(char **str, const char *append) { char *new_str; size_t old_len; @@ -173,7 +174,7 @@ realloc_strcat(struct bsdtar *bsdtar, ch new_str = malloc(old_len + strlen(append) + 1); if (new_str == NULL) - bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + bsdtar_errc(1, errno, "Out of memory"); memcpy(new_str, *str, old_len); strcpy(new_str + old_len, append); free(*str); @@ -206,12 +207,12 @@ apply_substitution(struct bsdtar *bsdtar got_match = 1; print_match |= rule->print; - realloc_strncat(bsdtar, result, name, matches[0].rm_so); + realloc_strncat(result, name, matches[0].rm_so); for (i = 0, j = 0; rule->result[i] != '\0'; ++i) { if (rule->result[i] == '~') { - realloc_strncat(bsdtar, result, rule->result + j, i - j); - realloc_strncat(bsdtar, result, name, matches[0].rm_eo); + realloc_strncat(result, rule->result + j, i - j); + realloc_strncat(result, name, matches[0].rm_eo); j = i + 1; continue; } @@ -223,7 +224,7 @@ apply_substitution(struct bsdtar *bsdtar switch (c) { case '~': case '\\': - realloc_strncat(bsdtar, result, rule->result + j, i - j - 1); + realloc_strncat(result, rule->result + j, i - j - 1); j = i; break; case '1': @@ -235,13 +236,13 @@ apply_substitution(struct bsdtar *bsdtar case '7': case '8': case '9': - realloc_strncat(bsdtar, result, rule->result + j, i - j - 1); + realloc_strncat(result, rule->result + j, i - j - 1); if ((size_t)(c - '0') > (size_t)(rule->re.re_nsub)) { free(*result); *result = NULL; return -1; } - realloc_strncat(bsdtar, result, name + matches[c - '0'].rm_so, matches[c - '0'].rm_eo - matches[c - '0'].rm_so); + realloc_strncat(result, name + matches[c - '0'].rm_so, matches[c - '0'].rm_eo - matches[c - '0'].rm_so); j = i + 1; break; default: @@ -251,7 +252,7 @@ apply_substitution(struct bsdtar *bsdtar } - realloc_strcat(bsdtar, result, rule->result + j); + realloc_strcat(result, rule->result + j); name += matches[0].rm_eo; @@ -260,7 +261,7 @@ apply_substitution(struct bsdtar *bsdtar } if (got_match) - realloc_strcat(bsdtar, result, name); + realloc_strcat(result, name); if (print_match) fprintf(stderr, "%s >> %s\n", path, *result); Modified: stable/8/usr.bin/tar/util.c ============================================================================== --- stable/8/usr.bin/tar/util.c Sat Nov 13 05:43:58 2010 (r215227) +++ stable/8/usr.bin/tar/util.c Sat Nov 13 05:50:49 2010 (r215228) @@ -54,9 +54,8 @@ __FBSDID("$FreeBSD$"); #endif #include "bsdtar.h" +#include "err.h" -static void bsdtar_vwarnc(struct bsdtar *, int code, - const char *fmt, va_list ap); static size_t bsdtar_expand_char(char *, size_t, char); static const char *strip_components(const char *path, int elements); @@ -203,37 +202,6 @@ bsdtar_expand_char(char *buff, size_t of return (i - offset); } -static void -bsdtar_vwarnc(struct bsdtar *bsdtar, int code, const char *fmt, va_list ap) -{ - fprintf(stderr, "%s: ", bsdtar->progname); - vfprintf(stderr, fmt, ap); - if (code != 0) - fprintf(stderr, ": %s", strerror(code)); - fprintf(stderr, "\n"); -} - -void -bsdtar_warnc(struct bsdtar *bsdtar, int code, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - bsdtar_vwarnc(bsdtar, code, fmt, ap); - va_end(ap); -} - -void -bsdtar_errc(struct bsdtar *bsdtar, int eval, int code, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - bsdtar_vwarnc(bsdtar, code, fmt, ap); - va_end(ap); - exit(eval); -} - int yes(const char *fmt, ...) { @@ -297,11 +265,11 @@ process_lines(struct bsdtar *bsdtar, con else f = fopen(pathname, "r"); if (f == NULL) - bsdtar_errc(bsdtar, 1, errno, "Couldn't open %s", pathname); + bsdtar_errc(1, errno, "Couldn't open %s", pathname); buff_length = 8192; buff = malloc(buff_length); if (buff == NULL) - bsdtar_errc(bsdtar, 1, ENOMEM, "Can't read %s", pathname); + bsdtar_errc(1, ENOMEM, "Can't read %s", pathname); line_start = line_end = buff_end = buff; for (;;) { /* Get some more data into the buffer. */ @@ -322,7 +290,7 @@ process_lines(struct bsdtar *bsdtar, con if (feof(f)) break; if (ferror(f)) - bsdtar_errc(bsdtar, 1, errno, + bsdtar_errc(1, errno, "Can't read %s", pathname); if (line_start > buff) { /* Move a leftover fractional line to the beginning. */ @@ -334,12 +302,12 @@ process_lines(struct bsdtar *bsdtar, con /* Line is too big; enlarge the buffer. */ new_buff_length = buff_length * 2; if (new_buff_length <= buff_length) - bsdtar_errc(bsdtar, 1, ENOMEM, + bsdtar_errc(1, ENOMEM, "Line too long in %s", pathname); buff_length = new_buff_length; p = realloc(buff, buff_length); if (p == NULL) - bsdtar_errc(bsdtar, 1, ENOMEM, + bsdtar_errc(1, ENOMEM, "Line too long in %s", pathname); buff_end = p + (buff_end - buff); line_end = p + (line_end - buff); @@ -399,7 +367,7 @@ set_chdir(struct bsdtar *bsdtar, const c free(old_pending); } if (bsdtar->pending_chdir == NULL) - bsdtar_errc(bsdtar, 1, errno, "No memory"); + bsdtar_errc(1, errno, "No memory"); } void @@ -409,7 +377,7 @@ do_chdir(struct bsdtar *bsdtar) return; if (chdir(bsdtar->pending_chdir) != 0) { - bsdtar_errc(bsdtar, 1, 0, "could not chdir to '%s'\n", + bsdtar_errc(1, 0, "could not chdir to '%s'\n", bsdtar->pending_chdir); } free(bsdtar->pending_chdir); @@ -459,7 +427,7 @@ edit_pathname(struct bsdtar *bsdtar, str #if HAVE_REGEX_H r = apply_substitution(bsdtar, name, &subst_name, 0); if (r == -1) { - bsdtar_warnc(bsdtar, 0, "Invalid substitution, skipping entry"); + bsdtar_warnc(0, "Invalid substitution, skipping entry"); return 1; } if (r == 1) { @@ -475,7 +443,7 @@ edit_pathname(struct bsdtar *bsdtar, str if (archive_entry_hardlink(entry)) { r = apply_substitution(bsdtar, archive_entry_hardlink(entry), &subst_name, 1); if (r == -1) { - bsdtar_warnc(bsdtar, 0, "Invalid substitution, skipping entry"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 05:52:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADC8C1065670; Sat, 13 Nov 2010 05:52:45 +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 9ADD58FC2B; Sat, 13 Nov 2010 05:52:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD5qjVR037325; Sat, 13 Nov 2010 05:52:45 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD5qjX7037323; Sat, 13 Nov 2010 05:52:45 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201011130552.oAD5qjX7037323@svn.freebsd.org> From: Tim Kientzle Date: Sat, 13 Nov 2010 05:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215229 - stable/8/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 05:52:45 -0000 Author: kientzle Date: Sat Nov 13 05:52:45 2010 New Revision: 215229 URL: http://svn.freebsd.org/changeset/base/215229 Log: MFC: Allow -b up to 8192. Folks working with modern high-speed tape drives are routinely using block sizes of 1MB (-b 2048), allowing up to 8192 should allow a little room for future growth. Modified: stable/8/usr.bin/tar/bsdtar.c Directory Properties: stable/8/usr.bin/tar/ (props changed) Modified: stable/8/usr.bin/tar/bsdtar.c ============================================================================== --- stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:50:49 2010 (r215228) +++ stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:52:45 2010 (r215229) @@ -186,9 +186,9 @@ main(int argc, char **argv) break; case 'b': /* SUSv2 */ t = atoi(bsdtar->optarg); - if (t <= 0 || t > 1024) + if (t <= 0 || t > 8192) bsdtar_errc(1, 0, - "Argument to -b is out of range (1..1024)"); + "Argument to -b is out of range (1..8192)"); bsdtar->bytes_per_block = 512 * t; break; case 'C': /* GNU tar */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 05:53:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BCDC106567A; Sat, 13 Nov 2010 05:53:55 +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 58E928FC13; Sat, 13 Nov 2010 05:53:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD5rtkk037407; Sat, 13 Nov 2010 05:53:55 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD5rtLn037405; Sat, 13 Nov 2010 05:53:55 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201011130553.oAD5rtLn037405@svn.freebsd.org> From: Tim Kientzle Date: Sat, 13 Nov 2010 05:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215230 - stable/8/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 05:53:55 -0000 Author: kientzle Date: Sat Nov 13 05:53:55 2010 New Revision: 215230 URL: http://svn.freebsd.org/changeset/base/215230 Log: MFC minor Makefile reformat. Modified: stable/8/usr.bin/tar/Makefile Directory Properties: stable/8/usr.bin/tar/ (props changed) Modified: stable/8/usr.bin/tar/Makefile ============================================================================== --- stable/8/usr.bin/tar/Makefile Sat Nov 13 05:52:45 2010 (r215229) +++ stable/8/usr.bin/tar/Makefile Sat Nov 13 05:53:55 2010 (r215230) @@ -3,7 +3,17 @@ PROG= bsdtar BSDTAR_VERSION_STRING=2.7.0 -SRCS= bsdtar.c cmdline.c err.c getdate.c matching.c read.c siginfo.c subst.c tree.c util.c write.c +SRCS= bsdtar.c \ + cmdline.c \ + err.c \ + getdate.c \ + matching.c \ + read.c \ + siginfo.c \ + subst.c \ + tree.c \ + util.c \ + write.c DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} LDADD= -larchive -lbz2 -lz -lmd -llzma .if ${MK_OPENSSL} != "no" From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 05:55:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B6A01065672; Sat, 13 Nov 2010 05:55:57 +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 084E28FC0C; Sat, 13 Nov 2010 05:55:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD5tudg037535; Sat, 13 Nov 2010 05:55:56 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD5tuvs037532; Sat, 13 Nov 2010 05:55:56 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201011130555.oAD5tuvs037532@svn.freebsd.org> From: Tim Kientzle Date: Sat, 13 Nov 2010 05:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215231 - stable/8/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 05:55:57 -0000 Author: kientzle Date: Sat Nov 13 05:55:56 2010 New Revision: 215231 URL: http://svn.freebsd.org/changeset/base/215231 Log: MFC: reverse an ill-advised experiment trying to emulate a "root user" on Windows. Modified: stable/8/usr.bin/tar/bsdtar.c stable/8/usr.bin/tar/bsdtar_platform.h Directory Properties: stable/8/usr.bin/tar/ (props changed) Modified: stable/8/usr.bin/tar/bsdtar.c ============================================================================== --- stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:53:55 2010 (r215230) +++ stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:55:56 2010 (r215231) @@ -159,8 +159,10 @@ main(int argc, char **argv) /* Default: Perform basic security checks. */ bsdtar->extract_flags |= SECURITY; - /* Defaults for root user: */ - if (bsdtar_is_privileged(bsdtar)) { +#ifndef _WIN32 + /* On POSIX systems, assume --same-owner and -p when run by + * the root user. This doesn't make any sense on Windows. */ + if (bsdtar->user_uid == 0) { /* --same-owner */ bsdtar->extract_flags |= ARCHIVE_EXTRACT_OWNER; /* -p */ @@ -169,6 +171,7 @@ main(int argc, char **argv) bsdtar->extract_flags |= ARCHIVE_EXTRACT_XATTR; bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; } +#endif bsdtar->argv = argv; bsdtar->argc = argc; Modified: stable/8/usr.bin/tar/bsdtar_platform.h ============================================================================== --- stable/8/usr.bin/tar/bsdtar_platform.h Sat Nov 13 05:53:55 2010 (r215230) +++ stable/8/usr.bin/tar/bsdtar_platform.h Sat Nov 13 05:55:56 2010 (r215231) @@ -164,12 +164,8 @@ #define __LA_DEAD #endif -#if defined(__CYGWIN__) -#include "bsdtar_cygwin.h" -#elif defined(_WIN32) /* && !__CYGWIN__ */ +#if defined(_WIN32) && !defined(__CYGWIN__) #include "bsdtar_windows.h" -#else -#define bsdtar_is_privileged(bsdtar) (bsdtar->user_uid == 0) #endif #endif /* !BSDTAR_PLATFORM_H_INCLUDED */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 06:00:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 277F31065670; Sat, 13 Nov 2010 06:00:28 +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 132C08FC1D; Sat, 13 Nov 2010 06:00:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD60SSJ037775; Sat, 13 Nov 2010 06:00:28 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD60SPf037768; Sat, 13 Nov 2010 06:00:28 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201011130600.oAD60SPf037768@svn.freebsd.org> From: Tim Kientzle Date: Sat, 13 Nov 2010 06:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215232 - stable/8/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 06:00:28 -0000 Author: kientzle Date: Sat Nov 13 06:00:27 2010 New Revision: 215232 URL: http://svn.freebsd.org/changeset/base/215232 Log: MFC r203568: Refactor and simplify the SIGINFO/SIGUSR1 handling. Switch to a custom function to format 64-bit ints to avoid the headache of trying to guess printf modifiers on different platforms. Deleted: stable/8/usr.bin/tar/siginfo.c Modified: stable/8/usr.bin/tar/Makefile stable/8/usr.bin/tar/bsdtar.c stable/8/usr.bin/tar/bsdtar.h stable/8/usr.bin/tar/read.c stable/8/usr.bin/tar/util.c stable/8/usr.bin/tar/write.c Directory Properties: stable/8/usr.bin/tar/ (props changed) Modified: stable/8/usr.bin/tar/Makefile ============================================================================== --- stable/8/usr.bin/tar/Makefile Sat Nov 13 05:55:56 2010 (r215231) +++ stable/8/usr.bin/tar/Makefile Sat Nov 13 06:00:27 2010 (r215232) @@ -9,7 +9,6 @@ SRCS= bsdtar.c \ getdate.c \ matching.c \ read.c \ - siginfo.c \ subst.c \ tree.c \ util.c \ Modified: stable/8/usr.bin/tar/bsdtar.c ============================================================================== --- stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 05:55:56 2010 (r215231) +++ stable/8/usr.bin/tar/bsdtar.c Sat Nov 13 06:00:27 2010 (r215232) @@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_PATHS_H #include #endif +#ifdef HAVE_SIGNAL_H +#include +#endif #include #ifdef HAVE_STDLIB_H #include @@ -82,7 +85,32 @@ __FBSDID("$FreeBSD$"); #define _PATH_DEFTAPE "/dev/tape" #endif -/* External function to parse a date/time string (from getdate.y) */ +#if defined(HAVE_SIGACTION) && (defined(SIGINFO) || defined(SIGUSR1)) +static volatile int siginfo_occurred; + +static void +siginfo_handler(int sig) +{ + (void)sig; /* UNUSED */ + siginfo_occurred = 1; +} + +int +need_report(void) +{ + int r = siginfo_occurred; + siginfo_occurred = 0; + return (r); +} +#else +int +need_report(void) +{ + return (0); +} +#endif + +/* External function to parse a date/time string */ time_t get_date(time_t, const char *); static void long_help(void); @@ -114,11 +142,23 @@ main(int argc, char **argv) memset(bsdtar, 0, sizeof(*bsdtar)); bsdtar->fd = -1; /* Mark as "unused" */ option_o = 0; -#if defined(_WIN32) && !defined(__CYGWIN__) - /* Make sure open() function will be used with a binary mode. */ - /* on cygwin, we need something similar, but instead link against */ - /* a special startup object, binmode.o */ - _set_fmode(_O_BINARY); + +#if defined(HAVE_SIGACTION) && (defined(SIGINFO) || defined(SIGUSR1)) + { /* Catch SIGINFO and SIGUSR1, if they exist. */ + struct sigaction sa; + sa.sa_handler = siginfo_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; +#ifdef SIGINFO + if (sigaction(SIGINFO, &sa, NULL)) + bsdtar_errc(1, errno, "sigaction(SIGINFO) failed"); +#endif +#ifdef SIGUSR1 + /* ... and treat SIGUSR1 the same way as SIGINFO. */ + if (sigaction(SIGUSR1, &sa, NULL)) + bsdtar_errc(1, errno, "sigaction(SIGUSR1) failed"); +#endif + } #endif /* Need bsdtar_progname before calling bsdtar_warnc. */ Modified: stable/8/usr.bin/tar/bsdtar.h ============================================================================== --- stable/8/usr.bin/tar/bsdtar.h Sat Nov 13 05:55:56 2010 (r215231) +++ stable/8/usr.bin/tar/bsdtar.h Sat Nov 13 06:00:27 2010 (r215232) @@ -142,16 +142,13 @@ int exclude_from_file(struct bsdtar *, c int excluded(struct bsdtar *, const char *pathname); int include(struct bsdtar *, const char *pattern); int include_from_file(struct bsdtar *, const char *pathname); +int need_report(void); int pathcmp(const char *a, const char *b); int process_lines(struct bsdtar *bsdtar, const char *pathname, int (*process)(struct bsdtar *, const char *)); void safe_fprintf(FILE *, const char *fmt, ...); void set_chdir(struct bsdtar *, const char *newdir); -void siginfo_init(struct bsdtar *); -void siginfo_setinfo(struct bsdtar *, const char * oper, - const char * path, int64_t size); -void siginfo_printinfo(struct bsdtar *, off_t progress); -void siginfo_done(struct bsdtar *); +const char *tar_i64toa(int64_t); void tar_mode_c(struct bsdtar *bsdtar); void tar_mode_r(struct bsdtar *bsdtar); void tar_mode_t(struct bsdtar *bsdtar); Modified: stable/8/usr.bin/tar/read.c ============================================================================== --- stable/8/usr.bin/tar/read.c Sat Nov 13 05:55:56 2010 (r215231) +++ stable/8/usr.bin/tar/read.c Sat Nov 13 06:00:27 2010 (r215232) @@ -70,6 +70,12 @@ __FBSDID("$FreeBSD$"); #include "bsdtar.h" #include "err.h" +struct progress_data { + struct bsdtar *bsdtar; + struct archive *archive; + struct archive_entry *entry; +}; + static void list_item_verbose(struct bsdtar *, FILE *, struct archive_entry *); static void read_archive(struct bsdtar *bsdtar, char mode); @@ -84,22 +90,40 @@ tar_mode_t(struct bsdtar *bsdtar) void tar_mode_x(struct bsdtar *bsdtar) { - /* We want to catch SIGINFO and SIGUSR1. */ - siginfo_init(bsdtar); - read_archive(bsdtar, 'x'); unmatched_inclusions_warn(bsdtar, "Not found in archive"); - /* Restore old SIGINFO + SIGUSR1 handlers. */ - siginfo_done(bsdtar); } static void -progress_func(void * cookie) +progress_func(void *cookie) { - struct bsdtar * bsdtar = cookie; - - siginfo_printinfo(bsdtar, 0); + struct progress_data *progress_data = cookie; + struct bsdtar *bsdtar = progress_data->bsdtar; + struct archive *a = progress_data->archive; + struct archive_entry *entry = progress_data->entry; + uint64_t comp, uncomp; + + if (!need_report()) + return; + + if (bsdtar->verbose) + fprintf(stderr, "\n"); + if (a != NULL) { + comp = archive_position_compressed(a); + uncomp = archive_position_uncompressed(a); + fprintf(stderr, + "In: %s bytes, compression %d%%;", + tar_i64toa(comp), (int)((uncomp - comp) * 100 / uncomp)); + fprintf(stderr, " Out: %d files, %s bytes\n", + archive_file_count(a), tar_i64toa(uncomp)); + } + if (entry != NULL) { + safe_fprintf(stderr, "Current: %s", + archive_entry_pathname(entry)); + fprintf(stderr, " (%s bytes)\n", + tar_i64toa(archive_entry_size(entry))); + } } /* @@ -108,6 +132,7 @@ progress_func(void * cookie) static void read_archive(struct bsdtar *bsdtar, char mode) { + struct progress_data progress_data; FILE *out; struct archive *a; struct archive_entry *entry; @@ -140,8 +165,10 @@ read_archive(struct bsdtar *bsdtar, char if (mode == 'x') { /* Set an extract callback so that we can handle SIGINFO. */ + progress_data.bsdtar = bsdtar; + progress_data.archive = a; archive_read_extract_set_progress_callback(a, progress_func, - bsdtar); + &progress_data); } if (mode == 'x' && bsdtar->option_chroot) { @@ -161,6 +188,7 @@ read_archive(struct bsdtar *bsdtar, char break; r = archive_read_next_header(a, &entry); + progress_data.entry = entry; if (r == ARCHIVE_EOF) break; if (r < ARCHIVE_OK) @@ -268,10 +296,7 @@ read_archive(struct bsdtar *bsdtar, char fflush(stderr); } - /* Tell the SIGINFO-handler code what we're doing. */ - siginfo_setinfo(bsdtar, "extracting", - archive_entry_pathname(entry), 0); - siginfo_printinfo(bsdtar, 0); + // TODO siginfo_printinfo(bsdtar, 0); if (bsdtar->option_stdout) r = archive_read_data_into_fd(a, 1); Modified: stable/8/usr.bin/tar/util.c ============================================================================== --- stable/8/usr.bin/tar/util.c Sat Nov 13 05:55:56 2010 (r215231) +++ stable/8/usr.bin/tar/util.c Sat Nov 13 06:00:27 2010 (r215232) @@ -559,6 +559,28 @@ edit_pathname(struct bsdtar *bsdtar, str } /* + * It would be nice to just use printf() for formatting large numbers, + * but the compatibility problems are quite a headache. Hence the + * following simple utility function. + */ +const char * +tar_i64toa(int64_t n0) +{ + static char buff[24]; + int64_t n = n0 < 0 ? -n0 : n0; + char *p = buff + sizeof(buff); + + *--p = '\0'; + do { + *--p = '0' + (int)(n % 10); + n /= 10; + } while (n > 0); + if (n0 < 0) + *--p = '-'; + return p; +} + +/* * Like strcmp(), but try to be a little more aware of the fact that * we're comparing two paths. Right now, it just handles leading * "./" and trailing '/' specially, so that "a/b/" == "./a/b" Modified: stable/8/usr.bin/tar/write.c ============================================================================== --- stable/8/usr.bin/tar/write.c Sat Nov 13 05:55:56 2010 (r215231) +++ stable/8/usr.bin/tar/write.c Sat Nov 13 06:00:27 2010 (r215232) @@ -127,10 +127,12 @@ static void archive_names_from_file(st struct archive *a); static int archive_names_from_file_helper(struct bsdtar *bsdtar, const char *line); -static int copy_file_data(struct bsdtar *bsdtar, - struct archive *a, struct archive *ina); +static int copy_file_data(struct bsdtar *, struct archive *a, + struct archive *ina, struct archive_entry *); static int new_enough(struct bsdtar *, const char *path, const struct stat *); +static void report_write(struct bsdtar *, struct archive *, + struct archive_entry *, int64_t progress); static void test_for_append(struct bsdtar *); static void write_archive(struct archive *, struct bsdtar *); static void write_entry_backend(struct bsdtar *, struct archive *, @@ -414,9 +416,6 @@ write_archive(struct archive *a, struct const char *arg; struct archive_entry *entry, *sparse_entry; - /* We want to catch SIGINFO and SIGUSR1. */ - siginfo_init(bsdtar); - /* Allocate a buffer for file data. */ if ((bsdtar->buff = malloc(FILEDATABUFLEN)) == NULL) bsdtar_errc(1, 0, "cannot allocate memory"); @@ -488,14 +487,11 @@ cleanup: bsdtar->diskreader = NULL; if (bsdtar->option_totals) { - fprintf(stderr, "Total bytes written: " BSDTAR_FILESIZE_PRINTF "\n", - (BSDTAR_FILESIZE_TYPE)archive_position_compressed(a)); + fprintf(stderr, "Total bytes written: %s\n", + tar_i64toa(archive_position_compressed(a))); } archive_write_finish(a); - - /* Restore old SIGINFO + SIGUSR1 handlers. */ - siginfo_done(bsdtar); } /* @@ -591,10 +587,8 @@ append_archive(struct bsdtar *bsdtar, st if (bsdtar->verbose) safe_fprintf(stderr, "a %s", archive_entry_pathname(in_entry)); - siginfo_setinfo(bsdtar, "copying", - archive_entry_pathname(in_entry), - archive_entry_size(in_entry)); - siginfo_printinfo(bsdtar, 0); + if (need_report()) + report_write(bsdtar, a, in_entry, 0); e = archive_write_header(a, in_entry); if (e != ARCHIVE_OK) { @@ -611,7 +605,7 @@ append_archive(struct bsdtar *bsdtar, st if (e >= ARCHIVE_WARN) { if (archive_entry_size(in_entry) == 0) archive_read_data_skip(ina); - else if (copy_file_data(bsdtar, a, ina)) + else if (copy_file_data(bsdtar, a, ina, in_entry)) exit(1); } @@ -625,7 +619,8 @@ append_archive(struct bsdtar *bsdtar, st /* Helper function to copy data between archives. */ static int -copy_file_data(struct bsdtar *bsdtar, struct archive *a, struct archive *ina) +copy_file_data(struct bsdtar *bsdtar, struct archive *a, + struct archive *ina, struct archive_entry *entry) { ssize_t bytes_read; ssize_t bytes_written; @@ -633,7 +628,8 @@ copy_file_data(struct bsdtar *bsdtar, st bytes_read = archive_read_data(ina, bsdtar->buff, FILEDATABUFLEN); while (bytes_read > 0) { - siginfo_printinfo(bsdtar, progress); + if (need_report()) + report_write(bsdtar, a, entry, progress); bytes_written = archive_write_data(a, bsdtar->buff, bytes_read); @@ -839,14 +835,8 @@ write_hierarchy(struct bsdtar *bsdtar, s if (!S_ISREG(st->st_mode)) archive_entry_set_size(entry, 0); - /* Record what we're doing, for SIGINFO / SIGUSR1. */ - siginfo_setinfo(bsdtar, "adding", - archive_entry_pathname(entry), archive_entry_size(entry)); archive_entry_linkify(bsdtar->resolver, &entry, &spare_entry); - /* Handle SIGINFO / SIGUSR1 request if one was made. */ - siginfo_printinfo(bsdtar, 0); - while (entry != NULL) { write_entry_backend(bsdtar, a, entry); archive_entry_free(entry); @@ -916,6 +906,28 @@ write_entry_backend(struct bsdtar *bsdta close(fd); } +static void +report_write(struct bsdtar *bsdtar, struct archive *a, + struct archive_entry *entry, int64_t progress) +{ + uint64_t comp, uncomp; + if (bsdtar->verbose) + fprintf(stderr, "\n"); + comp = archive_position_compressed(a); + uncomp = archive_position_uncompressed(a); + fprintf(stderr, "In: %d files, %s bytes;", + archive_file_count(a), tar_i64toa(uncomp)); + fprintf(stderr, + " Out: %s bytes, compression %d%%\n", + tar_i64toa(comp), (int)((uncomp - comp) * 100 / uncomp)); + /* Can't have two calls to tar_i64toa() pending, so split the output. */ + safe_fprintf(stderr, "Current: %s (%s", + archive_entry_pathname(entry), + tar_i64toa(progress)); + fprintf(stderr, "/%s bytes)\n", + tar_i64toa(archive_entry_size(entry))); +} + /* Helper function to copy file to archive. */ static int @@ -928,7 +940,8 @@ write_file_data(struct bsdtar *bsdtar, s bytes_read = read(fd, bsdtar->buff, FILEDATABUFLEN); while (bytes_read > 0) { - siginfo_printinfo(bsdtar, progress); + if (need_report()) + report_write(bsdtar, a, entry, progress); bytes_written = archive_write_data(a, bsdtar->buff, bytes_read); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 06:07:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4616B106566B; Sat, 13 Nov 2010 06:07:40 +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 3293D8FC08; Sat, 13 Nov 2010 06:07:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD67edb038073; Sat, 13 Nov 2010 06:07:40 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD67eT3038065; Sat, 13 Nov 2010 06:07:40 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201011130607.oAD67eT3038065@svn.freebsd.org> From: Tim Kientzle Date: Sat, 13 Nov 2010 06:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215233 - stable/8/lib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 06:07:40 -0000 Author: kientzle Date: Sat Nov 13 06:07:39 2010 New Revision: 215233 URL: http://svn.freebsd.org/changeset/base/215233 Log: MFC archive_file_count() utility function. Modified: stable/8/lib/libarchive/Makefile stable/8/lib/libarchive/archive.h stable/8/lib/libarchive/archive_private.h stable/8/lib/libarchive/archive_read.c stable/8/lib/libarchive/archive_util.3 stable/8/lib/libarchive/archive_util.c stable/8/lib/libarchive/archive_virtual.c Directory Properties: stable/8/lib/libarchive/ (props changed) Modified: stable/8/lib/libarchive/Makefile ============================================================================== --- stable/8/lib/libarchive/Makefile Sat Nov 13 06:00:27 2010 (r215232) +++ stable/8/lib/libarchive/Makefile Sat Nov 13 06:07:39 2010 (r215233) @@ -227,6 +227,7 @@ MLINKS+= archive_util.3 archive_compress MLINKS+= archive_util.3 archive_compression_name.3 MLINKS+= archive_util.3 archive_errno.3 MLINKS+= archive_util.3 archive_error_string.3 +MLINKS+= archive_util.3 archive_file_count.3 MLINKS+= archive_util.3 archive_format.3 MLINKS+= archive_util.3 archive_format_name.3 MLINKS+= archive_util.3 archive_set_error.3 Modified: stable/8/lib/libarchive/archive.h ============================================================================== --- stable/8/lib/libarchive/archive.h Sat Nov 13 06:00:27 2010 (r215232) +++ stable/8/lib/libarchive/archive.h Sat Nov 13 06:07:39 2010 (r215233) @@ -704,6 +704,7 @@ __LA_DECL void archive_set_error(struc const char *fmt, ...); __LA_DECL void archive_copy_error(struct archive *dest, struct archive *src); +__LA_DECL int archive_file_count(struct archive *); #ifdef __cplusplus } Modified: stable/8/lib/libarchive/archive_private.h ============================================================================== --- stable/8/lib/libarchive/archive_private.h Sat Nov 13 06:00:27 2010 (r215232) +++ stable/8/lib/libarchive/archive_private.h Sat Nov 13 06:07:39 2010 (r215233) @@ -25,6 +25,10 @@ * $FreeBSD$ */ +#ifndef __LIBARCHIVE_BUILD +#error This header is only to be used internally to libarchive. +#endif + #ifndef ARCHIVE_PRIVATE_H_INCLUDED #define ARCHIVE_PRIVATE_H_INCLUDED @@ -87,9 +91,11 @@ struct archive { const char *compression_name; /* Position in UNCOMPRESSED data stream. */ - off_t file_position; + int64_t file_position; /* Position in COMPRESSED data stream. */ - off_t raw_position; + int64_t raw_position; + /* Number of file entries processed. */ + int file_count; int archive_error_number; const char *error; @@ -107,4 +113,12 @@ int __archive_parse_options(const char * #define err_combine(a,b) ((a) < (b) ? (a) : (b)) +#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER <= 1300) +# define ARCHIVE_LITERAL_LL(x) x##i64 +# define ARCHIVE_LITERAL_ULL(x) x##ui64 +#else +# define ARCHIVE_LITERAL_LL(x) x##ll +# define ARCHIVE_LITERAL_ULL(x) x##ull +#endif + #endif Modified: stable/8/lib/libarchive/archive_read.c ============================================================================== --- stable/8/lib/libarchive/archive_read.c Sat Nov 13 06:00:27 2010 (r215232) +++ stable/8/lib/libarchive/archive_read.c Sat Nov 13 06:07:39 2010 (r215233) @@ -386,6 +386,7 @@ archive_read_next_header2(struct archive ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA, "archive_read_next_header"); + ++_a->file_count; archive_entry_clear(entry); archive_clear_error(&a->archive); Modified: stable/8/lib/libarchive/archive_util.3 ============================================================================== --- stable/8/lib/libarchive/archive_util.3 Sat Nov 13 06:00:27 2010 (r215232) +++ stable/8/lib/libarchive/archive_util.3 Sat Nov 13 06:07:39 2010 (r215233) @@ -34,6 +34,7 @@ .Nm archive_copy_error , .Nm archive_errno , .Nm archive_error_string , +.Nm archive_file_count , .Nm archive_format , .Nm archive_format_name , .Nm archive_set_error @@ -53,6 +54,8 @@ .Ft const char * .Fn archive_error_string "struct archive *" .Ft int +.Fn archive_file_count "struct archive *" +.Ft int .Fn archive_format "struct archive *" .Ft const char * .Fn archive_format_name "struct archive *" @@ -92,6 +95,12 @@ obtained from passing the result of .Fn archive_errno to .Xr strerror 3 . +.It Fn archive_file_count +Returns a count of the number of files processed by this archive object. +The count is incremented by calls to +.Xr archive_write_header +or +.Xr archive_read_next_header . .It Fn archive_format Returns a numeric code indicating the format of the current archive entry. Modified: stable/8/lib/libarchive/archive_util.c ============================================================================== --- stable/8/lib/libarchive/archive_util.c Sat Nov 13 06:00:27 2010 (r215232) +++ stable/8/lib/libarchive/archive_util.c Sat Nov 13 06:07:39 2010 (r215233) @@ -100,6 +100,11 @@ archive_error_string(struct archive *a) return ("(Empty error message)"); } +int +archive_file_count(struct archive *a) +{ + return (a->file_count); +} int archive_format(struct archive *a) @@ -182,9 +187,14 @@ void __archive_errx(int retvalue, const char *msg) { static const char *msg1 = "Fatal Internal Error in libarchive: "; - write(2, msg1, strlen(msg1)); - write(2, msg, strlen(msg)); - write(2, "\n", 1); + size_t s; + + s = write(2, msg1, strlen(msg1)); + (void)s; /* UNUSED */ + s = write(2, msg, strlen(msg)); + (void)s; /* UNUSED */ + s = write(2, "\n", 1); + (void)s; /* UNUSED */ exit(retvalue); } Modified: stable/8/lib/libarchive/archive_virtual.c ============================================================================== --- stable/8/lib/libarchive/archive_virtual.c Sat Nov 13 06:00:27 2010 (r215232) +++ stable/8/lib/libarchive/archive_virtual.c Sat Nov 13 06:07:39 2010 (r215233) @@ -66,6 +66,7 @@ archive_read_finish(struct archive *a) int archive_write_header(struct archive *a, struct archive_entry *entry) { + ++a->file_count; return ((a->vtable->archive_write_header)(a, entry)); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 08:58:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F294106566C; Sat, 13 Nov 2010 08:58:36 +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 8B8078FC08; Sat, 13 Nov 2010 08:58:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD8waQJ041646; Sat, 13 Nov 2010 08:58:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD8waQP041643; Sat, 13 Nov 2010 08:58:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011130858.oAD8waQP041643@svn.freebsd.org> From: Xin LI Date: Sat, 13 Nov 2010 08:58: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: r215234 - head/sys/dev/arcmsr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 08:58:36 -0000 Author: delphij Date: Sat Nov 13 08:58:36 2010 New Revision: 215234 URL: http://svn.freebsd.org/changeset/base/215234 Log: Update to vendor release 1.20.00.19. Bug fixes: * Fixed "inquiry data fails comparion at DV1 step" * Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B * Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 Many thanks to Areca for continuing to support FreeBSD. This commit is intended for MFC before 8.2-RELEASE. Submitted by: Ching-Lung Huang Modified: head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Sat Nov 13 06:07:39 2010 (r215233) +++ head/sys/dev/arcmsr/arcmsr.c Sat Nov 13 08:58:36 2010 (r215234) @@ -38,29 +38,32 @@ ** History ** ** REV# DATE NAME DESCRIPTION -** 1.00.00.00 3/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 4/19/2005 Erich Chen add SATA 24 Ports adapter type support +** 1.00.00.00 3/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 4/19/2005 Erich Chen add SATA 24 Ports adapter type support ** clean unused function -** 1.20.00.12 9/12/2005 Erich Chen bug fix with abort command handling, +** 1.20.00.12 9/12/2005 Erich Chen bug fix with abort command handling, ** firmware version check ** and firmware update notify for hardware bug fix ** handling if none zero high part physical address ** of srb resource -** 1.20.00.13 8/18/2006 Erich Chen remove pending srb and report busy +** 1.20.00.13 8/18/2006 Erich Chen remove pending srb and report busy ** add iop message xfer ** with scsi pass-through command ** add new device id of sas raid adapters ** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 ****************************************************************************************** * $FreeBSD$ */ @@ -116,7 +119,7 @@ #define ARCMSR_LOCK_RELEASE(l) mtx_unlock(l) #define ARCMSR_LOCK_TRY(l) mtx_trylock(l) #define arcmsr_htole32(x) htole32(x) - typedef struct mtx arcmsr_lock_t; + typedef struct mtx arcmsr_lock_t; #else #include #include @@ -134,13 +137,14 @@ #define CAM_NEW_TRAN_CODE 1 #endif +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.19 2010-11-11" #include #define ARCMSR_SRBS_POOL_SIZE ((sizeof(struct CommandControlBlock) * ARCMSR_MAX_FREESRB_NUM)) /* ************************************************************************** ************************************************************************** */ -#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) +#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) #define CHIP_REG_WRITE32(s, b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r), d) /* ************************************************************************** @@ -182,8 +186,8 @@ static void UDELAY(u_int32_t us) { DELAY ************************************************************************** ************************************************************************** */ -static bus_dmamap_callback_t arcmsr_map_freesrb; -static bus_dmamap_callback_t arcmsr_executesrb; +static bus_dmamap_callback_t arcmsr_map_free_srb; +static bus_dmamap_callback_t arcmsr_execute_srb; /* ************************************************************************** ************************************************************************** @@ -200,7 +204,7 @@ static device_method_t arcmsr_methods[]= DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), { 0, 0 } }; @@ -226,29 +230,29 @@ static struct cdevsw arcmsr_cdevsw={ #if __FreeBSD_version > 502010 .d_version = D_VERSION, #endif - .d_flags = D_NEEDGIANT, - .d_open = arcmsr_open, /* open */ - .d_close = arcmsr_close, /* close */ - .d_ioctl = arcmsr_ioctl, /* ioctl */ - .d_name = "arcmsr", /* name */ + .d_flags = D_NEEDGIANT, + .d_open = arcmsr_open, /* open */ + .d_close = arcmsr_close, /* close */ + .d_ioctl = arcmsr_ioctl, /* ioctl */ + .d_name = "arcmsr", /* name */ }; #else #define ARCMSR_CDEV_MAJOR 180 static struct cdevsw arcmsr_cdevsw = { - arcmsr_open, /* open */ - arcmsr_close, /* close */ - noread, /* read */ - nowrite, /* write */ - arcmsr_ioctl, /* ioctl */ - nopoll, /* poll */ - nommap, /* mmap */ - nostrategy, /* strategy */ - "arcmsr", /* name */ - ARCMSR_CDEV_MAJOR, /* major */ - nodump, /* dump */ - nopsize, /* psize */ - 0 /* flags */ + arcmsr_open, /* open */ + arcmsr_close, /* close */ + noread, /* read */ + nowrite, /* write */ + arcmsr_ioctl, /* ioctl */ + nopoll, /* poll */ + nommap, /* mmap */ + nostrategy, /* strategy */ + "arcmsr", /* name */ + ARCMSR_CDEV_MAJOR, /* major */ + nodump, /* dump */ + nopsize, /* psize */ + 0 /* flags */ }; #endif /* @@ -259,9 +263,9 @@ static struct cdevsw arcmsr_cdevsw = { static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc) #else #if __FreeBSD_version < 503000 - static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc) + static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc) #else - static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) + static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) #endif #endif { @@ -284,9 +288,9 @@ static struct cdevsw arcmsr_cdevsw = { static int arcmsr_close(dev_t dev, int flags, int fmt, struct proc *proc) #else #if __FreeBSD_version < 503000 - static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc) + static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc) #else - static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) + static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) #endif #endif { @@ -309,9 +313,9 @@ static struct cdevsw arcmsr_cdevsw = { static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct proc *proc) #else #if __FreeBSD_version < 503000 - static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) + static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) #else - static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) + static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) #endif #endif { @@ -345,7 +349,7 @@ static u_int32_t arcmsr_disable_allintr( case ACB_ADAPTER_TYPE_B: { /* disable all outbound interrupt */ intmask_org=CHIP_REG_READ32(HBB_DOORBELL, - 0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ + 0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, 0); /* disable all interrupt */ } break; @@ -584,42 +588,6 @@ static void arcmsr_async(void *cb_arg, u ********************************************************************** ********************************************************************** */ -static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag) -{ - struct AdapterControlBlock *acb=srb->acb; - union ccb * pccb=srb->pccb; - - if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { - bus_dmasync_op_t op; - - if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - op = BUS_DMASYNC_POSTREAD; - } else { - op = BUS_DMASYNC_POSTWRITE; - } - bus_dmamap_sync(acb->dm_segs_dmat, srb->dm_segs_dmamap, op); - bus_dmamap_unload(acb->dm_segs_dmat, srb->dm_segs_dmamap); - } - if(stand_flag==1) { - atomic_subtract_int(&acb->srboutstandingcount, 1); - if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && ( - acb->srboutstandingcount < ARCMSR_RELEASE_SIMQ_LEVEL)) { - acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN; - pccb->ccb_h.status |= CAM_RELEASE_SIMQ; - } - } - srb->startdone=ARCMSR_SRB_DONE; - srb->srb_flags=0; - acb->srbworkingQ[acb->workingsrb_doneindex]=srb; - acb->workingsrb_doneindex++; - acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM; - xpt_done(pccb); - return; -} -/* -********************************************************************** -********************************************************************** -*/ static void arcmsr_report_sense_info(struct CommandControlBlock *srb) { union ccb * pccb=srb->pccb; @@ -695,6 +663,42 @@ static void arcmsr_abort_allcmd(struct A return; } /* +********************************************************************** +********************************************************************** +*/ +static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag) +{ + struct AdapterControlBlock *acb=srb->acb; + union ccb * pccb=srb->pccb; + + if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + bus_dmasync_op_t op; + + if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { + op = BUS_DMASYNC_POSTREAD; + } else { + op = BUS_DMASYNC_POSTWRITE; + } + bus_dmamap_sync(acb->dm_segs_dmat, srb->dm_segs_dmamap, op); + bus_dmamap_unload(acb->dm_segs_dmat, srb->dm_segs_dmamap); + } + if(stand_flag==1) { + atomic_subtract_int(&acb->srboutstandingcount, 1); + if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && ( + acb->srboutstandingcount < ARCMSR_RELEASE_SIMQ_LEVEL)) { + acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN; + pccb->ccb_h.status |= CAM_RELEASE_SIMQ; + } + } + srb->startdone=ARCMSR_SRB_DONE; + srb->srb_flags=0; + acb->srbworkingQ[acb->workingsrb_doneindex]=srb; + acb->workingsrb_doneindex++; + acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM; + xpt_done(pccb); + return; +} +/* ************************************************************************** ************************************************************************** */ @@ -1009,8 +1013,8 @@ static void arcmsr_post_srb(struct Adapt { CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); } - } - break; + } + break; } return; } @@ -1595,7 +1599,7 @@ static void arcmsr_hbb_postqueue_isr(str u_int32_t flag_srb; int index; u_int16_t error; - + /* ***************************************************************************** ** areca cdb command done @@ -2236,7 +2240,7 @@ message_out: ********************************************************************* ********************************************************************* */ -static void arcmsr_executesrb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) +static void arcmsr_execute_srb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) { struct CommandControlBlock *srb=(struct CommandControlBlock *)arg; struct AdapterControlBlock *acb=(struct AdapterControlBlock *)srb->acb; @@ -2386,18 +2390,16 @@ static void arcmsr_handle_virtual_comman xpt_done(pccb); return; } - inqdata[0] = T_PROCESSOR; - /* Periph Qualifier & Periph Dev Type */ - inqdata[1] = 0; - /* rem media bit & Dev Type Modifier */ - inqdata[2] = 0; - /* ISO, ECMA, & ANSI versions */ - inqdata[4] = 31; - /* length of additional data */ - strncpy(&inqdata[8], "Areca ", 8); - /* Vendor Identification */ - strncpy(&inqdata[16], "RAID controller ", 16); - /* Product Identification */ + inqdata[0] = T_PROCESSOR; /* Periph Qualifier & Periph Dev Type */ + inqdata[1] = 0; /* rem media bit & Dev Type Modifier */ + inqdata[2] = 0; /* ISO, ECMA, & ANSI versions */ + inqdata[3] = 0; + inqdata[4] = 31; /* length of additional data */ + inqdata[5] = 0; + inqdata[6] = 0; + inqdata[7] = 0; + strncpy(&inqdata[8], "Areca ", 8); /* Vendor Identification */ + strncpy(&inqdata[16], "RAID controller ", 16); /* Product Identification */ strncpy(&inqdata[32], "R001", 4); /* Product Revision */ memcpy(buffer, inqdata, sizeof(inqdata)); xpt_done(pccb); @@ -2460,15 +2462,19 @@ static void arcmsr_action(struct cam_sim , srb->dm_segs_dmamap , pccb->csio.data_ptr , pccb->csio.dxfer_len - , arcmsr_executesrb, srb, /*flags*/0); + , arcmsr_execute_srb, srb, /*flags*/0); if(error == EINPROGRESS) { xpt_freeze_simq(acb->psim, 1); pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } splx(s); - } else { - /* Buffer is physical */ - panic("arcmsr: CAM_DATA_PHYS not supported"); + } + else { /* Buffer is physical */ + struct bus_dma_segment seg; + + seg.ds_addr = (bus_addr_t)pccb->csio.data_ptr; + seg.ds_len = pccb->csio.dxfer_len; + arcmsr_execute_srb(srb, &seg, 1, 0); } } else { /* Scatter/gather list */ @@ -2482,10 +2488,10 @@ static void arcmsr_action(struct cam_sim return; } segs=(struct bus_dma_segment *)pccb->csio.data_ptr; - arcmsr_executesrb(srb, segs, pccb->csio.sglist_cnt, 0); + arcmsr_execute_srb(srb, segs, pccb->csio.sglist_cnt, 0); } } else { - arcmsr_executesrb(srb, NULL, 0, 0); + arcmsr_execute_srb(srb, NULL, 0, 0); } break; } @@ -3204,7 +3210,7 @@ static u_int32_t arcmsr_iop_confirm(stru return FALSE; } post_queue_phyaddr = srb_phyaddr + ARCMSR_MAX_FREESRB_NUM*sizeof(struct CommandControlBlock) - + offsetof(struct HBB_MessageUnit, post_qbuffer); + + offsetof(struct HBB_MessageUnit, post_qbuffer); CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[0], ARCMSR_SIGNATURE_SET_CONFIG); /* driver "set config" signature */ CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[1], srb_phyaddr_hi32); /* normal should be zero */ CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[2], post_queue_phyaddr); /* postQ size (256+8)*4 */ @@ -3288,7 +3294,7 @@ static void arcmsr_iop_init(struct Adapt ********************************************************************** ********************************************************************** */ -static void arcmsr_map_freesrb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +static void arcmsr_map_free_srb(void *arg, bus_dma_segment_t *segs, int nseg, int error) { struct AdapterControlBlock *acb=arg; struct CommandControlBlock *srb_tmp; @@ -3351,6 +3357,7 @@ static u_int32_t arcmsr_initialize(devic max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; + case PCIDevVenIDARC1200: case PCIDevVenIDARC1201: { acb->adapter_type=ACB_ADAPTER_TYPE_B; max_coherent_size=ARCMSR_SRBS_POOL_SIZE+(sizeof(struct HBB_MessageUnit)); @@ -3364,7 +3371,9 @@ static u_int32_t arcmsr_initialize(devic case PCIDevVenIDARC1210: case PCIDevVenIDARC1220: case PCIDevVenIDARC1230: + case PCIDevVenIDARC1231: case PCIDevVenIDARC1260: + case PCIDevVenIDARC1261: case PCIDevVenIDARC1270: case PCIDevVenIDARC1280: case PCIDevVenIDARC1212: @@ -3383,108 +3392,71 @@ static u_int32_t arcmsr_initialize(devic return ENOMEM; } } + if(bus_dma_tag_create( /*parent*/ NULL, + /*alignemnt*/ 1, + /*boundary*/ 0, + /*lowaddr*/ BUS_SPACE_MAXADDR, + /*highaddr*/ BUS_SPACE_MAXADDR, + /*filter*/ NULL, + /*filterarg*/ NULL, + /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT, + /*nsegments*/ BUS_SPACE_UNRESTRICTED, + /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, + /*flags*/ 0, #if __FreeBSD_version >= 502010 - if(bus_dma_tag_create( /*parent*/ NULL, - /*alignemnt*/ 1, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT, - /*nsegments*/ BUS_SPACE_UNRESTRICTED, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - /*lockfunc*/ NULL, - /*lockarg*/ NULL, - &acb->parent_dmat) != 0) -#else - if(bus_dma_tag_create( /*parent*/ NULL, - /*alignemnt*/ 1, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT, - /*nsegments*/ BUS_SPACE_UNRESTRICTED, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - &acb->parent_dmat) != 0) + /*lockfunc*/ NULL, + /*lockarg*/ NULL, #endif + &acb->parent_dmat) != 0) { printf("arcmsr%d: parent_dmat bus_dma_tag_create failure!\n", device_get_unit(dev)); return ENOMEM; } + /* Create a single tag describing a region large enough to hold all of the s/g lists we will need. */ -#if __FreeBSD_version >= 502010 if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, - /*alignment*/ 1, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ MAXBSIZE, - /*nsegments*/ ARCMSR_MAX_SG_ENTRIES, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - /*lockfunc*/ busdma_lock_mutex, + /*alignment*/ 1, + /*boundary*/ 0, + /*lowaddr*/ BUS_SPACE_MAXADDR, + /*highaddr*/ BUS_SPACE_MAXADDR, + /*filter*/ NULL, + /*filterarg*/ NULL, + /*maxsize*/ ARCMSR_MAX_SG_ENTRIES * PAGE_SIZE * ARCMSR_MAX_FREESRB_NUM, + /*nsegments*/ ARCMSR_MAX_SG_ENTRIES, + /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, + /*flags*/ 0, +#if __FreeBSD_version >= 502010 + /*lockfunc*/ busdma_lock_mutex, #if __FreeBSD_version >= 700025 - /*lockarg*/ &acb->qbuffer_lock, + /*lockarg*/ &acb->qbuffer_lock, #else - /*lockarg*/ &Giant, + /*lockarg*/ &Giant, #endif - &acb->dm_segs_dmat) != 0) -#else - if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, - /*alignment*/ 1, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ MAXBSIZE, - /*nsegments*/ ARCMSR_MAX_SG_ENTRIES, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - &acb->dm_segs_dmat) != 0) #endif + &acb->dm_segs_dmat) != 0) { bus_dma_tag_destroy(acb->parent_dmat); printf("arcmsr%d: dm_segs_dmat bus_dma_tag_create failure!\n", device_get_unit(dev)); return ENOMEM; } + /* DMA tag for our srb structures.... Allocate the freesrb memory */ -#if __FreeBSD_version >= 502010 - if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, - /*alignment*/ 0x20, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ max_coherent_size, - /*nsegments*/ 1, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - /*lockfunc*/ NULL, - /*lockarg*/ NULL, - &acb->srb_dmat) != 0) -#else if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, - /*alignment*/ 0x20, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ max_coherent_size, - /*nsegments*/ 1, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - &acb->srb_dmat) != 0) + /*alignment*/ 0x20, + /*boundary*/ 0, + /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT, + /*highaddr*/ BUS_SPACE_MAXADDR, + /*filter*/ NULL, + /*filterarg*/ NULL, + /*maxsize*/ max_coherent_size, + /*nsegments*/ 1, + /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, + /*flags*/ 0, +#if __FreeBSD_version >= 502010 + /*lockfunc*/ NULL, + /*lockarg*/ NULL, #endif + &acb->srb_dmat) != 0) { bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); @@ -3500,7 +3472,7 @@ static u_int32_t arcmsr_initialize(devic return ENXIO; } /* And permanently map them */ - if(bus_dmamap_load(acb->srb_dmat, acb->srb_dmamap, acb->uncacheptr, max_coherent_size, arcmsr_map_freesrb, acb, /*flags*/0)) { + if(bus_dmamap_load(acb->srb_dmat, acb->srb_dmamap, acb->uncacheptr, max_coherent_size, arcmsr_map_free_srb, acb, /*flags*/0)) { bus_dma_tag_destroy(acb->srb_dmat); bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); @@ -3518,7 +3490,7 @@ static u_int32_t arcmsr_initialize(devic case ACB_ADAPTER_TYPE_A: { u_int32_t rid0=PCIR_BAR(0); vm_offset_t mem_base0; - + acb->sys_res_arcmsr[0]=bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, 0x1000, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); @@ -3549,10 +3521,10 @@ static u_int32_t arcmsr_initialize(devic for(i=0; i<2; i++) { if(i==0) { acb->sys_res_arcmsr[i]=bus_alloc_resource(dev,SYS_RES_MEMORY, &rid[i], - 0x20400, 0x20400+sizeof(struct HBB_DOORBELL), sizeof(struct HBB_DOORBELL), RF_ACTIVE); + 0ul, ~0ul, sizeof(struct HBB_DOORBELL), RF_ACTIVE); } else { acb->sys_res_arcmsr[i]=bus_alloc_resource(dev, SYS_RES_MEMORY, &rid[i], - 0x0fa00, 0x0fa00+sizeof(struct HBB_RWBUFFER), sizeof(struct HBB_RWBUFFER), RF_ACTIVE); + 0ul, ~0ul, sizeof(struct HBB_RWBUFFER), RF_ACTIVE); } if(acb->sys_res_arcmsr[i] == NULL) { arcmsr_free_resource(acb); @@ -3751,6 +3723,7 @@ static int arcmsr_probe(device_t dev) { u_int32_t id; static char buf[256]; + char x_type[]={"X-TYPE"}; char *type; int raid6 = 1; @@ -3759,8 +3732,9 @@ static int arcmsr_probe(device_t dev) } switch(id=pci_get_devid(dev)) { case PCIDevVenIDARC1110: - case PCIDevVenIDARC1210: + case PCIDevVenIDARC1200: case PCIDevVenIDARC1201: + case PCIDevVenIDARC1210: raid6 = 0; /*FALLTHRU*/ case PCIDevVenIDARC1120: @@ -3769,7 +3743,9 @@ static int arcmsr_probe(device_t dev) case PCIDevVenIDARC1170: case PCIDevVenIDARC1220: case PCIDevVenIDARC1230: + case PCIDevVenIDARC1231: case PCIDevVenIDARC1260: + case PCIDevVenIDARC1261: case PCIDevVenIDARC1270: case PCIDevVenIDARC1280: type = "SATA"; @@ -3786,9 +3762,11 @@ static int arcmsr_probe(device_t dev) type = "SAS 6G"; break; default: - type = "X-TYPE"; + type = x_type; break; } + if(type == x_type) + return(ENXIO); sprintf(buf, "Areca %s Host Adapter RAID Controller %s\n", type, raid6 ? "(RAID6 capable)" : ""); device_set_desc_copy(dev, buf); return 0; Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Sat Nov 13 06:07:39 2010 (r215233) +++ head/sys/dev/arcmsr/arcmsr.h Sat Nov 13 08:58:36 2010 (r215234) @@ -37,22 +37,21 @@ ************************************************************************** * $FreeBSD$ */ -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.17 2010-07-15" -#define ARCMSR_SCSI_INITIATOR_ID 255 -#define ARCMSR_DEV_SECTOR_SIZE 512 -#define ARCMSR_MAX_XFER_SECTORS 4096 -#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ -#define ARCMSR_MAX_TARGETLUN 8 /*8*/ -#define ARCMSR_MAX_CHIPTYPE_NUM 4 -#define ARCMSR_MAX_OUTSTANDING_CMD 256 -#define ARCMSR_MAX_START_JOB 257 -#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD -#define ARCMSR_MAX_FREESRB_NUM 320 -#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ -#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ -#define ARCMSR_MAX_ADAPTER 4 -#define ARCMSR_RELEASE_SIMQ_LEVEL 230 -#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ +#define ARCMSR_SCSI_INITIATOR_ID 255 +#define ARCMSR_DEV_SECTOR_SIZE 512 +#define ARCMSR_MAX_XFER_SECTORS 4096 +#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ +#define ARCMSR_MAX_TARGETLUN 8 /*8*/ +#define ARCMSR_MAX_CHIPTYPE_NUM 4 +#define ARCMSR_MAX_OUTSTANDING_CMD 256 +#define ARCMSR_MAX_START_JOB 257 +#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD +#define ARCMSR_MAX_FREESRB_NUM 320 +#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ +#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ +#define ARCMSR_MAX_ADAPTER 4 +#define ARCMSR_RELEASE_SIMQ_LEVEL 230 +#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ /* ********************************************************************* */ @@ -74,45 +73,51 @@ ** ********************************************************************************** */ -#define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ -#define PCI_DEVICE_ID_ARECA_1110 0x1110 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1120 0x1120 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1130 0x1130 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1160 0x1160 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1170 0x1170 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1210 0x1210 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1220 0x1220 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1230 0x1230 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1260 0x1260 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1270 0x1270 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1280 0x1280 /* Device ID */ +#define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ +#define PCI_DEVICE_ID_ARECA_1110 0x1110 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1120 0x1120 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1130 0x1130 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1160 0x1160 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1170 0x1170 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1200 0x1200 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1201 0x1201 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1210 0x1210 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1212 0x1212 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1220 0x1220 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1222 0x1222 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1380 0x1380 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1381 0x1381 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1680 0x1680 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1201 0x1201 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1230 0x1230 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1231 0x1231 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1260 0x1260 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1261 0x1261 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1270 0x1270 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1280 0x1280 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1380 0x1380 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1381 0x1381 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1680 0x1680 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1880 0x1880 /* Device ID */ -#define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1160 0x116017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1170 0x117017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1270 0x127017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1280 0x128017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1160 0x116017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1170 0x117017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1200 0x120017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1380 0x138017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1381 0x138117D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1261 0x126117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1270 0x127017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1280 0x128017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1380 0x138017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1381 0x138117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ #ifndef PCIR_BARS @@ -120,30 +125,30 @@ #define PCIR_BAR(x) (PCIR_BARS + (x) * 4) #endif -#define PCI_BASE_ADDR0 0x10 -#define PCI_BASE_ADDR1 0x14 -#define PCI_BASE_ADDR2 0x18 -#define PCI_BASE_ADDR3 0x1C -#define PCI_BASE_ADDR4 0x20 -#define PCI_BASE_ADDR5 0x24 +#define PCI_BASE_ADDR0 0x10 +#define PCI_BASE_ADDR1 0x14 +#define PCI_BASE_ADDR2 0x18 +#define PCI_BASE_ADDR3 0x1C +#define PCI_BASE_ADDR4 0x20 +#define PCI_BASE_ADDR5 0x24 /* ********************************************************************************** ** ********************************************************************************** */ -#define ARCMSR_SCSICMD_IOCTL 0x77 -#define ARCMSR_CDEVSW_IOCTL 0x88 -#define ARCMSR_MESSAGE_FAIL 0x0001 -#define ARCMSR_MESSAGE_SUCCESS 0x0000 +#define ARCMSR_SCSICMD_IOCTL 0x77 +#define ARCMSR_CDEVSW_IOCTL 0x88 +#define ARCMSR_MESSAGE_FAIL 0x0001 +#define ARCMSR_MESSAGE_SUCCESS 0x0000 /* ********************************************************************************** ** ********************************************************************************** */ -#define arcmsr_ccbsrb_ptr spriv_ptr0 -#define arcmsr_ccbacb_ptr spriv_ptr1 -#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) -#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) +#define arcmsr_ccbsrb_ptr spriv_ptr0 +#define arcmsr_ccbacb_ptr spriv_ptr1 +#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) +#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) #define get_min(x,y) ((x) < (y) ? (x) : (y)) #define get_max(x,y) ((x) < (y) ? (y) : (x)) /* @@ -210,9 +215,9 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE _IOWR('F', FUNCTION_FLUSH_ADAPTER_CACHE, struct CMD_MESSAGE_FIELD) /* ARECA IOCTL ReturnCode */ -#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 -#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 -#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F +#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 +#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 +#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F #define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON 0x00000088 /* ************************************************************************ @@ -533,32 +538,32 @@ struct CMD_MESSAGE_FIELD { ************************************************************************************************ */ /* signature of set and get firmware config */ -#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 -#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 +#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 +#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 /* message code of inbound message register */ -#define ARCMSR_INBOUND_MESG0_NOP 0x00000000 -#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 -#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 -#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 -#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 -#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 -#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 -#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 -#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 +#define ARCMSR_INBOUND_MESG0_NOP 0x00000000 +#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 +#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 +#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 +#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 +#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 +#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 +#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 +#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 /* doorbell interrupt generator */ -#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 -#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 -#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 -#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 +#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 +#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 +#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 +#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 /* srb areca cdb flag */ -#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 -#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 -#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 -#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 +#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 +#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 +#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 +#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 #define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0 0x10000000 #define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1 0x00000001 /* outbound firmware ok */ -#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 +#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 /* ********************************** ** @@ -603,15 +608,15 @@ struct QBUFFER { #define ARCMSR_FW_CFGVER_OFFSET 25 struct FIRMWARE_INFO { - u_int32_t signature; /*0,00-03*/ - u_int32_t request_len; /*1,04-07*/ - u_int32_t numbers_queue; /*2,08-11*/ - u_int32_t sdram_size; /*3,12-15*/ - u_int32_t ide_channels; /*4,16-19*/ - char vendor[40]; /*5,20-59*/ - char model[8]; /*15,60-67*/ - char firmware_ver[16]; /*17,68-83*/ - char device_map[16]; /*21,84-99*/ + u_int32_t signature; /*0,00-03*/ + u_int32_t request_len; /*1,04-07*/ + u_int32_t numbers_queue; /*2,08-11*/ + u_int32_t sdram_size; /*3,12-15*/ + u_int32_t ide_channels; /*4,16-19*/ + char vendor[40]; /*5,20-59*/ + char model[8]; /*15,60-67*/ + char firmware_ver[16]; /*17,68-83*/ + char device_map[16]; /*21,84-99*/ u_int32_t cfgVersion; /*25,100-103 Added for checking of new firmware capability*/ char cfgSerial[16]; /*26,104-119*/ u_int32_t cfgPicStatus; /*30,120-123*/ @@ -649,33 +654,33 @@ struct FIRMWARE_INFO { ************************************************************************************************ */ struct ARCMSR_CDB { - u_int8_t Bus; /* 00h should be 0 */ - u_int8_t TargetID; /* 01h should be 0--15 */ - u_int8_t LUN; /* 02h should be 0--7 */ - u_int8_t Function; /* 03h should be 1 */ + u_int8_t Bus; /* 00h should be 0 */ + u_int8_t TargetID; /* 01h should be 0--15 */ + u_int8_t LUN; /* 02h should be 0--7 */ + u_int8_t Function; /* 03h should be 1 */ - u_int8_t CdbLength; /* 04h not used now */ - u_int8_t sgcount; /* 05h */ - u_int8_t Flags; /* 06h */ -#define ARCMSR_CDB_FLAG_SGL_BSIZE 0x01 /* bit 0: 0(256) / 1(512) bytes */ -#define ARCMSR_CDB_FLAG_BIOS 0x02 /* bit 1: 0(from driver) / 1(from BIOS) */ -#define ARCMSR_CDB_FLAG_WRITE 0x04 /* bit 2: 0(Data in) / 1(Data out) */ -#define ARCMSR_CDB_FLAG_SIMPLEQ 0x00 /* bit 4/3 ,00 : simple Q,01 : head of Q,10 : ordered Q */ -#define ARCMSR_CDB_FLAG_HEADQ 0x08 -#define ARCMSR_CDB_FLAG_ORDEREDQ 0x10 + u_int8_t CdbLength; /* 04h not used now */ + u_int8_t sgcount; /* 05h */ + u_int8_t Flags; /* 06h */ +#define ARCMSR_CDB_FLAG_SGL_BSIZE 0x01 /* bit 0: 0(256) / 1(512) bytes */ +#define ARCMSR_CDB_FLAG_BIOS 0x02 /* bit 1: 0(from driver) / 1(from BIOS) */ +#define ARCMSR_CDB_FLAG_WRITE 0x04 /* bit 2: 0(Data in) / 1(Data out) */ +#define ARCMSR_CDB_FLAG_SIMPLEQ 0x00 /* bit 4/3 ,00 : simple Q,01 : head of Q,10 : ordered Q */ +#define ARCMSR_CDB_FLAG_HEADQ 0x08 +#define ARCMSR_CDB_FLAG_ORDEREDQ 0x10 u_int8_t msgPages; /* 07h */ - u_int32_t Context; /* 08h Address of this request */ - u_int32_t DataLength; /* 0ch not used now */ + u_int32_t Context; /* 08h Address of this request */ + u_int32_t DataLength; /* 0ch not used now */ - u_int8_t Cdb[16]; /* 10h SCSI CDB */ + u_int8_t Cdb[16]; /* 10h SCSI CDB */ /* ******************************************************** **Device Status : the same from SCSI bus if error occur ** SCSI bus status codes. ******************************************************** */ - u_int8_t DeviceStatus; /* 20h if error */ + u_int8_t DeviceStatus; /* 20h if error */ #define SCSISTAT_GOOD 0x00 #define SCSISTAT_CHECK_CONDITION 0x02 #define SCSISTAT_CONDITION_MET 0x04 @@ -685,15 +690,15 @@ struct ARCMSR_CDB { #define SCSISTAT_RESERVATION_CONFLICT 0x18 #define SCSISTAT_COMMAND_TERMINATED 0x22 #define SCSISTAT_QUEUE_FULL 0x28 -#define ARCMSR_DEV_SELECT_TIMEOUT 0xF0 -#define ARCMSR_DEV_ABORTED 0xF1 -#define ARCMSR_DEV_INIT_FAIL 0xF2 +#define ARCMSR_DEV_SELECT_TIMEOUT 0xF0 +#define ARCMSR_DEV_ABORTED 0xF1 +#define ARCMSR_DEV_INIT_FAIL 0xF2 - u_int8_t SenseData[15]; /* 21h output */ + u_int8_t SenseData[15]; /* 21h output */ union { - struct SG32ENTRY sg32entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h Scatter gather address */ - struct SG64ENTRY sg64entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h */ + struct SG32ENTRY sg32entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h Scatter gather address */ + struct SG64ENTRY sg64entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h */ } u; }; /* @@ -706,23 +711,23 @@ struct ARCMSR_CDB { */ struct CommandControlBlock { struct ARCMSR_CDB arcmsr_cdb; /* 0 -503 (size of CDB=504): arcmsr messenger scsi command descriptor size 504 bytes */ - u_int32_t cdb_shifted_phyaddr; /* 504-507 */ + u_int32_t cdb_shifted_phyaddr; /* 504-507 */ u_int32_t arc_cdb_size; /* 508-511 */ /* ======================512+32 bytes============================ */ #if defined(__x86_64__) || defined(__amd64__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) union ccb *pccb; /* 512-515 516-519 pointer of freebsd scsi command */ struct AdapterControlBlock *acb; /* 520-523 524-527 */ - bus_dmamap_t dm_segs_dmamap; /* 528-531 532-535 */ - u_int16_t srb_flags; /* 536-537 */ - u_int16_t startdone; /* 538-539 */ - u_int32_t reserved2; /* 540-543 */ + bus_dmamap_t dm_segs_dmamap; /* 528-531 532-535 */ + u_int16_t srb_flags; /* 536-537 */ + u_int16_t startdone; /* 538-539 */ + u_int32_t reserved2; /* 540-543 */ #else union ccb *pccb; /* 512-515 pointer of freebsd scsi command */ struct AdapterControlBlock *acb; /* 516-519 */ - bus_dmamap_t dm_segs_dmamap; /* 520-523 */ - u_int16_t srb_flags; /* 524-525 */ - u_int16_t startdone; /* 526-527 */ - u_int32_t reserved2[4]; /* 528-531 532-535 536-539 540-543 */ + bus_dmamap_t dm_segs_dmamap; /* 520-523 */ + u_int16_t srb_flags; /* 524-525 */ + u_int16_t startdone; /* 526-527 */ + u_int32_t reserved2[4]; /* 528-531 532-535 536-539 540-543 */ #endif /* ========================================================== */ /* struct callout ccb_callout; */ @@ -752,37 +757,37 @@ struct CommandControlBlock { ** Adapter Control Block ********************************************************************* */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 09:28:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B2F6106566B; Sat, 13 Nov 2010 09:28:49 +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 690CB8FC0A; Sat, 13 Nov 2010 09:28:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAD9SnbZ042316; Sat, 13 Nov 2010 09:28:49 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAD9Snfx042314; Sat, 13 Nov 2010 09:28:49 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201011130928.oAD9Snfx042314@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 13 Nov 2010 09:28: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: r215235 - head/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 09:28:49 -0000 Author: jh Date: Sat Nov 13 09:28:49 2010 New Revision: 215235 URL: http://svn.freebsd.org/changeset/base/215235 Log: Set FD_CLOEXEC for the output file only when the file has been specified with the -o option. Setting the flag for stderr (the default) could cause the traced process to redirect stderr to a random file. PR: bin/152151 Submitted by: ashish MFC after: 5 days Modified: head/usr.bin/truss/main.c Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Sat Nov 13 08:58:36 2010 (r215234) +++ head/usr.bin/truss/main.c Sat Nov 13 09:28:49 2010 (r215235) @@ -241,13 +241,14 @@ main(int ac, char **av) if (fname != NULL) { /* Use output file */ if ((trussinfo->outfile = fopen(fname, "w")) == NULL) errx(1, "cannot open %s", fname); + /* + * Set FD_CLOEXEC, so that the output file is not shared with + * the traced process. + */ + if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == + -1) + warn("fcntl()"); } - /* - * Set FD_CLOEXEC, so that the output file is not shared with - * the traced process. - */ - if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == -1) - warn("fcntl()"); /* * If truss starts the process itself, it will ignore some signals -- From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 09:37:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0450A106564A; Sat, 13 Nov 2010 09:37:22 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0C9458FC15; Sat, 13 Nov 2010 09:37:20 +0000 (UTC) Received: by fxm19 with SMTP id 19so2874747fxm.13 for ; Sat, 13 Nov 2010 01:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :x-comment-to:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=OyLFoAdz0go8TZCkbe9FcgZo1M3qk00nja/G4+KKWGA=; b=w69FGw/ZzROv4tP1dUpkoj4V9buMsXDYTsAAOBXhServox3U/RgjtrOw8d65v4x40h Hvykda4mXNuV9NY88RIEwRgx79pC600Wf+iEArYsL6Hc0hnXOdW2T7+8peq/GhdzngKO yLf3ECmTfhtV7wemxO8jPxhr6S8YS2VH5n7OM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=ZfN1oPN187wSGxU941v0UsrGD0bwJiH9tzX0gRVGnrOhTDNrvMJPw4ZDh+BkYiKaA7 4XC/h0mowkfEodLhXkyW+ry7rQSO17/UvDHtC6GBEOd4Y5n1N7lNuRWPJ5/RtWBQ7jVF gAJPUUCRK5INNfkofPJhfnH2DXtVd491Zj5bI= Received: by 10.223.79.65 with SMTP id o1mr1199279fak.145.1289639358530; Sat, 13 Nov 2010 01:09:18 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id b15sm285074fah.28.2010.11.13.01.09.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 13 Nov 2010 01:09:16 -0800 (PST) From: Mikolaj Golub To: "George V. Neville-Neil" References: <201011122203.oACM32cN024939@svn.freebsd.org> X-Comment-To: George V. Neville-Neil Date: Sat, 13 Nov 2010 11:09:14 +0200 In-Reply-To: <201011122203.oACM32cN024939@svn.freebsd.org> (George V. Neville-Neil's message of "Fri, 12 Nov 2010 22:03:02 +0000 (UTC)") Message-ID: <86fwv57fph.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (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: r215207 - in head: sys/net sys/netinet tools/regression/netinet/arphold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 09:37:22 -0000 On Fri, 12 Nov 2010 22:03:02 +0000 (UTC) George V. Neville-Neil wrote: GVN> Author: gnn GVN> Date: Fri Nov 12 22:03:02 2010 GVN> New Revision: 215207 GVN> URL: http://svn.freebsd.org/changeset/base/215207 GVN> Modified: head/sys/net/if_llatbl.c GVN> ============================================================================== GVN> --- head/sys/net/if_llatbl.c Fri Nov 12 21:47:36 2010 (r215206) GVN> +++ head/sys/net/if_llatbl.c Fri Nov 12 22:03:02 2010 (r215207) GVN> @@ -100,18 +100,34 @@ done: GVN> * This function is called by the timer functions GVN> * such as arptimer() and nd6_llinfo_timer(), and GVN> * the caller does the locking. GVN> + * GVN> + * Returns the number of held packets, if any, that were dropped. GVN> */ GVN> -void GVN> +size_t GVN> llentry_free(struct llentry *lle) GVN> { GVN> - GVN> + size_t pkts_dropped; GVN> + struct mbuf *next; GVN> + GVN> + pkts_dropped = 0; GVN> LLE_WLOCK_ASSERT(lle); GVN> LIST_REMOVE(lle, lle_next); GVN> GVN> - if (lle->la_hold != NULL) GVN> + while ((lle->la_numheld > 0) && (lle->la_hold != NULL)) { GVN> + next = lle->la_hold->m_nextpkt; GVN> m_freem(lle->la_hold); GVN> + lle->la_hold = next; GVN> + lle->la_numheld--; GVN> + pkts_dropped++; GVN> + } GVN> + GVN> + KASSERT(lle->la_numheld == 0, GVN> + ("%s: la_numheld %d > 0, pkts_droped %ld", __func__, GVN> + lle->la_numheld, pkts_dropped)); cc -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -Werror /usr/src/sys/net/if_llatbl.c cc1: warnings being treated as errors /usr/src/sys/net/if_llatbl.c: In function 'llentry_free': /usr/src/sys/net/if_llatbl.c:124: warning: format '%ld' expects type 'long int', but argument 4 has type 'size_t' *** Error code 1 I think this should be: Index: sys/net/if_llatbl.c =================================================================== --- sys/net/if_llatbl.c (revision 215233) +++ sys/net/if_llatbl.c (working copy) @@ -122,7 +122,7 @@ llentry_free(struct llentry *lle) } KASSERT(lle->la_numheld == 0, - ("%s: la_numheld %d > 0, pkts_droped %ld", __func__, + ("%s: la_numheld %d > 0, pkts_droped %zu", __func__, lle->la_numheld, pkts_dropped)); LLE_FREE_LOCKED(lle); -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 09:40:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F08E3106564A; Sat, 13 Nov 2010 09:40:51 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6D78FC12; Sat, 13 Nov 2010 09:40:49 +0000 (UTC) Received: by fxm19 with SMTP id 19so2875527fxm.13 for ; Sat, 13 Nov 2010 01:40:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :x-comment-to:date:in-reply-to:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=iD8bP8tmmkqwhJwgJmynjrprxBkBdvwh8qArn4fOF5U=; b=K33HLVIeE+3vcUZR4G2yR4PHtTZ0eItw5Rcq6g2jCoIIMMy1GLallbxc5t0P8EmNkK rK+Taa71OMM7hgN+sXjDt5S/HI9t9hgVntqtqi5LQ2QRnzwbRzPgEFgY6HClPC0OySpK 0+r1WrU7Wsu9HKXw9Bbrp9vM4wiI8Lwx0ff00= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; b=mmgyEK+b1+krianmZg8yi5ikbFYo1PwmCbLXV60Mn6JVgqAa3zc48NrTDJ5T9aR6CU IHrvIYgp4rmNfj54xnAFS6xPWk+UK94j9OoXm3K9+yIYjOFJVAX6KqhOOQEW575PXFs1 arQvg/f8bZG2qk/mJ6on61RLJei4ZWBg8G2HA= Received: by 10.223.115.203 with SMTP id j11mr2438713faq.35.1289641249003; Sat, 13 Nov 2010 01:40:49 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id a24sm505516fak.1.2010.11.13.01.40.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 13 Nov 2010 01:40:47 -0800 (PST) From: Mikolaj Golub To: Lawrence Stewart References: <201011120641.oAC6fui3098584@svn.freebsd.org> X-Comment-To: Lawrence Stewart Date: Sat, 13 Nov 2010 11:40:43 +0200 In-Reply-To: <201011120641.oAC6fui3098584@svn.freebsd.org> (Lawrence Stewart's message of "Fri, 12 Nov 2010 06:41:56 +0000 (UTC)") Message-ID: <8662w17e90.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215166 - in head: . sys/conf sys/netinet sys/netinet/cc sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 09:40:52 -0000 On Fri, 12 Nov 2010 06:41:56 +0000 (UTC) Lawrence Stewart wrote: LS> Author: lstewart LS> Date: Fri Nov 12 06:41:55 2010 LS> New Revision: 215166 LS> URL: http://svn.freebsd.org/changeset/base/215166 LS> Log: LS> This commit marks the first formal contribution of the "Five New TCP Congestion LS> Control Algorithms for FreeBSD" FreeBSD Foundation funded project. More details LS> about the project are available at: http://caia.swin.edu.au/freebsd/5cc/ It looks like the code needs improvement to work with VIMAGE :-) options VIMAGE jail -i -c vnet persist path=/ panic: lock "cc_list" 0xc101c418 already initialized #0 doadump () at pcpu.h:231 #1 0xc04f26b9 in db_fncall (dummy1=-1064234614, dummy2=0, dummy3=-1, dummy4=0xca54b688 "\234¶TÊ") at /usr/src/sys/ddb/db_command.c:548 #2 0xc04f2aef in db_command (last_cmdp=0xc0e7957c, cmd_table=0x0, dopager=0) at /usr/src/sys/ddb/db_command.c:445 #3 0xc04f2ba4 in db_command_script (command=0xc0e7a484 "call doadump") at /usr/src/sys/ddb/db_command.c:516 #4 0xc04f6df0 in db_script_exec (scriptname=0xca54b794 "kdb.enter.panic", warnifnotfound=Variable "warnifnotfound" is not available.) at /usr/src/sys/ddb/db_script.c:302 #5 0xc04f6ed7 in db_script_kdbenter (eventname=0xc0d2410e "panic") at /usr/src/sys/ddb/db_script.c:324 #6 0xc04f4b28 in db_trap (type=3, code=0) at /usr/src/sys/ddb/db_main.c:228 #7 0xc0910fbe in kdb_trap (type=3, code=0, tf=0xca54b918) at /usr/src/sys/kern/subr_kdb.c:546 #8 0xc0c3d7c6 in trap (frame=0xca54b918) at /usr/src/sys/i386/i386/trap.c:732 #9 0xc0c2647c in calltrap () at /usr/src/sys/i386/i386/exception.s:168 #10 0xc091118a in kdb_enter (why=0xc0d2410e "panic", msg=0xc0d2410e "panic") at cpufunc.h:71 #11 0xc08dcd14 in panic (fmt=0xc0d27986 "lock \"%s\" %p already initialized") at /usr/src/sys/kern/kern_shutdown.c:574 #12 0xc0911bd4 in lock_init (lock=0xc147b204, class=0xc0e23a00, name=0xc0d3f215 "cc_list", type=0x0, flags=2228224) at /usr/src/sys/kern/subr_lock.c:81 #13 0xc08daf5d in rw_init_flags (rw=0xc101c418, name=0xc0d3f215 "cc_list", opts=0) at /usr/src/sys/kern/kern_rwlock.c:195 #14 0xc0a0d0c2 in cc_init () at /usr/src/sys/netinet/cc/cc.c:182 #15 0xc0a7a4fd in tcp_init () at /usr/src/sys/netinet/tcp_subr.c:281 #16 0xc0940e59 in protosw_init (pr=0x0) at /usr/src/sys/kern/uipc_domain.c:157 #17 0xc0940e87 in domain_init (arg=0xc0e34280) at /usr/src/sys/kern/uipc_domain.c:174 #18 0xc0940ee1 in vnet_domain_init (arg=0xc0e34280) at /usr/src/sys/kern/uipc_domain.c:190 #19 0xc09adb2e in vnet_sysinit () at /usr/src/sys/net/vnet.c:625 #20 0xc09ae1ef in vnet_alloc () at /usr/src/sys/net/vnet.c:254 #21 0xc08ba41a in kern_jail_set (td=0xc306d870, optuio=0xc2d66a80, flags=0) at /usr/src/sys/kern/kern_jail.c:1244 #22 0xc08bbd00 in jail_set (td=0xc306d870, uap=0xca54bcec) at /usr/src/sys/kern/kern_jail.c:489 #23 0xc091e903 in syscallenter (td=0xc306d870, sa=0xca54bce4) at /usr/src/sys/kern/subr_trap.c:318 #24 0xc0c3cebf in syscall (frame=0xca54bd28) at /usr/src/sys/i386/i386/trap.c:1095 #25 0xc0c26511 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:266 #26 0x00000033 in ?? () -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 10:38:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99E05106566C; Sat, 13 Nov 2010 10:38:06 +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 859578FC14; Sat, 13 Nov 2010 10:38:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADAc6Zd043791; Sat, 13 Nov 2010 10:38:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADAc6OV043787; Sat, 13 Nov 2010 10:38:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011131038.oADAc6OV043787@svn.freebsd.org> From: Xin LI Date: Sat, 13 Nov 2010 10:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215236 - in head: include lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 10:38:06 -0000 Author: delphij Date: Sat Nov 13 10:38:06 2010 New Revision: 215236 URL: http://svn.freebsd.org/changeset/base/215236 Log: Sync with OpenBSD, primarily better signal and terminal handling. Obtained from: OpenBSD MFC after: 2 weeks Modified: head/include/readpassphrase.h head/lib/libc/gen/readpassphrase.3 head/lib/libc/gen/readpassphrase.c Modified: head/include/readpassphrase.h ============================================================================== --- head/include/readpassphrase.h Sat Nov 13 09:28:49 2010 (r215235) +++ head/include/readpassphrase.h Sat Nov 13 10:38:06 2010 (r215236) @@ -1,31 +1,24 @@ -/* $OpenBSD: /usr/local/www/cvsroot/OpenBSD/src/include/readpassphrase.h,v 1.2 2002/02/16 21:27:17 millert Exp $ */ +/* $OpenBSD: readpassphrase.h,v 1.5 2003/06/17 21:56:23 millert Exp $ */ /* $FreeBSD$ */ /* - * Copyright (c) 2000 Todd C. Miller - * All rights reserved. + * Copyright (c) 2000, 2002 Todd C. Miller * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ #ifndef _READPASSPHRASE_H_ @@ -37,6 +30,7 @@ #define RPP_FORCELOWER 0x04 /* Force input to lower case. */ #define RPP_FORCEUPPER 0x08 /* Force input to upper case. */ #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */ +#define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */ #include #include Modified: head/lib/libc/gen/readpassphrase.3 ============================================================================== --- head/lib/libc/gen/readpassphrase.3 Sat Nov 13 09:28:49 2010 (r215235) +++ head/lib/libc/gen/readpassphrase.3 Sat Nov 13 10:38:06 2010 (r215236) @@ -1,33 +1,26 @@ -.\" $OpenBSD: readpassphrase.3,v 1.7 2001/12/15 15:37:51 millert Exp $ +.\" $OpenBSD: readpassphrase.3,v 1.17 2007/05/31 19:19:28 jmc Exp $ .\" -.\" Copyright (c) 2000 Todd C. Miller -.\" All rights reserved. +.\" Copyright (c) 2000, 2002 Todd C. Miller .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" Sponsored in part by the Defense Advanced Research Projects +.\" Agency (DARPA) and Air Force Research Laboratory, Air Force +.\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ .\" -.Dd December 7, 2001 +.Dd May 31, 2007 .Dt READPASSPHRASE 3 .Os .Sh NAME @@ -79,6 +72,8 @@ force input to lower case force input to upper case .It Dv RPP_SEVENBIT strip the high bit from input +.It Dv RPP_STDIN +force read of passphrase from stdin .El .Pp The calling process should zero the passphrase as soon as possible to @@ -87,7 +82,7 @@ space. .Sh RETURN VALUES Upon successful completion, .Fn readpassphrase -returns a pointer to the null-terminated passphrase. +returns a pointer to the NUL-terminated passphrase. If an error is encountered, the terminal state is restored and a .Dv NULL @@ -117,40 +112,6 @@ if (compare(transform(passbuf), epass) ! memset(passbuf, 0, sizeof(passbuf)); .Ed -.Sh SIGNALS -The -.Fn readpassphrase -function -will catch the following signals: -.Pp -.Bl -tag -compact -.It Dv SIGINT -.It Dv SIGHUP -.It Dv SIGQUIT -.It Dv SIGTERM -.It Dv SIGTSTP -.It Dv SIGTTIN -.It Dv SIGTTOU -.El -.Pp -When one of the above signals is intercepted, terminal echo will -be restored if it had previously been turned off. -If a signal handler was installed for the signal when -.Fn readpassphrase -was called that handler is then executed. -If no handler was previously installed for the signal then the -default action is taken as per -.Xr sigaction 2 . -.Pp -The -.Dv SIGTSTP , SIGTTIN , -and -.Dv SIGTTOU -signals (stop signal generated from keyboard or due to terminal I/O -from a background process) are treated specially. -When the process is resumed after it has been stopped, -.Fn readpassphrase -will reprint the prompt and the user may then enter a passphrase. .Sh ERRORS .Bl -tag -width Er .It Bq Er EINTR @@ -159,14 +120,14 @@ The function was interrupted by a signal. .It Bq Er EINVAL The -.Fa bufsiz +.Ar bufsiz argument was zero. .It Bq Er EIO The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the .Dv SIGTTIN -signal or the process group is orphaned. +signal, or the process group is orphaned. .It Bq Er EMFILE The process has already reached its limit for open file descriptors. .It Bq Er ENFILE @@ -176,6 +137,35 @@ There is no controlling terminal and the .Dv RPP_REQUIRE_TTY flag was specified. .El +.Sh SIGNALS +The +.Fn readpassphrase +function +will catch the following signals: +.Bd -literal -offset indent +SIGALRM SIGHUP SIGINT +SIGPIPE SIGQUIT SIGTERM +SIGTSTP SIGTTIN SIGTTOU +.Ed +.Pp +When one of the above signals is intercepted, terminal echo will +be restored if it had previously been turned off. +If a signal handler was installed for the signal when +.Fn readpassphrase +was called, that handler is then executed. +If no handler was previously installed for the signal then the +default action is taken as per +.Xr sigaction 2 . +.Pp +The +.Dv SIGTSTP , SIGTTIN +and +.Dv SIGTTOU +signals (stop signals generated from keyboard or due to terminal I/O +from a background process) are treated specially. +When the process is resumed after it has been stopped, +.Fn readpassphrase +will reprint the prompt and the user may then enter a passphrase. .Sh SEE ALSO .Xr sigaction 2 , .Xr getpass 3 Modified: head/lib/libc/gen/readpassphrase.c ============================================================================== --- head/lib/libc/gen/readpassphrase.c Sat Nov 13 09:28:49 2010 (r215235) +++ head/lib/libc/gen/readpassphrase.c Sat Nov 13 10:38:06 2010 (r215236) @@ -1,35 +1,26 @@ -/* $OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.23 2010/05/14 13:30:34 millert Exp $ */ /* - * Copyright (c) 2000 Todd C. Miller - * All rights reserved. + * Copyright (c) 2000-2002, 2007, 2010 + * Todd C. Miller * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -46,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -static volatile sig_atomic_t signo; +static volatile sig_atomic_t signo[NSIG]; static void handler(int); @@ -54,11 +45,11 @@ char * readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) { ssize_t nr; - int input, output, save_errno; + int input, output, save_errno, i, need_restart; char ch, *p, *end; struct termios term, oterm; - struct sigaction sa, saveint, savehup, savequit, saveterm; - struct sigaction savetstp, savettin, savettou; + struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; + struct sigaction savetstp, savettin, savettou, savepipe; /* I suppose we could alloc on demand in this case (XXX). */ if (bufsiz == 0) { @@ -67,11 +58,17 @@ readpassphrase(const char *prompt, char } restart: + for (i = 0; i < NSIG; i++) + signo[i] = 0; + nr = -1; + save_errno = 0; + need_restart = 0; /* * Read and write to /dev/tty if available. If not, read from * stdin and write to stderr unless a tty is required. */ - if ((input = output = _open(_PATH_TTY, O_RDWR)) == -1) { + if ((flags & RPP_STDIN) || + (input = output = _open(_PATH_TTY, O_RDWR)) == -1) { if (flags & RPP_REQUIRE_TTY) { errno = ENOTTY; return(NULL); @@ -81,45 +78,55 @@ restart: } /* + * Turn off echo if possible. + * If we are using a tty but are not the foreground pgrp this will + * generate SIGTTOU, so do it *before* installing the signal handlers. + */ + if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { + memcpy(&term, &oterm, sizeof(term)); + if (!(flags & RPP_ECHO_ON)) + term.c_lflag &= ~(ECHO | ECHONL); + if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) + term.c_cc[VSTATUS] = _POSIX_VDISABLE; + (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); + } else { + memset(&term, 0, sizeof(term)); + term.c_lflag |= ECHO; + memset(&oterm, 0, sizeof(oterm)); + oterm.c_lflag |= ECHO; + } + + /* * Catch signals that would otherwise cause the user to end * up with echo turned off in the shell. Don't worry about - * things like SIGALRM and SIGPIPE for now. + * things like SIGXCPU and SIGVTALRM for now. */ sigemptyset(&sa.sa_mask); sa.sa_flags = 0; /* don't restart system calls */ sa.sa_handler = handler; - (void)_sigaction(SIGINT, &sa, &saveint); + (void)_sigaction(SIGALRM, &sa, &savealrm); (void)_sigaction(SIGHUP, &sa, &savehup); + (void)_sigaction(SIGINT, &sa, &saveint); + (void)_sigaction(SIGPIPE, &sa, &savepipe); (void)_sigaction(SIGQUIT, &sa, &savequit); (void)_sigaction(SIGTERM, &sa, &saveterm); (void)_sigaction(SIGTSTP, &sa, &savetstp); (void)_sigaction(SIGTTIN, &sa, &savettin); (void)_sigaction(SIGTTOU, &sa, &savettou); - /* Turn off echo if possible. */ - if (tcgetattr(input, &oterm) == 0) { - memcpy(&term, &oterm, sizeof(term)); - if (!(flags & RPP_ECHO_ON)) - term.c_lflag &= ~(ECHO | ECHONL); - if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) - term.c_cc[VSTATUS] = _POSIX_VDISABLE; - (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); - } else { - memset(&term, 0, sizeof(term)); - memset(&oterm, 0, sizeof(oterm)); - } - - (void)_write(output, prompt, strlen(prompt)); + if (!(flags & RPP_STDIN)) + (void)_write(output, prompt, strlen(prompt)); end = buf + bufsiz - 1; - for (p = buf; (nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r';) { + p = buf; + while ((nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') { if (p < end) { if ((flags & RPP_SEVENBIT)) ch &= 0x7f; if (isalpha(ch)) { if ((flags & RPP_FORCELOWER)) - ch = tolower(ch); + ch = (char)tolower(ch); if ((flags & RPP_FORCEUPPER)) - ch = toupper(ch); + ch = (char)toupper(ch); } *p++ = ch; } @@ -130,11 +137,16 @@ restart: (void)_write(output, "\n", 1); /* Restore old terminal settings and signals. */ - if (memcmp(&term, &oterm, sizeof(term)) != 0) - (void)tcsetattr(input, TCSANOW|TCSASOFT, &oterm); - (void)_sigaction(SIGINT, &saveint, NULL); + if (memcmp(&term, &oterm, sizeof(term)) != 0) { + while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 && + errno == EINTR && !signo[SIGTTOU]) + continue; + } + (void)_sigaction(SIGALRM, &savealrm, NULL); (void)_sigaction(SIGHUP, &savehup, NULL); + (void)_sigaction(SIGINT, &saveint, NULL); (void)_sigaction(SIGQUIT, &savequit, NULL); + (void)_sigaction(SIGPIPE, &savepipe, NULL); (void)_sigaction(SIGTERM, &saveterm, NULL); (void)_sigaction(SIGTSTP, &savetstp, NULL); (void)_sigaction(SIGTTIN, &savettin, NULL); @@ -146,18 +158,22 @@ restart: * If we were interrupted by a signal, resend it to ourselves * now that we have restored the signal handlers. */ - if (signo) { - kill(getpid(), signo); - switch (signo) { - case SIGTSTP: - case SIGTTIN: - case SIGTTOU: - signo = 0; - goto restart; + for (i = 0; i < NSIG; i++) { + if (signo[i]) { + kill(getpid(), i); + switch (i) { + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + need_restart = 1; + } } } + if (need_restart) + goto restart; - errno = save_errno; + if (save_errno) + errno = save_errno; return(nr == -1 ? NULL : buf); } @@ -174,5 +190,5 @@ getpass(const char *prompt) static void handler(int s) { - signo = s; + signo[s] = 1; } From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 10:45:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EC2106566B; Sat, 13 Nov 2010 10:45:00 +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 B68E78FC15; Sat, 13 Nov 2010 10:44:58 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA12132; Sat, 13 Nov 2010 12:44:57 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1PHDbM-000Muv-S8; Sat, 13 Nov 2010 12:44:56 +0200 Message-ID: <4CDE6BD8.7040501@freebsd.org> Date: Sat, 13 Nov 2010 12:43:36 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Dimitry Andric References: <201011122259.oACMxoIV026900@svn.freebsd.org> In-Reply-To: <201011122259.oACMxoIV026900@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215212 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 10:45:00 -0000 on 13/11/2010 00:59 Dimitry Andric said the following: > Author: dim > Date: Fri Nov 12 22:59:50 2010 > New Revision: 215212 > URL: http://svn.freebsd.org/changeset/base/215212 > > Log: > Similar to r212647, remove the workaround in sys/net/vnet.h for an ld > bug (incorrect placement of __start_SECNAME in some cases) that was > fixed in r210245. Thanks! > There is already an UPDATING entry about needing a recent ld. > > MFC after: 1 month > > Modified: > head/sys/net/vnet.h > > Modified: head/sys/net/vnet.h > ============================================================================== > --- head/sys/net/vnet.h Fri Nov 12 22:43:40 2010 (r215211) > +++ head/sys/net/vnet.h Fri Nov 12 22:59:50 2010 (r215212) > @@ -193,15 +193,6 @@ extern struct sx vnet_sxlock; > * Virtual network stack memory allocator, which allows global variables to > * be automatically instantiated for each network stack instance. > */ > -__asm__( > -#if defined(__arm__) > - ".section " VNET_SETNAME ", \"aw\", %progbits\n" > -#else > - ".section " VNET_SETNAME ", \"aw\", @progbits\n" > -#endif > - "\t.p2align " __XSTRING(CACHE_LINE_SHIFT) "\n" > - "\t.previous"); > - > #define VNET_NAME(n) vnet_entry_##n > #define VNET_DECLARE(t, n) extern t VNET_NAME(n) > #define VNET_DEFINE(t, n) t VNET_NAME(n) __section(VNET_SETNAME) __used -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 10:54:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8455B106564A; Sat, 13 Nov 2010 10:54:10 +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 57D358FC08; Sat, 13 Nov 2010 10:54:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADAsAHs045099; Sat, 13 Nov 2010 10:54:10 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADAsA7I045096; Sat, 13 Nov 2010 10:54:10 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201011131054.oADAsA7I045096@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 13 Nov 2010 10:54: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: r215237 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 10:54:10 -0000 Author: uqs Date: Sat Nov 13 10:54:10 2010 New Revision: 215237 URL: http://svn.freebsd.org/changeset/base/215237 Log: Fix bug in jn(3) and jnf(3) that led to -inf results Explanation by Steve: jn[f](n,x) for certain ranges of x uses downward recursion to compute the value of the function. The recursion sequence that is generated is proportional to the actual desired value, so a normalization step is taken. This normalization is j0[f](x) divided by the zeroth sequence member. As Bruce notes, near the zeros of j0[f](x) the computed value can have giga-ULP inaccuracy. I found for the 1st zero of j0f(x) only the leading decimal digit is correct. The solution to the issue is fairly straight forward. The zeros of j0(x) and j1(x) never coincide, so as j0(x) approaches a zero, the normalization constant switches to j1[f](x) divided by the 2nd sequence member. The expectation is that j1[f](x) is a more accurately computed value. PR: bin/144306 Submitted by: Steven G. Kargl Reviewed by: bde MFC after: 7 days Modified: head/lib/msun/src/e_jn.c head/lib/msun/src/e_jnf.c Modified: head/lib/msun/src/e_jn.c ============================================================================== --- head/lib/msun/src/e_jn.c Sat Nov 13 10:38:06 2010 (r215236) +++ head/lib/msun/src/e_jn.c Sat Nov 13 10:54:10 2010 (r215237) @@ -200,7 +200,12 @@ __ieee754_jn(int n, double x) } } } - b = (t*__ieee754_j0(x)/b); + z = __ieee754_j0(x); + w = __ieee754_j1(x); + if (fabs(z) >= fabs(w)) + b = (t*z/b); + else + b = (t*w/a); } } if(sgn==1) return -b; else return b; Modified: head/lib/msun/src/e_jnf.c ============================================================================== --- head/lib/msun/src/e_jnf.c Sat Nov 13 10:38:06 2010 (r215236) +++ head/lib/msun/src/e_jnf.c Sat Nov 13 10:54:10 2010 (r215237) @@ -152,7 +152,12 @@ __ieee754_jnf(int n, float x) } } } - b = (t*__ieee754_j0f(x)/b); + z = __ieee754_j0f(x); + w = __ieee754_j1f(x); + if (fabsf(z) >= fabsf(w)) + b = (t*z/b); + else + b = (t*w/a); } } if(sgn==1) return -b; else return b; From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 11:11:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24D281065694; Sat, 13 Nov 2010 11:11:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1330E8FC1C; Sat, 13 Nov 2010 11:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADBBpww045521; Sat, 13 Nov 2010 11:11:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADBBpQ5045519; Sat, 13 Nov 2010 11:11:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011131111.oADBBpQ5045519@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Nov 2010 11:11: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: r215238 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 11:11:52 -0000 Author: kib Date: Sat Nov 13 11:11:51 2010 New Revision: 215238 URL: http://svn.freebsd.org/changeset/base/215238 Log: Use 'z' modifier for size_t printing. Modified: head/sys/net/if_llatbl.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Sat Nov 13 10:54:10 2010 (r215237) +++ head/sys/net/if_llatbl.c Sat Nov 13 11:11:51 2010 (r215238) @@ -122,7 +122,7 @@ llentry_free(struct llentry *lle) } KASSERT(lle->la_numheld == 0, - ("%s: la_numheld %d > 0, pkts_droped %ld", __func__, + ("%s: la_numheld %d > 0, pkts_droped %zd", __func__, lle->la_numheld, pkts_dropped)); LLE_FREE_LOCKED(lle); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 11:15:07 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 686281065672; Sat, 13 Nov 2010 11:15:07 +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 C61B58FC0A; Sat, 13 Nov 2010 11:15:06 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 4C55F7E84A; Sat, 13 Nov 2010 22:14:58 +1100 (EST) Message-ID: <4CDE7330.3060705@freebsd.org> Date: Sat, 13 Nov 2010 22:14:56 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.9) Gecko/20101006 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: Mikolaj Golub References: <201011120641.oAC6fui3098584@svn.freebsd.org> <8662w17e90.fsf@kopusha.home.net> In-Reply-To: <8662w17e90.fsf@kopusha.home.net> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r215166 - in head: . sys/conf sys/netinet sys/netinet/cc sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 11:15:07 -0000 On 11/13/10 20:40, Mikolaj Golub wrote: > > On Fri, 12 Nov 2010 06:41:56 +0000 (UTC) Lawrence Stewart wrote: > > LS> Author: lstewart > LS> Date: Fri Nov 12 06:41:55 2010 > LS> New Revision: 215166 > LS> URL: http://svn.freebsd.org/changeset/base/215166 > > LS> Log: > LS> This commit marks the first formal contribution of the "Five New TCP Congestion > LS> Control Algorithms for FreeBSD" FreeBSD Foundation funded project. More details > LS> about the project are available at: http://caia.swin.edu.au/freebsd/5cc/ > > It looks like the code needs improvement to work with VIMAGE :-) > > options VIMAGE > > jail -i -c vnet persist path=/ > > panic: lock "cc_list" 0xc101c418 already initialized > > #0 doadump () at pcpu.h:231 > #1 0xc04f26b9 in db_fncall (dummy1=-1064234614, dummy2=0, dummy3=-1, > dummy4=0xca54b688 "\234¶TÊ") at /usr/src/sys/ddb/db_command.c:548 > #2 0xc04f2aef in db_command (last_cmdp=0xc0e7957c, cmd_table=0x0, dopager=0) > at /usr/src/sys/ddb/db_command.c:445 > #3 0xc04f2ba4 in db_command_script (command=0xc0e7a484 "call doadump") > at /usr/src/sys/ddb/db_command.c:516 > #4 0xc04f6df0 in db_script_exec (scriptname=0xca54b794 "kdb.enter.panic", warnifnotfound=Variable "warnifnotfound" is not available.) > at /usr/src/sys/ddb/db_script.c:302 > #5 0xc04f6ed7 in db_script_kdbenter (eventname=0xc0d2410e "panic") > at /usr/src/sys/ddb/db_script.c:324 > #6 0xc04f4b28 in db_trap (type=3, code=0) at /usr/src/sys/ddb/db_main.c:228 > #7 0xc0910fbe in kdb_trap (type=3, code=0, tf=0xca54b918) at /usr/src/sys/kern/subr_kdb.c:546 > #8 0xc0c3d7c6 in trap (frame=0xca54b918) at /usr/src/sys/i386/i386/trap.c:732 > #9 0xc0c2647c in calltrap () at /usr/src/sys/i386/i386/exception.s:168 > #10 0xc091118a in kdb_enter (why=0xc0d2410e "panic", msg=0xc0d2410e "panic") at cpufunc.h:71 > #11 0xc08dcd14 in panic (fmt=0xc0d27986 "lock \"%s\" %p already initialized") > at /usr/src/sys/kern/kern_shutdown.c:574 > #12 0xc0911bd4 in lock_init (lock=0xc147b204, class=0xc0e23a00, name=0xc0d3f215 "cc_list", > type=0x0, flags=2228224) at /usr/src/sys/kern/subr_lock.c:81 > #13 0xc08daf5d in rw_init_flags (rw=0xc101c418, name=0xc0d3f215 "cc_list", opts=0) > at /usr/src/sys/kern/kern_rwlock.c:195 > #14 0xc0a0d0c2 in cc_init () at /usr/src/sys/netinet/cc/cc.c:182 > #15 0xc0a7a4fd in tcp_init () at /usr/src/sys/netinet/tcp_subr.c:281 > #16 0xc0940e59 in protosw_init (pr=0x0) at /usr/src/sys/kern/uipc_domain.c:157 > #17 0xc0940e87 in domain_init (arg=0xc0e34280) at /usr/src/sys/kern/uipc_domain.c:174 > #18 0xc0940ee1 in vnet_domain_init (arg=0xc0e34280) at /usr/src/sys/kern/uipc_domain.c:190 > #19 0xc09adb2e in vnet_sysinit () at /usr/src/sys/net/vnet.c:625 > #20 0xc09ae1ef in vnet_alloc () at /usr/src/sys/net/vnet.c:254 > #21 0xc08ba41a in kern_jail_set (td=0xc306d870, optuio=0xc2d66a80, flags=0) > at /usr/src/sys/kern/kern_jail.c:1244 > #22 0xc08bbd00 in jail_set (td=0xc306d870, uap=0xca54bcec) at /usr/src/sys/kern/kern_jail.c:489 > #23 0xc091e903 in syscallenter (td=0xc306d870, sa=0xca54bce4) > at /usr/src/sys/kern/subr_trap.c:318 > #24 0xc0c3cebf in syscall (frame=0xca54bd28) at /usr/src/sys/i386/i386/trap.c:1095 > #25 0xc0c26511 in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:266 > #26 0x00000033 in ?? () > Gah, didn't occur to me that cc_init() could be called multiple times. I think I know how to fix it but probably won't get to look at this until tomorrow. Thanks for the report. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 11:43:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C68C7106564A; Sat, 13 Nov 2010 11:43:20 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48B88FC0A; Sat, 13 Nov 2010 11:43:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADBhK5I046160; Sat, 13 Nov 2010 11:43:20 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADBhKoL046158; Sat, 13 Nov 2010 11:43:20 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011131143.oADBhKoL046158@svn.freebsd.org> From: Bruce Cran Date: Sat, 13 Nov 2010 11:43: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: r215239 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 11:43:20 -0000 Author: brucec Date: Sat Nov 13 11:43:20 2010 New Revision: 215239 URL: http://svn.freebsd.org/changeset/base/215239 Log: Memory stats are reported in bytes, not pages. PR: docs/151283 Submitted by: Bas Smeelen MFC after: 3 days Modified: head/usr.bin/top/top.local.1 Modified: head/usr.bin/top/top.local.1 ============================================================================== --- head/usr.bin/top/top.local.1 Sat Nov 13 11:11:51 2010 (r215238) +++ head/usr.bin/top/top.local.1 Sat Nov 13 11:43:20 2010 (r215239) @@ -6,8 +6,8 @@ The '-H' option will toggle the display At runtime the 'H' key will toggle this mode. The default is OFF. .SH DESCRIPTION OF MEMORY -Mem: 9220K Active, 1032K Inact, 3284K Wired, 1MB Cache, 2M Buf, 1320K Free -Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104 K Out +Mem: 9220K Active, 1032K Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free +Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out .B K: Kilobyte @@ -19,23 +19,23 @@ Megabyte 1/100 .TP .B Active: -number of pages active +number of bytes active .TP .B Inact: -number of pages inactive +number of bytes inactive .TP .B Wired: -number of pages wired down, including cached file data pages +number of bytes wired down, including cached file data pages .TP .B Cache: -number of clean pages caching data that are available for +number of clean bytes caching data that are available for immediate reallocation .TP .B Buf: -number of pages used for BIO-level disk caching +number of bytes used for BIO-level disk caching .TP .B Free: -number of pages free +number of bytes free .TP .B Total: total available swap usage @@ -47,7 +47,7 @@ total free swap usage swap usage .TP .B In: -pages paged in from swap devices (last interval) +bytes paged in from swap devices (last interval) .TP .B Out: -pages paged out to swap devices (last interval) +bytes paged out to swap devices (last interval) From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 11:54:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ED231065675; Sat, 13 Nov 2010 11:54:05 +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 3D2278FC15; Sat, 13 Nov 2010 11:54:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADBs5Ih046417; Sat, 13 Nov 2010 11:54:05 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADBs5hx046415; Sat, 13 Nov 2010 11:54:05 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201011131154.oADBs5hx046415@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 13 Nov 2010 11:54: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: r215240 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 11:54:05 -0000 Author: trasz Date: Sat Nov 13 11:54:04 2010 New Revision: 215240 URL: http://svn.freebsd.org/changeset/base/215240 Log: Remove unused variables. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sat Nov 13 11:43:20 2010 (r215239) +++ head/sys/kern/sched_ule.c Sat Nov 13 11:54:04 2010 (r215240) @@ -1675,23 +1675,19 @@ sched_prio(struct thread *td, u_char pri void sched_user_prio(struct thread *td, u_char prio) { - u_char oldprio; td->td_base_user_pri = prio; if (td->td_flags & TDF_UBORROWING && td->td_user_pri <= prio) return; - oldprio = td->td_user_pri; td->td_user_pri = prio; } void sched_lend_user_prio(struct thread *td, u_char prio) { - u_char oldprio; THREAD_LOCK_ASSERT(td, MA_OWNED); td->td_flags |= TDF_UBORROWING; - oldprio = td->td_user_pri; td->td_user_pri = prio; } From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 12:23:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB3381065670; Sat, 13 Nov 2010 12:23:03 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 524578FC19; Sat, 13 Nov 2010 12:23:03 +0000 (UTC) Received: by qyk2 with SMTP id 2so444073qyk.13 for ; Sat, 13 Nov 2010 04:23:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=fqvr9+olwtihak1drhyjhlCBLRujZJRlsLW4kroS1sU=; b=Zsy+HgU3NUFlt7mmRYC1N9M/L8OrgBp8KOQA29Oyk3SCaEr9bEwks0b2CYV9WWeMqw sCPOWEwNnAYSG6/2qb1496ECcgHSdAtb3NRF0G2iGNfdEfOvmL3YPFatPEz9BHOfsuF8 PHxZfHkhxJh0TKoGhrS6XdhJ2szxhVaNEGs1s= DomainKey-Signature: a=rsa-sha1; c=nofws; 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 :content-transfer-encoding; b=EPKoT/vMuQOoyUAtEc1/Da+ws7IGZ5mwTAjqe3D+0qObYM54/vQv8LUw8MmIycKc4X 0V76Qpx7Ub1DiObFFeEw3oeljnCJkGAhVwA2n8ACdaY83H3HfmnsdNhlptFRnH0To9Sk 29plTjn+9sP1cg7CPTelXU9JM1xH95845Noys= MIME-Version: 1.0 Received: by 10.229.190.145 with SMTP id di17mr2906314qcb.252.1289649393022; Sat, 13 Nov 2010 03:56:33 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.229.69.135 with HTTP; Sat, 13 Nov 2010 03:56:32 -0800 (PST) In-Reply-To: <201011131143.oADBhKoL046158@svn.freebsd.org> References: <201011131143.oADBhKoL046158@svn.freebsd.org> Date: Sat, 13 Nov 2010 14:56:32 +0300 X-Google-Sender-Auth: LNALmbOQQ5NYLsApyjCC9fsJu1o Message-ID: From: Sergey Kandaurov To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215239 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 12:23:04 -0000 On 13 November 2010 14:43, Bruce Cran wrote: > Author: brucec > Date: Sat Nov 13 11:43:20 2010 > New Revision: 215239 > URL: http://svn.freebsd.org/changeset/base/215239 > > Log: > =A0Memory stats are reported in bytes, not pages. > > =A0PR: =A0 docs/151283 > =A0Submitted by: Bas Smeelen > =A0MFC after: 3 days > Hi. The downside is that usually active/passive/inactive operations are performed over pages, not bytes, since a page is usually the minimum unit of memory manage= ment. The sentences resulted after this change sound now weird for me. > Modified: > =A0head/usr.bin/top/top.local.1 > > Modified: head/usr.bin/top/top.local.1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/top/top.local.1 =A0 =A0 =A0 =A0Sat Nov 13 11:11:51 2010 = =A0 =A0 =A0 =A0(r215238) > +++ head/usr.bin/top/top.local.1 =A0 =A0 =A0 =A0Sat Nov 13 11:43:20 2010 = =A0 =A0 =A0 =A0(r215239) > @@ -6,8 +6,8 @@ The '-H' option will toggle the display > =A0At runtime the 'H' key will toggle this mode. The default is OFF. > > =A0.SH DESCRIPTION OF MEMORY > -Mem: 9220K Active, 1032K Inact, 3284K Wired, 1MB Cache, 2M Buf, 1320K Fr= ee > -Swap: =A0 91M Total, 79M Free, 13% Inuse, 80K In, 104 K Out > +Mem: 9220K Active, 1032K Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Fre= e > +Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out > > =A0.B K: > =A0Kilobyte > @@ -19,23 +19,23 @@ Megabyte > =A01/100 > =A0.TP > =A0.B Active: > -number of pages active > +number of bytes active > =A0.TP > =A0.B Inact: > -number of pages inactive > +number of bytes inactive > =A0.TP > =A0.B Wired: > -number of pages wired down, including cached file data pages > +number of bytes wired down, including cached file data pages > =A0.TP > =A0.B Cache: > -number of clean pages caching data that are available for > +number of clean bytes caching data that are available for > =A0immediate reallocation > =A0.TP > =A0.B Buf: > -number of pages used for BIO-level disk caching > +number of bytes used for BIO-level disk caching > =A0.TP > =A0.B Free: > -number of pages free > +number of bytes free > =A0.TP > =A0.B Total: > =A0total available swap usage > @@ -47,7 +47,7 @@ total free swap usage > =A0swap usage > =A0.TP > =A0.B In: > -pages paged in from swap devices (last interval) > +bytes paged in from swap devices (last interval) > =A0.TP > =A0.B Out: > -pages paged out to swap devices (last interval) > +bytes paged out to swap devices (last interval) > From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 12:29:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 600991065728; Sat, 13 Nov 2010 12:29:03 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id EC70A8FC1B; Sat, 13 Nov 2010 12:29:02 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 4D66AE7216; Sat, 13 Nov 2010 12:29:02 +0000 (GMT) Received: from unknown (client-82-26-212-122.pete.adsl.virginmedia.com [82.26.212.122]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA; Sat, 13 Nov 2010 12:29:00 +0000 (GMT) Date: Sat, 13 Nov 2010 12:28:50 +0000 From: Bruce Cran To: Sergey Kandaurov Message-ID: <20101113122850.00001748@unknown> In-Reply-To: References: <201011131143.oADBhKoL046158@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Cran Subject: Re: svn commit: r215239 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 12:29:03 -0000 On Sat, 13 Nov 2010 14:56:32 +0300 Sergey Kandaurov wrote: > On 13 November 2010 14:43, Bruce Cran wrote: > > Author: brucec > > Date: Sat Nov 13 11:43:20 2010 > > New Revision: 215239 > > URL: http://svn.freebsd.org/changeset/base/215239 > > > > Log: > > =A0Memory stats are reported in bytes, not pages. > > > > =A0PR: =A0 docs/151283 > > =A0Submitted by: Bas Smeelen > > =A0MFC after: 3 days > > >=20 > Hi. > The downside is that usually active/passive/inactive operations are > performed over > pages, not bytes, since a page is usually the minimum unit of memory > management. The sentences resulted after this change sound now weird > for me. I think the wording is better in that it's not so misleading, but could still be improved. --=20 Bruce Cran From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 12:40:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 77F5F1065696; Sat, 13 Nov 2010 12:40:20 +0000 (UTC) Date: Sat, 13 Nov 2010 12:40:20 +0000 From: Alexander Best To: Bruce Cran Message-ID: <20101113124020.GA22689@freebsd.org> References: <201011131143.oADBhKoL046158@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011131143.oADBhKoL046158@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215239 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 12:40:20 -0000 On Sat Nov 13 10, Bruce Cran wrote: > Author: brucec > Date: Sat Nov 13 11:43:20 2010 > New Revision: 215239 > URL: http://svn.freebsd.org/changeset/base/215239 > > Log: > Memory stats are reported in bytes, not pages. thanks. :) > > PR: docs/151283 > Submitted by: Bas Smeelen > MFC after: 3 days > > Modified: > head/usr.bin/top/top.local.1 > > Modified: head/usr.bin/top/top.local.1 > ============================================================================== > --- head/usr.bin/top/top.local.1 Sat Nov 13 11:11:51 2010 (r215238) > +++ head/usr.bin/top/top.local.1 Sat Nov 13 11:43:20 2010 (r215239) > @@ -6,8 +6,8 @@ The '-H' option will toggle the display > At runtime the 'H' key will toggle this mode. The default is OFF. > > .SH DESCRIPTION OF MEMORY > -Mem: 9220K Active, 1032K Inact, 3284K Wired, 1MB Cache, 2M Buf, 1320K Free > -Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104 K Out > +Mem: 9220K Active, 1032K Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free > +Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out > > .B K: > Kilobyte > @@ -19,23 +19,23 @@ Megabyte > 1/100 > .TP > .B Active: > -number of pages active > +number of bytes active > .TP > .B Inact: > -number of pages inactive > +number of bytes inactive > .TP > .B Wired: > -number of pages wired down, including cached file data pages > +number of bytes wired down, including cached file data pages > .TP > .B Cache: > -number of clean pages caching data that are available for > +number of clean bytes caching data that are available for > immediate reallocation > .TP > .B Buf: > -number of pages used for BIO-level disk caching > +number of bytes used for BIO-level disk caching > .TP > .B Free: > -number of pages free > +number of bytes free > .TP > .B Total: > total available swap usage > @@ -47,7 +47,7 @@ total free swap usage > swap usage > .TP > .B In: > -pages paged in from swap devices (last interval) > +bytes paged in from swap devices (last interval) > .TP > .B Out: > -pages paged out to swap devices (last interval) > +bytes paged out to swap devices (last interval) -- a13x From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 12:52:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FB5D1065693; Sat, 13 Nov 2010 12:52:44 +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 6DE568FC0A; Sat, 13 Nov 2010 12:52:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADCqi1f047748; Sat, 13 Nov 2010 12:52:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADCqiS7047746; Sat, 13 Nov 2010 12:52:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011131252.oADCqiS7047746@svn.freebsd.org> From: Michael Tuexen Date: Sat, 13 Nov 2010 12:52: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: r215241 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 12:52:44 -0000 Author: tuexen Date: Sat Nov 13 12:52:44 2010 New Revision: 215241 URL: http://svn.freebsd.org/changeset/base/215241 Log: Fix a locking issue reported by brucec@ affecting 1-to-1 style sockets which have not yet been accepted. MFC after: 3 days. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Nov 13 11:54:04 2010 (r215240) +++ head/sys/netinet/sctp_pcb.c Sat Nov 13 12:52:44 2010 (r215241) @@ -3464,6 +3464,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, cnt = 0; for ((asoc = LIST_FIRST(&inp->sctp_asoc_list)); asoc != NULL; asoc = nasoc) { + SCTP_TCB_LOCK(asoc); nasoc = LIST_NEXT(asoc, sctp_tcblist); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { @@ -3471,10 +3472,10 @@ sctp_inpcb_free(struct sctp_inpcb *inp, sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } cnt++; + SCTP_TCB_UNLOCK(asoc); continue; } /* Free associations that are NOT killing us */ - SCTP_TCB_LOCK(asoc); if ((SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_COOKIE_WAIT) && ((asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0)) { struct mbuf *op_err; From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 12:56:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id CC476106566B; Sat, 13 Nov 2010 12:56:48 +0000 (UTC) Date: Sat, 13 Nov 2010 12:56:48 +0000 From: Alexander Best To: Ulrich Spoerlein Message-ID: <20101113125648.GA25183@freebsd.org> References: <201011131054.oADAsA7I045096@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011131054.oADAsA7I045096@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215237 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 12:56:48 -0000 On Sat Nov 13 10, Ulrich Spoerlein wrote: > Author: uqs > Date: Sat Nov 13 10:54:10 2010 > New Revision: 215237 > URL: http://svn.freebsd.org/changeset/base/215237 > > Log: > Fix bug in jn(3) and jnf(3) that led to -inf results thank you very much for fixing this long outstanding issue. you might want to have a look at [1], where two more issues have been reported. cheers. alex [1] http://mailman.oakapple.net/pipermail/numeric-interest/2010-September/thread.html > > Explanation by Steve: > jn[f](n,x) for certain ranges of x uses downward recursion to compute > the value of the function. The recursion sequence that is generated is > proportional to the actual desired value, so a normalization step is > taken. This normalization is j0[f](x) divided by the zeroth sequence > member. As Bruce notes, near the zeros of j0[f](x) the computed value > can have giga-ULP inaccuracy. I found for the 1st zero of j0f(x) only > the leading decimal digit is correct. The solution to the issue is > fairly straight forward. The zeros of j0(x) and j1(x) never coincide, > so as j0(x) approaches a zero, the normalization constant switches to > j1[f](x) divided by the 2nd sequence member. The expectation is that > j1[f](x) is a more accurately computed value. > > PR: bin/144306 > Submitted by: Steven G. Kargl > Reviewed by: bde > MFC after: 7 days > > Modified: > head/lib/msun/src/e_jn.c > head/lib/msun/src/e_jnf.c > > Modified: head/lib/msun/src/e_jn.c > ============================================================================== > --- head/lib/msun/src/e_jn.c Sat Nov 13 10:38:06 2010 (r215236) > +++ head/lib/msun/src/e_jn.c Sat Nov 13 10:54:10 2010 (r215237) > @@ -200,7 +200,12 @@ __ieee754_jn(int n, double x) > } > } > } > - b = (t*__ieee754_j0(x)/b); > + z = __ieee754_j0(x); > + w = __ieee754_j1(x); > + if (fabs(z) >= fabs(w)) > + b = (t*z/b); > + else > + b = (t*w/a); > } > } > if(sgn==1) return -b; else return b; > > Modified: head/lib/msun/src/e_jnf.c > ============================================================================== > --- head/lib/msun/src/e_jnf.c Sat Nov 13 10:38:06 2010 (r215236) > +++ head/lib/msun/src/e_jnf.c Sat Nov 13 10:54:10 2010 (r215237) > @@ -152,7 +152,12 @@ __ieee754_jnf(int n, float x) > } > } > } > - b = (t*__ieee754_j0f(x)/b); > + z = __ieee754_j0f(x); > + w = __ieee754_j1f(x); > + if (fabsf(z) >= fabsf(w)) > + b = (t*z/b); > + else > + b = (t*w/a); > } > } > if(sgn==1) return -b; else return b; -- a13x From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 13:46:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE9B1106564A; Sat, 13 Nov 2010 13:46:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBA978FC23; Sat, 13 Nov 2010 13:46:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADDkVHG049442; Sat, 13 Nov 2010 13:46:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADDkVZ1049440; Sat, 13 Nov 2010 13:46:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011131346.oADDkVZ1049440@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Nov 2010 13:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215242 - in stable/8/release: picobsd/floppy.tree/sbin sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 13:46:32 -0000 Author: marius Date: Sat Nov 13 13:46:31 2010 New Revision: 215242 URL: http://svn.freebsd.org/changeset/base/215242 Log: MFC: r214940 Add gpart and glabel to the release CD mfsroot. Modified: stable/8/release/sparc64/boot_crunch.conf Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) Modified: stable/8/release/sparc64/boot_crunch.conf ============================================================================== --- stable/8/release/sparc64/boot_crunch.conf Sat Nov 13 12:52:44 2010 (r215241) +++ stable/8/release/sparc64/boot_crunch.conf Sat Nov 13 13:46:31 2010 (r215242) @@ -15,6 +15,7 @@ srcdirs /usr/src/sbin progs camcontrol progs dhclient progs fsck_ffs +progs geom progs ifconfig progs mount_nfs progs newfs @@ -23,6 +24,8 @@ progs rtsol progs tunefs ln fsck_ffs fsck_4.2bsd ln fsck_ffs fsck_ufs +ln geom glabel +ln geom gpart srcdirs /usr/src/usr.bin progs cpio @@ -40,5 +43,5 @@ progs sysinstall progs usbconfig libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph -libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lbsdxml +libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lgeom -lbsdxml libs -larchive -lbz2 -lusb -ljail From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 13:46:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E204A10656CC; Sat, 13 Nov 2010 13:46:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 041398FC1E; Sat, 13 Nov 2010 13:46:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADDkXlK049478; Sat, 13 Nov 2010 13:46:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADDkXcc049476; Sat, 13 Nov 2010 13:46:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011131346.oADDkXcc049476@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Nov 2010 13:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215243 - stable/7/release/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 13:46:35 -0000 Author: marius Date: Sat Nov 13 13:46:33 2010 New Revision: 215243 URL: http://svn.freebsd.org/changeset/base/215243 Log: MFC: r214940 Add gpart and glabel to the release CD mfsroot. Modified: stable/7/release/sparc64/boot_crunch.conf Directory Properties: stable/7/release/ (props changed) stable/7/release/doc/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/7/release/picobsd/tinyware/login/ (props changed) Modified: stable/7/release/sparc64/boot_crunch.conf ============================================================================== --- stable/7/release/sparc64/boot_crunch.conf Sat Nov 13 13:46:31 2010 (r215242) +++ stable/7/release/sparc64/boot_crunch.conf Sat Nov 13 13:46:33 2010 (r215243) @@ -18,6 +18,7 @@ srcdirs /usr/src/sbin progs camcontrol progs dhclient progs fsck_ffs +progs geom progs ifconfig progs mount_nfs progs newfs @@ -27,6 +28,8 @@ progs slattach progs tunefs ln fsck_ffs fsck_4.2bsd ln fsck_ffs fsck_ufs +ln geom glabel +ln geom gpart srcdirs /usr/src/usr.bin progs find @@ -43,4 +46,4 @@ progs sysinstall progs usbdevs libs -ll -ledit -lutil -lmd -lcrypt -lftpio -lz -lnetgraph -libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs +libs -ldialog -lncurses -ldisk -lcam -lsbuf -lufs -lgeom -lbsdxml From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 14:59:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5972106566B; Sat, 13 Nov 2010 14:59:54 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D38B18FC0A; Sat, 13 Nov 2010 14:59:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADExsE1051123; Sat, 13 Nov 2010 14:59:54 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADExsfu051121; Sat, 13 Nov 2010 14:59:54 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011131459.oADExsfu051121@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 13 Nov 2010 14:59: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: r215244 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 14:59:55 -0000 Author: bschmidt Date: Sat Nov 13 14:59:54 2010 New Revision: 215244 URL: http://svn.freebsd.org/changeset/base/215244 Log: Some device drivers calculate various timing related things based on the currently selected rate. The calculations of course need a valid rate. To make that possible before any call to node_rate() is done, initialize ni_txrate on none_node_init() calls. MFC after: 1 week Modified: head/sys/net80211/ieee80211_ratectl_none.c Modified: head/sys/net80211/ieee80211_ratectl_none.c ============================================================================== --- head/sys/net80211/ieee80211_ratectl_none.c Sat Nov 13 13:46:33 2010 (r215243) +++ head/sys/net80211/ieee80211_ratectl_none.c Sat Nov 13 14:59:54 2010 (r215244) @@ -59,6 +59,7 @@ none_deinit(struct ieee80211vap *vap) static void none_node_init(struct ieee80211_node *ni) { + ni->ni_txrate = ni->ni_rates.rs_rates[0] & IEEE80211_RATE_VAL; } static void From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 15:23:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD98C106566B; Sat, 13 Nov 2010 15:23:20 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB8958FC08; Sat, 13 Nov 2010 15:23:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADFNKe2051620; Sat, 13 Nov 2010 15:23:20 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADFNKpv051618; Sat, 13 Nov 2010 15:23:20 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201011131523.oADFNKpv051618@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 13 Nov 2010 15: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: r215245 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 15:23:21 -0000 Author: nyan Date: Sat Nov 13 15:23:20 2010 New Revision: 215245 URL: http://svn.freebsd.org/changeset/base/215245 Log: Remove unused includes. Modified: head/sys/boot/i386/libi386/i386_module.c Modified: head/sys/boot/i386/libi386/i386_module.c ============================================================================== --- head/sys/boot/i386/libi386/i386_module.c Sat Nov 13 14:59:54 2010 (r215244) +++ head/sys/boot/i386/libi386/i386_module.c Sat Nov 13 15:23:20 2010 (r215245) @@ -32,12 +32,6 @@ __FBSDID("$FreeBSD$"); * */ -#include -#include - -#include "bootstrap.h" -#include "libi386.h" - /* * Use voodoo to load modules required by current hardware. */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 15:24:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 533D41065693; Sat, 13 Nov 2010 15:24:57 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2701F8FC1B; Sat, 13 Nov 2010 15:24:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADFOvlG051699; Sat, 13 Nov 2010 15:24:57 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADFOvKm051698; Sat, 13 Nov 2010 15:24:57 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201011131524.oADFOvKm051698@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 13 Nov 2010 15:24: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: r215246 - head/sys/boot/pc98/libpc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 15:24:57 -0000 Author: nyan Date: Sat Nov 13 15:24:56 2010 New Revision: 215246 URL: http://svn.freebsd.org/changeset/base/215246 Log: Now there is no functional difference from i386 version. So use i386 version. Deleted: head/sys/boot/pc98/libpc98/i386_module.c From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 15:28:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F6851065673; Sat, 13 Nov 2010 15:28:45 +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 2DA218FC1D; Sat, 13 Nov 2010 15:28:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADFSjZP051835; Sat, 13 Nov 2010 15:28:45 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADFSjGJ051832; Sat, 13 Nov 2010 15:28:45 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201011131528.oADFSjGJ051832@svn.freebsd.org> From: Joel Dahl Date: Sat, 13 Nov 2010 15:28: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: r215247 - head/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 15:28:45 -0000 Author: joel (doc committer) Date: Sat Nov 13 15:28:44 2010 New Revision: 215247 URL: http://svn.freebsd.org/changeset/base/215247 Log: Use "cylinder" instead of "cyl" for consistency. Reviewed by: phk Modified: head/sbin/mdconfig/mdconfig.8 head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Sat Nov 13 15:24:56 2010 (r215246) +++ head/sbin/mdconfig/mdconfig.8 Sat Nov 13 15:28:44 2010 (r215247) @@ -58,7 +58,7 @@ .Op Fl S Ar sectorsize .Op Fl u Ar unit .Op Fl x Ar sectors/track -.Op Fl y Ar heads/cyl +.Op Fl y Ar heads/cylinder .Nm .Fl d .Fl u Ar unit Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Sat Nov 13 15:24:56 2010 (r215246) +++ head/sbin/mdconfig/mdconfig.c Sat Nov 13 15:28:44 2010 (r215247) @@ -57,7 +57,7 @@ usage(void) fprintf(stderr, "usage: mdconfig -a -t type [-n] [-o [no]option] ... [-f file]\n" " [-s size] [-S sectorsize] [-u unit]\n" -" [-x sectors/track] [-y heads/cyl]\n" +" [-x sectors/track] [-y heads/cylinder]\n" " mdconfig -d -u unit [-o [no]force]\n" " mdconfig -l [-v] [-n] [-u unit]\n"); fprintf(stderr, "\t\ttype = {malloc, preload, vnode, swap}\n"); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 15:52:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34649106566B; Sat, 13 Nov 2010 15:52:04 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id E1AAA8FC0A; Sat, 13 Nov 2010 15:52:03 +0000 (UTC) Received: from tmpll101wap.cooper.edu ([199.98.18.212] helo=[10.20.1.201]) by vps.hungerhost.com with esmtpa (Exim 4.69) (envelope-from ) id 1PHHoh-0000We-EE; Sat, 13 Nov 2010 10:14:59 -0500 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: George Neville-Neil In-Reply-To: <86fwv57fph.fsf@kopusha.home.net> Date: Sat, 13 Nov 2010 10:15:00 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201011122203.oACM32cN024939@svn.freebsd.org> <86fwv57fph.fsf@kopusha.home.net> To: Mikolaj Golub X-Mailer: Apple Mail (2.1082) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - FreeBSD.org X-Source: X-Source-Args: X-Source-Dir: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215207 - in head: sys/net sys/netinet tools/regression/netinet/arphold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 15:52:04 -0000 On Nov 13, 2010, at 04:09 , Mikolaj Golub wrote: >=20 > On Fri, 12 Nov 2010 22:03:02 +0000 (UTC) George V. Neville-Neil wrote: >=20 > GVN> Author: gnn > GVN> Date: Fri Nov 12 22:03:02 2010 > GVN> New Revision: 215207 > GVN> URL: http://svn.freebsd.org/changeset/base/215207 >=20 >=20 >=20 > cc -c -O -pipe -std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline = -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc = -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL = -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common = -finline-limit=3D8000 --param inline-unit-growth=3D100 --param = large-function-growth=3D1000 -mno-align-long-strings = -mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 = -mno-sse3 -ffreestanding -fstack-protector -Werror = /usr/src/sys/net/if_llatbl.c > cc1: warnings being treated as errors > /usr/src/sys/net/if_llatbl.c: In function 'llentry_free': > /usr/src/sys/net/if_llatbl.c:124: warning: format '%ld' expects type = 'long int', but argument 4 has type 'size_t' > *** Error code 1 >=20 > I think this should be: >=20 > Index: sys/net/if_llatbl.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 > --- sys/net/if_llatbl.c (revision 215233) > +++ sys/net/if_llatbl.c (working copy) > @@ -122,7 +122,7 @@ llentry_free(struct llentry *lle) > } >=20 > KASSERT(lle->la_numheld =3D=3D 0,=20 > - ("%s: la_numheld %d > 0, pkts_droped %ld", __func__,=20 > + ("%s: la_numheld %d > 0, pkts_droped %zu", __func__,=20 > lle->la_numheld, pkts_dropped)); >=20 > LLE_FREE_LOCKED(lle); Looks like Konstatin already fixed this. Best, George From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 16:46:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85ABD1065672; Sat, 13 Nov 2010 16:46:46 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 4A1238FC1A; Sat, 13 Nov 2010 16:46:46 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id oADGkj6T069663; Sat, 13 Nov 2010 08:46:45 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id oADGkj93069662; Sat, 13 Nov 2010 08:46:45 -0800 (PST) (envelope-from sgk) Date: Sat, 13 Nov 2010 08:46:45 -0800 From: Steve Kargl To: Alexander Best Message-ID: <20101113164645.GB69612@troutmask.apl.washington.edu> References: <201011131054.oADAsA7I045096@svn.freebsd.org> <20101113125648.GA25183@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101113125648.GA25183@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ulrich Spoerlein Subject: Re: svn commit: r215237 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 16:46:46 -0000 On Sat, Nov 13, 2010 at 12:56:48PM +0000, Alexander Best wrote: > On Sat Nov 13 10, Ulrich Spoerlein wrote: > > Author: uqs > > Date: Sat Nov 13 10:54:10 2010 > > New Revision: 215237 > > URL: http://svn.freebsd.org/changeset/base/215237 > > > > Log: > > Fix bug in jn(3) and jnf(3) that led to -inf results > > thank you very much for fixing this long outstanding issue. > you might want to have a look at [1], where two more issues have been reported. > > cheers. > alex > > [1] http://mailman.oakapple.net/pipermail/numeric-interest/2010-September/thread.html > Ulrich, thanks. Of the two remaining issues, I can verify one is indeed an issue. laptop:kargl[204] cat mn.c #include #include static const double z = 0.; int main(void) { double x, y; x = -1. / z; y = exp( 0.5 * log(x)); printf("pow(%f, 0.5) = %le, %le\n", x, pow(x, 0.5), y); y = exp(-0.5 * log(x)); printf("pow(%f, -0.5) = %le, %le\n", x, pow(x, -0.5), y); return 0; } laptop:kargl[205] cc -o z mn.c -fno-builtin -lm && ./z pow(-inf, 0.5) = inf, nan pow(-inf, -0.5) = 0.000000e+00, nan -- Steve From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 16:49:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65ADD1065675; Sat, 13 Nov 2010 16:49:07 +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 53BC68FC1C; Sat, 13 Nov 2010 16:49:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADGn7S5053636; Sat, 13 Nov 2010 16:49:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADGn7xA053634; Sat, 13 Nov 2010 16:49:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011131649.oADGn7xA053634@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Nov 2010 16:49: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: r215248 - head/sbin/kldstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 16:49:07 -0000 Author: kib Date: Sat Nov 13 16:49:07 2010 New Revision: 215248 URL: http://svn.freebsd.org/changeset/base/215248 Log: In printfile(), exit the process instead of only printing the warning. This fixes verbose mode when either -i specified non-existent kldfile id, or the file was unloaded between two kldnext(2) calls. While there, fix printfile() definition to be style(9)-compliant. Submitted by: arundel MFC after: 1 week Modified: head/sbin/kldstat/kldstat.c Modified: head/sbin/kldstat/kldstat.c ============================================================================== --- head/sbin/kldstat/kldstat.c Sat Nov 13 15:28:44 2010 (r215247) +++ head/sbin/kldstat/kldstat.c Sat Nov 13 16:49:07 2010 (r215248) @@ -50,14 +50,15 @@ printmod(int modid) printf("\t\t%2d %s\n", stat.id, stat.name); } -static void printfile(int fileid, int verbose) +static void +printfile(int fileid, int verbose) { struct kld_file_stat stat; int modid; stat.version = sizeof(struct kld_file_stat); if (kldstat(fileid, &stat) < 0) - warn("can't stat file id %d", fileid); + err(1, "can't stat file id %d", fileid); else printf("%2d %4d %p %-8zx %s", stat.id, stat.refs, stat.address, stat.size, From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 17:52:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C0CE1065673; Sat, 13 Nov 2010 17:52: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 9B81F8FC08; Sat, 13 Nov 2010 17:52:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADHq45B055151; Sat, 13 Nov 2010 17:52:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADHq4JR055149; Sat, 13 Nov 2010 17:52:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201011131752.oADHq4JR055149@svn.freebsd.org> From: Michael Tuexen Date: Sat, 13 Nov 2010 17:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215249 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 17:52:05 -0000 Author: tuexen Date: Sat Nov 13 17:52:04 2010 New Revision: 215249 URL: http://svn.freebsd.org/changeset/base/215249 Log: Add for existing protocol entries the missing SCTP port allocations and add protocol entries for protocols which have SCTP port allocations. These entries are according to http://www.iana.org/assignments/port-numbers as of today. Also add SCTP port allocation entires for the echo, daytime, and chargen service. Discussed with rwatson@ MFC after: 3 days. Modified: head/etc/services Modified: head/etc/services ============================================================================== --- head/etc/services Sat Nov 13 16:49:07 2010 (r215248) +++ head/etc/services Sat Nov 13 17:52:04 2010 (r215249) @@ -33,24 +33,31 @@ echo 4/ddp #AppleTalk Echo Protoco rje 5/tcp #Remote Job Entry rje 5/udp #Remote Job Entry zip 6/ddp #Zone Information Protocol +echo 7/sctp echo 7/tcp echo 7/udp +discard 9/sctp sink null discard 9/tcp sink null discard 9/udp sink null systat 11/tcp users #Active Users systat 11/udp users #Active Users +daytime 13/sctp daytime 13/tcp daytime 13/udp qotd 17/tcp quote #Quote of the Day qotd 17/udp quote #Quote of the Day msp 18/tcp #Message Send Protocol msp 18/udp #Message Send Protocol +chargen 19/sctp ttytst source #Character Generator chargen 19/tcp ttytst source #Character Generator chargen 19/udp ttytst source #Character Generator +ftp-data 20/sctp #File Transfer [Default Data] ftp-data 20/tcp #File Transfer [Default Data] ftp-data 20/udp #File Transfer [Default Data] +ftp 21/sctp #File Transfer [Control] ftp 21/tcp #File Transfer [Control] ftp 21/udp #File Transfer [Control] +ssh 22/sctp #Secure Shell Login ssh 22/tcp #Secure Shell Login ssh 22/udp #Secure Shell Login telnet 23/tcp @@ -151,6 +158,7 @@ vettcp 78/tcp vettcp 78/udp finger 79/tcp finger 79/udp +http 80/sctp www www-http #World Wide Web HTTP http 80/tcp www www-http #World Wide Web HTTP http 80/udp www www-http #World Wide Web HTTP hosts2-ns 81/tcp #HOSTS2 Name Server @@ -350,6 +358,7 @@ xdmcp 177/tcp #X Display Manager Con xdmcp 177/udp #X Display Manager Control Protocol NextStep 178/tcp nextstep NeXTStep #NextStep Window Server NextStep 178/udp nextstep NeXTStep #NextStep Window Server +bgp 179/sctp #Border Gateway Protocol bgp 179/tcp #Border Gateway Protocol bgp 179/udp #Border Gateway Protocol ris 180/tcp #Intergraph @@ -738,6 +747,7 @@ decvms-sysmgt 441/tcp decvms-sysmgt 441/udp cvc_hostd 442/tcp cvc_hostd 442/udp +https 443/sctp https 443/tcp https 443/udp snpp 444/tcp #Simple Network Paging Protocol @@ -1519,7 +1529,9 @@ nfsd-keepalive 1110/udp #Client status supfiledbg 1127/tcp # for SUP nfa 1155/tcp #Network File Access nfa 1155/udp #Network File Access -phone 1167/udp #conference calling +cisco-ipsla 1167/sctp #Cisco IP SLAs Control Protocol +cisco-ipsla 1167/tcp #Cisco IP SLAs Control Protocol +cisco-ipsla 1167/udp #Cisco IP SLAs Control Protocol skkserv 1178/tcp #SKK (kanji input) openvpn 1194/tcp #OpenVPN openvpn 1194/udp #OpenVPN @@ -2119,6 +2131,7 @@ sdfunc 2046/udp #dls 2047/udp dls-monitor 2048/tcp dls-monitor 2048/udp +nfsd 2049/sctp nfs # NFS server daemon nfsd 2049/tcp nfs # NFS server daemon nfsd 2049/udp nfs # NFS server daemon #PROBLEMS!============================================================= @@ -2146,6 +2159,8 @@ hpssd 2207/tcp #HP Status and Service hpssd 2207/udp #HP Status and Services hpiod 2208/tcp #HP I/O Backend hpiod 2208/udp #HP I/O Backend +rcip-itu 2225/sctp #Resource Connection Initiation Protocol +rcip-itu 2225/tcp #Resource Connection Initiation Protocol ivs-video 2232/tcp #IVS Video default ivs-video 2232/udp #IVS Video default ivsd 2241/tcp #IVS Daemon @@ -2179,6 +2194,17 @@ dict 2628/udp #RFC 2229 listen 2766/tcp #System V listener port www-dev 2784/tcp #world wide web - development www-dev 2784/udp #world wide web - development +m2ua 2904/sctp #M2UA +m2ua 2904/tcp #M2UA +m2ua 2904/udp #M2UA +m3ua 2905/sctp #M3UA +m3ua 2905/tcp #M3UA +megaco-h248 2944/sctp #Megaco-H.248 text +megaco-h248 2944/tcp #Megaco H-248 +megaco-h248 2944/udp #Megaco H-248 +h248-binary 2945/sctp #Megaco/H.248 binary +h248-binary 2945/tcp #H248 Binary +h248-binary 2945/udp #H248 Binary eppc 3031/tcp #Remote AppleEvents/PPC Toolbox eppc 3031/udp #Remote AppleEvents/PPC Toolbox NSWS 3049/tcp @@ -2186,6 +2212,7 @@ NSWS 3049/udp gds_db 3050/tcp #InterBase Database Remote Protocol gds_db 3050/udp #InterBase Database Remote Protocol sj3 3086/tcp #SJ3 (kanji input) +itu-bicc-stc 3097/sctp #ITU-T Q.1902.1/Q.2150.3 vmodem 3141/tcp vmodem 3141/udp iscsi-target 3260/tcp # iSCSI port @@ -2205,10 +2232,19 @@ vat-control 3457/tcp #VAT default cont vat-control 3457/udp #VAT default control nut 3493/tcp #Network UPS Tools nut 3493/udp #Network UPS Tools +m2pa 3565/sctp #M2PA +m2pa 3565/tcp #M2PA tsp 3653/tcp #Tunnel Setup Protocol tsp 3653/udp #Tunnel Setup Protocol svn 3690/tcp #Subversion svn 3690/udp #Subversion +asap 3863/sctp #asap sctp +asap 3863/tcp #asap tcp port +asap 3863/udp #asap udp port +asap-tls 3864/sctp #asap-sctp/tls +asap-tls 3864/tcp #asap/tls tcp port +diameter 3868/tcp #DIAMETER +diameter 3868/sctp #DIAMETER udt_os 3900/tcp #Unidata UDT OS udt_os 3900/udp #Unidata UDT OS mapper-nodemgr 3984/tcp #MAPPER network node manager @@ -2245,6 +2281,12 @@ fax 4557/tcp #FAX transmission servic hylafax 4559/tcp #HylaFAX client-server protocol rfa 4672/tcp #remote file access server rfa 4672/udp #remote file access server +ipfix 4739/sctp #IP Flow Info Export +ipfix 4739/tcp #IP Flow Info Export +ipfix 4739/udp #IP Flow Info Export +ipfixs 4740/sctp #ipfix protocol over DTLS +ipfixs 4740/tcp #ipfix protocol over TLS +ipfixs 4740/udp #ipfix protocol over DTLS commplex-main 5000/tcp commplex-main 5000/udp commplex-link 5001/tcp @@ -2263,6 +2305,8 @@ sip 5060/tcp #Session Initialization sip 5060/udp #Session Initialization Protocol (VoIP) sip-tls 5061/tcp #SIP over TLS sip-tls 5061/udp #SIP over TLS +car 5090/sctp #Candidate AR +cxtp 5091/sctp #Context Transfer Protocol rmonitor_secure 5145/tcp rmonitor_secure 5145/udp aol 5190/tcp #America-Online @@ -2298,6 +2342,12 @@ mdns 5353/udp #Multicast DNS postgresql 5432/tcp #PostgreSQL Database postgresql 5432/udp #PostgreSQL Database rplay 5555/udp +amqp 5672/sctp #AMQP +amqp 5672/tcp #AMQP +amqp 5672/udp #AMQP +v5ua 5675/sctp #V5UA application port +v5ua 5675/tcp #V5UA application port +v5ua 5675/udp #V5UA application port canna 5680/tcp #Canna (Japanese Input) proshareaudio 5713/tcp #proshare conf audio proshareaudio 5713/udp #proshare conf audio @@ -2343,6 +2393,9 @@ xdsxdm 6558/udp sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unoffical) +frc-hp 6704/sctp #ForCES HP (High Priority) channel +frc-mp 6705/sctp #ForCES MP (Medium Priority) channel +frc-lp 6706/sctp #ForCES LP (Low priority) channel acmsoda 6969/tcp acmsoda 6969/udp afs3-fileserver 7000/tcp #file server itself @@ -2377,8 +2430,16 @@ fodms 7200/tcp #FODMS FLIP fodms 7200/udp #FODMS FLIP dlip 7201/tcp dlip 7201/udp +simco 7626/sctp #SImple Middlebox COnfiguration (SIMCO) +simco 7626/tcp #SImple Middlebox COnfiguration (SIMCO) Server ftp-proxy 8021/tcp # FTP proxy +pim 8471/sctp #PIM over Reliable Transport +pim 8471/tcp #PIM over Reliable Transport natd 8668/divert # Network Address Translation +lcs-ap 9082/sctp #LCS Application Protocol +aurora 9084/sctp #IBM AURORA Performance Visualizer +aurora 9084/tcp #IBM AURORA Performance Visualizer +aurora 9084/udp #IBM AURORA Performance Visualizer jetdirect 9100/tcp #HP JetDirect card git 9418/tcp #git pack transfer service git 9418/udp #git pack transfer service @@ -2386,18 +2447,37 @@ man 9535/tcp man 9535/udp sd 9876/tcp #Session Director sd 9876/udp #Session Director +iua 9900/sctp #IUA +iua 9900/tcp #IUA +iua 9900/udp #IUA +enrp 9901/sctp #enrp server channel +enrp 9901/udp #enrp server channel +enrp-tls 9902/sctp #enrp/tls server channel amanda 10080/tcp #Dump server control amanda 10080/udp #Dump server control amandaidx 10082/tcp #Amanda indexing amidxtape 10083/tcp #Amanda tape indexing +wmereceiving 11997/sctp #WorldMailExpress +wmedistribution 11998/sctp #WorldMailExpress +wmereporting 11999/sctp #WorldMailExpress +sua 14001/sctp #SUA +sua 14001/tcp #SUA isode-dua 17007/tcp isode-dua 17007/udp biimenu 18000/tcp #Beckman Instruments, Inc. biimenu 18000/udp #Beckman Instruments, Inc. +nfsrdma 20049/sctp #Network File System (NFS) over RDMA +nfsrdma 20049/tcp #Network File System (NFS) over RDMA +nfsrdma 20049/udp #Network File System (NFS) over RDMA wnn4 22273/tcp wnn6 #Wnn4 (Japanese input) wnn4_Cn 22289/tcp wnn6_Cn #Wnn4 (Chinese input) wnn4_Kr 22305/tcp wnn6_Kr #Wnn4 (Korean input) wnn4_Tw 22321/tcp wnn6_Tw #Wnn4 (Taiwanse input) wnn6_DS 26208/tcp #Wnn6 (Dserver) +sgsap 29118/sctp #SGsAP in 3GPP +sbcap 29168/sctp #SBcAP in 3GPP +iuhsctpassoc 29169/sctp #HNBAP and RUA Common Association +s1-control 36412/sctp #S1-Control Plane (3GPP) +x2-control 36422/sctp #X2-Control Plane (3GPP) dbbrowse 47557/tcp #Databeam Corporation dbbrowse 47557/udp #Databeam Corporation From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 18:10:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E9A01065695; Sat, 13 Nov 2010 18:10:45 +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 D69088FC20; Sat, 13 Nov 2010 18:10:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADIAiQC055594; Sat, 13 Nov 2010 18:10:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADIAiTO055592; Sat, 13 Nov 2010 18:10:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201011131810.oADIAiTO055592@svn.freebsd.org> From: Doug Barton Date: Sat, 13 Nov 2010 18:10: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: r215250 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 18:10:45 -0000 Author: dougb Date: Sat Nov 13 18:10:44 2010 New Revision: 215250 URL: http://svn.freebsd.org/changeset/base/215250 Log: Remove references to the long-gone ramdisk Submitted by: Garrett Cooper Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Nov 13 17:52:04 2010 (r215249) +++ head/share/man/man5/rc.conf.5 Sat Nov 13 18:10:44 2010 (r215250) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2010 +.Dd November 13, 2010 .Dt RC.CONF 5 .Os .Sh NAME @@ -4082,65 +4082,6 @@ one could set the following: .Bd -literal mdconfig_md0_cmd="tar xfzC /var/file.tgz \e${_mp}" .Ed -.It Va ramdisk_units -.Pq Vt str -A list of one or more ramdisk units to configure with -.Xr mdconfig 8 -and -.Xr newfs 8 -in time to be mounted from -.Xr fstab 5 . -Each listed unit -.Ar X -must specify at least a -.Ar type -in a -.Va ramdisk_ Ns Ao Ar X Ac Ns Va _config -variable. -Note that this way to configure ramdisks has been deprecated -in favor of new -.Va mdconfig_md* -variables (see above). -.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _config -.Pq Vt str -Arguments to -.Xr mdconfig 8 -for ramdisk -.Ar X . -At minimum a -.Fl t Ar type -must be specified, where -.Ar type -must be one of -.Cm malloc -or -.Cm swap . -.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _newfs -.Pq Vt str -Optional arguments passed to -.Xr newfs 8 -to initialize ramdisk -.Ar X . -.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _owner -.Pq Vt str -An ownership specification passed to -.Xr chown 8 -after the specified ramdisk unit -.Ar X -has been mounted. -Both the -.Xr md 4 -device and the mount point will be changed. -.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _perms -.Pq Vt str -A mode string passed to -.Xr chmod 1 -after the specified ramdisk unit -.Ar X -has been mounted. -Both the -.Xr md 4 -device and the mount point will be changed. .It Va autobridge_interfaces .Pq Vt str Set to the list of bridge interfaces that will have newly arriving interfaces From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 18:36:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 06C87106566C; Sat, 13 Nov 2010 18:36:17 +0000 (UTC) Date: Sat, 13 Nov 2010 18:36:17 +0000 From: Alexey Dokuchaev To: Pyun YongHyeon Message-ID: <20101113183616.GB75779@FreeBSD.org> References: <201011130046.oAD0k7Ii029261@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201011130046.oAD0k7Ii029261@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r215214 - stable/8/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 18:36:17 -0000 On Sat, Nov 13, 2010 at 12:46:07AM +0000, Pyun YongHyeon wrote: > Author: yongari > Date: Sat Nov 13 00:46:07 2010 > New Revision: 215214 > URL: http://svn.freebsd.org/changeset/base/215214 > > Log: > MFC r214898: > If we got an invalid station address, generate random address. This > might be caused by broken BIOS. > > Reported by: "Mikhail T." aldan.algebra.com> Perhaps the reporter can be more easily referenced as mi@? ./danfe From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 18:38:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E58B106566B; Sat, 13 Nov 2010 18:38:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CE408FC12; Sat, 13 Nov 2010 18:38:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADIcZCP056280; Sat, 13 Nov 2010 18:38:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADIcZPi056278; Sat, 13 Nov 2010 18:38:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011131838.oADIcZPi056278@svn.freebsd.org> From: Warner Losh Date: Sat, 13 Nov 2010 18: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: r215251 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 18:38:35 -0000 Author: imp Date: Sat Nov 13 18:38:35 2010 New Revision: 215251 URL: http://svn.freebsd.org/changeset/base/215251 Log: Let the linker pick the right output format automatically Modified: head/sys/conf/ldscript.mips Modified: head/sys/conf/ldscript.mips ============================================================================== --- head/sys/conf/ldscript.mips Sat Nov 13 18:10:44 2010 (r215250) +++ head/sys/conf/ldscript.mips Sat Nov 13 18:38:35 2010 (r215251) @@ -30,16 +30,9 @@ * $FreeBSD$ */ -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", - "elf32-tradlittlemips") - OUTPUT_ARCH(mips) ENTRY(_start) SEARCH_DIR(/usr/lib); -/* Do we need any of these for elf? - __DYNAMIC = 0; -PROVIDE (_DYNAMIC = 0); -*/ SECTIONS { /* Read-only sections, merged into text segment: */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 18:39:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19490106564A; Sat, 13 Nov 2010 18:39:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07FBC8FC13; Sat, 13 Nov 2010 18:39:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADIdOkb056333; Sat, 13 Nov 2010 18:39:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADIdOOZ056331; Sat, 13 Nov 2010 18:39:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011131839.oADIdOOZ056331@svn.freebsd.org> From: Warner Losh Date: Sat, 13 Nov 2010 18:39: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: r215252 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 18:39:25 -0000 Author: imp Date: Sat Nov 13 18:39:24 2010 New Revision: 215252 URL: http://svn.freebsd.org/changeset/base/215252 Log: Add legacy names for mips:mips and arm with TARGET_BIG_ENDIAN, for the moment. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Nov 13 18:38:35 2010 (r215251) +++ head/Makefile.inc1 Sat Nov 13 18:39:24 2010 (r215252) @@ -123,6 +123,20 @@ TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun ${TARGET_ARCH} != ${MACHINE_ARCH} TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm} .endif +# Legacy names, for a transition period mips:mips -> mipsel:mips +.if ${TARGET_ARCH} == "mips" && ${TARGET} == "mips" +.warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb" +.if defined(TARGET_BIG_ENDIAN) +TARGET_ARCH=mipseb +.else +TARGET_ARCH=mipsel +.endif +.endif +# arm with TARGET_BIG_ENDIAN -> armeb +.if ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) +.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated. use armeb" +TARGET_ARCH=armeb +.endif # Otherwise, default to current machine type and architecture. TARGET?= ${MACHINE} TARGET_ARCH?= ${MACHINE_ARCH} From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 19:25:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5655106572F; Sat, 13 Nov 2010 19:25:11 +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 896088FC15; Sat, 13 Nov 2010 19:25:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADJPBTH057415; Sat, 13 Nov 2010 19:25:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADJPBUY057412; Sat, 13 Nov 2010 19:25:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201011131925.oADJPBUY057412@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 13 Nov 2010 19:25: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: r215253 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 19:25:11 -0000 Author: hselasky Date: Sat Nov 13 19:25:11 2010 New Revision: 215253 URL: http://svn.freebsd.org/changeset/base/215253 Log: Fix LibUSB v1.0 compliancy. 1) We need to allow the USB callback to free the USB transfer itself. 2) The USB transfer buffer should only be automatically freed when freeing the USB transfer. Fixed by: hselasky Submitted by: Gustau Perez i Querol Approved by: thompsa (mentor) Modified: head/lib/libusb/libusb10.c head/lib/libusb/libusb10_io.c Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Sat Nov 13 18:39:24 2010 (r215252) +++ head/lib/libusb/libusb10.c Sat Nov 13 19:25:11 2010 (r215253) @@ -800,6 +800,10 @@ libusb_free_transfer(struct libusb_trans if (uxfer == NULL) return; /* be NULL safe */ + /* check if we should free the transfer buffer */ + if (uxfer->flags & LIBUSB_TRANSFER_FREE_BUFFER) + free(uxfer->buffer); + sxfer = (struct libusb_super_transfer *)( (uint8_t *)uxfer - sizeof(*sxfer)); Modified: head/lib/libusb/libusb10_io.c ============================================================================== --- head/lib/libusb/libusb10_io.c Sat Nov 13 18:39:24 2010 (r215252) +++ head/lib/libusb/libusb10_io.c Sat Nov 13 19:25:11 2010 (r215253) @@ -187,6 +187,8 @@ do_done: /* Do all done callbacks */ while ((sxfer = TAILQ_FIRST(&ctx->tr_done))) { + uint8_t flags; + TAILQ_REMOVE(&ctx->tr_done, sxfer, entry); sxfer->entry.tqe_prev = NULL; @@ -197,13 +199,14 @@ do_done: uxfer = (struct libusb_transfer *)( ((uint8_t *)sxfer) + sizeof(*sxfer)); + /* Allow the callback to free the transfer itself. */ + flags = uxfer->flags; + if (uxfer->callback != NULL) (uxfer->callback) (uxfer); - if (uxfer->flags & LIBUSB_TRANSFER_FREE_BUFFER) - free(uxfer->buffer); - - if (uxfer->flags & LIBUSB_TRANSFER_FREE_TRANSFER) + /* Check if the USB transfer should be automatically freed. */ + if (flags & LIBUSB_TRANSFER_FREE_TRANSFER) libusb_free_transfer(uxfer); CTX_LOCK(ctx); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 19:26:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B5371065695; Sat, 13 Nov 2010 19:26:46 +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 EDB578FC14; Sat, 13 Nov 2010 19:26:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADJQjcT057483; Sat, 13 Nov 2010 19:26:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADJQjIH057482; Sat, 13 Nov 2010 19:26:45 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201011131926.oADJQjIH057482@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 13 Nov 2010 19:26: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: r215254 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 19:26:46 -0000 Author: hselasky Date: Sat Nov 13 19:26:45 2010 New Revision: 215254 URL: http://svn.freebsd.org/changeset/base/215254 Log: Fix compiler warnings. Submitted by: Alexander Best (arundel) Approved by: thompsa (mentor) Modified: head/sys/dev/usb/input/uhid.c Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Sat Nov 13 19:25:11 2010 (r215253) +++ head/sys/dev/usb/input/uhid.c Sat Nov 13 19:26:45 2010 (r215254) @@ -672,7 +672,7 @@ uhid_attach(device_t dev) if (uaa->info.idProduct == USB_PRODUCT_WACOM_GRAPHIRE) { sc->sc_repdesc_size = sizeof(uhid_graphire_report_descr); - sc->sc_repdesc_ptr = &uhid_graphire_report_descr; + sc->sc_repdesc_ptr = (void *)&uhid_graphire_report_descr; sc->sc_flags |= UHID_FLAG_STATIC_DESC; } else if (uaa->info.idProduct == USB_PRODUCT_WACOM_GRAPHIRE3_4X5) { @@ -693,7 +693,7 @@ uhid_attach(device_t dev) usbd_errstr(error)); } sc->sc_repdesc_size = sizeof(uhid_graphire3_4x5_report_descr); - sc->sc_repdesc_ptr = &uhid_graphire3_4x5_report_descr; + sc->sc_repdesc_ptr = (void *)&uhid_graphire3_4x5_report_descr; sc->sc_flags |= UHID_FLAG_STATIC_DESC; } } else if ((uaa->info.bInterfaceClass == UICLASS_VENDOR) && @@ -702,7 +702,7 @@ uhid_attach(device_t dev) /* the Xbox 360 gamepad has no report descriptor */ sc->sc_repdesc_size = sizeof(uhid_xb360gp_report_descr); - sc->sc_repdesc_ptr = &uhid_xb360gp_report_descr; + sc->sc_repdesc_ptr = (void *)&uhid_xb360gp_report_descr; sc->sc_flags |= UHID_FLAG_STATIC_DESC; } if (sc->sc_repdesc_ptr == NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 19:50:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 01C0C1065695; Sat, 13 Nov 2010 19:50:06 +0000 (UTC) Date: Sat, 13 Nov 2010 19:50:05 +0000 From: Alexander Best To: Hans Petter Selasky Message-ID: <20101113195005.GA90722@freebsd.org> References: <201011131926.oADJQjIH057482@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011131926.oADJQjIH057482@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215254 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 19:50:06 -0000 On Sat Nov 13 10, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Nov 13 19:26:45 2010 > New Revision: 215254 > URL: http://svn.freebsd.org/changeset/base/215254 > > Log: > Fix compiler warnings. thanks. :) > > Submitted by: Alexander Best (arundel) > Approved by: thompsa (mentor) > > Modified: > head/sys/dev/usb/input/uhid.c > > Modified: head/sys/dev/usb/input/uhid.c > ============================================================================== > --- head/sys/dev/usb/input/uhid.c Sat Nov 13 19:25:11 2010 (r215253) > +++ head/sys/dev/usb/input/uhid.c Sat Nov 13 19:26:45 2010 (r215254) > @@ -672,7 +672,7 @@ uhid_attach(device_t dev) > if (uaa->info.idProduct == USB_PRODUCT_WACOM_GRAPHIRE) { > > sc->sc_repdesc_size = sizeof(uhid_graphire_report_descr); > - sc->sc_repdesc_ptr = &uhid_graphire_report_descr; > + sc->sc_repdesc_ptr = (void *)&uhid_graphire_report_descr; > sc->sc_flags |= UHID_FLAG_STATIC_DESC; > > } else if (uaa->info.idProduct == USB_PRODUCT_WACOM_GRAPHIRE3_4X5) { > @@ -693,7 +693,7 @@ uhid_attach(device_t dev) > usbd_errstr(error)); > } > sc->sc_repdesc_size = sizeof(uhid_graphire3_4x5_report_descr); > - sc->sc_repdesc_ptr = &uhid_graphire3_4x5_report_descr; > + sc->sc_repdesc_ptr = (void *)&uhid_graphire3_4x5_report_descr; > sc->sc_flags |= UHID_FLAG_STATIC_DESC; > } > } else if ((uaa->info.bInterfaceClass == UICLASS_VENDOR) && > @@ -702,7 +702,7 @@ uhid_attach(device_t dev) > > /* the Xbox 360 gamepad has no report descriptor */ > sc->sc_repdesc_size = sizeof(uhid_xb360gp_report_descr); > - sc->sc_repdesc_ptr = &uhid_xb360gp_report_descr; > + sc->sc_repdesc_ptr = (void *)&uhid_xb360gp_report_descr; > sc->sc_flags |= UHID_FLAG_STATIC_DESC; > } > if (sc->sc_repdesc_ptr == NULL) { -- a13x From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 20:28:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 087B91065783; Sat, 13 Nov 2010 20:28:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB6A78FC23; Sat, 13 Nov 2010 20:28:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADKS6tX058814; Sat, 13 Nov 2010 20:28:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADKS6lT058812; Sat, 13 Nov 2010 20:28:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011132028.oADKS6lT058812@svn.freebsd.org> From: Warner Losh Date: Sat, 13 Nov 2010 20:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215255 - head/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 20:28:07 -0000 Author: imp Date: Sat Nov 13 20:28:06 2010 New Revision: 215255 URL: http://svn.freebsd.org/changeset/base/215255 Log: Correct mips/arm elimination of sym Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Nov 13 19:26:45 2010 (r215254) +++ head/sys/modules/Makefile Sat Nov 13 20:28:06 2010 (r215255) @@ -330,7 +330,7 @@ _syscons= syscons _vpo= vpo .endif -.if ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips" +.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" # no BUS_SPACE_UNSPECIFIED # No barrier instruction support (specific to this driver) _sym= sym From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 20:30:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8C93106566C; Sat, 13 Nov 2010 20:30:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 975128FC1D; Sat, 13 Nov 2010 20:30:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADKUO6n058896; Sat, 13 Nov 2010 20:30:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADKUOUa058894; Sat, 13 Nov 2010 20:30:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011132030.oADKUOUa058894@svn.freebsd.org> From: Warner Losh Date: Sat, 13 Nov 2010 20:30: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: r215256 - head/contrib/binutils/bfd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 20:30:24 -0000 Author: imp Date: Sat Nov 13 20:30:24 2010 New Revision: 215256 URL: http://svn.freebsd.org/changeset/base/215256 Log: Default to little endian output when building for little endian. This got lost as a result of a mismerge a few months back and I didn't notice until I collapsed tbemd into -head. Submitted by: similar patch by kan@ Modified: head/contrib/binutils/bfd/config.bfd Modified: head/contrib/binutils/bfd/config.bfd ============================================================================== --- head/contrib/binutils/bfd/config.bfd Sat Nov 13 20:28:06 2010 (r215255) +++ head/contrib/binutils/bfd/config.bfd Sat Nov 13 20:30:24 2010 (r215256) @@ -772,14 +772,18 @@ case "${targ}" in targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" ;; - mips*-*-freebsd*) - targ_defvec=bfd_elf32_tradbigmips_vec - targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" - ;; mips*-*-netbsd*) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" ;; + mips*el-*-freebsd*) + targ_defvec=bfd_elf32_tradlittlemips_vec + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + ;; + mips*-*-freebsd*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + ;; mips*-dec-* | mips*el-*-ecoff*) targ_defvec=ecoff_little_vec targ_selvecs=ecoff_big_vec From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 20:41:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AF91065679; Sat, 13 Nov 2010 20:41:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FA888FC18; Sat, 13 Nov 2010 20:41:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADKflAX059152; Sat, 13 Nov 2010 20:41:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADKfl6s059150; Sat, 13 Nov 2010 20:41:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011132041.oADKfl6s059150@svn.freebsd.org> From: Warner Losh Date: Sat, 13 Nov 2010 20:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215257 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 20:41:47 -0000 Author: imp Date: Sat Nov 13 20:41:47 2010 New Revision: 215257 URL: http://svn.freebsd.org/changeset/base/215257 Log: The fixes for mips/mips arm/arm compat hacks broke if TARGET or TARGET_ARCH wasn't defined. Fix it for that case. Submitted by: Garrett Cooper Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Nov 13 20:30:24 2010 (r215256) +++ head/Makefile.inc1 Sat Nov 13 20:41:47 2010 (r215257) @@ -124,7 +124,8 @@ TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm} .endif # Legacy names, for a transition period mips:mips -> mipsel:mips -.if ${TARGET_ARCH} == "mips" && ${TARGET} == "mips" +.if defined(TARGET) && defined(TARGET_ARCH) && \ + ${TARGET_ARCH} == "mips" && ${TARGET} == "mips" .warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb" .if defined(TARGET_BIG_ENDIAN) TARGET_ARCH=mipseb @@ -133,7 +134,7 @@ TARGET_ARCH=mipsel .endif .endif # arm with TARGET_BIG_ENDIAN -> armeb -.if ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) +.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) .warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated. use armeb" TARGET_ARCH=armeb .endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 20:45:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A20D1065694; Sat, 13 Nov 2010 20:45:17 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58A028FC18; Sat, 13 Nov 2010 20:45:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADKjHek059354; Sat, 13 Nov 2010 20:45:17 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADKjHCo059351; Sat, 13 Nov 2010 20:45:17 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201011132045.oADKjHCo059351@svn.freebsd.org> From: Nick Hibma Date: Sat, 13 Nov 2010 20:45: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: r215258 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 20:45:17 -0000 Author: n_hibma Date: Sat Nov 13 20:45:16 2010 New Revision: 215258 URL: http://svn.freebsd.org/changeset/base/215258 Log: Add the switch config for the XS Stick. It speaks AT commands on 2 out of 3 serial ports, but it has not been verified to work at all speaking PPP yet. Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sat Nov 13 20:41:47 2010 (r215257) +++ head/sys/dev/usb/serial/u3g.c Sat Nov 13 20:45:16 2010 (r215258) @@ -291,6 +291,8 @@ static const struct usb_device_id u3g_de U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), + U3G_DEV(LONGCHEER, DISK, U3GINIT_TCT), + U3G_DEV(LONGCHEER, W14, 0), U3G_DEV(MERLIN, V620, 0), U3G_DEV(NEOTEL, PRIME, 0), U3G_DEV(NOVATEL, E725, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat Nov 13 20:41:47 2010 (r215257) +++ head/sys/dev/usb/usbdevs Sat Nov 13 20:45:16 2010 (r215258) @@ -2086,7 +2086,10 @@ product LOGITEC RT2870_2 0x0163 RT2870 product LOGITEC RT2870_3 0x0164 RT2870 /* Longcheer Holdings, Ltd. products */ -product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA USB modem +product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA +product LONGCHEER W14 0x9603 Mobilcom W14 +product LONGCHEER DISK 0xf000 Driver disk + /* Lucent products */ product LUCENT EVALKIT 0x1001 USS-720 evaluation kit From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 21:03:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5074C1065672; Sat, 13 Nov 2010 21:03:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EFDB8FC1B; Sat, 13 Nov 2010 21:03:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADL3KcG059764; Sat, 13 Nov 2010 21:03:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADL3KWf059762; Sat, 13 Nov 2010 21:03:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011132103.oADL3KWf059762@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Nov 2010 21:03: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: r215259 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 21:03:20 -0000 Author: marius Date: Sat Nov 13 21:03:19 2010 New Revision: 215259 URL: http://svn.freebsd.org/changeset/base/215259 Log: When printing media with more than one media option set aggregate these in a comma delimited list instead of repeating "mediaopt" for each one. This matches how the options of the active media are printed with print_media_word() and brings us in line what NetBSD does. MFC after: 2 weeks Modified: head/sbin/ifconfig/ifmedia.c Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Sat Nov 13 20:45:16 2010 (r215258) +++ head/sbin/ifconfig/ifmedia.c Sat Nov 13 21:03:19 2010 (r215259) @@ -757,7 +757,7 @@ print_media_word_ifconfig(int ifmw) { struct ifmedia_description *desc; struct ifmedia_type_to_subtype *ttos; - int i; + int seen_option = 0, i; /* Find the top-level interface type. */ desc = get_toptype_desc(ifmw); @@ -792,7 +792,10 @@ print_media_word_ifconfig(int ifmw) for (desc = ttos->options[i].desc; desc->ifmt_string != NULL; desc++) { if (ifmw & desc->ifmt_word) { - printf(" mediaopt %s", desc->ifmt_string); + if (seen_option == 0) + printf(" mediaopt "); + printf("%s%s", seen_option++ ? "," : "", + desc->ifmt_string); } } } From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 21:09:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD488106566C; Sat, 13 Nov 2010 21:09:18 +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 AB7DC8FC13; Sat, 13 Nov 2010 21:09:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADL9IhC059904; Sat, 13 Nov 2010 21:09:18 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADL9Iuj059902; Sat, 13 Nov 2010 21:09:18 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201011132109.oADL9Iuj059902@svn.freebsd.org> From: Martin Matuska Date: Sat, 13 Nov 2010 21: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: r215260 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 21:09:18 -0000 Author: mm Date: Sat Nov 13 21:09:18 2010 New Revision: 215260 URL: http://svn.freebsd.org/changeset/base/215260 Log: Disable VFS_HOLD placed on mnt_vnodecovered during the mount of a snapshot and VFS_RELE on a non-existing hold on snapshot parent's z_vfs. This disables the changes from OpenSolaris onnv-revision 9234:bffdc4fc05c4 (bug IDs: 6792139, 6794830) - not applicable to FreeBSD. This fixes the process hang if umounting a manually mounted snapshot. Reported by: Alexander Zagrebin Approved by: delphij (mentor) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 13 21:03:19 2010 (r215259) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 13 21:09:18 2010 (r215260) @@ -1218,12 +1218,14 @@ zfs_mount(vfs_t *vfsp) error = zfs_domount(vfsp, osname); PICKUP_GIANT(); +#ifdef sun /* * Add an extra VFS_HOLD on our parent vfs so that it can't * disappear due to a forced unmount. */ if (error == 0 && ((zfsvfs_t *)vfsp->vfs_data)->z_issnap) VFS_HOLD(mvp->v_vfsp); +#endif /* sun */ out: return (error); @@ -1766,12 +1768,14 @@ zfs_freevfs(vfs_t *vfsp) { zfsvfs_t *zfsvfs = vfsp->vfs_data; +#ifdef sun /* * If this is a snapshot, we have an extra VFS_HOLD on our parent * from zfs_mount(). Release it here. */ if (zfsvfs->z_issnap) VFS_RELE(zfsvfs->z_parent->z_vfs); +#endif /* sun */ zfsvfs_free(zfsvfs); From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 21:48:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83B55106564A; Sat, 13 Nov 2010 21:48:32 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71E2C8FC0C; Sat, 13 Nov 2010 21:48:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADLmWMn060868; Sat, 13 Nov 2010 21:48:32 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADLmWVL060866; Sat, 13 Nov 2010 21:48:32 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011132148.oADLmWVL060866@svn.freebsd.org> From: Bruce Cran Date: Sat, 13 Nov 2010 21:48: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: r215263 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 21:48:32 -0000 Author: brucec Date: Sat Nov 13 21:48:32 2010 New Revision: 215263 URL: http://svn.freebsd.org/changeset/base/215263 Log: Add ftp4.se.freebsd.org to the set of mirrors. PR: bin/150552 Submitted by: Niclas Zeising MFC after: 3 days Modified: head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Sat Nov 13 21:37:18 2010 (r215262) +++ head/usr.sbin/sysinstall/menus.c Sat Nov 13 21:48:32 2010 (r215263) @@ -793,6 +793,8 @@ DMenu MenuMediaFTP = { VAR_FTP_PATH "=ftp://ftp2.se.freebsd.org" }, { " Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.se.freebsd.org" }, + { " Sweden #4", "ftp4.se.freebsd.org", NULL, dmenuSetVariable, NULL, + VAR_FTP_PATH "=ftp://ftp4.se.freebsd.org" }, { " Sweden #5", "ftp5.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.se.freebsd.org" }, From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:10:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 265F210656A4; Sat, 13 Nov 2010 22:10:27 +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 14D098FC1D; Sat, 13 Nov 2010 22:10:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADMAQiK061495; Sat, 13 Nov 2010 22:10:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADMAQfb061493; Sat, 13 Nov 2010 22:10:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011132210.oADMAQfb061493@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 13 Nov 2010 22:10: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: r215266 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:10:27 -0000 Author: jilles Date: Sat Nov 13 22:10:26 2010 New Revision: 215266 URL: http://svn.freebsd.org/changeset/base/215266 Log: sh: Do the additional actions if 'local -' restore changes -i/-m/-E/-V. Example: f() { local -; set +m; }; f caused failure to execute external programs because the job control tty fd was not opened. Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sat Nov 13 22:04:48 2010 (r215265) +++ head/bin/sh/var.c Sat Nov 13 22:10:26 2010 (r215266) @@ -805,6 +805,7 @@ poplocalvars(void) if (vp == NULL) { /* $- saved */ memcpy(optlist, lvp->text, sizeof optlist); ckfree(lvp->text); + optschanged(); } else if ((lvp->flags & (VUNSET|VSTRFIXED)) == VUNSET) { (void)unsetvar(vp->text); } else { From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:11:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90596106564A; Sat, 13 Nov 2010 22:11:07 +0000 (UTC) (envelope-from pyunyh@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 EBA498FC08; Sat, 13 Nov 2010 22:11:06 +0000 (UTC) Received: by gxk9 with SMTP id 9so2557806gxk.13 for ; Sat, 13 Nov 2010 14:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=M0mOWAjEBLOOrxaj0omZ6e2YKcr62PpMqKHOgu9H4qw=; b=pF0jnGgIdfWaC8F6WPSq8utgMfS9giwZXb2EpC8avZGY8TepkVYqF+crPtdghZ7XOK VjdFCFbnwAQ0qUgOc7ZiKK1qUd1mV2czmOVzsS5UihqLfoTisoiGZZ9Le1xNrp0eCfX0 BRnpeZ861KAfEqBwE6L4WkGiuo6NW/YRYb2g4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ZcZz5grhAVPZFlfdYBjvg6/F0zkchRDHm3POlDR+Y1dJnfcz2VAaekReu6OdqRKZoP uWkUqMx8j/qhdD1RMGY9jy2r6NhGQ3sdw+q2UuZ7X/zey3txpTy8ToNCszYA4e1oiWSX kjSw3mJUJG4SlttQ8HQmAuMGSWiMcDPIj353Q= Received: by 10.90.20.1 with SMTP id 1mr5449115agt.145.1289686265745; Sat, 13 Nov 2010 14:11:05 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 28sm1735528anv.6.2010.11.13.14.11.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 13 Nov 2010 14:11:04 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Sat, 13 Nov 2010 14:10:10 -0800 From: Pyun YongHyeon Date: Sat, 13 Nov 2010 14:10:10 -0800 To: Alexey Dokuchaev Message-ID: <20101113221010.GA28907@michelle.cdnetworks.com> References: <201011130046.oAD0k7Ii029261@svn.freebsd.org> <20101113183616.GB75779@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101113183616.GB75779@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r215214 - stable/8/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:11:07 -0000 On Sat, Nov 13, 2010 at 06:36:17PM +0000, Alexey Dokuchaev wrote: > On Sat, Nov 13, 2010 at 12:46:07AM +0000, Pyun YongHyeon wrote: > > Author: yongari > > Date: Sat Nov 13 00:46:07 2010 > > New Revision: 215214 > > URL: http://svn.freebsd.org/changeset/base/215214 > > > > Log: > > MFC r214898: > > If we got an invalid station address, generate random address. This > > might be caused by broken BIOS. > > > > Reported by: "Mikhail T." aldan.algebra.com> > > Perhaps the reporter can be more easily referenced as mi@? > Hmm, sorry. I was not able to find the name of reporter in committers file. > ./danfe From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:20:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 448CF1065672; Sat, 13 Nov 2010 22:20:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32E9F8FC25; Sat, 13 Nov 2010 22:20:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADMKllw061808; Sat, 13 Nov 2010 22:20:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADMKlsP061806; Sat, 13 Nov 2010 22:20:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011132220.oADMKlsP061806@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 13 Nov 2010 22:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215268 - head/bin/sh/funcs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:20:47 -0000 Author: jilles Date: Sat Nov 13 22:20:46 2010 New Revision: 215268 URL: http://svn.freebsd.org/changeset/base/215268 Log: sh: Update the suspend example for the change of the job control flag from -j to -m, many years ago. Due to r215266, this function now actually works. Modified: head/bin/sh/funcs/suspend Modified: head/bin/sh/funcs/suspend ============================================================================== --- head/bin/sh/funcs/suspend Sat Nov 13 22:18:12 2010 (r215267) +++ head/bin/sh/funcs/suspend Sat Nov 13 22:20:46 2010 (r215268) @@ -34,6 +34,6 @@ suspend() { local - - set +j + set +m kill -TSTP 0 } From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:22:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF0B91065675; Sat, 13 Nov 2010 22:22:18 +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 8387F8FC15; Sat, 13 Nov 2010 22:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADMMIhJ061885; Sat, 13 Nov 2010 22:22:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADMMIav061884; Sat, 13 Nov 2010 22:22:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201011132222.oADMMIav061884@svn.freebsd.org> From: Ed Maste Date: Sat, 13 Nov 2010 22:22: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: r215269 - head/lib/libc_r X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:22:18 -0000 Author: emaste Date: Sat Nov 13 22:22:18 2010 New Revision: 215269 URL: http://svn.freebsd.org/changeset/base/215269 Log: Remove libc_r threading library. It has been disconnected from the build for four years (since r162846). Submitted by: Alexander Best arundel@ Deleted: head/lib/libc_r/ From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:32:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id A2DDC10656D2; Sat, 13 Nov 2010 22:32:16 +0000 (UTC) Date: Sat, 13 Nov 2010 22:32:16 +0000 From: Alexander Best To: Ed Maste Message-ID: <20101113223216.GA18625@freebsd.org> References: <201011132222.oADMMIav061884@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011132222.oADMMIav061884@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215269 - head/lib/libc_r X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:32:16 -0000 On Sat Nov 13 10, Ed Maste wrote: > Author: emaste > Date: Sat Nov 13 22:22:18 2010 > New Revision: 215269 > URL: http://svn.freebsd.org/changeset/base/215269 > > Log: > Remove libc_r threading library. It has been disconnected from the build > for four years (since r162846). thanks. :) > > Submitted by: Alexander Best arundel@ > > Deleted: > head/lib/libc_r/ -- a13x From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:34:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAB9E10656A6; Sat, 13 Nov 2010 22:34:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7D9D8FC14; Sat, 13 Nov 2010 22:34:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADMYCsH062267; Sat, 13 Nov 2010 22:34:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADMYCaK062241; Sat, 13 Nov 2010 22:34:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011132234.oADMYCaK062241@svn.freebsd.org> From: Warner Losh Date: Sat, 13 Nov 2010 22:34: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: r215270 - in head/sys/mips: adm5120 alchemy atheros cavium conf idt sentry5 sibyte X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:34:12 -0000 Author: imp Date: Sat Nov 13 22:34:12 2010 New Revision: 215270 URL: http://svn.freebsd.org/changeset/base/215270 Log: Remove the 'machine mips' from DEFAULTS. Put the proper 'machine mips mipsel' or 'machine mips mipseb' into the config file (with a few 64's tossed in for good measure). This will let us build the proper kernels with different worlds as part of make universe. Added: head/sys/mips/atheros/std.ar71xx (contents, props changed) head/sys/mips/sentry5/std.sentry5 (contents, props changed) head/sys/mips/sibyte/std.sibyte (contents, props changed) Modified: head/sys/mips/adm5120/std.adm5120 head/sys/mips/alchemy/std.alchemy head/sys/mips/cavium/std.octeon1 head/sys/mips/conf/ADM5120 head/sys/mips/conf/ALCHEMY head/sys/mips/conf/AR71XX head/sys/mips/conf/DEFAULTS head/sys/mips/conf/MALTA head/sys/mips/conf/MALTA64 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/OCTEON1-32 head/sys/mips/conf/QEMU head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SWARM head/sys/mips/conf/SWARM64 head/sys/mips/conf/SWARM64_SMP head/sys/mips/conf/SWARM_SMP head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 head/sys/mips/conf/std.SWARM head/sys/mips/idt/std.idt Modified: head/sys/mips/adm5120/std.adm5120 ============================================================================== --- head/sys/mips/adm5120/std.adm5120 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/adm5120/std.adm5120 Sat Nov 13 22:34:12 2010 (r215270) @@ -1,11 +1,13 @@ # $FreeBSD$ +# # Standard include file for ADM5120 -files "../adm5120/files.adm5120" +files "../adm5120/files.adm5120" +machine mips mipsel cpu CPU_MIPS4KC options ISA_MIPS32 -# device admpci +# device admpci device admsw device pci Modified: head/sys/mips/alchemy/std.alchemy ============================================================================== --- head/sys/mips/alchemy/std.alchemy Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/alchemy/std.alchemy Sat Nov 13 22:34:12 2010 (r215270) @@ -4,5 +4,6 @@ files "../alchemy/files.alchemy" +machine mips mipsel cpu CPU_MIPS4KC options ISA_MIPS32 Added: head/sys/mips/atheros/std.ar71xx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/atheros/std.ar71xx Sat Nov 13 22:34:12 2010 (r215270) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# +# standard config for all ar71xx based kernels. + +files "../atheros/files.ar71xx" + +machine mips mipseb +cpu CPU_MIPS4KC +options ISA_MIPS32 Modified: head/sys/mips/cavium/std.octeon1 ============================================================================== --- head/sys/mips/cavium/std.octeon1 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/cavium/std.octeon1 Sat Nov 13 22:34:12 2010 (r215270) @@ -5,3 +5,5 @@ # $FreeBSD$ # files "../cavium/files.octeon1" +machine mips mips64eb +cpu CPU_CNMIPS Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/ADM5120 Sat Nov 13 22:34:12 2010 (r215270) @@ -19,9 +19,6 @@ ident ADM5120 -#makeoptions ARCH_FLAGS=-march=mips32 -makeoptions MIPS_LITTLE_ENDIAN=defined - # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" Modified: head/sys/mips/conf/ALCHEMY ============================================================================== --- head/sys/mips/conf/ALCHEMY Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/ALCHEMY Sat Nov 13 22:34:12 2010 (r215270) @@ -19,9 +19,6 @@ ident ALCHEMY -makeoptions ARCH_FLAGS=-march=mips32 -makeoptions MIPS_LITTLE_ENDIAN=defined - # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" Modified: head/sys/mips/conf/AR71XX ============================================================================== --- head/sys/mips/conf/AR71XX Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/AR71XX Sat Nov 13 22:34:12 2010 (r215270) @@ -5,14 +5,11 @@ # ident AR71XX -cpu CPU_MIPS4KC -options ISA_MIPS32 -makeoptions TARGET_BIG_ENDIAN makeoptions KERNLOADADDR=0x80050000 options HZ=1000 -files "../atheros/files.ar71xx" hints "AR71XX.hints" +include "../atheros/std.ar71xx" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols #makeoptions MODULES_OVERRIDE="" Modified: head/sys/mips/conf/DEFAULTS ============================================================================== --- head/sys/mips/conf/DEFAULTS Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/DEFAULTS Sat Nov 13 22:34:12 2010 (r215270) @@ -3,8 +3,6 @@ # # $FreeBSD$ -machine mips - device mem device uart_ns8250 Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/MALTA Sat Nov 13 22:34:12 2010 (r215270) @@ -19,8 +19,8 @@ ident MALTA -#makeoptions ARCH_FLAGS=-march=mips32 -makeoptions MIPS_LITTLE_ENDIAN=defined +machine mips mipsel # Malta supports both, so it isn't in std.malta + makeoptions KERNLOADADDR=0x80100000 options YAMON Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/MALTA64 Sat Nov 13 22:34:12 2010 (r215270) @@ -19,8 +19,9 @@ ident MALTA +machine mips mips64el # Malta supports both, so it isn't in std.malta + makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" -makeoptions MIPS_LITTLE_ENDIAN=defined makeoptions LDSCRIPT_NAME= ldscript.mips.mips64 options YAMON Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/OCTEON1 Sat Nov 13 22:34:12 2010 (r215270) @@ -18,7 +18,6 @@ # # $FreeBSD$ -machine mips cpu CPU_CNMIPS ident OCTEON1 @@ -27,7 +26,6 @@ makeoptions LDSCRIPT_NAME=ldscript.mips. # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN=defined makeoptions KERNLOADADDR=0xffffffff80100000 include "../cavium/std.octeon1" Modified: head/sys/mips/conf/OCTEON1-32 ============================================================================== --- head/sys/mips/conf/OCTEON1-32 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/OCTEON1-32 Sat Nov 13 22:34:12 2010 (r215270) @@ -17,18 +17,16 @@ # # $FreeBSD$ -machine mips -cpu CPU_CNMIPS -ident OCTEON1 +ident OCTEON1-32 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN=defined makeoptions ARCH_FLAGS="-march=octeon" makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.32 makeoptions KERNLOADADDR=0x81000000 include "../cavium/std.octeon1" +machine mips mipseb hints "OCTEON1.hints" #Default places to look for devices. Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/QEMU Sat Nov 13 22:34:12 2010 (r215270) @@ -20,10 +20,6 @@ cpu CPU_MIPS32 ident QEMU -# XXX: These two options must be defined in MIPS kernel configs. -makeoptions MIPS_LITTLE_ENDIAN=defined -makeoptions ARCH_FLAGS=-march=mips32 - # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/SENTRY5 Sat Nov 13 22:34:12 2010 (r215270) @@ -25,14 +25,9 @@ # ident SENTRY5 -cpu CPU_MIPS4KC -options ISA_MIPS32 -options CPU_SENTRY5 # XXX should this be a - # sub-cpu option? # XXX only siba should be hardwired for now; we will use # bus enumeration there -files "../sentry5/files.sentry5" hints "SENTRY5.hints" # sentry5 normally ships with cfe firmware; use the console for now @@ -40,8 +35,6 @@ options CFE options CFE_CONSOLE options ALT_BREAK_TO_DEBUGGER -#makeoptions ARCH_FLAGS=-march=mips32 -makeoptions MIPS_LITTLE_ENDIAN=defined makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions MODULES_OVERRIDE="" @@ -56,18 +49,18 @@ options PSEUDOFS #Pseudo-filesystem fr options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions # Debugging for use in -current -#options DEADLKRES +#options DEADLKRES options INVARIANTS options INVARIANT_SUPPORT -#options BUS_DEBUG +#options BUS_DEBUG #makeoptions BUS_DEBUG device siba # Sonics SiliconBackplane device pci # siba_pcib -# device bfe # XXX will build both pci and siba -# device miibus # attachments +# device bfe # XXX will build both pci and siba +# device miibus # attachments # pci devices # notyet: Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/SWARM Sat Nov 13 22:34:12 2010 (r215270) @@ -6,6 +6,7 @@ include std.SWARM ident SWARM +machine mips mipseb options ISA_MIPS32 makeoptions ARCH_FLAGS="-mabi=32 -march=mips32" Modified: head/sys/mips/conf/SWARM64 ============================================================================== --- head/sys/mips/conf/SWARM64 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/SWARM64 Sat Nov 13 22:34:12 2010 (r215270) @@ -6,6 +6,7 @@ include std.SWARM ident SWARM64 +machine mips mips64eb makeoptions ARCH_FLAGS="-mabi=64 -march=mips64" makeoptions LDSCRIPT_NAME=ldscript.mips.64.cfe makeoptions KERNLOADADDR=0xffffffff80001000 Modified: head/sys/mips/conf/SWARM64_SMP ============================================================================== --- head/sys/mips/conf/SWARM64_SMP Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/SWARM64_SMP Sat Nov 13 22:34:12 2010 (r215270) @@ -9,6 +9,7 @@ ident SWARM64_SMP options SMP options PRINTF_BUFR_SIZE=128 +machine mips mips64eb makeoptions ARCH_FLAGS="-mabi=64 -march=mips64" makeoptions LDSCRIPT_NAME=ldscript.mips.64.cfe makeoptions KERNLOADADDR=0xffffffff80001000 Modified: head/sys/mips/conf/SWARM_SMP ============================================================================== --- head/sys/mips/conf/SWARM_SMP Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/SWARM_SMP Sat Nov 13 22:34:12 2010 (r215270) @@ -9,6 +9,7 @@ ident SWARM_SMP options SMP options PRINTF_BUFR_SIZE=128 +machine mips mipseb options ISA_MIPS32 makeoptions ARCH_FLAGS="-mabi=32 -march=mips32" Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/XLR Sat Nov 13 22:34:12 2010 (r215270) @@ -45,7 +45,7 @@ # # $FreeBSD$ -machine mips +machine mips mipseb cpu CPU_RMI ident XLR Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/XLR64 Sat Nov 13 22:34:12 2010 (r215270) @@ -17,7 +17,7 @@ # # $FreeBSD$ -machine mips +machine mips mips64eb cpu CPU_RMI ident XLR64 Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/XLRN32 Sat Nov 13 22:34:12 2010 (r215270) @@ -17,7 +17,7 @@ # # $FreeBSD$ -machine mips +machine mips mipseb cpu CPU_RMI ident XLRN32 Modified: head/sys/mips/conf/std.SWARM ============================================================================== --- head/sys/mips/conf/std.SWARM Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/conf/std.SWARM Sat Nov 13 22:34:12 2010 (r215270) @@ -2,8 +2,8 @@ # $FreeBSD$ # -files "../sibyte/files.sibyte" hints "SWARM.hints" +include "../sibyte/std.sibyte" options CFE options CFE_CONSOLE Modified: head/sys/mips/idt/std.idt ============================================================================== --- head/sys/mips/idt/std.idt Sat Nov 13 22:22:18 2010 (r215269) +++ head/sys/mips/idt/std.idt Sat Nov 13 22:34:12 2010 (r215270) @@ -3,4 +3,5 @@ files "../idt/files.idt" +machine mips mipsel options ISA_MIPS32 Added: head/sys/mips/sentry5/std.sentry5 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/sentry5/std.sentry5 Sat Nov 13 22:34:12 2010 (r215270) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# + +machine mips mipsel + +cpu CPU_MIPS4KC +options ISA_MIPS32 +options CPU_SENTRY5 # XXX should this be a + # sub-cpu option? +files "../sentry5/files.sentry5" + Added: head/sys/mips/sibyte/std.sibyte ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/sibyte/std.sibyte Sat Nov 13 22:34:12 2010 (r215270) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +files "../sibyte/files.sibyte" From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:38:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A4281065670; Sat, 13 Nov 2010 22:38:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 492A28FC08; Sat, 13 Nov 2010 22:38:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADMcXqX062377; Sat, 13 Nov 2010 22:38:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADMcXU1062375; Sat, 13 Nov 2010 22:38:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011132238.oADMcXU1062375@svn.freebsd.org> From: Warner Losh Date: Sat, 13 Nov 2010 22:38: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: r215271 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:38:33 -0000 Author: imp Date: Sat Nov 13 22:38:33 2010 New Revision: 215271 URL: http://svn.freebsd.org/changeset/base/215271 Log: Add mips back to universe Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Nov 13 22:34:12 2010 (r215270) +++ head/Makefile Sat Nov 13 22:38:33 2010 (r215271) @@ -281,7 +281,7 @@ tinderbox: # existing system is. # .if make(universe) || make(universe_kernels) || make(tinderbox) -TARGETS?=amd64 i386 ia64 pc98 powerpc sparc64 sun4v +TARGETS?=amd64 i386 ia64 pc98 powerpc sparc64 sun4v mips .if defined(DOING_TINDERBOX) FAILFILE=tinderbox.failed From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:40:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54AD81065673; Sat, 13 Nov 2010 22:40:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 14E998FC12; Sat, 13 Nov 2010 22:40:31 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Sat, 13 Nov 2010 17:40:31 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 3409233C00; Sat, 13 Nov 2010 17:40:31 -0500 (EST) Date: Sat, 13 Nov 2010 17:40:31 -0500 From: Ed Maste Message-ID: <20101113224031.GA20786@sandvine.com> References: <201011132222.oADMMIav061884@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201011132222.oADMMIav061884@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215269 - head/lib/libc_r X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:40:32 -0000 On Sat, Nov 13, 2010 at 10:22:18PM +0000, Ed Maste wrote: > Log: > Remove libc_r threading library. It has been disconnected from the build > for four years (since r162846). It has been suggested that there's some value in keeping libc_r around for comparison purposes and benchmarking -- sorry if I ripped it out from anyone who was planning to do so. Of course it's still available in svn if needed for such work. -Ed From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 22:40:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E582410656B1; Sat, 13 Nov 2010 22:40:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDE4B8FC16; Sat, 13 Nov 2010 22:40:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oADMebUq062452; Sat, 13 Nov 2010 22:40:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oADMebRk062450; Sat, 13 Nov 2010 22:40:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011132240.oADMebRk062450@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Nov 2010 22:40: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: r215272 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 22:40:38 -0000 Author: marius Date: Sat Nov 13 22:40:37 2010 New Revision: 215272 URL: http://svn.freebsd.org/changeset/base/215272 Log: When setting a media with no sub-type specified also reset the type specific options along with the global ones so these options don't stick when f.e. switching to IFM_AUTO. MFC after: 2 weeks Modified: head/sbin/ifconfig/ifmedia.c Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Sat Nov 13 22:38:33 2010 (r215271) +++ head/sbin/ifconfig/ifmedia.c Sat Nov 13 22:40:37 2010 (r215272) @@ -276,7 +276,7 @@ setmedia(const char *val, int d, int s, IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~IFM_GMASK; + ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); } ifmr->ifm_current = ifr.ifr_media; From owner-svn-src-all@FreeBSD.ORG Sat Nov 13 23:00:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 864D11065675; Sat, 13 Nov 2010 23:00:14 +0000 (UTC) Date: Sat, 13 Nov 2010 23:00:14 +0000 From: Alexander Best To: Ed Maste Message-ID: <20101113230014.GA22288@freebsd.org> References: <201011132222.oADMMIav061884@svn.freebsd.org> <20101113224031.GA20786@sandvine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101113224031.GA20786@sandvine.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215269 - head/lib/libc_r X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 23:00:14 -0000 On Sat Nov 13 10, Ed Maste wrote: > On Sat, Nov 13, 2010 at 10:22:18PM +0000, Ed Maste wrote: > > > Log: > > Remove libc_r threading library. It has been disconnected from the build > > for four years (since r162846). > > It has been suggested that there's some value in keeping libc_r around > for comparison purposes and benchmarking -- sorry if I ripped it out > from anyone who was planning to do so. Of course it's still available > in svn if needed for such work. just stumbled over this thread from 2005: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/arch/2005-10/0060.html however even back then it was decided that libc_r should stay for a while, but not forever. ...also a few people suggested moving it to ports, but for some reason that didn't happen. so i doubt that the removal of libc_r is a big loss to the majority of developers. ;) cheers. alex > > -Ed -- a13x