From owner-svn-src-head@FreeBSD.ORG Sun Nov 7 03:09:03 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 03:26:23 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 03:40:37 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 04:09:46 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 07:16:35 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 10:49:40 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 12:29:27 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 14:28:01 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 14:39:41 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 15:36:07 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 16:05:05 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 16:24:52 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 17:33:05 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 17:44:04 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 17:50:56 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 18:42:38 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 18:50:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 19:19:14 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 19:23:25 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 20:33:40 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 20:37:26 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 20:38:14 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 20:40:00 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 20:44:46 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 20:53:19 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 20:56:41 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 21:40:35 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 21:48:49 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 21:57:57 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 22:51:54 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 23:22:23 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 23:22:43 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 23:23:48 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 23:34:05 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 7 23:44:41 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Mon Nov 8 00:26:49 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 01:15:43 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 01:54:42 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 03:08:01 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 07:54:25 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 09:26:56 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 09:50:48 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 12:04:41 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 15:14:15 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 15:25:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 15:36:15 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 15:59:41 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 19:00:22 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 19:15:32 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 19:52:15 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 19:53:16 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:03:52 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:05:22 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:11:43 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:31:00 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:32:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:35:10 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:44:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:56:31 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:57:02 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 20:57:09 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 21:22:56 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 21:23:29 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 21:50:46 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 21:50:51 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 22:03:40 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 22:05:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 22:10:51 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 22:12:25 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 8 23:15:11 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Tue Nov 9 00:01:55 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 00:04:31 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 00:06:00 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 00:14:39 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 00:27:18 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 01:52:09 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 02:51:38 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 09:34:22 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 10:59:09 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 12:00:40 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 14:00:10 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 14:00:10 -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-head@FreeBSD.ORG Tue Nov 9 14:11:09 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 16:18:33 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 18:28:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 18:32:57 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 18:46:45 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 19:28:06 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 19:45:30 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 20:28:10 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 20:41:10 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 20:46:42 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 21:23:58 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 22:05:19 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 22:08:26 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 22:15:03 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 22:32:09 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 9 23:53:48 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Wed Nov 10 00:28:21 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 00:39:42 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 00:56:44 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 01:25:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10242106564A for ; Wed, 10 Nov 2010 01:25:50 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com [74.125.82.41]) by mx1.freebsd.org (Postfix) with ESMTP id 9655B8FC13 for ; Wed, 10 Nov 2010 01:25:48 +0000 (UTC) Received: by wwb29 with SMTP id 29so573053wwb.2 for ; Tue, 09 Nov 2010 17:25:48 -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=Lad1g3f5R32DbGSzt2VkavCRfEf26BDz12J49W0kMnE=; b=A4CB3B8fsWN9C2NexSwu7c0xrp1w7ydvn+3UQS28b7m0j4peY2bNQEF0mIMfqsnqXj X5NUex9+fUBkpqXl8S1ZOxjRC7lza8GXroJPpmf6WAeoBTNuxL7/U72b+2zgDj1cgcLN Np1fy8tbuD1zd6DBnaIXADFXLuWB3K7gtmoBY= 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=IZOIrUGZV9n9s1TIVehzQr5wj7DQzp3QWsdg093JkDZnz19fVNA/QEgNVQAsHbLCrx Q3I7+heOCj8WGqnwrL8zbNPjhESksGmgcg6F28OnhH57+tWvIn9VLd/uoAf1dUYls+8M 2s7PuGR/kOassUgDeFuO4HXe6OzVnrZbLV6no= MIME-Version: 1.0 Received: by 10.216.82.197 with SMTP id o47mr7679555wee.45.1289352347299; Tue, 09 Nov 2010 17:25:47 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Tue, 9 Nov 2010 17:25:47 -0800 (PST) In-Reply-To: <201011100056.oAA0uimN067694@svn.freebsd.org> References: <201011100056.oAA0uimN067694@svn.freebsd.org> Date: Tue, 9 Nov 2010 17:25:47 -0800 X-Google-Sender-Auth: Gw3ux_RfK-XO3sX753krgq-9OXI Message-ID: From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-committers@freebsd.org Subject: Re: svn commit: r215070 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 01:25:50 -0000 On Tue, Nov 9, 2010 at 4:56 PM, Warner Losh wrote: > Author: imp > Date: Wed Nov 10 00:56:44 2010 > New Revision: 215070 > URL: http://svn.freebsd.org/changeset/base/215070 > > Log: > =A0Build make.conf when the world is not selected to build, but the > =A0kernel is. > > =A0PR: =A0 =A0 =A0 =A0 =A0 151696 > =A0Submitted by: lev@ > > Modified: > =A0head/tools/tools/nanobsd/nanobsd.sh > > Modified: head/tools/tools/nanobsd/nanobsd.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:39:42 2010 =A0 =A0 = =A0 =A0(r215069) > +++ head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:56:44 2010 =A0 =A0 = =A0 =A0(r215070) > @@ -917,6 +917,9 @@ else > =A0fi > > =A0if $do_kernel ; then > + =A0 =A0 =A0 if ! $do_world ; then > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 make_conf_build > + =A0 =A0 =A0 fi > =A0 =A0 =A0 =A0build_kernel > =A0else > =A0 =A0 =A0 =A0pprint 2 "Skipping buildkernel (as instructed)" Funny that it overwrites __MAKE_CONF, but not SRCCONF (seems like the latter would infect a system more than the former *shrugs*); I think I understand why it's not set in this script though, because IIRC src.conf predates nanobsd. I set my core variables and features in src.conf so I think it'd probably be better to block that out too. Should I provide a patch for this item? Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Nov 10 01:26:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF2B1065670; Wed, 10 Nov 2010 01:26:16 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF668FC15; Wed, 10 Nov 2010 01:26:14 +0000 (UTC) Received: by wwb22 with SMTP id 22so124370wwb.31 for ; Tue, 09 Nov 2010 17:26:14 -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=jSJcRVQNEV/xrsTpP3B47NUMB4W6SKN8oW9z0olafzc=; b=AjqMk+xc95lfrzD7by4Or4yuc8rOG52FeJJ5avUnh03bIl/9SOncUjWa+iQy/QwprK UndazXDc+UZSEYIS/oCC2mV9U6A/I6NlagCutdkJO+z5m09JTxytk+OcotldZzh3Gc0r VqGBexkb0gisdkMcVCt4pFxYJQyaEdgQHPtUQ= 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=xRcabBimux4SN3z8DB+Q3sZ4GilDoFCsUMdPgQ3Yv6Ai4iORnpmf/oiYijiIjN/BYW GUJUXCfdlWPbfL2jHedqyCNi+Sr9s2aVYxYt4uG1NZ/kk8l7OwETj/EnBNs7MAHHYcd1 PUtgtNmJyzAmZ64CYdpHEJM9a3o8rZXrWFqOc= MIME-Version: 1.0 Received: by 10.216.175.18 with SMTP id y18mr7733345wel.30.1289352374166; Tue, 09 Nov 2010 17:26:14 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Tue, 9 Nov 2010 17:26:14 -0800 (PST) In-Reply-To: References: <201011100056.oAA0uimN067694@svn.freebsd.org> Date: Tue, 9 Nov 2010 17:26:14 -0800 X-Google-Sender-Auth: ne58u1FlJVGAYdIayEgr8oifTjA Message-ID: From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215070 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 01:26:16 -0000 On Tue, Nov 9, 2010 at 5:25 PM, Garrett Cooper wrote: > On Tue, Nov 9, 2010 at 4:56 PM, Warner Losh wrote: >> Author: imp >> Date: Wed Nov 10 00:56:44 2010 >> New Revision: 215070 >> URL: http://svn.freebsd.org/changeset/base/215070 >> >> Log: >> =A0Build make.conf when the world is not selected to build, but the >> =A0kernel is. >> >> =A0PR: =A0 =A0 =A0 =A0 =A0 151696 >> =A0Submitted by: lev@ >> >> Modified: >> =A0head/tools/tools/nanobsd/nanobsd.sh >> >> Modified: head/tools/tools/nanobsd/nanobsd.sh >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:39:42 2010 =A0 =A0= =A0 =A0(r215069) >> +++ head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:56:44 2010 =A0 =A0= =A0 =A0(r215070) >> @@ -917,6 +917,9 @@ else >> =A0fi >> >> =A0if $do_kernel ; then >> + =A0 =A0 =A0 if ! $do_world ; then >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 make_conf_build >> + =A0 =A0 =A0 fi >> =A0 =A0 =A0 =A0build_kernel >> =A0else >> =A0 =A0 =A0 =A0pprint 2 "Skipping buildkernel (as instructed)" > > =A0 =A0Funny that it overwrites __MAKE_CONF, but not SRCCONF (seems like > the latter would infect a system more than the former *shrugs*); I > think I understand why it's not set in this script though, because > IIRC src.conf predates nanobsd. > =A0 =A0I set my core variables and features in src.conf so I think it'd > probably be better to block that out too. > =A0 =A0Should I provide a patch for this item? Sorry for the spam. I sent the email to the wrong list. -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Nov 10 01:29:56 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 04:47:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F9E2106564A; Wed, 10 Nov 2010 04:47:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0E0558FC14; Wed, 10 Nov 2010 04:47:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oAA4fPtC030952; Tue, 9 Nov 2010 21:41:25 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4CDA2275.1030403@bsdimp.com> Date: Tue, 09 Nov 2010 21:41:25 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100918 Thunderbird/3.1.4 MIME-Version: 1.0 To: Garrett Cooper References: <201011100056.oAA0uimN067694@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r215070 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 04:47:27 -0000 On 11/09/2010 18:25, Garrett Cooper wrote: > On Tue, Nov 9, 2010 at 4:56 PM, Warner Losh wrote: >> 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)" > Funny that it overwrites __MAKE_CONF, but not SRCCONF (seems like > the latter would infect a system more than the former *shrugs*); I > think I understand why it's not set in this script though, because > IIRC src.conf predates nanobsd. > I set my core variables and features in src.conf so I think it'd > probably be better to block that out too. > Should I provide a patch for this item? __MAKE_CONF is the root of all evil. SRCCONF shouldn't affect anything if __MAKE_CONF is overriden. If it does, then point me at the code in src that pulls it in? Warner > Thanks, > -Garrett > > > From owner-svn-src-head@FreeBSD.ORG Wed Nov 10 05:32:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 06:10:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DFC0106566C; Wed, 10 Nov 2010 06:10:40 +0000 (UTC) (envelope-from yanegomi@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 968A18FC14; Wed, 10 Nov 2010 06:10:39 +0000 (UTC) Received: by wya21 with SMTP id 21so389817wya.13 for ; Tue, 09 Nov 2010 22:10:38 -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=Xndf/ln0F4PSOF3uxzQFGDv+bCEmvi4EnhwK0jmJVnc=; b=pIcdR6gkRPijAwKHGs6wbhPxcKFYPueK17wb11DeurTg7J2GKnNSn7ybwWup0GQGwz zn225vgn3PjHhu8vV0FPmIgpmQigf7QV9qxCYHmcRN6bZSe5JOiy4cR3+5bX9lmsrO5X qFez7bmvSQ+/Z46TTcLc90wgfUgvvPUMpEYAI= 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=jCBhngsopcrcvt8ObOrj8wuvStveDOnuoqPDWr4z1aF6N5fkTyLp3wGp3MS+Gu+U4i u/nYLsN38Vae4n2GXzAuGbUsavf4El+fL6goWrqSsP4Y+4zglnvkiy9qtvei7feyw8Vw TAttLrwD0mVDTd+i0GUYP3bOYfmi+N1GcLNwo= MIME-Version: 1.0 Received: by 10.216.46.200 with SMTP id r50mr649543web.45.1289369438020; Tue, 09 Nov 2010 22:10:38 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Tue, 9 Nov 2010 22:10:37 -0800 (PST) In-Reply-To: <4CDA2275.1030403@bsdimp.com> References: <201011100056.oAA0uimN067694@svn.freebsd.org> <4CDA2275.1030403@bsdimp.com> Date: Tue, 9 Nov 2010 22:10:37 -0800 X-Google-Sender-Auth: adUdw_cvuFEBBBktMQCeK3iuQcQ Message-ID: From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r215070 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 06:10:40 -0000 On Tue, Nov 9, 2010 at 8:41 PM, Warner Losh wrote: > =A0On 11/09/2010 18:25, Garrett Cooper wrote: >> >> On Tue, Nov 9, 2010 at 4:56 PM, Warner Losh =A0wrote: >>> >>> Author: imp >>> Date: Wed Nov 10 00:56:44 2010 >>> New Revision: 215070 >>> URL: http://svn.freebsd.org/changeset/base/215070 >>> >>> Log: >>> =A0Build make.conf when the world is not selected to build, but the >>> =A0kernel is. >>> >>> =A0PR: =A0 =A0 =A0 =A0 =A0 151696 >>> =A0Submitted by: lev@ >>> >>> Modified: >>> =A0head/tools/tools/nanobsd/nanobsd.sh >>> >>> Modified: head/tools/tools/nanobsd/nanobsd.sh >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:39:42 2010 >>> =A0(r215069) >>> +++ head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:56:44 2010 >>> =A0(r215070) >>> @@ -917,6 +917,9 @@ else >>> =A0fi >>> >>> =A0if $do_kernel ; then >>> + =A0 =A0 =A0 if ! $do_world ; then >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 make_conf_build >>> + =A0 =A0 =A0 fi >>> =A0 =A0 =A0 =A0build_kernel >>> =A0else >>> =A0 =A0 =A0 =A0pprint 2 "Skipping buildkernel (as instructed)" >> >> =A0 =A0 Funny that it overwrites __MAKE_CONF, but not SRCCONF (seems lik= e >> the latter would infect a system more than the former *shrugs*); I >> think I understand why it's not set in this script though, because >> IIRC src.conf predates nanobsd. >> =A0 =A0 I set my core variables and features in src.conf so I think it'd >> probably be better to block that out too. >> =A0 =A0 Should I provide a patch for this item? > > __MAKE_CONF is the root of all evil. =A0SRCCONF shouldn't affect anything= if > __MAKE_CONF is overriden. =A0If it does, then point me at the code in src= that > pulls it in? $ cat test-srcconf.mk .include $ tail -n 1 /etc/src.conf .error "Hallo old chap!" $ make __MAKE_CONF=3D/dev/null -f test-srcconf.mk "/etc/src.conf", line 64: "Hallo old chap!" They're completely different methods of supplying different bits of inf= o :). Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Nov 10 06:24:17 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 06:29:15 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15E311065673; Wed, 10 Nov 2010 06:29:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AA2ED8FC14; Wed, 10 Nov 2010 06:29:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oAA6QXWV031823; Tue, 9 Nov 2010 23:26:33 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4CDA3B19.8000108@bsdimp.com> Date: Tue, 09 Nov 2010 23:26:33 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100918 Thunderbird/3.1.4 MIME-Version: 1.0 To: Garrett Cooper References: <201011100056.oAA0uimN067694@svn.freebsd.org> <4CDA2275.1030403@bsdimp.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-committers@FreeBSD.org, Warner Losh Subject: Re: svn commit: r215070 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 06:29:15 -0000 On 11/09/2010 23:10, Garrett Cooper wrote: > On Tue, Nov 9, 2010 at 8:41 PM, Warner Losh wrote: >> On 11/09/2010 18:25, Garrett Cooper wrote: >>> On Tue, Nov 9, 2010 at 4:56 PM, Warner Losh wrote: >>>> 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)" >>> Funny that it overwrites __MAKE_CONF, but not SRCCONF (seems like >>> the latter would infect a system more than the former *shrugs*); I >>> think I understand why it's not set in this script though, because >>> IIRC src.conf predates nanobsd. >>> I set my core variables and features in src.conf so I think it'd >>> probably be better to block that out too. >>> Should I provide a patch for this item? >> __MAKE_CONF is the root of all evil. SRCCONF shouldn't affect anything if >> __MAKE_CONF is overriden. If it does, then point me at the code in src that >> pulls it in? > $ cat test-srcconf.mk > .include > $ tail -n 1 /etc/src.conf > .error "Hallo old chap!" > $ make __MAKE_CONF=/dev/null -f test-srcconf.mk > "/etc/src.conf", line 64: "Hallo old chap!" > > They're completely different methods of supplying different bits of info :). At least the patch looks trivial.. Warner > Thanks! > -Garrett > > > From owner-svn-src-head@FreeBSD.ORG Wed Nov 10 06:39:50 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 07:14:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5DAB106564A; Wed, 10 Nov 2010 07:14:07 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 0B0918FC18; Wed, 10 Nov 2010 07:14:06 +0000 (UTC) Received: by wwb22 with SMTP id 22so360514wwb.31 for ; Tue, 09 Nov 2010 23:14:06 -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=Vjq1iw2K5a1ao4MhrapR9wS6F8WvSzU3zHOpogFEjws=; b=uU7uK6bsg560f8eTvgxC18uWO6nJzzO4ylZtGgr7pYDxMEEhtPwFnscMYuBOOGwSDD bNSgx3Gi0NOwHKKCwsgiGnTpD2KkYYdyUlJF0d3BcVSrjEEYHSIJZGBl+9P+vHouFI5H TC1+kw85CzJ2NAcWKcv4qcdJtqPY11dZ0vhjI= 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=HK6YgWZdYy7wTt28rlTvXJxppqAFcy+k/8UIguLEybkVTBKHoWkQ8OAMDJoFEyQqnH fkyg4whp6n+8QcXvvPgMeXAgcSk4K7LNMzWm9CMhIbhMk0i6Sswc6V5mksPvZ78Y3KdF Ty9yXHEXi5SFse+Y4exM8svGo3YhQTP7sErHY= MIME-Version: 1.0 Received: by 10.216.82.197 with SMTP id o47mr7953864wee.45.1289373245610; Tue, 09 Nov 2010 23:14:05 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Tue, 9 Nov 2010 23:14:05 -0800 (PST) In-Reply-To: <4CDA3B19.8000108@bsdimp.com> References: <201011100056.oAA0uimN067694@svn.freebsd.org> <4CDA2275.1030403@bsdimp.com> <4CDA3B19.8000108@bsdimp.com> Date: Tue, 9 Nov 2010 23:14:05 -0800 X-Google-Sender-Auth: lelgSZNE7xYJad4iat4YWHORt7E Message-ID: From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r215070 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 07:14:07 -0000 On Tue, Nov 9, 2010 at 10:26 PM, Warner Losh wrote: > =A0On 11/09/2010 23:10, Garrett Cooper wrote: >> >> On Tue, Nov 9, 2010 at 8:41 PM, Warner Losh =A0wrote: >>> >>> =A0On 11/09/2010 18:25, Garrett Cooper wrote: >>>> >>>> On Tue, Nov 9, 2010 at 4:56 PM, Warner Losh =A0 =A0wr= ote: >>>>> >>>>> Author: imp >>>>> Date: Wed Nov 10 00:56:44 2010 >>>>> New Revision: 215070 >>>>> URL: http://svn.freebsd.org/changeset/base/215070 >>>>> >>>>> Log: >>>>> =A0Build make.conf when the world is not selected to build, but the >>>>> =A0kernel is. >>>>> >>>>> =A0PR: =A0 =A0 =A0 =A0 =A0 151696 >>>>> =A0Submitted by: lev@ >>>>> >>>>> Modified: >>>>> =A0head/tools/tools/nanobsd/nanobsd.sh >>>>> >>>>> Modified: head/tools/tools/nanobsd/nanobsd.sh >>>>> >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:39:42 2010 >>>>> =A0(r215069) >>>>> +++ head/tools/tools/nanobsd/nanobsd.sh Wed Nov 10 00:56:44 2010 >>>>> =A0(r215070) >>>>> @@ -917,6 +917,9 @@ else >>>>> =A0fi >>>>> >>>>> =A0if $do_kernel ; then >>>>> + =A0 =A0 =A0 if ! $do_world ; then >>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 make_conf_build >>>>> + =A0 =A0 =A0 fi >>>>> =A0 =A0 =A0 =A0build_kernel >>>>> =A0else >>>>> =A0 =A0 =A0 =A0pprint 2 "Skipping buildkernel (as instructed)" >>>> >>>> =A0 =A0 Funny that it overwrites __MAKE_CONF, but not SRCCONF (seems l= ike >>>> the latter would infect a system more than the former *shrugs*); I >>>> think I understand why it's not set in this script though, because >>>> IIRC src.conf predates nanobsd. >>>> =A0 =A0 I set my core variables and features in src.conf so I think it= 'd >>>> probably be better to block that out too. >>>> =A0 =A0 Should I provide a patch for this item? >>> >>> __MAKE_CONF is the root of all evil. =A0SRCCONF shouldn't affect anythi= ng >>> if >>> __MAKE_CONF is overriden. =A0If it does, then point me at the code in s= rc >>> that >>> pulls it in? >> >> $ cat test-srcconf.mk >> .include >> $ tail -n 1 /etc/src.conf >> .error "Hallo old chap!" >> $ make __MAKE_CONF=3D/dev/null -f test-srcconf.mk >> "/etc/src.conf", line 64: "Hallo old chap!" >> >> =A0 =A0 They're completely different methods of supplying different bits= of >> info :). > > At least the patch looks trivial.. I realize that nanobsd aims to block that stuff off, but since it's executed as a script, does it make more sense to supply values via the CLI or something, but default to __MAKECONF=3D/dev/null and setting _WITHOUT_SRCCONF? The commit you made looks good though for taking care of src.conf thoug= h. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Nov 10 08:21:26 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 10:23:40 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 14:33:10 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 14:38:52 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 16:42:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 17:57:34 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 18:37:03 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 18:40:45 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 18:41:39 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 18:45:33 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 18:50:13 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 19:33:30 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 20:09:05 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 20:28:10 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 21:06:49 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 21:33:39 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 10 23:45:44 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Thu Nov 11 00:29:19 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 02:40:01 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 05:40:39 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 08:15:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 08:56:50 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 11:26:59 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 11:35:42 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 11:38:58 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 11:41:52 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 11:46:19 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 11:54:01 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 12:13:41 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 13:35:24 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 13:42:47 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 13:46:28 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 13:48:48 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 15:02:15 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 15:13:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 15:24:57 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 15:48:27 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 16:06:48 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 16:53:25 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 17:30:50 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 18:08:50 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 18:35:29 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 18:41:04 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 18:43:31 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 18:52:37 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:13:16 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:18:00 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:18:52 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:20:33 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:29:06 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:36:21 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:37:26 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:44:24 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 19:49:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Thu Nov 11 20:18:33 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 20:25:25 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 21:19:05 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Thu Nov 11 21:34:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 21:36:52 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 21:49:06 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Thu Nov 11 21:53:47 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 22:35:43 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 22:52:42 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 22:53:55 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 23:00:38 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 23:41:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 11 23:45:19 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Fri Nov 12 00:01:34 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Fri Nov 12 00:19:42 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 00:44:18 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 01:40:30 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 03:43:23 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 04:13:49 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 04:18:20 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 04:22:00 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 05:12:39 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 06:41:56 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 06:58:05 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 06:59:13 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 09:17:25 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 12:07:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 12:48:42 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 13:02:27 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 13:05:17 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 14:40:20 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 15:20:11 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 15:28:46 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 15:30:50 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 15:40:00 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 15:42:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 15:52:28 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 16:50:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 16:53:17 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 17:10:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 19:33:14 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 19:43:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 20:26:35 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 20:45:22 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 20:46:34 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 20:55:15 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 21:11:50 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 22:03:02 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 22:28:47 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 22:40:19 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 22:43:40 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 12 22:59:51 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Sat Nov 13 00:40:44 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 00:54:00 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 01:21:55 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 03:11:28 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 08:58:36 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 09:28:49 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 09:37:22 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 09:40:51 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 10:38:06 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 10:45:00 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 10:54:10 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 11:11:52 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 11:15:07 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 11:43:20 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 11:54:05 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 12:23:03 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 12:29:03 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 12:40:20 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 12:52:44 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 12:56:48 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 14:59:54 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 15:23:20 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 15:24:57 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 15:28:45 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 15:52:04 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 16:46:46 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 16:49:07 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 17:52:05 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 18:10:45 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 18:38:35 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 18:39:25 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 19:25:11 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 19:26:46 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 19:50:06 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 20:28:07 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 20:30:24 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 20:41:47 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 20:45:17 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 21:03:20 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 21:09:18 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 21:48:32 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 22:10:27 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 22:20:47 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 22:22:18 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 22:32:16 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 22:34:12 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 22:38:33 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 22:40:32 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 22:40:37 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 13 23:00:14 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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