From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 00:04:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FCAD106564A; Sun, 3 Oct 2010 00:04:01 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 671EA8FC0A; Sun, 3 Oct 2010 00:04:00 +0000 (UTC) Received: by qyk33 with SMTP id 33so2512220qyk.13 for ; Sat, 02 Oct 2010 17:03:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=E2etKHooZkZABrlhr1+LHSKcTiFZ33yLx5vwHw2ZdmQ=; b=jDNiflIDaswoB/NS8VyKGV1/Zhxr4XySTADclIbdGv57QR/U68o0JGeFSbjPMQr2db RU6X3cBX/UNxPKf9Ge0v9XHt6DWKg/gBXcsLTM5F71tf6w2WW9DSLh8uct1FxDHadZKz hQRqsZQ/0cG82YwY01ZzOrwv1gRUV9HxoSgnc= 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=vqqYBI79Lp0v+fpFiuID32QvmmMmcwg5A0CttrWGf6VHc0lx3f9vWyZxuYd4eJre5T 3AeDWINYSkcgeW6JGawrhML2BBCvx5hx3j394yFrmVcJUBdjsKYX/Ocb/6Wo2IDWJulY VcgA8PIPc2Im2gtDYJjZDtlzrDV1m+g7sXdVM= MIME-Version: 1.0 Received: by 10.224.20.7 with SMTP id d7mr5414737qab.61.1286064239133; Sat, 02 Oct 2010 17:03:59 -0700 (PDT) Received: by 10.229.50.8 with HTTP; Sat, 2 Oct 2010 17:03:59 -0700 (PDT) In-Reply-To: <20101002.153645.1021672927781301295.imp@bsdimp.com> References: <201009281533.o8SFXULh078409@svn.freebsd.org> <20101002.153645.1021672927781301295.imp@bsdimp.com> Date: Sun, 3 Oct 2010 04:03:59 +0400 Message-ID: From: Sergey Kandaurov To: "M. Warner Losh" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, antoine@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r213248 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 00:04:01 -0000 On 3 October 2010 01:36, M. Warner Losh wrote: > In message: > =A0 =A0 =A0 =A0 =A0 =A0Sergey Kandaurov writes: > : On 2 October 2010 22:12, Antoine Brodin wrote: > : > On Tue, Sep 28, 2010 at 5:33 PM, Warner Losh wrote: > : >> Author: imp > : >> Date: Tue Sep 28 15:33:30 2010 > : >> New Revision: 213248 > : >> URL: http://svn.freebsd.org/changeset/base/213248 > : >> > : >> Log: > : >> =A0This file has been unused for ages. =A0Retire it. > : >> > : >> =A0Submitted by: pluknet > : >> > : >> Deleted: > : >> =A0head/sys/kern/Makefile > : > > : > Hi, > : > > : > What is the correct way to "make sysent" now ? > : > > : > : Hi. > : > : It seems I just dumbbroke the useful functionality. I'm sorry. > : Obviously that was somehow overlooked last time I checked it. > : So, removing sysent target is not something intentional. > : > : I think it should be simply reverted for now, or more preferably > : restored with sysent target only. > > Please review the commit I just made to make sure that I didn't botch > anything. =A0I'm pretty sure I got it right, but you never know. > > Warner > Seems correct. Thank you. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 04:33:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3D8C1065672; Sun, 3 Oct 2010 04:33:58 +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 D1AEB8FC13; Sun, 3 Oct 2010 04:33: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 o934XwEX063736; Sun, 3 Oct 2010 04:33:58 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o934Xwpx063728; Sun, 3 Oct 2010 04:33:58 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201010030433.o934Xwpx063728@svn.freebsd.org> From: "Jayachandran C." Date: Sun, 3 Oct 2010 04:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213377 - in head/sys/mips/rmi: . dev/nlge dev/xlr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 04:33:59 -0000 Author: jchandra Date: Sun Oct 3 04:33:58 2010 New Revision: 213377 URL: http://svn.freebsd.org/changeset/base/213377 Log: Update message ring handling code for XLR/XLS - Wakeup multiple threads per core using message ring watermark interrupts. - Update message ring handler registration, use the real device station id for registering interrupts. - rge/nlge: update for the new message ring registration code. - rge/nlge: use 2 message ring stations for incoming packets, this will allow more messages to be queued. - nlge: comment fixes, remove unused variable - style and whitespace fixes Modified: head/sys/mips/rmi/board.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/xlr/rge.c head/sys/mips/rmi/fmn.c head/sys/mips/rmi/msgring.h head/sys/mips/rmi/rmi_mips_exts.h head/sys/mips/rmi/xlr_machdep.c Modified: head/sys/mips/rmi/board.c ============================================================================== --- head/sys/mips/rmi/board.c Sat Oct 2 22:21:01 2010 (r213376) +++ head/sys/mips/rmi/board.c Sun Oct 3 04:33:58 2010 (r213377) @@ -42,42 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -static int xlr_rxstn_to_txstn_map[128] = { - [0 ... 7] = TX_STN_CPU_0, - [8 ... 15] = TX_STN_CPU_1, - [16 ... 23] = TX_STN_CPU_2, - [24 ... 31] = TX_STN_CPU_3, - [32 ... 39] = TX_STN_CPU_4, - [40 ... 47] = TX_STN_CPU_5, - [48 ... 55] = TX_STN_CPU_6, - [56 ... 63] = TX_STN_CPU_7, - [64 ... 95] = TX_STN_INVALID, - [96 ... 103] = TX_STN_GMAC, - [104 ... 107] = TX_STN_DMA, - [108 ... 111] = TX_STN_INVALID, - [112 ... 113] = TX_STN_XGS_0, - [114 ... 115] = TX_STN_XGS_1, - [116 ... 119] = TX_STN_INVALID, - [120 ... 127] = TX_STN_SAE -}; - -static int xls_rxstn_to_txstn_map[128] = { - [0 ... 7] = TX_STN_CPU_0, - [8 ... 15] = TX_STN_CPU_1, - [16 ... 23] = TX_STN_CPU_2, - [24 ... 31] = TX_STN_CPU_3, - [32 ... 63] = TX_STN_INVALID, - [64 ... 71] = TX_STN_PCIE, - [72 ... 79] = TX_STN_INVALID, - [80 ... 87] = TX_STN_GMAC1, - [88 ... 95] = TX_STN_INVALID, - [96 ... 103] = TX_STN_GMAC0, - [104 ... 107] = TX_STN_DMA, - [108 ... 111] = TX_STN_CDE, - [112 ... 119] = TX_STN_INVALID, - [120 ... 127] = TX_STN_SAE -}; - struct stn_cc *xlr_core_cc_configs[] = { &cc_table_cpu_0, &cc_table_cpu_1, &cc_table_cpu_2, &cc_table_cpu_3, &cc_table_cpu_4, &cc_table_cpu_5, &cc_table_cpu_6, &cc_table_cpu_7}; @@ -351,7 +315,6 @@ xlr_board_info_setup() xlr_board_info.pci_irq = 0; xlr_board_info.credit_configs = xls_core_cc_configs; xlr_board_info.bucket_sizes = &xls_bucket_sizes; - xlr_board_info.msgmap = xls_rxstn_to_txstn_map; xlr_board_info.gmacports = MAX_NA_PORTS; /* ---------------- Network Acc 0 ---------------- */ @@ -359,7 +322,7 @@ xlr_board_info_setup() blk0->type = XLR_GMAC; blk0->enabled = 0xf; blk0->credit_config = &xls_cc_table_gmac0; - blk0->station_id = TX_STN_GMAC0; + blk0->station_id = MSGRNG_STNID_GMAC; blk0->station_txbase = MSGRNG_STNID_GMACTX0; blk0->station_rfr = MSGRNG_STNID_GMACRFR_0; blk0->mode = XLR_SGMII; @@ -388,7 +351,7 @@ xlr_board_info_setup() blk1->type = XLR_GMAC; blk1->enabled = 0xf; blk1->credit_config = &xls_cc_table_gmac1; - blk1->station_id = TX_STN_GMAC1; + blk1->station_id = MSGRNG_STNID_GMAC1; blk1->station_txbase = MSGRNG_STNID_GMAC1_TX0; blk1->station_rfr = MSGRNG_STNID_GMAC1_FR_0; blk1->mode = XLR_SGMII; @@ -424,14 +387,13 @@ xlr_board_info_setup() xlr_board_info.pci_irq = 0; xlr_board_info.credit_configs = xlr_core_cc_configs; xlr_board_info.bucket_sizes = &bucket_sizes; - xlr_board_info.msgmap = xlr_rxstn_to_txstn_map; xlr_board_info.gmacports = 4; /* ---------------- GMAC0 ---------------- */ blk0->type = XLR_GMAC; blk0->enabled = 0xf; blk0->credit_config = &cc_table_gmac; - blk0->station_id = TX_STN_GMAC; + blk0->station_id = MSGRNG_STNID_GMAC; blk0->station_txbase = MSGRNG_STNID_GMACTX0; blk0->station_rfr = MSGRNG_STNID_GMACRFR_0; blk0->mode = XLR_RGMII; @@ -461,7 +423,7 @@ xlr_board_info_setup() blk1->credit_config = &cc_table_xgs_0; blk1->station_txbase = MSGRNG_STNID_XGS0_TX; blk1->station_rfr = MSGRNG_STNID_XMAC0RFR; - blk1->station_id = TX_STN_XGS_0; /* TBD: is this correct ? */ + blk1->station_id = MSGRNG_STNID_XGS0FR; blk1->baseaddr = XLR_IO_XGMAC_0_OFFSET; blk1->baseirq = PIC_XGS_0_IRQ; blk1->baseinst = 4; @@ -481,7 +443,7 @@ xlr_board_info_setup() blk2->credit_config = &cc_table_xgs_1; blk2->station_txbase = MSGRNG_STNID_XGS1_TX; blk2->station_rfr = MSGRNG_STNID_XMAC1RFR; - blk2->station_id = TX_STN_XGS_1; /* TBD: is this correct ? */ + blk2->station_id = MSGRNG_STNID_XGS1FR; blk2->baseaddr = XLR_IO_XGMAC_1_OFFSET; blk2->baseirq = PIC_XGS_1_IRQ; blk2->baseinst = 5; Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Sat Oct 2 22:21:01 2010 (r213376) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Sun Oct 3 04:33:58 2010 (r213377) @@ -902,11 +902,12 @@ nlna_hw_init(struct nlna_softc *sc) { /* - * It is seen that this is a critical function in bringing up FreeBSD. - * When it is not invoked, FreeBSD panics and fails during the - * multi-processor init (SI_SUB_SMP of * mi_startup). The key function - * in this sequence seems to be platform_prep_smp_launch. */ - if (register_msgring_handler(sc->station_id, nlge_msgring_handler, sc)) { + * Register message ring handler for the NA block, messages from + * the GMAC will have sourec station id to the first bucket of the + * NA FMN station, so register just that station id. + */ + if (register_msgring_handler(sc->station_id, sc->station_id + 1, + nlge_msgring_handler, sc)) { panic("Couldn't register msgring handler\n"); } nlna_config_fifo_spill_area(sc); @@ -1143,13 +1144,13 @@ nlna_config_pde(struct nlna_softc *sc) if (smp_started) cpumask = xlr_hw_thread_mask; #endif - bucket_map = 0; for (i = 0; i < 32; i++) { if (cpumask & (1 << i)) { cpu = i; - bucket = ((cpu >> 2) << 3); - bucket_map |= (1ULL << bucket); + /* use bucket 0 and 1 on every core for NA msgs */ + bucket = cpu/4 * 8; + bucket_map |= (3ULL << bucket); } } NLGE_WRITE(sc->base, R_PDE_CLASS_0, (bucket_map & 0xffffffff)); @@ -1165,6 +1166,11 @@ nlna_config_pde(struct nlna_softc *sc) NLGE_WRITE(sc->base, R_PDE_CLASS_3 + 1, ((bucket_map >> 32) & 0xffffffff)); } +/* + * Update the network accelerator packet distribution engine for SMP. + * On bootup, we have just the boot hw thread handling all packets, on SMP + * start, we can start distributing packets across all the cores which are up. + */ static void nlna_smp_update_pde(void *dummy __unused) { @@ -1235,11 +1241,9 @@ nlna_config_common(struct nlna_softc *sc { struct xlr_gmac_block_t *block_info; struct stn_cc *gmac_cc_config; - int i, id; + int i; block_info = device_get_ivars(sc->nlna_dev); - - id = device_get_unit(sc->nlna_dev); gmac_cc_config = block_info->credit_config; for (i = 0; i < MAX_NUM_MSGRNG_STN_CC; i++) { NLGE_WRITE(sc->base, R_CC_CPU0_0 + i, Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Sat Oct 2 22:21:01 2010 (r213376) +++ head/sys/mips/rmi/dev/xlr/rge.c Sun Oct 3 04:33:58 2010 (r213377) @@ -971,7 +971,7 @@ rmi_xlr_config_pde(struct driver_data *p if (cpumask & (1 << i)) { cpu = i; bucket = ((cpu >> 2) << 3); - bucket_map |= (1ULL << bucket); + bucket_map |= (3ULL << bucket); } } printf("rmi_xlr_config_pde: bucket_map=%jx\n", (uintmax_t)bucket_map); @@ -2539,17 +2539,20 @@ mac_common_init(void) init_tx_ring(); if (xlr_board_info.is_xls) { - if (register_msgring_handler(TX_STN_GMAC0, - rmi_xlr_mac_msgring_handler, NULL)) { + if (register_msgring_handler(MSGRNG_STNID_GMAC, + MSGRNG_STNID_GMAC + 1, rmi_xlr_mac_msgring_handler, + NULL)) { panic("Couldn't register msgring handler\n"); } - if (register_msgring_handler(TX_STN_GMAC1, - rmi_xlr_mac_msgring_handler, NULL)) { + if (register_msgring_handler(MSGRNG_STNID_GMAC1, + MSGRNG_STNID_GMAC1 + 1, rmi_xlr_mac_msgring_handler, + NULL)) { panic("Couldn't register msgring handler\n"); } } else { - if (register_msgring_handler(TX_STN_GMAC, - rmi_xlr_mac_msgring_handler, NULL)) { + if (register_msgring_handler(MSGRNG_STNID_GMAC, + MSGRNG_STNID_GMAC + 1, rmi_xlr_mac_msgring_handler, + NULL)) { panic("Couldn't register msgring handler\n"); } } Modified: head/sys/mips/rmi/fmn.c ============================================================================== --- head/sys/mips/rmi/fmn.c Sat Oct 2 22:21:01 2010 (r213376) +++ head/sys/mips/rmi/fmn.c Sun Oct 3 04:33:58 2010 (r213377) @@ -60,25 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* definitions */ -struct tx_stn_handler { - void (*action) (int, int, int, int, struct msgrng_msg *, void *); - void *dev_id; -}; - -struct msgring_ithread { - struct thread *i_thread; - u_int i_pending; - u_int i_flags; - int i_cpu; - int i_core; -}; - -struct msgring_ithread *msgring_ithreads[MAXCPU]; - -/* globals */ -static struct tx_stn_handler tx_stn_handlers[MAX_TX_STNS]; - #define MSGRNG_CC_INIT_CPU_DEST(dest, counter) \ do { \ msgrng_write_cc(MSGRNG_CC_##dest##_REG, counter[dest][0], 0 ); \ @@ -92,40 +73,68 @@ do { \ } while(0) -/* make this a read/write spinlock */ -static struct mtx msgrng_lock; -static int msgring_int_enabled; -static int msgring_pop_num_buckets; -static uint8_t msgring_pop_bucket_mask; -static int msgring_int_type; -static int msgring_watermark_count; -static uint32_t msgring_thread_mask; -uint32_t msgrng_msg_cycles = 0; +/* + * Keep track of our message ring handler threads, each core has a + * different message station. Ideally we will need to start a few + * message handling threads every core, and wake them up depending on + * load + */ +struct msgring_thread { + struct { + struct thread *thread; /* msgring handler threads */ + int needed; /* thread needs to wake up */ + } threads[XLR_NTHREADS]; + int running; /* number of threads running */ + int nthreads; /* number of threads started */ + struct mtx lock; /* for changing running/active */ +}; +static struct msgring_thread msgring_threads[XLR_MAX_CORES]; +static struct proc *msgring_proc; /* all threads are under a proc */ + +/* + * The maximum number of software message handler threads to be started + * per core. Default is 2 per core + */ +static int msgring_maxthreads = 2; +TUNABLE_INT("hw.fmn.maxthreads", &msgring_maxthreads); + +/* + * The device drivers can register a handler for the the messages sent + * from a station (corresponding to the device). + */ +struct tx_stn_handler { + msgring_handler action; + void *arg; +}; +static struct tx_stn_handler msgmap[MSGRNG_NSTATIONS]; +static struct mtx msgmap_lock; +/* + * Initialize the messaging subsystem. + * + * Message Stations are shared among all threads in a cpu core, this + * has to be called once from every core which is online. + */ void xlr_msgring_cpu_init(void) { struct stn_cc *cc_config; struct bucket_size *bucket_sizes; - int id; uint32_t flags; + int id; KASSERT(xlr_thr_id() == 0, - ("xlr_msgring_cpu_init from non-zero thread\n")); - + ("xlr_msgring_cpu_init from non-zero thread")); id = xlr_core_id(); - bucket_sizes = xlr_board_info.bucket_sizes; cc_config = xlr_board_info.credit_configs[id]; + flags = msgrng_access_enable(); /* - * Message Stations are shared among all threads in a cpu core - * Assume, thread 0 on all cores are always active when more than 1 - * thread is active in a core + * FMN messages are received in 8 buckets per core, set up + * the bucket sizes for each bucket */ - flags = msgrng_access_enable(); - msgrng_write_bucksize(0, bucket_sizes->bucket[id * 8 + 0]); msgrng_write_bucksize(1, bucket_sizes->bucket[id * 8 + 1]); msgrng_write_bucksize(2, bucket_sizes->bucket[id * 8 + 2]); @@ -135,36 +144,43 @@ xlr_msgring_cpu_init(void) msgrng_write_bucksize(6, bucket_sizes->bucket[id * 8 + 6]); msgrng_write_bucksize(7, bucket_sizes->bucket[id * 8 + 7]); - MSGRNG_CC_INIT_CPU_DEST(0, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(1, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(2, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(3, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(4, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(5, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(6, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(7, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(8, cc_config->counters); - MSGRNG_CC_INIT_CPU_DEST(9, cc_config->counters); + /* + * For sending FMN messages, we need credits on the destination + * bucket. Program the credits this core has on the 128 possible + * destination buckets. + * We cannot use a loop, because the the first argument has to + * be a constant integer value. + */ + MSGRNG_CC_INIT_CPU_DEST(0, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(1, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(2, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(3, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(4, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(5, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(6, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(7, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(8, cc_config->counters); + MSGRNG_CC_INIT_CPU_DEST(9, cc_config->counters); MSGRNG_CC_INIT_CPU_DEST(10, cc_config->counters); MSGRNG_CC_INIT_CPU_DEST(11, cc_config->counters); MSGRNG_CC_INIT_CPU_DEST(12, cc_config->counters); MSGRNG_CC_INIT_CPU_DEST(13, cc_config->counters); MSGRNG_CC_INIT_CPU_DEST(14, cc_config->counters); MSGRNG_CC_INIT_CPU_DEST(15, cc_config->counters); - msgrng_restore(flags); } +/* + * Boot time init, called only once + */ void xlr_msgring_config(void) { - mtx_init(&msgrng_lock, "msgring", NULL, MTX_SPIN | MTX_RECURSE); - msgring_int_type = 0x02; - msgring_pop_num_buckets = 8; - msgring_pop_bucket_mask = 0xff; - msgring_int_enabled = 0; - msgring_watermark_count = 1; - msgring_thread_mask = 0x01; + mtx_init(&msgmap_lock, "msgring", NULL, MTX_SPIN); + + /* check value */ + if (msgring_maxthreads < 0 || msgring_maxthreads > XLR_NTHREADS) + msgring_maxthreads = XLR_NTHREADS; } /* @@ -175,44 +191,42 @@ uint32_t xlr_msgring_handler(uint8_t bucket_mask, uint32_t max_messages) { int bucket = 0; - int size = 0, code = 0, rx_stid = 0, tx_stid = 0; + int size = 0, code = 0, rx_stid = 0; struct msgrng_msg msg; - uint8_t bucket_empty_bm = 0; + struct tx_stn_handler *he; unsigned int status = 0; unsigned long mflags; - uint32_t n_msgs; + uint32_t n_msgs; + uint32_t msgbuckets; n_msgs = 0; mflags = msgrng_access_enable(); - /* First Drain all the high priority messages */ for (;;) { - bucket_empty_bm = (msgrng_read_status() >> 24) & bucket_mask; + msgbuckets = (~msgrng_read_status() >> 24) & bucket_mask; /* all buckets empty, break */ - if (bucket_empty_bm == bucket_mask) + if (msgbuckets == 0) break; - for (bucket = 0; bucket < msgring_pop_num_buckets; bucket++) { - if (!((1 << bucket) & bucket_mask) /* bucket not in mask */ - || (bucket_empty_bm & (1 << bucket))) /* empty */ + for (bucket = 0; bucket < 8; bucket++) { + if ((msgbuckets & (1 << bucket)) == 0) /* empty */ continue; - status = message_receive(bucket, &size, &code, &rx_stid, &msg); - if (status) + status = message_receive(bucket, &size, &code, + &rx_stid, &msg); + if (status != 0) continue; - - tx_stid = xlr_board_info.msgmap[rx_stid]; n_msgs++; - - if (!tx_stn_handlers[tx_stid].action) { - printf("[%s]: No Handler for message from stn_id=%d, bucket=%d, " - "size=%d, msg0=%jx, dropping message\n", - __FUNCTION__, tx_stid, bucket, size, (uintmax_t)msg.msg0); + he = &msgmap[rx_stid]; + if (he->action == NULL) { + printf("[%s]: No Handler for message from " + "stn_id=%d, bucket=%d, size=%d, msg0=%jx\n", + __func__, rx_stid, bucket, size, + (uintmax_t)msg.msg0); } else { - //printf("[%s]: rx_stid = %d\n", __FUNCTION__, rx_stid); msgrng_restore(mflags); - (*tx_stn_handlers[tx_stid].action) (bucket, size, code, rx_stid, - &msg, tx_stn_handlers[tx_stid].dev_id); + (*he->action)(bucket, size, code, rx_stid, + &msg, he->arg); mflags = msgrng_access_enable(); } if (max_messages > 0 && n_msgs >= max_messages) @@ -222,132 +236,166 @@ xlr_msgring_handler(uint8_t bucket_mask, done: msgrng_restore(mflags); - return (n_msgs); } -static void -enable_msgring_int(void) +/* + * XLR COP2 supports watermark interrupts based on the number of + * messages pending in all the buckets in the core. We increase + * the watermark until all the possible handler threads in the core + * are woken up. + */ +static void +msgrng_setconfig(int running, int nthr) { uint32_t config, mflags; + int watermark = 1; /* non zero needed */ + int wm_intr_value; - config = (msgring_watermark_count << 24) | (IRQ_MSGRING << 16) | - (msgring_thread_mask << 8) | msgring_int_type; + KASSERT(nthr >= 0 && nthr <= msgring_maxthreads, + ("Bad value of nthr %d", nthr)); + KASSERT(running <= nthr, ("Bad value of running %d", running)); + + if (running == nthr) { + wm_intr_value = 0; + } else { + switch (running) { + case 0: break; /* keep default */ + case 1: + watermark = 16; break; + case 2: + watermark = 32; break; + case 3: + watermark = 48; break; + } + wm_intr_value = 0x2; /* set watermark enable interrupt */ + } mflags = msgrng_access_enable(); + config = (watermark << 24) | (IRQ_MSGRING << 16) | (1 << 8) | + wm_intr_value; + /* clear any pending interrupts */ + write_c0_eirr64(1ULL << IRQ_MSGRING); msgrng_write_config(config); msgrng_restore(mflags); } -static void -disable_msgring_int(void) +static int +msgring_process_fast_intr(void *arg) { - uint32_t config, mflags; + struct msgring_thread *mthd; + struct thread *td; + uint32_t mflags; + int core, nt; + + core = xlr_core_id(); + mthd = &msgring_threads[core]; + + mtx_lock_spin(&mthd->lock); + nt = mthd->running; + if(nt >= mthd->nthreads) { + mtx_unlock_spin(&mthd->lock); + return (FILTER_HANDLED); + } + td = mthd->threads[nt].thread; mflags = msgrng_access_enable(); - config = msgrng_read_config() & ~0x3; - msgrng_write_config(config); - msgrng_restore(mflags); -} -static int -msgring_process_fast_intr(void *arg) -{ - int core = xlr_core_id(); - volatile struct msgring_ithread *it; - struct thread *td; + /* default value with interrupts disabled */ + msgrng_write_config((1 << 24) | (IRQ_MSGRING << 16) | (1 << 8)); - /* wakeup an appropriate intr_thread for processing this interrupt */ - it = (volatile struct msgring_ithread *)msgring_ithreads[core]; - KASSERT(it != NULL, ("No interrupt thread on cpu %d", core)); - td = it->i_thread; + msgrng_restore(mflags); + mtx_unlock_spin(&mthd->lock); - /* - * Interrupt thread will enable the interrupts after processing all - * messages - */ - disable_msgring_int(); - atomic_store_rel_int(&it->i_pending, 1); + /* wake up the target thread */ + mthd->threads[nt].needed = 1; thread_lock(td); if (TD_AWAITING_INTR(td)) { TD_CLR_IWAIT(td); sched_add(td, SRQ_INTR); } thread_unlock(td); - return FILTER_HANDLED; + return (FILTER_HANDLED); } static void msgring_process(void *arg) { - volatile struct msgring_ithread *ithd; - struct thread *td; - struct proc *p; - - td = curthread; - p = td->td_proc; - ithd = (volatile struct msgring_ithread *)arg; - KASSERT(ithd->i_thread == td, - ("%s:msg_ithread and proc linkage out of sync", __func__)); + struct msgring_thread *mthd; + struct thread *td; + int hwtid, tid, core; + int nmsgs; + + hwtid = (intptr_t)arg; + core = hwtid / 4; + tid = hwtid % 4; + mthd = &msgring_threads[core]; + td = mthd->threads[tid].thread; + KASSERT(curthread == td, + ("Incorrect thread core %d, thread %d", core, hwtid)); /* First bind this thread to the right CPU */ thread_lock(td); - - sched_bind(td, ithd->i_cpu); + sched_bind(td, xlr_hwtid_to_cpuid[hwtid]); thread_unlock(td); - atomic_store_rel_ptr((volatile uintptr_t *)&msgring_ithreads[ithd->i_core], - (uintptr_t)arg); - enable_msgring_int(); - - while (1) { - while (ithd->i_pending) { - /* - * This might need a full read and write barrier to - * make sure that this write posts before any of the - * memory or device accesses in the handlers. - */ - xlr_msgring_handler(msgring_pop_bucket_mask, 0); - atomic_store_rel_int(&ithd->i_pending, 0); - enable_msgring_int(); - } - if (!ithd->i_pending) { - thread_lock(td); - if (ithd->i_pending) { - thread_unlock(td); - continue; - } - sched_class(td, PRI_ITHD); - TD_SET_IWAIT(td); - mi_switch(SW_VOL, NULL); + /* + * Mark ourselves as a running thread, and update the + * message watermark config for this thread + */ + mtx_lock_spin(&mthd->lock); + ++mthd->nthreads; + mtx_unlock_spin(&mthd->lock); + + /* start processing messages */ + for(;;) { + mtx_lock_spin(&mthd->lock); + ++mthd->running; + msgrng_setconfig(mthd->running, mthd->nthreads); + mtx_unlock_spin(&mthd->lock); + + atomic_store_rel_int(&mthd->threads[tid].needed, 0); + nmsgs = xlr_msgring_handler(0xff, 0); + + mtx_lock_spin(&mthd->lock); + --mthd->running; + msgrng_setconfig(mthd->running, mthd->nthreads); + mtx_unlock_spin(&mthd->lock); + + /* sleep */ + thread_lock(td); + if (mthd->threads[tid].needed) { thread_unlock(td); + continue; } + sched_class(td, PRI_ITHD); + TD_SET_IWAIT(td); + mi_switch(SW_VOL, NULL); + thread_unlock(td); } - } static void -create_msgring_thread(int core, int cpu) +create_msgring_thread(int hwtid) { - struct msgring_ithread *ithd; + struct msgring_thread *mthd; struct thread *td; - struct proc *p; - int error; + int tid, core; + int error; - /* Create kernel thread for message ring interrupt processing */ - /* Currently create one task for thread 0 of each core */ - ithd = malloc(sizeof(struct msgring_ithread), - M_DEVBUF, M_WAITOK | M_ZERO); - error = kproc_create(msgring_process, (void *)ithd, &p, - RFSTOPPED | RFHIGHPID, 2, "msg_intr%d", cpu); + core = hwtid / 4; + tid = hwtid % 4; + mthd = &msgring_threads[core]; + if (tid == 0) { + mtx_init(&mthd->lock, "msgrngcore", NULL, MTX_SPIN); + mthd->running = mthd->nthreads = 0; + } + error = kproc_kthread_add(msgring_process, (void *)hwtid, + &msgring_proc, &td, RFSTOPPED, 2, "msgrngproc", + "msgthr%d", hwtid); if (error) - panic("kproc_create() failed with %d", error); - td = FIRST_THREAD_IN_PROC(p); /* XXXKSE */ - - ithd->i_thread = td; - ithd->i_pending = 0; - ithd->i_cpu = cpu; - ithd->i_core = core; + panic("kproc_kthread_add() failed with %d", error); + mthd->threads[tid].thread = td; thread_lock(td); sched_class(td, PRI_ITHD); @@ -357,40 +405,49 @@ create_msgring_thread(int core, int cpu) } int -register_msgring_handler(int major, - void (*action) (int, int, int, int, struct msgrng_msg *, void *), - void *dev_id) +register_msgring_handler(int startb, int endb, msgring_handler action, + void *arg) { - void *cookie; /* FIXME - use? */ - - if (major >= MAX_TX_STNS) - return 1; - - mtx_lock_spin(&msgrng_lock); - tx_stn_handlers[major].action = action; - tx_stn_handlers[major].dev_id = dev_id; - mtx_unlock_spin(&msgrng_lock); + void *cookie; + int i; + static int msgring_int_enabled = 0; + + printf("register handler %d-%d %p %p\n", startb, endb, action, arg); + KASSERT(startb >= 0 && startb <= endb && endb < MSGRNG_NSTATIONS, + ("Invalid value for for bucket range %d,%d", startb, endb)); + + mtx_lock_spin(&msgmap_lock); + for (i = startb; i <= endb; i++) { + KASSERT(msgmap[i].action == NULL, + ("Bucket %d already used [action %p]", i, msgmap[i].action)); + msgmap[i].action = action; + msgmap[i].arg = arg; + } + mtx_unlock_spin(&msgmap_lock); if (xlr_test_and_set(&msgring_int_enabled)) { - create_msgring_thread(0, 0); - cpu_establish_hardintr("msgring", (driver_filter_t *) msgring_process_fast_intr, + create_msgring_thread(0); + if (msgring_maxthreads > xlr_threads_per_core) + msgring_maxthreads = xlr_threads_per_core; + cpu_establish_hardintr("msgring", msgring_process_fast_intr, NULL, NULL, IRQ_MSGRING, INTR_TYPE_NET | INTR_FAST, &cookie); } - return 0; + return (0); } static void start_msgring_threads(void *arg) { - int core, cpu; + int hwt, tid; - for (core = 1; core < XLR_MAX_CORES; core++) { - if ((xlr_hw_thread_mask >> (4 * core)) & 0xf) { - /* start one thread for an enabled core */ - cpu = xlr_hwtid_to_cpuid[4 * core]; - create_msgring_thread(core, cpu); - } + for (hwt = 1; hwt < XLR_MAX_CORES * XLR_NTHREADS; hwt++) { + if ((xlr_hw_thread_mask & (1 << hwt)) == 0) + continue; + tid = hwt % XLR_NTHREADS; + if (tid >= msgring_maxthreads) + continue; + create_msgring_thread(hwt); } } Modified: head/sys/mips/rmi/msgring.h ============================================================================== --- head/sys/mips/rmi/msgring.h Sat Oct 2 22:21:01 2010 (r213376) +++ head/sys/mips/rmi/msgring.h Sun Oct 3 04:33:58 2010 (r213377) @@ -171,14 +171,12 @@ #define MSGRNG_CODE_SEC 0 #define MSGRNG_CODE_BOOT_WAKEUP 200 #define MSGRNG_CODE_SPI4 3 -#define msgrng_read_status() read_c2_register32(MSGRNG_MSG_STATUS_REG, 0) +#define msgrng_read_status() read_c2_register32(MSGRNG_MSG_STATUS_REG, 0) #define msgrng_read_config() read_c2_register32(MSGRNG_MSG_CONFIG_REG, 0) #define msgrng_write_config(v) write_c2_register32(MSGRNG_MSG_CONFIG_REG, 0, v) - #define msgrng_read_bucksize(b) read_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b) #define msgrng_write_bucksize(b, v) write_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b, v) - #define msgrng_read_cc(r, s) read_c2_register32(r, s) #define msgrng_write_cc(r, v, s) write_c2_register32(r, s, v) @@ -321,14 +319,16 @@ message_receive(int bucket, int *size, i return (0); } -#define MSGRNG_STN_RX_QSIZE 256 +#define MSGRNG_STN_RX_QSIZE 256 +#define MSGRNG_NSTATIONS 128 +#define MSGRNG_CORE_NBUCKETS 8 struct stn_cc { unsigned short counters[16][8]; }; struct bucket_size { - unsigned short bucket[128]; + unsigned short bucket[MSGRNG_NSTATIONS]; }; extern struct bucket_size bucket_sizes; @@ -360,35 +360,9 @@ extern struct stn_cc xls_cc_table_pcie; extern struct stn_cc xls_cc_table_dma; extern struct stn_cc xls_cc_table_sec; -/* - * NOTE: this is not stationid/8, ie the station numbers below are just - * for internal use - */ -enum { - TX_STN_CPU_0, - TX_STN_CPU_1, - TX_STN_CPU_2, - TX_STN_CPU_3, - TX_STN_CPU_4, - TX_STN_CPU_5, - TX_STN_CPU_6, - TX_STN_CPU_7, - TX_STN_GMAC, - TX_STN_DMA, - TX_STN_XGS_0, - TX_STN_XGS_1, - TX_STN_SAE, - TX_STN_GMAC0, - TX_STN_GMAC1, - TX_STN_CDE, - TX_STN_PCIE, - TX_STN_INVALID, - MAX_TX_STNS -}; - -int register_msgring_handler(int major, - void (*action) (int, int, int, int, struct msgrng_msg *, void *), - void *dev_id); +typedef void (*msgring_handler)(int, int, int, int, struct msgrng_msg *, void *); +int register_msgring_handler(int startb, int endb, msgring_handler action, + void *arg); uint32_t xlr_msgring_handler(uint8_t bucket_mask, uint32_t max_messages); void xlr_msgring_cpu_init(void); void xlr_msgring_config(void); Modified: head/sys/mips/rmi/rmi_mips_exts.h ============================================================================== --- head/sys/mips/rmi/rmi_mips_exts.h Sat Oct 2 22:21:01 2010 (r213376) +++ head/sys/mips/rmi/rmi_mips_exts.h Sun Oct 3 04:33:58 2010 (r213377) @@ -309,7 +309,6 @@ xlr_thr_id(void) /* Additional registers on the XLR */ #define MIPS_COP_0_OSSCRATCH 22 #define XLR_CACHELINE_SIZE 32 -#define XLR_MAX_CORES 8 /* functions to write to and read from the extended * cp0 registers. @@ -559,7 +558,19 @@ xlr_restore_kx(uint32_t sr) } #endif /* defined(__mips_n64) || defined(__mips_n32) */ -/* for cpuid to hardware thread id mapping */ +/* + * XLR/XLS processors have maximum 8 cores, and maximum 4 threads + * per core + */ +#define XLR_MAX_CORES 8 +#define XLR_NTHREADS 4 + +/* + * FreeBSD can be started with few threads and cores turned off, + * so have a hardware thread id to FreeBSD cpuid mapping. + */ +extern int xlr_ncores; +extern int xlr_threads_per_core; extern uint32_t xlr_hw_thread_mask; extern int xlr_cpuid_to_hwtid[]; extern int xlr_hwtid_to_cpuid[]; Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Sat Oct 2 22:21:01 2010 (r213376) +++ head/sys/mips/rmi/xlr_machdep.c Sun Oct 3 04:33:58 2010 (r213377) @@ -596,7 +596,6 @@ platform_ipi_send(int cpuid) { pic_send_ipi(xlr_cpuid_to_hwtid[cpuid], platform_ipi_intrnum()); - } void From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 08:12:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F4BD1065693; Sun, 3 Oct 2010 08:12:17 +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 5C5218FC14; Sun, 3 Oct 2010 08:12: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 o938CHRX068345; Sun, 3 Oct 2010 08:12:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o938CH8S068342; Sun, 3 Oct 2010 08:12:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010030812.o938CH8S068342@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 3 Oct 2010 08:12: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: r213379 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 08:12:17 -0000 Author: hselasky Date: Sun Oct 3 08:12:17 2010 New Revision: 213379 URL: http://svn.freebsd.org/changeset/base/213379 Log: Commit initial version of new XHCI driver which was written from scratch. This driver adds support for USB3.0 devices. The XHCI interface is also backwards compatible to USB2.0 and USB1.0 and will evntually replace the OHCI/UHCI and EHCI drivers. There will be follow-up commits during the coming week to link the driver into the default kernel build and add missing USB3.0 functionality in the USB core. Currently only the driver files are committed. Approved by: thompsa (mentor) Added: head/sys/dev/usb/controller/xhci.c (contents, props changed) head/sys/dev/usb/controller/xhci.h (contents, props changed) head/sys/dev/usb/controller/xhci_pci.c (contents, props changed) head/sys/dev/usb/controller/xhcireg.h (contents, props changed) Modified: Directory Properties: head/sys/dev/usb/controller/ (props changed) Added: head/sys/dev/usb/controller/xhci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/xhci.c Sun Oct 3 08:12:17 2010 (r213379) @@ -0,0 +1,3862 @@ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * USB eXtensible Host Controller Interface, a.k.a. USB 3.0 controller. + * + * The XHCI 1.0 spec can be found at + * http://www.intel.com/technology/usb/download/xHCI_Specification_for_USB.pdf + * and the USB 3.0 spec at + * http://www.usb.org/developers/docs/usb_30_spec_060910.zip + */ + +/* + * A few words about the design implementation: This driver emulates + * the concept about TDs which is found in EHCI specification. This + * way we avoid too much diveration among USB drivers. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define USB_DEBUG_VAR xhcidebug + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define XHCI_BUS2SC(bus) \ + ((struct xhci_softc *)(((uint8_t *)(bus)) - \ + ((uint8_t *)&(((struct xhci_softc *)0)->sc_bus)))) + +#ifdef USB_DEBUG +static int xhcidebug = 0; + +SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, + &xhcidebug, 0, "Debug level"); + +TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); + +#endif + +#define XHCI_INTR_ENDPT 1 + +struct xhci_std_temp { + struct xhci_softc *sc; + struct usb_page_cache *pc; + struct xhci_td *td; + struct xhci_td *td_next; + uint32_t len; + uint32_t offset; + uint32_t max_packet_size; + uint32_t average; + uint16_t isoc_delta; + uint16_t isoc_frame; + uint8_t shortpkt; + uint8_t multishort; + uint8_t last_frame; + uint8_t trb_type; + uint8_t direction; + uint8_t tbc; + uint8_t tlbpc; + uint8_t step_td; +}; + +static void xhci_do_poll(struct usb_bus *); +static void xhci_device_done(struct usb_xfer *, usb_error_t); +static void xhci_root_intr(struct xhci_softc *); +static void xhci_free_device_ext(struct usb_device *); +static struct xhci_endpoint_ext *xhci_get_endpoint_ext(struct usb_device *, + struct usb_endpoint_descriptor *); +static usb_proc_callback_t xhci_configure_msg; +static usb_error_t xhci_configure_device(struct usb_device *); +static usb_error_t xhci_configure_endpoint(struct usb_device *, + struct usb_endpoint_descriptor *, uint64_t, uint16_t, + uint8_t, uint8_t, uint8_t, uint16_t, uint16_t); +static usb_error_t xhci_configure_mask(struct usb_device *, + uint32_t, uint8_t); +static usb_error_t xhci_cmd_evaluate_ctx(struct xhci_softc *, + uint64_t, uint8_t); +static void xhci_endpoint_doorbell(struct usb_xfer *); + +extern struct usb_bus_methods xhci_bus_methods; + +#ifdef USB_DEBUG +static void +xhci_dump_trb(struct xhci_trb *trb) +{ + DPRINTFN(5, "trb = %p\n", trb); + DPRINTFN(5, "qwTrb0 = 0x%016llx\n", (long long)le64toh(trb->qwTrb0)); + DPRINTFN(5, "dwTrb2 = 0x%08x\n", le32toh(trb->dwTrb2)); + DPRINTFN(5, "dwTrb3 = 0x%08x\n", le32toh(trb->dwTrb3)); +} + +static void +xhci_dump_endpoint(struct xhci_endp_ctx *pep) +{ + DPRINTFN(5, "pep = %p\n", pep); + DPRINTFN(5, "dwEpCtx0=0x%08x\n", pep->dwEpCtx0); + DPRINTFN(5, "dwEpCtx1=0x%08x\n", pep->dwEpCtx1); + DPRINTFN(5, "qwEpCtx2=0x%016llx\n", (long long)pep->qwEpCtx2); + DPRINTFN(5, "dwEpCtx4=0x%08x\n", pep->dwEpCtx4); + DPRINTFN(5, "dwEpCtx5=0x%08x\n", pep->dwEpCtx5); + DPRINTFN(5, "dwEpCtx6=0x%08x\n", pep->dwEpCtx6); + DPRINTFN(5, "dwEpCtx7=0x%08x\n", pep->dwEpCtx7); +} + +static void +xhci_dump_device(struct xhci_slot_ctx *psl) +{ + DPRINTFN(5, "psl = %p\n", psl); + DPRINTFN(5, "dwSctx0=0x%08x\n", psl->dwSctx0); + DPRINTFN(5, "dwSctx1=0x%08x\n", psl->dwSctx1); + DPRINTFN(5, "dwSctx2=0x%08x\n", psl->dwSctx2); + DPRINTFN(5, "dwSctx3=0x%08x\n", psl->dwSctx3); +} +#endif + +static void +xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) +{ + struct xhci_softc *sc = XHCI_BUS2SC(bus); + uint8_t i; + + cb(bus, &sc->sc_hw.root_pc, &sc->sc_hw.root_pg, + sizeof(struct xhci_hw_root), XHCI_PAGE_SIZE); + + cb(bus, &sc->sc_hw.ctx_pc, &sc->sc_hw.ctx_pg, + sizeof(struct xhci_dev_ctx_addr), XHCI_PAGE_SIZE); + + for (i = 0; i != XHCI_MAX_SCRATCHPADS; i++) { + cb(bus, &sc->sc_hw.scratch_pc[i], &sc->sc_hw.scratch_pg[i], + XHCI_PAGE_SIZE, XHCI_PAGE_SIZE); + } +} + +usb_error_t +xhci_start_controller(struct xhci_softc *sc) +{ + struct usb_page_search buf_res; + struct xhci_hw_root *phwr; + struct xhci_dev_ctx_addr *pdctxa; + uint64_t addr; + uint32_t temp; + uint16_t i; + + DPRINTF("\n"); + + sc->sc_capa_off = 0; + sc->sc_oper_off = XREAD1(sc, capa, XHCI_CAPLENGTH); + sc->sc_runt_off = XREAD4(sc, capa, XHCI_RTSOFF) & ~0x1F; + sc->sc_door_off = XREAD4(sc, capa, XHCI_DBOFF) & ~0x3; + + DPRINTF("CAPLENGTH=0x%x\n", sc->sc_oper_off); + DPRINTF("RUNTIMEOFFSET=0x%x\n", sc->sc_runt_off); + DPRINTF("DOOROFFSET=0x%x\n", sc->sc_door_off); + + sc->sc_event_ccs = 1; + sc->sc_event_idx = 0; + sc->sc_command_ccs = 1; + sc->sc_command_idx = 0; + + DPRINTF("xHCI version = 0x%04x\n", XREAD2(sc, capa, XHCI_HCIVERSION)); + + temp = XREAD4(sc, capa, XHCI_HCSPARAMS0); + + DPRINTF("HCS0 = 0x%08x\n", temp); + + if (XHCI_HCS0_CSZ(temp)) { + device_printf(sc->sc_bus.parent, "Driver does not " + "support 64-byte contexts."); + return (USB_ERR_IOERROR); + } + + /* Reset controller */ + XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); + + for (i = 0; i != 100; i++) { + usb_pause_mtx(NULL, hz / 1000); + temp = XREAD4(sc, oper, XHCI_USBCMD) & + (XHCI_CMD_HCRST | XHCI_STS_CNR); + if (!temp) + break; + } + + if (temp) { + device_printf(sc->sc_bus.parent, "Controller " + "reset timeout.\n"); + return (USB_ERR_IOERROR); + } + + if (!(XREAD4(sc, oper, XHCI_PAGESIZE) & XHCI_PAGESIZE_4K)) { + device_printf(sc->sc_bus.parent, "Controller does " + "not support 4K page size.\n"); + return (USB_ERR_IOERROR); + } + + temp = XREAD4(sc, capa, XHCI_HCSPARAMS1); + + i = XHCI_HCS1_N_PORTS(temp); + + if (i == 0) { + device_printf(sc->sc_bus.parent, "Invalid number " + "of ports: %u\n", i); + return (USB_ERR_IOERROR); + } + + sc->sc_noport = i; + sc->sc_noslot = XHCI_HCS1_DEVSLOT_MAX(temp); + + if (sc->sc_noslot > XHCI_MAX_DEVICES) + sc->sc_noslot = XHCI_MAX_DEVICES; + + /* setup number of device slots */ + + DPRINTF("CONFIG=0x%08x -> 0x%08x\n", + XREAD4(sc, oper, XHCI_CONFIG), sc->sc_noslot); + + XWRITE4(sc, oper, XHCI_CONFIG, sc->sc_noslot); + + DPRINTF("Max slots: %u\n", sc->sc_noslot); + + temp = XREAD4(sc, capa, XHCI_HCSPARAMS2); + + sc->sc_noscratch = XHCI_HCS2_SPB_MAX(temp); + + if (sc->sc_noscratch > XHCI_MAX_SCRATCHPADS) { + device_printf(sc->sc_bus.parent, "XHCI request " + "too many scratchpads\n"); + return (USB_ERR_NOMEM); + } + + DPRINTF("Max scratch: %u\n", sc->sc_noscratch); + + temp = XREAD4(sc, capa, XHCI_HCSPARAMS3); + + sc->sc_exit_lat_max = XHCI_HCS3_U1_DEL(temp) + + XHCI_HCS3_U2_DEL(temp) + 250 /* us */; + + temp = XREAD4(sc, oper, XHCI_USBSTS); + + /* clear interrupts */ + XWRITE4(sc, oper, XHCI_USBSTS, temp); + /* disable all device notifications */ + XWRITE4(sc, oper, XHCI_DNCTRL, 0); + + /* setup device context base address */ + usbd_get_page(&sc->sc_hw.ctx_pc, 0, &buf_res); + pdctxa = buf_res.buffer; + memset(pdctxa, 0, sizeof(*pdctxa)); + + addr = buf_res.physaddr; + addr += (uintptr_t)&((struct xhci_dev_ctx_addr *)0)->qwSpBufPtr[0]; + + /* slot 0 points to the table of scratchpad pointers */ + pdctxa->qwBaaDevCtxAddr[0] = htole64(addr); + + for (i = 0; i != sc->sc_noscratch; i++) { + struct usb_page_search buf_scp; + usbd_get_page(&sc->sc_hw.scratch_pc[i], 0, &buf_scp); + pdctxa->qwSpBufPtr[i] = htole64((uint64_t)buf_scp.physaddr); + } + + addr = buf_res.physaddr; + + XWRITE4(sc, oper, XHCI_DCBAAP_LO, (uint32_t)addr); + XWRITE4(sc, oper, XHCI_DCBAAP_HI, (uint32_t)(addr >> 32)); + XWRITE4(sc, oper, XHCI_DCBAAP_LO, (uint32_t)addr); + XWRITE4(sc, oper, XHCI_DCBAAP_HI, (uint32_t)(addr >> 32)); + + /* Setup event table size */ + + temp = XREAD4(sc, capa, XHCI_HCSPARAMS2); + + DPRINTF("HCS2=0x%08x\n", temp); + + temp = XHCI_HCS2_ERST_MAX(temp); + temp = 1U << temp; + if (temp > XHCI_MAX_RSEG) + temp = XHCI_MAX_RSEG; + + sc->sc_erst_max = temp; + + DPRINTF("ERSTSZ=0x%08x -> 0x%08x\n", + XREAD4(sc, runt, XHCI_ERSTSZ(0)), temp); + + XWRITE4(sc, runt, XHCI_ERSTSZ(0), XHCI_ERSTS_SET(temp)); + + /* Setup interrupt rate */ + XWRITE4(sc, runt, XHCI_IMOD(0), XHCI_IMOD_DEFAULT); + + usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); + + phwr = buf_res.buffer; + addr = buf_res.physaddr; + addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_events[0]; + + /* reset hardware root structure */ + memset(phwr, 0, sizeof(*phwr)); + + phwr->hwr_ring_seg[0].qwEvrsTablePtr = htole64(addr); + phwr->hwr_ring_seg[0].dwEvrsTableSize = htole32(XHCI_MAX_EVENTS); + + DPRINTF("ERDP(0)=0x%016llx\n", (unsigned long long)addr); + + XWRITE4(sc, runt, XHCI_ERDP_LO(0), (uint32_t)addr); + XWRITE4(sc, runt, XHCI_ERDP_HI(0), (uint32_t)(addr >> 32)); + + addr = (uint64_t)buf_res.physaddr; + + DPRINTF("ERSTBA(0)=0x%016llx\n", (unsigned long long)addr); + + XWRITE4(sc, runt, XHCI_ERSTBA_LO(0), (uint32_t)addr); + XWRITE4(sc, runt, XHCI_ERSTBA_HI(0), (uint32_t)(addr >> 32)); + + /* Setup interrupter registers */ + + temp = XREAD4(sc, runt, XHCI_IMAN(0)); + temp |= XHCI_IMAN_INTR_ENA; + XWRITE4(sc, runt, XHCI_IMAN(0), temp); + + /* setup command ring control base address */ + addr = buf_res.physaddr; + addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_commands[0]; + + DPRINTF("CRCR=0x%016llx\n", (unsigned long long)addr); + + XWRITE4(sc, oper, XHCI_CRCR_LO, ((uint32_t)addr) | XHCI_CRCR_LO_RCS); + XWRITE4(sc, oper, XHCI_CRCR_HI, (uint32_t)(addr >> 32)); + + phwr->hwr_commands[XHCI_MAX_COMMANDS - 1].qwTrb0 = htole64(addr); + + usb_bus_mem_flush_all(&sc->sc_bus, &xhci_iterate_hw_softc); + + /* Go! */ + XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_RS | + XHCI_CMD_INTE | XHCI_CMD_HSEE); + + for (i = 0; i != 100; i++) { + usb_pause_mtx(NULL, hz / 1000); + temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH; + if (!temp) + break; + } + if (temp) { + XWRITE4(sc, oper, XHCI_USBCMD, 0); + device_printf(sc->sc_bus.parent, "Run timeout.\n"); + return (USB_ERR_IOERROR); + } + + /* catch any lost interrupts */ + xhci_do_poll(&sc->sc_bus); + + return (0); +} + +usb_error_t +xhci_halt_controller(struct xhci_softc *sc) +{ + uint32_t temp; + uint16_t i; + + DPRINTF("\n"); + + sc->sc_capa_off = 0; + sc->sc_oper_off = XREAD1(sc, capa, XHCI_CAPLENGTH); + sc->sc_runt_off = XREAD4(sc, capa, XHCI_RTSOFF) & ~0xF; + sc->sc_door_off = XREAD4(sc, capa, XHCI_DBOFF) & ~0x3; + + /* Halt controller */ + XWRITE4(sc, oper, XHCI_USBCMD, 0); + + for (i = 0; i != 100; i++) { + usb_pause_mtx(NULL, hz / 1000); + temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH; + if (temp) + break; + } + + if (!temp) { + device_printf(sc->sc_bus.parent, "Controller halt timeout.\n"); + return (USB_ERR_IOERROR); + } + return (0); +} + +usb_error_t +xhci_init(struct xhci_softc *sc, device_t self) +{ + /* initialise some bus fields */ + sc->sc_bus.parent = self; + + /* set the bus revision */ + sc->sc_bus.usbrev = USB_REV_3_0; + + /* set up the bus struct */ + sc->sc_bus.methods = &xhci_bus_methods; + + /* setup devices array */ + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = XHCI_MAX_DEVICES; + + /* setup command queue mutex and condition varible */ + cv_init(&sc->sc_cmd_cv, "CMDQ"); + sx_init(&sc->sc_cmd_sx, "CMDQ lock"); + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &xhci_iterate_hw_softc)) { + return (ENOMEM); + } + + sc->sc_config_msg[0].hdr.pm_callback = &xhci_configure_msg; + sc->sc_config_msg[0].bus = &sc->sc_bus; + sc->sc_config_msg[1].hdr.pm_callback = &xhci_configure_msg; + sc->sc_config_msg[1].bus = &sc->sc_bus; + + if (usb_proc_create(&sc->sc_config_proc, + &sc->sc_bus.bus_mtx, device_get_nameunit(self), USB_PRI_MED)) { + printf("WARNING: Creation of XHCI configure " + "callback process failed.\n"); + } + return (0); +} + +void +xhci_uninit(struct xhci_softc *sc) +{ + usb_proc_free(&sc->sc_config_proc); + + usb_bus_mem_free_all(&sc->sc_bus, &xhci_iterate_hw_softc); + + cv_destroy(&sc->sc_cmd_cv); + sx_destroy(&sc->sc_cmd_sx); +} + +void +xhci_suspend(struct xhci_softc *sc) +{ + /* XXX TODO */ +} + +void +xhci_resume(struct xhci_softc *sc) +{ + /* XXX TODO */ +} + +void +xhci_shutdown(struct xhci_softc *sc) +{ + DPRINTF("Stopping the XHCI\n"); + + xhci_halt_controller(sc); +} + +static usb_error_t +xhci_generic_done_sub(struct usb_xfer *xfer) +{ + struct xhci_td *td; + struct xhci_td *td_alt_next; + uint32_t len; + uint8_t status; + + td = xfer->td_transfer_cache; + td_alt_next = td->alt_next; + + if (xfer->aframes != xfer->nframes) + usbd_xfer_set_frame_len(xfer, xfer->aframes, 0); + + while (1) { + + usb_pc_cpu_invalidate(td->page_cache); + + status = td->status; + len = td->remainder; + + DPRINTFN(4, "xfer=%p[%u/%u] rem=%u/%u status=%u\n", + xfer, (unsigned int)xfer->aframes, + (unsigned int)xfer->nframes, + (unsigned int)len, (unsigned int)td->len, + (unsigned int)status); + + /* + * Verify the status length and + * add the length to "frlengths[]": + */ + if (len > td->len) { + /* should not happen */ + DPRINTF("Invalid status length, " + "0x%04x/0x%04x bytes\n", len, td->len); + status = XHCI_TRB_ERROR_LENGTH; + } else if (xfer->aframes != xfer->nframes) { + xfer->frlengths[xfer->aframes] += td->len - len; + } + /* Check for last transfer */ + if (((void *)td) == xfer->td_transfer_last) { + td = NULL; + break; + } + /* Check for transfer error */ + if (status != XHCI_TRB_ERROR_SHORT_PKT && + status != XHCI_TRB_ERROR_SUCCESS) { + /* the transfer is finished */ + td = NULL; + break; + } + /* Check for short transfer */ + if (len > 0) { + if (xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr || + xfer->flags_int.control_xfr) { + /* follow alt next */ + td = td->alt_next; + } else { + /* the transfer is finished */ + td = NULL; + } + break; + } + td = td->obj_next; + + if (td->alt_next != td_alt_next) { + /* this USB frame is complete */ + break; + } + } + + /* update transfer cache */ + + xfer->td_transfer_cache = td; + + return ((status == XHCI_TRB_ERROR_STALL) ? USB_ERR_STALLED : + (status != XHCI_TRB_ERROR_SHORT_PKT && + status != XHCI_TRB_ERROR_SUCCESS) ? USB_ERR_IOERROR : + USB_ERR_NORMAL_COMPLETION); +} + +static void +xhci_generic_done(struct usb_xfer *xfer) +{ + usb_error_t err = 0; + + DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", + xfer, xfer->endpoint); + + /* reset scanner */ + + xfer->td_transfer_cache = xfer->td_transfer_first; + + if (xfer->flags_int.control_xfr) { + + if (xfer->flags_int.control_hdr) + err = xhci_generic_done_sub(xfer); + + xfer->aframes = 1; + + if (xfer->td_transfer_cache == NULL) + goto done; + } + + while (xfer->aframes != xfer->nframes) { + + err = xhci_generic_done_sub(xfer); + xfer->aframes++; + + if (xfer->td_transfer_cache == NULL) + goto done; + } + + if (xfer->flags_int.control_xfr && + !xfer->flags_int.control_act) + err = xhci_generic_done_sub(xfer); +done: + /* transfer is complete */ + xhci_device_done(xfer, err); +} + +static void +xhci_activate_transfer(struct usb_xfer *xfer) +{ + struct xhci_td *td; + + td = xfer->td_transfer_cache; + + usb_pc_cpu_invalidate(td->page_cache); + + if (!(td->td_trb[0].dwTrb3 & htole32(XHCI_TRB_3_CYCLE_BIT))) { + + /* activate the transfer */ + + td->td_trb[0].dwTrb3 |= htole32(XHCI_TRB_3_CYCLE_BIT); + usb_pc_cpu_flush(td->page_cache); + + xhci_endpoint_doorbell(xfer); + } +} + +static void +xhci_skip_transfer(struct usb_xfer *xfer) +{ + struct xhci_td *td; + struct xhci_td *td_last; + + td = xfer->td_transfer_cache; + td_last = xfer->td_transfer_last; + + td = td->alt_next; + + usb_pc_cpu_invalidate(td->page_cache); + + if (!(td->td_trb[0].dwTrb3 & htole32(XHCI_TRB_3_CYCLE_BIT))) { + + usb_pc_cpu_invalidate(td_last->page_cache); + + /* copy LINK TRB to current waiting location */ + + td->td_trb[0].qwTrb0 = td_last->td_trb[td_last->ntrb].qwTrb0; + td->td_trb[0].dwTrb2 = td_last->td_trb[td_last->ntrb].dwTrb2; + usb_pc_cpu_flush(td->page_cache); + + td->td_trb[0].dwTrb3 = td_last->td_trb[td_last->ntrb].dwTrb3; + usb_pc_cpu_flush(td->page_cache); + + xhci_endpoint_doorbell(xfer); + } +} + +/*------------------------------------------------------------------------* + * xhci_check_transfer + *------------------------------------------------------------------------*/ +static void +xhci_check_transfer(struct xhci_softc *sc, struct xhci_trb *trb) +{ + int64_t offset; + uint64_t td_event; + uint32_t temp; + uint32_t remainder; + uint8_t status; + uint8_t halted; + uint8_t epno; + uint8_t index; + uint8_t i; + + /* decode TRB */ + td_event = le64toh(trb->qwTrb0); + temp = le32toh(trb->dwTrb2); + + remainder = XHCI_TRB_2_REM_GET(temp); + status = XHCI_TRB_2_ERROR_GET(temp); + + temp = le32toh(trb->dwTrb3); + epno = XHCI_TRB_3_EP_GET(temp); + index = XHCI_TRB_3_SLOT_GET(temp); + + /* check if error means halted */ + halted = (status != XHCI_TRB_ERROR_SHORT_PKT && + status != XHCI_TRB_ERROR_SUCCESS); + + DPRINTF("slot=%u epno=%u remainder=%u status=%u\n", + index, epno, remainder, status); + + if (index > sc->sc_noslot) { + DPRINTF("Invalid slot.\n"); + return; + } + + if ((epno == 0) || (epno >= XHCI_MAX_ENDPOINTS)) { + DPRINTF("Invalid endpoint.\n"); + return; + } + + /* try to find the USB transfer that generated the event */ + for (i = 0; i != (XHCI_MAX_TRANSFERS - 1); i++) { + struct usb_xfer *xfer; + struct xhci_td *td; + struct xhci_endpoint_ext *pepext; + + pepext = &sc->sc_hw.devs[index].endp[epno]; + + xfer = pepext->xfer[i]; + if (xfer == NULL) + continue; + + td = xfer->td_transfer_cache; + + DPRINTFN(5, "Checking if 0x%016llx == (0x%016llx .. 0x%016llx)\n", + (long long)td_event, + (long long)td->td_self, + (long long)td->td_self + sizeof(td->td_trb)); + + /* + * NOTE: Some XHCI implementations might not trigger + * an event on the last LINK TRB so we need to + * consider both the last and second last event + * address as conditions for a successful transfer. + * + * NOTE: We assume that the XHCI will only trigger one + * event per chain of TRBs. + */ + + offset = td_event - td->td_self; + + if (offset >= 0 && + offset < sizeof(td->td_trb)) { + + usb_pc_cpu_invalidate(td->page_cache); + + /* compute rest of remainder, if any */ + for (i = (offset / 16) + 1; i < td->ntrb; i++) { + temp = le32toh(td->td_trb[i].dwTrb2); + remainder += XHCI_TRB_2_BYTES_GET(temp); + } + + DPRINTFN(5, "New remainder: %u\n", remainder); + + /* clear isochronous transfer errors */ + if (xfer->flags_int.isochronous_xfr) { + if (halted) { + halted = 0; + status = XHCI_TRB_ERROR_SUCCESS; + remainder = td->len; + } + } + + /* "td->remainder" is verified later */ + td->remainder = remainder; + td->status = status; + + usb_pc_cpu_flush(td->page_cache); + + /* + * 1) Last transfer descriptor makes the + * transfer done + */ + if (((void *)td) == xfer->td_transfer_last) { + DPRINTF("TD is last\n"); + xhci_generic_done(xfer); + break; + } + + /* + * 2) Any kind of error makes the transfer + * done + */ + if (halted) { + DPRINTF("TD has I/O error\n"); + xhci_generic_done(xfer); + break; + } + + /* + * 3) If there is no alternate next transfer, + * a short packet also makes the transfer done + */ + if (td->remainder > 0) { + DPRINTF("TD has short pkt\n"); + if (xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr || + xfer->flags_int.control_xfr) { + /* follow the alt next */ + xfer->td_transfer_cache = td->alt_next; + xhci_activate_transfer(xfer); + break; + } + xhci_skip_transfer(xfer); + xhci_generic_done(xfer); + break; + } + + /* + * 4) Transfer complete - go to next TD + */ + DPRINTF("Following next TD\n"); + xfer->td_transfer_cache = td->obj_next; + xhci_activate_transfer(xfer); + break; /* there should only be one match */ + } + } +} + +static void +xhci_check_command(struct xhci_softc *sc, struct xhci_trb *trb) +{ + if (sc->sc_cmd_addr == trb->qwTrb0) { + DPRINTF("Received command event\n"); + sc->sc_cmd_result[0] = trb->dwTrb2; + sc->sc_cmd_result[1] = trb->dwTrb3; + cv_signal(&sc->sc_cmd_cv); + } +} + +static void +xhci_interrupt_poll(struct xhci_softc *sc) +{ + struct usb_page_search buf_res; + struct xhci_hw_root *phwr; + uint64_t addr; + uint32_t temp; + uint16_t i; + uint8_t event; + uint8_t j; + uint8_t k; + uint8_t t; + + usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); + + phwr = buf_res.buffer; + + /* Receive any events */ + + usb_pc_cpu_invalidate(&sc->sc_hw.root_pc); + + i = sc->sc_event_idx; + j = sc->sc_event_ccs; + t = 2; + + while (1) { + + temp = le32toh(phwr->hwr_events[i].dwTrb3); + + k = (temp & XHCI_TRB_3_CYCLE_BIT) ? 1 : 0; + + if (j != k) + break; + + event = XHCI_TRB_3_TYPE_GET(temp); + + DPRINTFN(10, "event[%u] = %u (0x%016llx 0x%08lx 0x%08lx)\n", + i, event, (long long)le64toh(phwr->hwr_events[i].qwTrb0), + (long)le32toh(phwr->hwr_events[i].dwTrb2), + (long)le32toh(phwr->hwr_events[i].dwTrb3)); + + switch (event) { + case XHCI_TRB_EVENT_TRANSFER: + xhci_check_transfer(sc, &phwr->hwr_events[i]); + break; + case XHCI_TRB_EVENT_CMD_COMPLETE: + xhci_check_command(sc, &phwr->hwr_events[i]); + break; + default: + DPRINTF("Unhandled event = %u\n", event); + break; + } + + i++; + + if (i == XHCI_MAX_EVENTS) { + i = 0; + j ^= 1; + + /* check for timeout */ + if (!--t) + break; + } + } + + sc->sc_event_idx = i; + sc->sc_event_ccs = j; + + /* + * NOTE: The Event Ring Dequeue Pointer Register is 64-bit + * latched. That means to activate the register we need to + * write both the low and high double word of the 64-bit + * register. + */ + + addr = (uint32_t)buf_res.physaddr; + addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_events[i]; + + /* try to clear busy bit */ + addr |= XHCI_ERDP_LO_BUSY; + + XWRITE4(sc, runt, XHCI_ERDP_LO(0), (uint32_t)addr); + XWRITE4(sc, runt, XHCI_ERDP_HI(0), (uint32_t)(addr >> 32)); +} + +static usb_error_t +xhci_do_command(struct xhci_softc *sc, struct xhci_trb *trb, + uint16_t timeout_ms) +{ + struct usb_page_search buf_res; + struct xhci_hw_root *phwr; + uint64_t addr; + uint32_t temp; + uint8_t i; + uint8_t j; + int err; + + XHCI_CMD_ASSERT_LOCKED(sc); + + /* get hardware root structure */ + + usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); + + phwr = buf_res.buffer; + + /* Queue command */ + + USB_BUS_LOCK(&sc->sc_bus); + + i = sc->sc_command_idx; + j = sc->sc_command_ccs; + + DPRINTFN(10, "command[%u] = %u (0x%016llx, 0x%08lx, 0x%08lx)\n", + i, XHCI_TRB_3_TYPE_GET(le32toh(trb->dwTrb3)), + (long long)le64toh(trb->qwTrb0), + (long)le32toh(trb->dwTrb2), + (long)le32toh(trb->dwTrb3)); + + phwr->hwr_commands[i].qwTrb0 = trb->qwTrb0; + phwr->hwr_commands[i].dwTrb2 = trb->dwTrb2; + + usb_pc_cpu_flush(&sc->sc_hw.root_pc); + + temp = trb->dwTrb3; + + if (j) + temp |= htole32(XHCI_TRB_3_CYCLE_BIT); + else + temp &= ~htole32(XHCI_TRB_3_CYCLE_BIT); + + temp &= ~htole32(XHCI_TRB_3_TC_BIT); + + phwr->hwr_commands[i].dwTrb3 = temp; + + usb_pc_cpu_flush(&sc->sc_hw.root_pc); + + addr = buf_res.physaddr; + addr += (uintptr_t)&((struct xhci_hw_root *)0)->hwr_commands[i]; + + sc->sc_cmd_addr = htole64(addr); + + i++; + + if (i == (XHCI_MAX_COMMANDS - 1)) { + + if (j) { + temp = htole32(XHCI_TRB_3_TC_BIT | + XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK) | + XHCI_TRB_3_CYCLE_BIT); + } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 08:57:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 489F1106564A; Sun, 3 Oct 2010 08:57:03 +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 F3CC28FC18; Sun, 3 Oct 2010 08: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 o938v2qn069359; Sun, 3 Oct 2010 08:57:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o938v2Hx069355; Sun, 3 Oct 2010 08:57:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010030857.o938v2Hx069355@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Oct 2010 08:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213380 - stable/8/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 08:57:03 -0000 Author: kib Date: Sun Oct 3 08:57:02 2010 New Revision: 213380 URL: http://svn.freebsd.org/changeset/base/213380 Log: MFC r212506: Do not fork nfsiod directly from the vop methods. Schedule the task that performs fork to be executed in the taskqueue context. Modified: stable/8/sys/nfsclient/nfs.h stable/8/sys/nfsclient/nfs_nfsiod.c stable/8/sys/nfsclient/nfs_subs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfsclient/nfs.h ============================================================================== --- stable/8/sys/nfsclient/nfs.h Sun Oct 3 08:12:17 2010 (r213379) +++ stable/8/sys/nfsclient/nfs.h Sun Oct 3 08:57:02 2010 (r213380) @@ -125,6 +125,7 @@ extern struct uma_zone *nfsmount_zone; extern struct nfsstats nfsstats; extern struct mtx nfs_iod_mtx; +extern struct task nfs_nfsiodnew_task; extern int nfs_numasync; extern unsigned int nfs_iodmax; @@ -253,6 +254,7 @@ int nfs_commit(struct vnode *vp, u_quad_ struct ucred *cred, struct thread *td); int nfs_readdirrpc(struct vnode *, struct uio *, struct ucred *); int nfs_nfsiodnew(int); +void nfs_nfsiodnew_tq(__unused void *, int); int nfs_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); int nfs_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); void nfs_doio_directwrite (struct buf *); Modified: stable/8/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- stable/8/sys/nfsclient/nfs_nfsiod.c Sun Oct 3 08:12:17 2010 (r213379) +++ stable/8/sys/nfsclient/nfs_nfsiod.c Sun Oct 3 08:57:02 2010 (r213380) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -75,6 +76,16 @@ static MALLOC_DEFINE(M_NFSSVC, "nfsclien static void nfssvc_iod(void *); +struct nfsiod_str { + STAILQ_ENTRY(nfsiod_str) ni_links; + int *ni_inst; + int ni_iod; + int ni_error; + int ni_done; +}; +static STAILQ_HEAD(, nfsiod_str) nfsiodhead = + STAILQ_HEAD_INITIALIZER(nfsiodhead); + static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; SYSCTL_DECL(_vfs_nfs); @@ -159,11 +170,30 @@ SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, sizeof (nfs_iodmax), sysctl_iodmax, "IU", "Max number of nfsiod kthreads"); +void +nfs_nfsiodnew_tq(__unused void *arg, int pending) +{ + struct nfsiod_str *nip; + + mtx_lock(&nfs_iod_mtx); + while ((nip = STAILQ_FIRST(&nfsiodhead)) != NULL) { + STAILQ_REMOVE_HEAD(&nfsiodhead, ni_links); + mtx_unlock(&nfs_iod_mtx); + nip->ni_error = kproc_create(nfssvc_iod, nip->ni_inst, NULL, + RFHIGHPID, 0, "nfsiod %d", nip->ni_iod); + nip->ni_done = 1; + mtx_lock(&nfs_iod_mtx); + wakeup(nip); + } + mtx_unlock(&nfs_iod_mtx); +} + int nfs_nfsiodnew(int set_iodwant) { int error, i; int newiod; + struct nfsiod_str *nip; if (nfs_numasync >= nfs_iodmax) return (-1); @@ -179,9 +209,16 @@ nfs_nfsiodnew(int set_iodwant) if (set_iodwant > 0) nfs_iodwant[i] = NFSIOD_CREATED_FOR_NFS_ASYNCIO; mtx_unlock(&nfs_iod_mtx); - error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, - 0, "nfsiod %d", newiod); + nip = malloc(sizeof(*nip), M_TEMP, M_WAITOK | M_ZERO); + nip->ni_inst = nfs_asyncdaemon + i; + nip->ni_iod = newiod; mtx_lock(&nfs_iod_mtx); + STAILQ_INSERT_TAIL(&nfsiodhead, nip, ni_links); + taskqueue_enqueue(taskqueue_thread, &nfs_nfsiodnew_task); + while (!nip->ni_done) + mtx_sleep(nip, &nfs_iod_mtx, 0, "niwt", 0); + error = nip->ni_error; + free(nip, M_TEMP); if (error) { if (set_iodwant > 0) nfs_iodwant[i] = NFSIOD_NOT_AVAILABLE; Modified: stable/8/sys/nfsclient/nfs_subs.c ============================================================================== --- stable/8/sys/nfsclient/nfs_subs.c Sun Oct 3 08:12:17 2010 (r213379) +++ stable/8/sys/nfsclient/nfs_subs.c Sun Oct 3 08:57:02 2010 (r213380) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -117,6 +118,7 @@ int nfs_pbuf_freecnt = -1; /* start out struct nfs_bufq nfs_bufq; static struct mtx nfs_xid_mtx; +struct task nfs_nfsiodnew_task; /* * and the reverse mapping from generic to Version 2 procedure numbers @@ -354,6 +356,7 @@ nfs_init(struct vfsconf *vfsp) */ mtx_init(&nfs_iod_mtx, "NFS iod lock", NULL, MTX_DEF); mtx_init(&nfs_xid_mtx, "NFS xid lock", NULL, MTX_DEF); + TASK_INIT(&nfs_nfsiodnew_task, 0, nfs_nfsiodnew_tq, NULL); nfs_pbuf_freecnt = nswbuf / 2 + 1; @@ -368,9 +371,13 @@ nfs_uninit(struct vfsconf *vfsp) /* * Tell all nfsiod processes to exit. Clear nfs_iodmax, and wakeup * any sleeping nfsiods so they check nfs_iodmax and exit. + * Drain nfsiodnew task before we wait for them to finish. */ mtx_lock(&nfs_iod_mtx); nfs_iodmax = 0; + mtx_unlock(&nfs_iod_mtx); + taskqueue_drain(taskqueue_thread, &nfs_nfsiodnew_task); + mtx_lock(&nfs_iod_mtx); for (i = 0; i < nfs_numasync; i++) if (nfs_iodwant[i] == NFSIOD_AVAILABLE) wakeup(&nfs_iodwant[i]); From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 13:13:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64C3A106566C; Sun, 3 Oct 2010 13:13:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54ACA8FC1E; Sun, 3 Oct 2010 13:13: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 o93DDA2L076258; Sun, 3 Oct 2010 13:13:10 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93DDAO5076256; Sun, 3 Oct 2010 13:13:10 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201010031313.o93DDAO5076256@svn.freebsd.org> From: Hiroki Sato Date: Sun, 3 Oct 2010 13:13: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: r213381 - head/release/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 13:13:10 -0000 Author: hrs Date: Sun Oct 3 13:13:10 2010 New Revision: 213381 URL: http://svn.freebsd.org/changeset/base/213381 Log: Replace an obsolete flag -L in an mkisofs(1) command line with -allow-leading-dots to fix "make release" for FreeBSD/powerpc. Reviewed by: marcel Modified: head/release/powerpc/mkisoimages.sh Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Sun Oct 3 08:57:02 2010 (r213380) +++ head/release/powerpc/mkisoimages.sh Sun Oct 3 13:13:10 2010 (r213381) @@ -54,4 +54,4 @@ fi LABEL=$1; shift NAME=$1; shift -mkisofs $bootable -r -hfs -part -no-desktop -hfs-volid $LABEL -l -J -L -o $NAME $* +mkisofs $bootable -r -hfs -part -no-desktop -hfs-volid $LABEL -l -J -allow-leading-dots -o $NAME $* From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 13:52:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36AC3106566C; Sun, 3 Oct 2010 13:52:18 +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 263048FC1D; Sun, 3 Oct 2010 13:52: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 o93DqI21077330; Sun, 3 Oct 2010 13:52:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93DqIjS077328; Sun, 3 Oct 2010 13:52:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010031352.o93DqIjS077328@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Oct 2010 13:52: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: r213382 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 13:52:18 -0000 Author: kib Date: Sun Oct 3 13:52:17 2010 New Revision: 213382 URL: http://svn.freebsd.org/changeset/base/213382 Log: The makectx() function, used by kdb_trap() to reconstruct pcb from trap frame when trap initiated kdb entry, incorrectly calculated the value of %rsp for trapped thread. According to Intel(R) 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide, Part 1, rev. 035, 6.14.2 64-Bit Mode Stack Frame, "64-bit mode ... pushes SS:RSP unconditionally, rather than only on a CPL change." Even assuming the conditional push of the %ss:%rsp, the calculation was still wrong because sizeof(tf_ss) + sizeof(tf_rsp) == 16 on amd64. Always use the tf_rsp from trap frame. The change supposedly fixes stepping when using kgdb backend for kdb. Submitted by: Zhouyi Zhou PR: amd64/151167 Reviewed by: avg MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sun Oct 3 13:13:10 2010 (r213381) +++ head/sys/amd64/amd64/machdep.c Sun Oct 3 13:52:17 2010 (r213382) @@ -1799,7 +1799,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_rbp = tf->tf_rbp; pcb->pcb_rbx = tf->tf_rbx; pcb->pcb_rip = tf->tf_rip; - pcb->pcb_rsp = (ISPL(tf->tf_cs)) ? tf->tf_rsp : (long)(tf + 1) - 8; + pcb->pcb_rsp = tf->tf_rsp; } int From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 15:10:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 3159A106566C; Sun, 3 Oct 2010 15:10:04 +0000 (UTC) Date: Sun, 3 Oct 2010 15:10:04 +0000 From: Alexander Best To: Hans Petter Selasky Message-ID: <20101003151004.GA66312@freebsd.org> References: <201010030812.o938CH8S068342@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010030812.o938CH8S068342@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213379 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 15:10:04 -0000 great stuff!!! can't wait to add "device xhci" to my KERNCONF. :) -- a13x From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 16:02:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 965971065673; Sun, 3 Oct 2010 16:02:53 +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 843E38FC16; Sun, 3 Oct 2010 16:02:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o93G2rjG080122; Sun, 3 Oct 2010 16:02:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93G2rqn080117; Sun, 3 Oct 2010 16:02:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010031602.o93G2rqn080117@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 3 Oct 2010 16:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213383 - in head/sys: conf modules/mem powerpc/include powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 16:02:53 -0000 Author: nwhitehorn Date: Sun Oct 3 16:02:53 2010 New Revision: 213383 URL: http://svn.freebsd.org/changeset/base/213383 Log: Add a memory-range interface to /dev/mem on PowerPC using PAT attributes. Unlike actual MTRR, this only controls the mapping attributes for subsequent mmap() of /dev/mem. Nonetheless, the support is sufficiently MTRR-like that Xorg can use it, which translates into an enormous increase in graphics performance on PowerPC. MFC after: 2 weeks Modified: head/sys/conf/files.powerpc head/sys/modules/mem/Makefile head/sys/powerpc/include/memdev.h head/sys/powerpc/powerpc/mem.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Oct 3 13:52:17 2010 (r213382) +++ head/sys/conf/files.powerpc Sun Oct 3 16:02:53 2010 (r213383) @@ -27,6 +27,7 @@ dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/kbd/kbd.c optional sc +dev/mem/memutil.c optional mem dev/ofw/openfirm.c optional aim | fdt dev/ofw/openfirmio.c optional aim | fdt dev/ofw/ofw_bus_if.m optional aim | fdt Modified: head/sys/modules/mem/Makefile ============================================================================== --- head/sys/modules/mem/Makefile Sun Oct 3 13:52:17 2010 (r213382) +++ head/sys/modules/mem/Makefile Sun Oct 3 16:02:53 2010 (r213383) @@ -6,7 +6,7 @@ KMOD= mem SRCS= memdev.c mem.c -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} = "powerpc" SRCS+= memutil.c .endif .if ${MACHINE_CPUARCH} == "i386" Modified: head/sys/powerpc/include/memdev.h ============================================================================== --- head/sys/powerpc/include/memdev.h Sun Oct 3 13:52:17 2010 (r213382) +++ head/sys/powerpc/include/memdev.h Sun Oct 3 16:02:53 2010 (r213383) @@ -31,7 +31,7 @@ d_open_t memopen; d_read_t memrw; -#define memioctl (d_ioctl_t *)NULL +d_ioctl_t memioctl; d_mmap_t memmmap; void dev_mem_md_init(void); Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Sun Oct 3 13:52:17 2010 (r213382) +++ head/sys/powerpc/powerpc/mem.c Sun Oct 3 16:02:53 2010 (r213383) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -68,7 +69,21 @@ __FBSDID("$FreeBSD$"); #include -struct mem_range_softc mem_range_softc; +static void ppc_mrinit(struct mem_range_softc *); +static int ppc_mrset(struct mem_range_softc *, struct mem_range_desc *, int *); + +MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); + +static struct mem_range_ops ppc_mem_range_ops = { + ppc_mrinit, + ppc_mrset, + NULL, + NULL +}; +struct mem_range_softc mem_range_softc = { + &ppc_mem_range_ops, + 0, 0, 0 +}; /* ARGSUSED */ int @@ -162,6 +177,8 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { + int i; + /* * /dev/mem is the only one that makes sense through this * interface. For /dev/kmem any physaddr we return here @@ -178,10 +195,143 @@ memmmap(struct cdev *dev, vm_ooffset_t o *paddr = offset; + for (i = 0; i < mem_range_softc.mr_ndesc; i++) { + if (!(mem_range_softc.mr_desc[i].mr_flags & MDF_ACTIVE)) + continue; + + if (offset >= mem_range_softc.mr_desc[i].mr_base && + offset < mem_range_softc.mr_desc[i].mr_base + + mem_range_softc.mr_desc[i].mr_len) { + switch (mem_range_softc.mr_desc[i].mr_flags & + MDF_ATTRMASK) { + case MDF_WRITEBACK: + *memattr = VM_MEMATTR_WRITE_BACK; + break; + case MDF_WRITECOMBINE: + *memattr = VM_MEMATTR_WRITE_COMBINING; + break; + case MDF_UNCACHEABLE: + *memattr = VM_MEMATTR_UNCACHEABLE; + break; + case MDF_WRITETHROUGH: + *memattr = VM_MEMATTR_WRITE_THROUGH; + break; + } + + break; + } + } + return (0); } void dev_mem_md_init(void) { + mem_range_softc.mr_op->init(&mem_range_softc); +} + +static void +ppc_mrinit(struct mem_range_softc *sc) +{ + sc->mr_cap = 0; + sc->mr_ndesc = 8; /* XXX: Should be dynamically expandable */ + sc->mr_desc = malloc(sc->mr_ndesc * sizeof(struct mem_range_desc), + M_MEMDESC, M_NOWAIT | M_ZERO); + if (sc->mr_desc == NULL) + panic("%s: malloc returns NULL", __func__); +} + +static int +ppc_mrset(struct mem_range_softc *sc, struct mem_range_desc *desc, int *arg) +{ + int i; + + switch(*arg) { + case MEMRANGE_SET_UPDATE: + for (i = 0; i < sc->mr_ndesc; i++) { + if (!sc->mr_desc[i].mr_len) { + sc->mr_desc[i] = *desc; + sc->mr_desc[i].mr_flags |= MDF_ACTIVE; + return (0); + } + if (sc->mr_desc[i].mr_base == desc->mr_base && + sc->mr_desc[i].mr_len == desc->mr_len) + return (EEXIST); + } + return (ENOSPC); + case MEMRANGE_SET_REMOVE: + for (i = 0; i < sc->mr_ndesc; i++) + if (sc->mr_desc[i].mr_base == desc->mr_base && + sc->mr_desc[i].mr_len == desc->mr_len) { + bzero(&sc->mr_desc[i], sizeof(sc->mr_desc[i])); + return (0); + } + return (ENOENT); + default: + return (EOPNOTSUPP); + } + + return (0); } + +/* + * Operations for changing memory attributes. + * + * This is basically just an ioctl shim for mem_range_attr_get + * and mem_range_attr_set. + */ +/* ARGSUSED */ +int +memioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, + struct thread *td) +{ + int nd, error = 0; + struct mem_range_op *mo = (struct mem_range_op *)data; + struct mem_range_desc *md; + + /* is this for us? */ + if ((cmd != MEMRANGE_GET) && + (cmd != MEMRANGE_SET)) + return (ENOTTY); + + /* any chance we can handle this? */ + if (mem_range_softc.mr_op == NULL) + return (EOPNOTSUPP); + + /* do we have any descriptors? */ + if (mem_range_softc.mr_ndesc == 0) + return (ENXIO); + + switch (cmd) { + case MEMRANGE_GET: + nd = imin(mo->mo_arg[0], mem_range_softc.mr_ndesc); + if (nd > 0) { + md = (struct mem_range_desc *) + malloc(nd * sizeof(struct mem_range_desc), + M_MEMDESC, M_WAITOK); + error = mem_range_attr_get(md, &nd); + if (!error) + error = copyout(md, mo->mo_desc, + nd * sizeof(struct mem_range_desc)); + free(md, M_MEMDESC); + } + else + nd = mem_range_softc.mr_ndesc; + mo->mo_arg[0] = nd; + break; + + case MEMRANGE_SET: + md = (struct mem_range_desc *)malloc(sizeof(struct mem_range_desc), + M_MEMDESC, M_WAITOK); + error = copyin(mo->mo_desc, md, sizeof(struct mem_range_desc)); + /* clamp description string */ + md->mr_owner[sizeof(md->mr_owner) - 1] = 0; + if (error == 0) + error = mem_range_attr_set(md, &mo->mo_arg[0]); + free(md, M_MEMDESC); + break; + } + return (error); +} + From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 17:00:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D428B106566C; Sun, 3 Oct 2010 17:00:57 +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 C2F108FC08; Sun, 3 Oct 2010 17:00: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 o93H0vDS081531; Sun, 3 Oct 2010 17:00:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93H0vq2081514; Sun, 3 Oct 2010 17:00:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010031700.o93H0vq2081514@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Oct 2010 17:00: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: r213384 - in head/sys/dev: dc mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 17:00:57 -0000 Author: marius Date: Sun Oct 3 17:00:57 2010 New Revision: 213384 URL: http://svn.freebsd.org/changeset/base/213384 Log: Consistently always explicitly set IFM_HDX for half-duplex. Obtained from: OpenBSD (mostly) Modified: head/sys/dev/dc/dcphy.c head/sys/dev/dc/pnphy.c head/sys/dev/mii/acphy.c head/sys/dev/mii/amphy.c head/sys/dev/mii/axphy.c head/sys/dev/mii/bmtphy.c head/sys/dev/mii/gentbi.c head/sys/dev/mii/inphy.c head/sys/dev/mii/lxtphy.c head/sys/dev/mii/nsphy.c head/sys/dev/mii/qsphy.c head/sys/dev/mii/rlphy.c head/sys/dev/mii/ruephy.c head/sys/dev/mii/tdkphy.c head/sys/dev/mii/tlphy.c head/sys/dev/mii/ukphy_subr.c Modified: head/sys/dev/dc/dcphy.c ============================================================================== --- head/sys/dev/dc/dcphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/dc/dcphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -341,14 +341,14 @@ dcphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX | IFM_FDX; else if (anlpar & ANLPAR_T4 && sc->mii_capabilities & BMSR_100T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4 | IFM_HDX; else if (anlpar & ANLPAR_TX && sc->mii_capabilities & BMSR_100TXHDX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX | IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T | IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; if (DC_IS_INTEL(dc_sc)) @@ -366,9 +366,9 @@ dcphy_status(struct mii_softc *sc) * change the media settings if we're wrong. */ if (!(reg & DC_TSTAT_LS100)) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX | IFM_HDX; else if (!(reg & DC_TSTAT_LS10)) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; if (DC_IS_INTEL(dc_sc)) @@ -383,6 +383,8 @@ skip: mii->mii_media_active |= IFM_100_TX; if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } static int Modified: head/sys/dev/dc/pnphy.c ============================================================================== --- head/sys/dev/dc/pnphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/dc/pnphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -237,4 +237,6 @@ pnphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_100_TX; if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } Modified: head/sys/dev/mii/acphy.c ============================================================================== --- head/sys/dev/mii/acphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/acphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -245,6 +245,8 @@ acphy_status(struct mii_softc *sc) if (diag & AC_DIAG_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/amphy.c ============================================================================== --- head/sys/dev/mii/amphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/amphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -206,13 +206,13 @@ amphy_status(struct mii_softc *sc) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -225,11 +225,11 @@ amphy_status(struct mii_softc *sc) if (par & DSCSR_100FDX) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (par & DSCSR_100HDX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (par & DSCSR_10FDX) mii->mii_media_active |= IFM_10_T|IFM_HDX; else if (par & DSCSR_10HDX) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/axphy.c ============================================================================== --- head/sys/dev/mii/axphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/axphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -189,6 +189,8 @@ axphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (scr & SCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; #endif } else mii->mii_media_active = ife->ifm_media; Modified: head/sys/dev/mii/bmtphy.c ============================================================================== --- head/sys/dev/mii/bmtphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/bmtphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -243,6 +243,8 @@ bmtphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (aux_csr & AUX_CSR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/gentbi.c ============================================================================== --- head/sys/dev/mii/gentbi.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/gentbi.c Sun Oct 3 17:00:57 2010 (r213384) @@ -263,11 +263,12 @@ gentbi_status(struct mii_softc *sc) * see if we're doing full-duplex. */ mii->mii_media_active |= IFM_1000_SX; - anlpar = PHY_READ(sc, MII_ANLPAR); if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0 && (anlpar & ANLPAR_X_FD) != 0) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/inphy.c ============================================================================== --- head/sys/dev/mii/inphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/inphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -197,6 +197,8 @@ inphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (scr & SCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/lxtphy.c ============================================================================== --- head/sys/dev/mii/lxtphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/lxtphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -250,6 +250,8 @@ lxtphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (csr & CSR_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/nsphy.c ============================================================================== --- head/sys/dev/mii/nsphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/nsphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -298,13 +298,13 @@ nsphy_status(struct mii_softc *sc) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -320,10 +320,7 @@ nsphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; else mii->mii_media_active |= IFM_100_TX; -#if 0 - if (par & PAR_FDX) - mii->mii_media_active |= IFM_FDX; -#endif + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/qsphy.c ============================================================================== --- head/sys/dev/mii/qsphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/qsphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -215,19 +215,19 @@ qsphy_status(struct mii_softc *sc) pctl = PHY_READ(sc, MII_QSPHY_PCTL); switch (pctl & PCTL_OPMASK) { case PCTL_10_T: - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; break; case PCTL_10_T_FDX: mii->mii_media_active |= IFM_10_T|IFM_FDX; break; case PCTL_100_TX: - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; break; case PCTL_100_TX_FDX: mii->mii_media_active |= IFM_100_TX|IFM_FDX; break; case PCTL_100_T4: - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; break; case PCTL_AN: mii->mii_media_active |= IFM_NONE; Modified: head/sys/dev/mii/rlphy.c ============================================================================== --- head/sys/dev/mii/rlphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/rlphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -249,13 +249,13 @@ rlphy_status(struct mii_softc *phy) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; return; @@ -299,6 +299,7 @@ rlphy_status(struct mii_softc *phy) else mii->mii_media_active |= IFM_100_TX; } + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/ruephy.c ============================================================================== --- head/sys/dev/mii/ruephy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/ruephy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -244,6 +244,8 @@ ruephy_status(struct mii_softc *phy) if (msr & RUEPHY_MSR_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; } else mii->mii_media_active = ife->ifm_media; } Modified: head/sys/dev/mii/tdkphy.c ============================================================================== --- head/sys/dev/mii/tdkphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/tdkphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -217,13 +217,13 @@ tdkphy_status(struct mii_softc *phy) if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else { /* * ANLPAR isn't set, which leaves two possibilities: @@ -234,10 +234,12 @@ tdkphy_status(struct mii_softc *phy) */ diag = PHY_READ(phy, MII_DIAG); if (diag & DIAG_NEGFAIL) /* assume 10baseT if no neg */ - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else { if (diag & DIAG_DUPLEX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; if (diag & DIAG_RATE_100) mii->mii_media_active |= IFM_100_TX; else Modified: head/sys/dev/mii/tlphy.c ============================================================================== --- head/sys/dev/mii/tlphy.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/tlphy.c Sun Oct 3 17:00:57 2010 (r213384) @@ -333,6 +333,8 @@ tlphy_status(struct tlphy_softc *sc) */ if (bmcr & BMCR_FDX) mii->mii_media_active |= IFM_FDX; + else + mii->mii_media_active |= IFM_HDX; mii->mii_media_active |= IFM_10_T; } Modified: head/sys/dev/mii/ukphy_subr.c ============================================================================== --- head/sys/dev/mii/ukphy_subr.c Sun Oct 3 16:02:53 2010 (r213383) +++ head/sys/dev/mii/ukphy_subr.c Sun Oct 3 17:00:57 2010 (r213384) @@ -104,17 +104,17 @@ ukphy_status(struct mii_softc *phy) mii->mii_media_active |= IFM_1000_T|IFM_FDX; else if ((gtcr & GTCR_ADV_1000THDX) && (gtsr & GTSR_LP_1000THDX)) - mii->mii_media_active |= IFM_1000_T; + mii->mii_media_active |= IFM_1000_T|IFM_HDX; else if (anlpar & ANLPAR_TX_FD) mii->mii_media_active |= IFM_100_TX|IFM_FDX; else if (anlpar & ANLPAR_T4) - mii->mii_media_active |= IFM_100_T4; + mii->mii_media_active |= IFM_100_T4|IFM_HDX; else if (anlpar & ANLPAR_TX) - mii->mii_media_active |= IFM_100_TX; + mii->mii_media_active |= IFM_100_TX|IFM_HDX; else if (anlpar & ANLPAR_10_FD) mii->mii_media_active |= IFM_10_T|IFM_FDX; else if (anlpar & ANLPAR_10) - mii->mii_media_active |= IFM_10_T; + mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; } else From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 17:05:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89E841065672; Sun, 3 Oct 2010 17:05: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 77AF88FC1F; Sun, 3 Oct 2010 17:05: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 o93H5PoD081650; Sun, 3 Oct 2010 17:05:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93H5Pgj081648; Sun, 3 Oct 2010 17:05:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010031705.o93H5Pgj081648@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Oct 2010 17:05: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: r213385 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 17:05:25 -0000 Author: marius Date: Sun Oct 3 17:05:25 2010 New Revision: 213385 URL: http://svn.freebsd.org/changeset/base/213385 Log: Remove an header that apart from the license is empty. Deleted: head/sys/dev/mii/axphyreg.h Modified: head/sys/dev/mii/axphy.c Modified: head/sys/dev/mii/axphy.c ============================================================================== --- head/sys/dev/mii/axphy.c Sun Oct 3 17:00:57 2010 (r213384) +++ head/sys/dev/mii/axphy.c Sun Oct 3 17:05:25 2010 (r213385) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include "miidevs.h" -#include - #include "miibus_if.h" static int axphy_probe(device_t dev); From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 17:50:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33DE7106566B; Sun, 3 Oct 2010 17:50:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22C2B8FC19; Sun, 3 Oct 2010 17:50: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 o93HoiSL082556; Sun, 3 Oct 2010 17:50:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93Hoh2D082550; Sun, 3 Oct 2010 17:50:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010031750.o93Hoh2D082550@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 3 Oct 2010 17:50: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: r213386 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 17:50:45 -0000 Author: nwhitehorn Date: Sun Oct 3 17:50:43 2010 New Revision: 213386 URL: http://svn.freebsd.org/changeset/base/213386 Log: Extend sysinstall to handle powerpc64 by teaching it that powerpc64 has a lib32 distribution, and that the GENERIC kernel is named GENERIC64. More modifications will be required later for installations from ftp due to the shared platform name with 32-bit powerpc, but this is enough for snapshot CDs to work. Reviewed by: brucec Modified: head/usr.sbin/sysinstall/dist.c head/usr.sbin/sysinstall/dist.h head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/menus.c head/usr.sbin/sysinstall/sysinstall.8 Modified: head/usr.sbin/sysinstall/dist.c ============================================================================== --- head/usr.sbin/sysinstall/dist.c Sun Oct 3 17:05:25 2010 (r213385) +++ head/usr.sbin/sysinstall/dist.c Sun Oct 3 17:50:43 2010 (r213386) @@ -87,7 +87,7 @@ static Distribution DistTable[] = { DTE_TARBALL("proflibs", &Dists, PROFLIBS, "/"), DTE_TARBALL("dict", &Dists, DICT, "/"), DTE_TARBALL("info", &Dists, INFO, "/"), -#ifdef __amd64__ +#if defined(__amd64__) || defined(__powerpc64__) DTE_TARBALL("lib32", &Dists, LIB32, "/"), #endif DTE_SUBDIST("src", &Dists, SRC, SrcDistTable), @@ -98,7 +98,7 @@ static Distribution DistTable[] = { /* The kernel distributions */ static Distribution KernelDistTable[] = { - DTE_TARBALL("GENERIC", &KernelDists, KERNEL_GENERIC, "/boot"), + DTE_TARBALL(GENERIC_KERNEL_NAME, &KernelDists, KERNEL_GENERIC, "/boot"), DTE_END, }; Modified: head/usr.sbin/sysinstall/dist.h ============================================================================== --- head/usr.sbin/sysinstall/dist.h Sun Oct 3 17:05:25 2010 (r213385) +++ head/usr.sbin/sysinstall/dist.h Sun Oct 3 17:50:43 2010 (r213386) @@ -16,7 +16,7 @@ #define DIST_CATPAGES 0x00200 #define DIST_PORTS 0x00400 #define DIST_LOCAL 0x00800 -#ifdef __amd64__ +#if defined(__amd64__) || defined(__powerpc64__) #define DIST_LIB32 0x01000 #endif #define DIST_KERNEL 0x02000 @@ -75,6 +75,12 @@ #define DIST_KERNEL_SMP 0x00002 #define DIST_KERNEL_ALL 0xFFFFF +#ifdef __powerpc64__ +#define GENERIC_KERNEL_NAME "GENERIC64" +#else +#define GENERIC_KERNEL_NAME "GENERIC" +#endif + /* Canned distribution sets */ #define _DIST_USER \ Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Sun Oct 3 17:05:25 2010 (r213385) +++ head/usr.sbin/sysinstall/install.c Sun Oct 3 17:50:43 2010 (r213386) @@ -979,7 +979,7 @@ installFixupKernel(dialogMenuItem *self, * already and the /boot/kernel we remove is empty. */ vsystem("rm -rf /boot/kernel"); - vsystem("mv /boot/GENERIC /boot/kernel"); + vsystem("mv /boot/" GENERIC_KERNEL_NAME " /boot/kernel"); } return DITEM_SUCCESS | DITEM_RESTORE; } Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Sun Oct 3 17:05:25 2010 (r213385) +++ head/usr.sbin/sysinstall/menus.c Sun Oct 3 17:50:43 2010 (r213386) @@ -993,7 +993,7 @@ DMenu MenuSubDistributions = { dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_GAMES }, { " info", "GNU info files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_INFO }, -#ifdef __amd64__ +#if defined(__amd64__) || defined(__powerpc64__) { " lib32", "32-bit runtime compatibility libraries", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_LIB32 }, #endif Modified: head/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.8 Sun Oct 3 17:05:25 2010 (r213385) +++ head/usr.sbin/sysinstall/sysinstall.8 Sun Oct 3 17:50:43 2010 (r213386) @@ -428,7 +428,7 @@ Dictionary information (for tools like s .It Li info GNU info files and other extra docs. .It Li lib32 -(amd64 only) +(amd64 and powerpc64 only) 32-bit runtime compatibility libraries. .It Li ports The ports collection. From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 18:24:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AFD9106564A; Sun, 3 Oct 2010 18:24:32 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A9258FC18; Sun, 3 Oct 2010 18:24: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 o93IOWE0083409; Sun, 3 Oct 2010 18:24:32 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93IOWux083407; Sun, 3 Oct 2010 18:24:32 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201010031824.o93IOWux083407@svn.freebsd.org> From: Antoine Brodin Date: Sun, 3 Oct 2010 18:24: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: r213387 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 18:24:32 -0000 Author: antoine Date: Sun Oct 3 18:24:31 2010 New Revision: 213387 URL: http://svn.freebsd.org/changeset/base/213387 Log: Add more obsolete files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Oct 3 17:50:43 2010 (r213386) +++ head/ObsoleteFiles.inc Sun Oct 3 18:24:31 2010 (r213387) @@ -23,8 +23,13 @@ OLD_FILES+=usr/share/man/man3/ascftime.3 OLD_FILES+=usr/share/man/man3/cfree.3.gz OLD_FILES+=usr/share/man/man3/cftime.3.gz OLD_FILES+=usr/share/man/man3/getpw.3.gz +# 20100801: tzdata2010k import +OLD_FILES+=usr/share/zoneinfo/Pacific/Ponape +OLD_FILES+=usr/share/zoneinfo/Pacific/Truk # 20100725: acpi_aiboost(4) removal. OLD_FILES+=usr/share/man/man4/acpi_aiboost.4.gz +# 20100724: nfsclient/nfs_lock.h moved to nfs/nfs_lock.h +OLD_FILES+=usr/include/nfsclient/nfs_lock.h # 20100720: new clang import which bumps version from 2.0 to 2.8 OLD_FILES+=usr/include/clang/2.0/emmintrin.h OLD_FILES+=usr/include/clang/2.0/mm_malloc.h From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 18:49:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1430B1065675; Sun, 3 Oct 2010 18:49:33 +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 41FAF8FC17; Sun, 3 Oct 2010 18:49:31 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o93InQ0J063807 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Oct 2010 21:49:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o93InQb5087705; Sun, 3 Oct 2010 21:49:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o93InQpJ087704; Sun, 3 Oct 2010 21:49:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 3 Oct 2010 21:49:26 +0300 From: Kostik Belousov To: Hajimu UMEMOTO Message-ID: <20101003184925.GA87647@deviant.kiev.zoral.com.ua> References: <201008130639.o7D6dsk1022779@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <201008130639.o7D6dsk1022779@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=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, 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: r211276 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 18:49:33 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 13, 2010 at 06:39:54AM +0000, Hajimu UMEMOTO wrote: > Author: ume > Date: Fri Aug 13 06:39:54 2010 > New Revision: 211276 > URL: http://svn.freebsd.org/changeset/base/211276 >=20 > Log: > - When there is no room for returning the result, nss backend > have to return ERANGE and terminate with NS_RETURN. > - When gethostbyname_r(3) and the friends end with an error, > set errno to the value nss backend returns, and return errno > value. > =20 > PR: kern/131623 > MFC after: 2 weeks I suspect there is some subtle issue with the commit present. When getprotobyname_r() is unable to find the protocol, it seems that established behaviour is to return 0 and set *protoent to NULL. The getprotobyname_r() in HEAD and stable/8, when the protocol cannot be found, return whatever value was present in errno at the time of the call. Below is the example: #include #include #include #include int main(int argc, char *argv[]) { char buf[1024]; struct protoent proto, *pres; int res; res =3D getprotobyname_r(argv[1], &proto, buf, sizeof(buf), &pres); if (res =3D=3D 0 && pres !=3D NULL) printf("Protocol %s num %d (%p %p)\n", proto.p_name, proto.p_proto, &proto, pres); else printf("Res %d errno %d %s pres %p\n", res, errno, strerror(errno), pres); return (0); } When run with the argument "tcp1" on Linux, I get Res 0 errno 0 Success pres (nil) On the recent FreeBSD I get Res 25 errno 25 Inappropriate ioctl for device pres 0x0 (ENOTTY is from stdio). --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyo0DUACgkQC3+MBN1Mb4gmeACfa0YqIp8SFgMncR4Tn/DST+JX j8sAoMvKs6MbJxDmuboidMUZxRzhGeJp =B8Dr -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm-- From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 20:04:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E10A106564A; Sun, 3 Oct 2010 20:04:11 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3258FC15; Sun, 3 Oct 2010 20:04: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 o93K4B0J085684; Sun, 3 Oct 2010 20:04:11 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93K4Bb3085682; Sun, 3 Oct 2010 20:04:11 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201010032004.o93K4Bb3085682@svn.freebsd.org> From: Antoine Brodin Date: Sun, 3 Oct 2010 20:04: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: r213388 - head/sys/modules/mem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 20:04:11 -0000 Author: antoine Date: Sun Oct 3 20:04:11 2010 New Revision: 213388 URL: http://svn.freebsd.org/changeset/base/213388 Log: Unbreak build. Modified: head/sys/modules/mem/Makefile Modified: head/sys/modules/mem/Makefile ============================================================================== --- head/sys/modules/mem/Makefile Sun Oct 3 18:24:31 2010 (r213387) +++ head/sys/modules/mem/Makefile Sun Oct 3 20:04:11 2010 (r213388) @@ -6,7 +6,7 @@ KMOD= mem SRCS= memdev.c mem.c -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} = "powerpc" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" SRCS+= memutil.c .endif .if ${MACHINE_CPUARCH} == "i386" From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 20:09:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D028C106566B; Sun, 3 Oct 2010 20:09:19 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A55428FC15; Sun, 3 Oct 2010 20:09:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o93K9JhH085817; Sun, 3 Oct 2010 20:09:19 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93K9JjD085815; Sun, 3 Oct 2010 20:09:19 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201010032009.o93K9JjD085815@svn.freebsd.org> From: Antoine Brodin Date: Sun, 3 Oct 2010 20:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213389 - head/usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 20:09:19 -0000 Author: antoine Date: Sun Oct 3 20:09:19 2010 New Revision: 213389 URL: http://svn.freebsd.org/changeset/base/213389 Log: Reconnect uathload to the build. Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Oct 3 20:04:11 2010 (r213388) +++ head/usr.sbin/Makefile Sun Oct 3 20:09:19 2010 (r213389) @@ -288,6 +288,7 @@ SUBDIR+= crunch .endif .if ${MK_USB} != "no" +SUBDIR+= uathload SUBDIR+= uhsoctl SUBDIR+= usbconfig .endif From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 21:18:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AA2C106566C; Sun, 3 Oct 2010 21:18:54 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id B9E308FC12; Sun, 3 Oct 2010 21:18:53 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id CB5C6582C8; Sun, 3 Oct 2010 16:18:52 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id qEbqOPITKI+a; Sun, 3 Oct 2010 16:18:52 -0500 (CDT) Received: from comporellon.tachypleus.net (unknown [76.210.68.10]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 592B0582C5; Sun, 3 Oct 2010 16:18:52 -0500 (CDT) Message-ID: <4CA8F33B.3040404@freebsd.org> Date: Sun, 03 Oct 2010 16:18:51 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.12) Gecko/20100925 Thunderbird/3.0.8 MIME-Version: 1.0 To: Antoine Brodin References: <201010032004.o93K4Bb3085682@svn.freebsd.org> In-Reply-To: <201010032004.o93K4Bb3085682@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: r213388 - head/sys/modules/mem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 21:18:54 -0000 On 10/03/10 15:04, Antoine Brodin wrote: > Author: antoine > Date: Sun Oct 3 20:04:11 2010 > New Revision: 213388 > URL: http://svn.freebsd.org/changeset/base/213388 > > Log: > Unbreak build. > Ack! Thanks for fixing it, and sorry for the breakage. -Nathan From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 21:56:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D3DB106566C; Sun, 3 Oct 2010 21:56:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A3718FC12; Sun, 3 Oct 2010 21:56: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 o93LuL7Y091330; Sun, 3 Oct 2010 21:56:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93LuKNd091308; Sun, 3 Oct 2010 21:56:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010032156.o93LuKNd091308@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Oct 2010 21:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213390 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 21:56:21 -0000 Author: jilles Date: Sun Oct 3 21:56:20 2010 New Revision: 213390 URL: http://svn.freebsd.org/changeset/base/213390 Log: MFC r201053: sh: Various warning fixes (from WARNS=6 NO_WERROR=1): - const - initializations to silence -Wuninitialized (it was safe anyway) - remove nested extern declarations - rename "index" locals to "idx" Modified: stable/8/bin/sh/arith.y stable/8/bin/sh/cd.c stable/8/bin/sh/eval.c stable/8/bin/sh/eval.h stable/8/bin/sh/exec.c stable/8/bin/sh/expand.c stable/8/bin/sh/histedit.c stable/8/bin/sh/input.c stable/8/bin/sh/jobs.c stable/8/bin/sh/main.c stable/8/bin/sh/miscbltin.c stable/8/bin/sh/mkbuiltins stable/8/bin/sh/mkinit.c stable/8/bin/sh/mksyntax.c stable/8/bin/sh/mystring.c stable/8/bin/sh/options.c stable/8/bin/sh/options.h stable/8/bin/sh/parser.c stable/8/bin/sh/parser.h stable/8/bin/sh/var.c stable/8/bin/sh/var.h Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/arith.y ============================================================================== --- stable/8/bin/sh/arith.y Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/arith.y Sun Oct 3 21:56:20 2010 (r213390) @@ -314,7 +314,7 @@ yyerror(const char *s) int expcmd(int argc, char **argv) { - char *p; + const char *p; char *concat; char **ap; arith_t i; Modified: stable/8/bin/sh/cd.c ============================================================================== --- stable/8/bin/sh/cd.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/cd.c Sun Oct 3 21:56:20 2010 (r213390) @@ -79,7 +79,7 @@ STATIC char *cdcomppath; int cdcmd(int argc, char **argv) { - char *dest; + const char *dest; const char *path; char *p; struct stat statb; Modified: stable/8/bin/sh/eval.c ============================================================================== --- stable/8/bin/sh/eval.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/eval.c Sun Oct 3 21:56:20 2010 (r213390) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #endif -MKINIT int evalskip; /* set if we are skipping commands */ +int evalskip; /* set if we are skipping commands */ STATIC int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ @@ -407,8 +407,7 @@ evalsubshell(union node *n, int flags) flags &=~ EV_TESTED; redirect(n->nredir.redirect, 0); evaltree(n->nredir.n, flags | EV_EXIT); /* never returns */ - } - if (! backgnd) { + } else if (! backgnd) { INTOFF; exitstatus = waitforjob(jp, (int *)NULL); INTON; @@ -852,7 +851,7 @@ evalcommand(union node *cmd, int flags, listsetvar(cmdenviron); commandname = argv[0]; argptr = argv + 1; - optptr = NULL; /* initialize nextopt */ + nextopt_optptr = NULL; /* initialize nextopt */ builtin_flags = flags; exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv); flushall(); Modified: stable/8/bin/sh/eval.h ============================================================================== --- stable/8/bin/sh/eval.h Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/eval.h Sun Oct 3 21:56:20 2010 (r213390) @@ -35,6 +35,7 @@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ +extern int oexitstatus; /* saved exit status */ extern struct strlist *cmdenviron; /* environment for builtin command */ Modified: stable/8/bin/sh/exec.c ============================================================================== --- stable/8/bin/sh/exec.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/exec.c Sun Oct 3 21:56:20 2010 (r213390) @@ -109,7 +109,7 @@ STATIC void delete_cmd_entry(void); */ void -shellexec(char **argv, char **envp, const char *path, int index) +shellexec(char **argv, char **envp, const char *path, int idx) { char *cmdname; int e; @@ -120,7 +120,7 @@ shellexec(char **argv, char **envp, cons } else { e = ENOENT; while ((cmdname = padvance(&path, argv[0])) != NULL) { - if (--index < 0 && pathopt == NULL) { + if (--idx < 0 && pathopt == NULL) { tryexec(cmdname, argv, envp); if (errno != ENOENT && errno != ENOTDIR) e = errno; @@ -268,17 +268,17 @@ hashcmd(int argc __unused, char **argv _ STATIC void printentry(struct tblentry *cmdp, int verbose) { - int index; + int idx; const char *path; char *name; if (cmdp->cmdtype == CMDNORMAL) { - index = cmdp->param.index; + idx = cmdp->param.index; path = pathval(); do { name = padvance(&path, cmdp->cmdname); stunalloc(name); - } while (--index >= 0); + } while (--idx >= 0); out1str(name); } else if (cmdp->cmdtype == CMDBUILTIN) { out1fmt("builtin %s", cmdp->cmdname); @@ -314,7 +314,7 @@ find_command(const char *name, struct cm const char *path) { struct tblentry *cmdp; - int index; + int idx; int prev; char *fullname; struct stat statb; @@ -354,11 +354,11 @@ find_command(const char *name, struct cm } e = ENOENT; - index = -1; + idx = -1; loop: while ((fullname = padvance(&path, name)) != NULL) { stunalloc(fullname); - index++; + idx++; if (pathopt) { if (prefix("builtin", pathopt)) { if ((i = find_builtin(name, &spec)) < 0) @@ -377,8 +377,8 @@ loop: } } /* if rehash, don't redo absolute path names */ - if (fullname[0] == '/' && index <= prev) { - if (index < prev) + if (fullname[0] == '/' && idx <= prev) { + if (idx < prev) goto loop; TRACE(("searchexec \"%s\": no change\n", name)); goto success; @@ -415,7 +415,7 @@ loop: INTOFF; cmdp = cmdlookup(name, 1); cmdp->cmdtype = CMDNORMAL; - cmdp->param.index = index; + cmdp->param.index = idx; INTON; goto success; } @@ -493,18 +493,18 @@ void changepath(const char *newval) { const char *old, *new; - int index; + int idx; int firstchange; int bltin; old = pathval(); new = newval; firstchange = 9999; /* assume no change */ - index = 0; + idx = 0; bltin = -1; for (;;) { if (*old != *new) { - firstchange = index; + firstchange = idx; if ((*old == '\0' && *new == ':') || (*old == ':' && *new == '\0')) firstchange++; @@ -513,9 +513,9 @@ changepath(const char *newval) if (*new == '\0') break; if (*new == '%' && bltin < 0 && prefix("builtin", new + 1)) - bltin = index; + bltin = idx; if (*new == ':') { - index++; + idx++; } new++, old++; } @@ -723,15 +723,14 @@ typecmd_impl(int argc, char **argv, int { struct cmdentry entry; struct tblentry *cmdp; - char **pp; + const char *const *pp; struct alias *ap; int i; - int error = 0; - extern char *const parsekwd[]; + int error1 = 0; for (i = 1; i < argc; i++) { /* First look at the keywords */ - for (pp = (char **)parsekwd; *pp; pp++) + for (pp = parsekwd; *pp; pp++) if (**pp == *argv[i] && equal(*pp, argv[i])) break; @@ -792,7 +791,7 @@ typecmd_impl(int argc, char **argv, int if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: %s\n", argv[i], strerror(errno)); - error |= 127; + error1 |= 127; } } break; @@ -817,11 +816,11 @@ typecmd_impl(int argc, char **argv, int default: if (cmd != TYPECMD_SMALLV) outfmt(out2, "%s: not found\n", argv[i]); - error |= 127; + error1 |= 127; break; } } - return error; + return error1; } /* Modified: stable/8/bin/sh/expand.c ============================================================================== --- stable/8/bin/sh/expand.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/expand.c Sun Oct 3 21:56:20 2010 (r213390) @@ -852,7 +852,6 @@ varvalue(char *name, int quoted, int sub int num; char *p; int i; - extern int oexitstatus; char sep; char **ap; char const *syntax; @@ -976,7 +975,7 @@ ifsbreakup(char *string, struct arglist char *start; char *p; char *q; - char *ifs; + const char *ifs; const char *ifsspc; int had_param_ch = 0; Modified: stable/8/bin/sh/histedit.c ============================================================================== --- stable/8/bin/sh/histedit.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/histedit.c Sun Oct 3 21:56:20 2010 (r213390) @@ -165,19 +165,19 @@ int histcmd(int argc, char **argv) { int ch; - char *editor = NULL; + const char *editor = NULL; HistEvent he; int lflg = 0, nflg = 0, rflg = 0, sflg = 0; int i, retval; - char *firststr, *laststr; + const char *firststr, *laststr; int first, last, direction; - char *pat = NULL, *repl; + char *pat = NULL, *repl = NULL; static int active = 0; struct jmploc jmploc; struct jmploc *savehandler; char editfilestr[PATH_MAX]; char *volatile editfile; - FILE *efp; + FILE *efp = NULL; int oldhistnum; if (hist == NULL) Modified: stable/8/bin/sh/input.c ============================================================================== --- stable/8/bin/sh/input.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/input.c Sun Oct 3 21:56:20 2010 (r213390) @@ -93,7 +93,7 @@ struct parsefile { int plinno = 1; /* input line number */ -MKINIT int parsenleft; /* copy of parsefile->nleft */ +int parsenleft; /* copy of parsefile->nleft */ MKINIT int parselleft; /* copy of parsefile->lleft */ char *parsenextc; /* copy of parsefile->nextc */ MKINIT struct parsefile basepf; /* top level input file */ @@ -111,9 +111,9 @@ static int preadfd(void); INCLUDE "input.h" INCLUDE "error.h" -INIT { - extern char basebuf[]; +MKINIT char basebuf[]; +INIT { basepf.nextc = basepf.buf = basebuf; } Modified: stable/8/bin/sh/jobs.c ============================================================================== --- stable/8/bin/sh/jobs.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/jobs.c Sun Oct 3 21:56:20 2010 (r213390) @@ -92,7 +92,7 @@ STATIC struct job *getjob(char *); STATIC pid_t dowait(int, struct job *); STATIC pid_t waitproc(int, int *); STATIC void cmdtxt(union node *); -STATIC void cmdputs(char *); +STATIC void cmdputs(const char *); #if JOBS STATIC void setcurjob(struct job *); STATIC void deljob(struct job *); @@ -1088,7 +1088,7 @@ cmdtxt(union node *n) { union node *np; struct nodelist *lp; - char *p; + const char *p; int i; char s[2]; @@ -1217,9 +1217,10 @@ redir: STATIC void -cmdputs(char *s) +cmdputs(const char *s) { - char *p, *q; + const char *p; + char *q; char c; int subtype = 0; Modified: stable/8/bin/sh/main.c ============================================================================== --- stable/8/bin/sh/main.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/main.c Sun Oct 3 21:56:20 2010 (r213390) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); int rootpid; int rootshell; -STATIC void read_profile(char *); +STATIC void read_profile(const char *); STATIC char *find_dot_file(char *); /* @@ -250,7 +250,7 @@ cmdloop(int top) */ STATIC void -read_profile(char *name) +read_profile(const char *name) { int fd; @@ -336,8 +336,6 @@ dotcmd(int argc, char **argv) int exitcmd(int argc, char **argv) { - extern int oexitstatus; - if (stoppedjobs()) return 0; if (argc > 1) Modified: stable/8/bin/sh/miscbltin.c ============================================================================== --- stable/8/bin/sh/miscbltin.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/miscbltin.c Sun Oct 3 21:56:20 2010 (r213390) @@ -93,7 +93,7 @@ readcmd(int argc __unused, char **argv _ char c; int rflag; char *prompt; - char *ifs; + const char *ifs; char *p; int startword; int status; @@ -255,7 +255,7 @@ readcmd(int argc __unused, char **argv _ int -umaskcmd(int argc __unused, char **argv) +umaskcmd(int argc __unused, char **argv __unused) { char *ap; int mask; Modified: stable/8/bin/sh/mkbuiltins ============================================================================== --- stable/8/bin/sh/mkbuiltins Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/mkbuiltins Sun Oct 3 21:56:20 2010 (r213390) @@ -88,7 +88,7 @@ tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJ awk '{ printf "#define %s %d\n", $1, NR-1}' echo ' struct builtincmd { - char *name; + const char *name; int code; int special; }; Modified: stable/8/bin/sh/mkinit.c ============================================================================== --- stable/8/bin/sh/mkinit.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/mkinit.c Sun Oct 3 21:56:20 2010 (r213390) @@ -102,9 +102,9 @@ struct block { */ struct event { - char *name; /* name of event (e.g. INIT) */ - char *routine; /* name of routine called on event */ - char *comment; /* comment describing routine */ + const char *name; /* name of event (e.g. INIT) */ + const char *routine; /* name of routine called on event */ + const char *comment; /* comment describing routine */ struct text code; /* code for handling event */ }; @@ -140,7 +140,7 @@ struct event event[] = { }; -char *curfile; /* current file */ +const char *curfile; /* current file */ int linno; /* current line */ char *header_files[200]; /* list of header files */ struct text defines; /* #define statements */ @@ -148,20 +148,20 @@ struct text decls; /* declarations */ int amiddecls; /* for formatting */ -void readfile(char *); -int match(char *, char *); -int gooddefine(char *); -void doevent(struct event *, FILE *, char *); +void readfile(const char *); +int match(const char *, const char *); +int gooddefine(const char *); +void doevent(struct event *, FILE *, const char *); void doinclude(char *); void dodecl(char *, FILE *); void output(void); -void addstr(char *, struct text *); +void addstr(const char *, struct text *); void addchar(int, struct text *); void writetext(struct text *, FILE *); -FILE *ckfopen(char *, char *); +FILE *ckfopen(const char *, const char *); void *ckmalloc(size_t); -char *savestr(char *); -void error(char *); +char *savestr(const char *); +void error(const char *); #define equal(s1, s2) (strcmp(s1, s2) == 0) @@ -170,9 +170,9 @@ main(int argc __unused, char *argv[]) { char **ap; - header_files[0] = "\"shell.h\""; - header_files[1] = "\"mystring.h\""; - header_files[2] = "\"init.h\""; + header_files[0] = savestr("\"shell.h\""); + header_files[1] = savestr("\"mystring.h\""); + header_files[2] = savestr("\"init.h\""); for (ap = argv + 1 ; *ap ; ap++) readfile(*ap); output(); @@ -186,7 +186,7 @@ main(int argc __unused, char *argv[]) */ void -readfile(char *fname) +readfile(const char *fname) { FILE *fp; char line[1024]; @@ -230,9 +230,9 @@ readfile(char *fname) int -match(char *name, char *line) +match(const char *name, const char *line) { - char *p, *q; + const char *p, *q; p = name, q = line; while (*p) { @@ -246,9 +246,9 @@ match(char *name, char *line) int -gooddefine(char *line) +gooddefine(const char *line) { - char *p; + const char *p; if (! match("#define", line)) return 0; /* not a define */ @@ -269,11 +269,11 @@ gooddefine(char *line) void -doevent(struct event *ep, FILE *fp, char *fname) +doevent(struct event *ep, FILE *fp, const char *fname) { char line[1024]; int indent; - char *p; + const char *p; sprintf(line, "\n /* from %s: */\n", fname); addstr(line, &ep->code); @@ -407,7 +407,7 @@ output(void) */ void -addstr(char *s, struct text *text) +addstr(const char *s, struct text *text) { while (*s) { if (--text->nleft < 0) @@ -452,7 +452,7 @@ writetext(struct text *text, FILE *fp) } FILE * -ckfopen(char *file, char *mode) +ckfopen(const char *file, const char *mode) { FILE *fp; @@ -474,7 +474,7 @@ ckmalloc(size_t nbytes) } char * -savestr(char *s) +savestr(const char *s) { char *p; @@ -484,7 +484,7 @@ savestr(char *s) } void -error(char *msg) +error(const char *msg) { if (curfile != NULL) fprintf(stderr, "%s:%d: ", curfile, linno); Modified: stable/8/bin/sh/mksyntax.c ============================================================================== --- stable/8/bin/sh/mksyntax.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/mksyntax.c Sun Oct 3 21:56:20 2010 (r213390) @@ -55,8 +55,8 @@ __FBSDID("$FreeBSD$"); struct synclass { - char *name; - char *comment; + const char *name; + const char *comment; }; /* Syntax classes */ @@ -101,16 +101,16 @@ static char writer[] = "\ static FILE *cfile; static FILE *hfile; -static char *syntax[513]; +static const char *syntax[513]; static int base; static int size; /* number of values which a char variable can have */ static int nbits; /* number of bits in a character */ static int digit_contig;/* true if digits are contiguous */ -static void filltable(char *); +static void filltable(const char *); static void init(void); -static void add(char *, char *); -static void print(char *); +static void add(const char *, const char *); +static void print(const char *); static void output_type_macros(void); static void digit_convert(void); @@ -259,7 +259,7 @@ main(int argc __unused, char **argv __un */ static void -filltable(char *dftval) +filltable(const char *dftval) { int i; @@ -293,7 +293,7 @@ init(void) */ static void -add(char *p, char *type) +add(const char *p, const char *type) { while (*p) syntax[*p++ + base] = type; @@ -306,7 +306,7 @@ add(char *p, char *type) */ static void -print(char *name) +print(const char *name) { int i; int col; @@ -338,7 +338,7 @@ print(char *name) * contiguous, we can test for them quickly. */ -static char *macro[] = { +static const char *macro[] = { "#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)", "#define is_eof(c)\t((c) == PEOF)", "#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))", @@ -351,7 +351,7 @@ static char *macro[] = { static void output_type_macros(void) { - char **pp; + const char **pp; if (digit_contig) macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)"; Modified: stable/8/bin/sh/mystring.c ============================================================================== --- stable/8/bin/sh/mystring.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/mystring.c Sun Oct 3 21:56:20 2010 (r213390) @@ -108,7 +108,7 @@ int number(const char *s) { if (! is_number(s)) - error("Illegal number: %s", (char *)s); + error("Illegal number: %s", s); return atoi(s); } Modified: stable/8/bin/sh/options.c ============================================================================== --- stable/8/bin/sh/options.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/options.c Sun Oct 3 21:56:20 2010 (r213390) @@ -64,7 +64,7 @@ char *arg0; /* value of $0 */ struct shparam shellparam; /* current positional parameters */ char **argptr; /* argument list for builtin commands */ char *shoptarg; /* set by nextopt (like getopt) */ -char *optptr; /* used by nextopt */ +char *nextopt_optptr; /* used by nextopt */ char *minusc; /* argument to -c option */ @@ -560,7 +560,7 @@ nextopt(const char *optstring) const char *q; char c; - if ((p = optptr) == NULL || *p == '\0') { + if ((p = nextopt_optptr) == NULL || *p == '\0') { p = *argptr; if (p == NULL || *p != '-' || *++p == '\0') return '\0'; @@ -581,6 +581,6 @@ nextopt(const char *optstring) shoptarg = p; p = NULL; } - optptr = p; + nextopt_optptr = p; return c; } Modified: stable/8/bin/sh/options.h ============================================================================== --- stable/8/bin/sh/options.h Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/options.h Sun Oct 3 21:56:20 2010 (r213390) @@ -102,7 +102,7 @@ extern char *arg0; /* $0 */ extern struct shparam shellparam; /* $@ */ extern char **argptr; /* argument list for builtin commands */ extern char *shoptarg; /* set by nextopt */ -extern char *optptr; /* used by nextopt */ +extern char *nextopt_optptr; /* used by nextopt */ void procargs(int, char **); void optschanged(void); Modified: stable/8/bin/sh/parser.c ============================================================================== --- stable/8/bin/sh/parser.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/parser.c Sun Oct 3 21:56:20 2010 (r213390) @@ -115,7 +115,7 @@ STATIC int xxreadtoken(void); STATIC int readtoken1(int, char const *, char *, int); STATIC int noexpand(char *); STATIC void synexpect(int); -STATIC void synerror(char *); +STATIC void synerror(const char *); STATIC void setprompt(int); @@ -1555,7 +1555,7 @@ synexpect(int token) STATIC void -synerror(char *msg) +synerror(const char *msg) { if (commandname) outfmt(&errout, "%s: %d: ", commandname, startlinno); @@ -1584,13 +1584,14 @@ getprompt(void *unused __unused) static char ps[PROMPTLEN]; char *fmt; int i, j, trim; + static char internal_error[] = ""; /* * Select prompt format. */ switch (whichprompt) { case 0: - fmt = ""; + fmt = nullstr; break; case 1: fmt = ps1val(); @@ -1599,7 +1600,7 @@ getprompt(void *unused __unused) fmt = ps2val(); break; default: - return ""; + return internal_error; } /* Modified: stable/8/bin/sh/parser.h ============================================================================== --- stable/8/bin/sh/parser.h Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/parser.h Sun Oct 3 21:56:20 2010 (r213390) @@ -73,6 +73,7 @@ extern int tokpushback; #define NEOF ((union node *)&tokpushback) extern int whichprompt; /* 1 == PS1, 2 == PS2 */ +extern const char *const parsekwd[]; union node *parsecmd(int); Modified: stable/8/bin/sh/var.c ============================================================================== --- stable/8/bin/sh/var.c Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/var.c Sun Oct 3 21:56:20 2010 (r213390) @@ -132,9 +132,9 @@ STATIC int localevar(const char *); #ifdef mkinit INCLUDE "var.h" +MKINIT char **environ; INIT { char **envp; - extern char **environ; initvar(); for (envp = environ ; *envp ; envp++) { @@ -255,11 +255,11 @@ setvar(const char *name, const char *val STATIC int localevar(const char *s) { - static char *lnames[7] = { + static const char *lnames[7] = { "ALL", "COLLATE", "CTYPE", "MONETARY", "NUMERIC", "TIME", NULL }; - char **ss; + const char **ss; if (*s != 'L') return 0; @@ -471,9 +471,9 @@ environment(void) * VSTACK set since these are currently allocated on the stack. */ -#ifdef mkinit MKINIT void shprocvar(void); +#ifdef mkinit SHELLPROC { shprocvar(); } Modified: stable/8/bin/sh/var.h ============================================================================== --- stable/8/bin/sh/var.h Sun Oct 3 20:09:19 2010 (r213389) +++ stable/8/bin/sh/var.h Sun Oct 3 21:56:20 2010 (r213390) @@ -108,7 +108,6 @@ void listsetvar(struct strlist *); char *lookupvar(const char *); char *bltinlookup(const char *, int); char **environment(void); -void shprocvar(void); int showvarscmd(int, char **); int exportcmd(int, char **); int localcmd(int, char **); From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 22:24:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 270DE106566B; Sun, 3 Oct 2010 22:24:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15A2B8FC08; Sun, 3 Oct 2010 22:24: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 o93MOET2092213; Sun, 3 Oct 2010 22:24:14 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93MOEGj092210; Sun, 3 Oct 2010 22:24:14 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010032224.o93MOEGj092210@svn.freebsd.org> From: Gordon Tetlow Date: Sun, 3 Oct 2010 22:24: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: r213391 - in head: gnu/usr.bin usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 22:24:15 -0000 Author: gordon Date: Sun Oct 3 22:24:14 2010 New Revision: 213391 URL: http://svn.freebsd.org/changeset/base/213391 Log: Retire GNU man in favor of the newly written BSDL version. Approved by: wes (mentor) Modified: head/gnu/usr.bin/Makefile head/usr.bin/Makefile Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Sun Oct 3 21:56:20 2010 (r213390) +++ head/gnu/usr.bin/Makefile Sun Oct 3 22:24:14 2010 (r213391) @@ -13,7 +13,6 @@ SUBDIR= ${_binutils} \ ${_gperf} \ ${_grep} \ ${_groff} \ - ${_man} \ patch \ ${_rcs} \ sdiff \ @@ -44,10 +43,6 @@ _dtc= dtc _texinfo= texinfo .endif -.if ${MK_MAN_UTILS} != "no" -_man= man -.endif - .if ${MK_RCS} != "no" _rcs= rcs .endif Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sun Oct 3 21:56:20 2010 (r213390) +++ head/usr.bin/Makefile Sun Oct 3 22:24:14 2010 (r213391) @@ -5,7 +5,7 @@ # XXX MISSING: deroff diction graph learn plot # spell spline struct xsend -# XXX Use GNU versions: apropos diff ld man patch whatis +# XXX Use GNU versions: diff ld patch # Moved to secure: bdes # @@ -94,6 +94,7 @@ SUBDIR= alias \ lzmainfo \ m4 \ ${_makewhatis} \ + ${_man} \ mesg \ minigzip \ ministat \ @@ -266,6 +267,7 @@ SUBDIR+= make .if ${MK_MAN_UTILS} != "no" _makewhatis= makewhatis +_man= man .endif .if ${MK_NETCAT} != "no" From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 22:59:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 756DE1065674; Sun, 3 Oct 2010 22:59:35 +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 359F38FC17; Sun, 3 Oct 2010 22:59:35 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:9dad:5e85:9a1:37cf] (unknown [IPv6:2001:7b8:3a7:0:9dad:5e85:9a1:37cf]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 7A60C5C43; Mon, 4 Oct 2010 00:59:34 +0200 (CEST) Message-ID: <4CA90ADF.60707@FreeBSD.org> Date: Mon, 04 Oct 2010 00:59:43 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.12pre) Gecko/20101001 Lanikai/3.1.5pre MIME-Version: 1.0 To: Gordon Tetlow References: <201010032224.o93MOEGj092210@svn.freebsd.org> In-Reply-To: <201010032224.o93MOEGj092210@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: r213391 - in head: gnu/usr.bin usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 22:59:35 -0000 On 2010-10-04 00:24, Gordon Tetlow wrote: > Author: gordon > Date: Sun Oct 3 22:24:14 2010 > New Revision: 213391 > URL: http://svn.freebsd.org/changeset/base/213391 > > Log: > Retire GNU man in favor of the newly written BSDL version. And there was much rejoicing. :) From owner-svn-src-all@FreeBSD.ORG Sun Oct 3 23:43:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41B3E106566B; Sun, 3 Oct 2010 23:43:24 +0000 (UTC) (envelope-from kato@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FBA88FC17; Sun, 3 Oct 2010 23:43: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 o93NhOhQ093879; Sun, 3 Oct 2010 23:43:24 GMT (envelope-from kato@svn.freebsd.org) Received: (from kato@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o93NhOlX093876; Sun, 3 Oct 2010 23:43:24 GMT (envelope-from kato@svn.freebsd.org) Message-Id: <201010032343.o93NhOlX093876@svn.freebsd.org> From: KATO Takenori Date: Sun, 3 Oct 2010 23:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213393 - stable/6/sys/pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 23:43:24 -0000 Author: kato Date: Sun Oct 3 23:43:23 2010 New Revision: 213393 URL: http://svn.freebsd.org/changeset/base/213393 Log: MF revision 184327 except for the default algorithm. The improved IDE HDD geometry adjustment is merged but default algorithm is not changed in this branch. This commit allows 6-stable user to test new algorithm before complete upgrading to 7 or later. Modified: stable/6/sys/pc98/pc98/pc98_machdep.c stable/6/sys/pc98/pc98/pc98_machdep.h Modified: stable/6/sys/pc98/pc98/pc98_machdep.c ============================================================================== --- stable/6/sys/pc98/pc98/pc98_machdep.c Sun Oct 3 23:40:54 2010 (r213392) +++ stable/6/sys/pc98/pc98/pc98_machdep.c Sun Oct 3 23:43:23 2010 (r213393) @@ -36,15 +36,23 @@ #include #include -#include -#include #include #include #include +#include +#include +#include +#include #include #include #include +static int ad_geom_method = AD_GEOM_ADJUST_COMPATCYL16; + +TUNABLE_INT("machdep.ad_geom_method", &ad_geom_method); +SYSCTL_INT(_machdep, OID_AUTO, ad_geom_method, CTLFLAG_RW, &ad_geom_method, 0, + "IDE disk geometry conversion method"); + /* * Initialize DMA controller */ @@ -198,12 +206,62 @@ scsi_da_bios_params(struct ccb_calc_geom } /* - * Get the geometry of the ATA HDD from the BIOS work area. - * - * XXX for now, we hack it + * Adjust the geometry of the IDE HDD. */ -void -pc98_ad_firmware_geom_adjust(device_t dev, struct disk *disk) + +/* IDE BIOS compatible mode. */ +static void +pc98_ad_geom_adjust_idebios(struct disk *disk) +{ + + if (disk->d_mediasize < MEDIASIZE_4_3G) { + disk->d_fwsectors = 17; + disk->d_fwheads = 8; + } else if (disk->d_mediasize < MEDIASIZE_29_5G) { + disk->d_fwsectors = 63; + if (disk->d_fwheads != 15) /* Allow 15H63S. */ + disk->d_fwheads = 16; + } else if (disk->d_mediasize < MEDIASIZE_31_5G) { + disk->d_fwsectors = 63; + disk->d_fwheads = 16; + } else if (disk->d_mediasize < MEDIASIZE_127G) { + disk->d_fwsectors = 255; + disk->d_fwheads = 16; + } else { + /* XXX */ + disk->d_fwsectors = 255; + disk->d_fwheads = 255; + } +} + +/* SCSI BIOS compatible mode. */ +static void +pc98_ad_geom_adjust_scsibios(struct disk *disk) +{ + + if (disk->d_mediasize < MEDIASIZE_8G) { + disk->d_fwsectors = 32; + disk->d_fwheads = 8; + } else if (disk->d_mediasize < MEDIASIZE_32G) { + disk->d_fwsectors = 128; + disk->d_fwheads = 8; + } else if (disk->d_mediasize < MEDIASIZE_60G) { + /* Compatible with IFC-USP 1.2. */ + disk->d_fwsectors = 128; + disk->d_fwheads = 15; + } else if (disk->d_mediasize < MEDIASIZE_120G) { + disk->d_fwsectors = 255; + disk->d_fwheads = 15; + } else { + /* XXX */ + disk->d_fwsectors = 255; + disk->d_fwheads = 255; + } +} + +/* Compatible with the revision 1.28. */ +static void +pc98_ad_geom_adjust_cyl16bit(struct disk *disk) { off_t totsec = disk->d_mediasize / disk->d_sectorsize; off_t cyl = totsec / disk->d_fwsectors / disk->d_fwheads; @@ -229,3 +287,35 @@ pc98_ad_firmware_geom_adjust(device_t de } } } + +void +pc98_ad_firmware_geom_adjust(device_t dev, struct disk *disk) +{ + u_int oldsectors, oldheads; + + oldsectors = disk->d_fwsectors; + oldheads = disk->d_fwheads; + + switch (ad_geom_method) { + case AD_GEOM_ADJUST_COMPATIDE: + pc98_ad_geom_adjust_idebios(disk); + break; + case AD_GEOM_ADJUST_COMPATSCSI: + pc98_ad_geom_adjust_scsibios(disk); + break; + case AD_GEOM_ADJUST_COMPATCYL16: + pc98_ad_geom_adjust_cyl16bit(disk); + break; + default: + /* Do nothing. */ + break; + } + + if (bootverbose && + (oldsectors != disk->d_fwsectors || oldheads != disk->d_fwheads)) + device_printf(dev, + "geometry adjusted from [%dH/%dS] to [%dH/%dS]\n", + oldheads, oldsectors, + disk->d_fwheads, disk->d_fwsectors); + +} Modified: stable/6/sys/pc98/pc98/pc98_machdep.h ============================================================================== --- stable/6/sys/pc98/pc98/pc98_machdep.h Sun Oct 3 23:40:54 2010 (r213392) +++ stable/6/sys/pc98/pc98/pc98_machdep.h Sun Oct 3 23:43:23 2010 (r213393) @@ -85,6 +85,21 @@ extern unsigned char pc98_system_paramet #define EPSON_PC486_SR 0x38 #define EPSON_PC486_HA 0x3b +/* IDE HDD geometry conversion. */ +#define AD_GEOM_ADJUST_NONE 0 /* Do nothing. */ +#define AD_GEOM_ADJUST_COMPATIDE 1 /* PC-98 IDE BIOS. */ +#define AD_GEOM_ADJUST_COMPATSCSI 2 /* PC-98 SCSI. */ +#define AD_GEOM_ADJUST_COMPATCYL16 100 /* Compat Rev. 1.28. */ + +#define MEDIASIZE_4_3G (4351LL * 1024LL * 1024LL) /* 4351M */ +#define MEDIASIZE_8G (8192LL * 1024LL * 1024LL) /* 8192M */ +#define MEDIASIZE_29_5G (30239LL * 1024LL * 1024LL) /* 30239M */ +#define MEDIASIZE_31_5G (32255LL * 1024 * 1024) /* 32255M */ +#define MEDIASIZE_32G (32768LL * 1024LL * 1024LL) /* 32768M */ +#define MEDIASIZE_60G (61440LL * 1024LL * 1024LL) /* 61440M */ +#define MEDIASIZE_120G (122400LL * 1024LL * 1024LL) /* 122400M */ +#define MEDIASIZE_127G (130558LL * 1024LL * 1024LL) /* 130558M */ + #endif /* _KERNEL */ #endif /* __PC98_PC98_PC98_MACHDEP_H__ */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 01:07:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 510E4106566C; Mon, 4 Oct 2010 01:07:05 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40B598FC1A; Mon, 4 Oct 2010 01:07: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 o94175rd095637; Mon, 4 Oct 2010 01:07:05 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94175b9095635; Mon, 4 Oct 2010 01:07:05 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010040107.o94175b9095635@svn.freebsd.org> From: Gordon Tetlow Date: Mon, 4 Oct 2010 01:07: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: r213394 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 01:07:05 -0000 Author: gordon Date: Mon Oct 4 01:07:04 2010 New Revision: 213394 URL: http://svn.freebsd.org/changeset/base/213394 Log: No longer install /etc/manpath.config since the BSDL man utilities don't use it. Approved by: wes (mentor) Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Oct 3 23:43:23 2010 (r213393) +++ head/etc/Makefile Mon Oct 4 01:07:04 2010 (r213394) @@ -68,10 +68,6 @@ BIN1+= hosts.lpd printcap BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc .endif -.if ${MK_MAN_UTILS} != "no" -BIN1+= ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config -.endif - .if ${MK_NTP} != "no" BIN1+= ntp.conf .endif From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 01:08:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD40110656AB; Mon, 4 Oct 2010 01:08:31 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACC2D8FC0A; Mon, 4 Oct 2010 01:08:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9418VIG095700; Mon, 4 Oct 2010 01:08:31 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9418Vcw095698; Mon, 4 Oct 2010 01:08:31 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010040108.o9418Vcw095698@svn.freebsd.org> From: Gordon Tetlow Date: Mon, 4 Oct 2010 01:08: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: r213395 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 01:08:31 -0000 Author: gordon Date: Mon Oct 4 01:08:31 2010 New Revision: 213395 URL: http://svn.freebsd.org/changeset/base/213395 Log: Bump __FreeBSD_version for switch from GNU man to BSDL man. Approved by: wes (mentor) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Oct 4 01:07:04 2010 (r213394) +++ head/sys/sys/param.h Mon Oct 4 01:08:31 2010 (r213395) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900021 /* Master, propagated to newvers */ +#define __FreeBSD_version 900022 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 06:17:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36185106566B; Mon, 4 Oct 2010 06:17:46 +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 25C878FC1D; Mon, 4 Oct 2010 06:17: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 o946HkDb002411; Mon, 4 Oct 2010 06:17:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o946HkOO002409; Mon, 4 Oct 2010 06:17:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010040617.o946HkOO002409@svn.freebsd.org> From: Xin LI Date: Mon, 4 Oct 2010 06:17: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: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 06:17:46 -0000 Author: delphij Date: Mon Oct 4 06:17:45 2010 New Revision: 213398 URL: http://svn.freebsd.org/changeset/base/213398 Log: Clarify the combination effect of -P and -f to make it clear. Submitted by: arundel MFC after: 2 weeks Modified: head/bin/rm/rm.1 Modified: head/bin/rm/rm.1 ============================================================================== --- head/bin/rm/rm.1 Mon Oct 4 05:56:29 2010 (r213397) +++ head/bin/rm/rm.1 Mon Oct 4 06:17:45 2010 (r213398) @@ -32,7 +32,7 @@ .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" $FreeBSD$ .\" -.Dd December 26, 2006 +.Dd October 3, 2010 .Dt RM 1 .Os .Sh NAME @@ -88,9 +88,13 @@ yet provides almost the same level of pr Overwrite regular files before deleting them. Files are overwritten three times, first with the byte pattern 0xff, then 0x00, and then 0xff again, before they are deleted. -Files with multiple links will not be overwritten nor deleted unless +Files with multiple links will not be overwritten nor deleted +and a warning will be issued. +If the .Fl f -is specified, a warning is generated instead. +option is specified, files with multiple links will also be overwritten +and deleted. +No warning will be issued. .Pp Specifying this flag for a read only file will cause .Nm From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 06:49:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 259031065673; Mon, 4 Oct 2010 06:49:13 +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 099378FC13; Mon, 4 Oct 2010 06:49: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 o946nCSB003158; Mon, 4 Oct 2010 06:49:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o946nC1J003156; Mon, 4 Oct 2010 06:49:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010040649.o946nC1J003156@svn.freebsd.org> From: Xin LI Date: Mon, 4 Oct 2010 06:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213399 - stable/8/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 06:49:13 -0000 Author: delphij Date: Mon Oct 4 06:49:12 2010 New Revision: 213399 URL: http://svn.freebsd.org/changeset/base/213399 Log: Revision 209601 should have merged this part of r203711 to make fmt(1) build unconditional. PR: misc/151180 Modified: stable/8/usr.bin/Makefile Directory Properties: stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) Modified: stable/8/usr.bin/Makefile ============================================================================== --- stable/8/usr.bin/Makefile Mon Oct 4 06:17:45 2010 (r213398) +++ stable/8/usr.bin/Makefile Mon Oct 4 06:49:12 2010 (r213399) @@ -64,7 +64,7 @@ SUBDIR= alias \ ${_file2c} \ find \ finger \ - ${_fmt} \ + fmt \ fold \ ${_from} \ fstat \ @@ -293,7 +293,6 @@ _locate= locate # XXX msgs? .if ${MK_MAIL} != "no" _biff= biff -_fmt= fmt _from= from _mail= mail _msgs= msgs From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 07:00:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2BC81065672; Mon, 4 Oct 2010 07:00:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91F638FC14; Mon, 4 Oct 2010 07:00: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 o9470l4t003542; Mon, 4 Oct 2010 07:00:47 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9470le8003540; Mon, 4 Oct 2010 07:00:47 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010040700.o9470le8003540@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Oct 2010 07:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213400 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 07:00:47 -0000 Author: bz Date: Mon Oct 4 07:00:47 2010 New Revision: 213400 URL: http://svn.freebsd.org/changeset/base/213400 Log: MFC r213325: Proper bracketing. Submitted by: SunMinghao (sunminghao hotmail.com) PR: kern/151100 Modified: stable/8/sys/netinet/igmp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/igmp.c ============================================================================== --- stable/8/sys/netinet/igmp.c Mon Oct 4 06:49:12 2010 (r213399) +++ stable/8/sys/netinet/igmp.c Mon Oct 4 07:00:47 2010 (r213400) @@ -1219,8 +1219,8 @@ igmp_input_v1_report(struct ifnet *ifp, if (ifp->if_flags & IFF_LOOPBACK) return (0); - if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr) || - !in_hosteq(igmp->igmp_group, ip->ip_dst))) { + if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr)) || + !in_hosteq(igmp->igmp_group, ip->ip_dst)) { IGMPSTAT_INC(igps_rcv_badreports); return (EINVAL); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 08:57:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3811106564A; Mon, 4 Oct 2010 08:57:05 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 891F48FC12; Mon, 4 Oct 2010 08:57:05 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id BE914C3BDA; Mon, 4 Oct 2010 10:40:46 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id DzTpnl+c84bC; Mon, 4 Oct 2010 10:40:46 +0200 (CEST) Received: from [10.0.0.79] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id 2A047C3BAF; Mon, 4 Oct 2010 10:40:46 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <201010020543.o925hIrY028836@svn.freebsd.org> Date: Mon, 4 Oct 2010 10:40:45 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <707050B9-8C7B-4700-83F0-9172E5A5B64A@semihalf.com> References: <201010020543.o925hIrY028836@svn.freebsd.org> To: Juli Mallett 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: r213346 - in head/sys: contrib/octeon-sdk mips/cavium mips/cavium/octe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 08:57:06 -0000 On 2010-10-02, at 07:43, Juli Mallett wrote: > Author: jmallett > Date: Sat Oct 2 05:43:17 2010 > New Revision: 213346 > URL: http://svn.freebsd.org/changeset/base/213346 >=20 > Log: > o) Allow devices to override the MDIO read and write functions = presented to > the miibus attached to octe interfaces. > o) Add an SMI/MDIO interface to the MV88E61XX and use it for the = switch PHY on > the Lanner MR-320. An actual driver for the switch PHY will come = later. > Note that for now it intercepts and fakes MII_BMSR reads to = prevent the > miibus from talking to anything but the switch itself. Hi Juli, Here's some related work we've done for this switch family, although not = fully featured (the user space config is still missing etc.) Maybe it = can ease your efforts somehow: = http://people.freebsd.org/~raj/misc/e6000sw.c Rafal From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 09:26:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 889A61065670; Mon, 4 Oct 2010 09:26:40 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 336F68FC08; Mon, 4 Oct 2010 09:26:31 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 229B545CD9; Mon, 4 Oct 2010 11:26:29 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 4214345CA6; Mon, 4 Oct 2010 11:26:24 +0200 (CEST) Date: Mon, 4 Oct 2010 11:25:59 +0200 From: Pawel Jakub Dawidek To: Xin LI Message-ID: <20101004092559.GB7322@garage.freebsd.pl> References: <201010040617.o946HkOO002409@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eAbsdosE1cNLO4uF" Content-Disposition: inline In-Reply-To: <201010040617.o946HkOO002409@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 09:26:40 -0000 --eAbsdosE1cNLO4uF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 04, 2010 at 06:17:46AM +0000, Xin LI wrote: > Author: delphij > Date: Mon Oct 4 06:17:45 2010 > New Revision: 213398 > URL: http://svn.freebsd.org/changeset/base/213398 >=20 > Log: > Clarify the combination effect of -P and -f to make it clear. While you're at it, it would be nice to add a note that this doesn't work with all file systems. In case of eg. ZFS the data won't be overwritten. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --eAbsdosE1cNLO4uF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkypnacACgkQForvXbEpPzSnmQCgm8EonD5XKSdNec1NQllUSzKk dZQAoJqFncXSYyPm06cbuX0avd/aumHU =1/IZ -----END PGP SIGNATURE----- --eAbsdosE1cNLO4uF-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 09:58:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 15BEA1065673; Mon, 4 Oct 2010 09:58:45 +0000 (UTC) Date: Mon, 4 Oct 2010 09:58:45 +0000 From: Alexander Best To: Pawel Jakub Dawidek Message-ID: <20101004095845.GA99361@freebsd.org> References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101004092559.GB7322@garage.freebsd.pl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 09:58:45 -0000 On Mon Oct 4 10, Pawel Jakub Dawidek wrote: > On Mon, Oct 04, 2010 at 06:17:46AM +0000, Xin LI wrote: > > Author: delphij > > Date: Mon Oct 4 06:17:45 2010 > > New Revision: 213398 > > URL: http://svn.freebsd.org/changeset/base/213398 > > > > Log: > > Clarify the combination effect of -P and -f to make it clear. > > While you're at it, it would be nice to add a note that this doesn't > work with all file systems. In case of eg. ZFS the data won't be > overwritten. isn't this detail already being covered by the existing note in the BUGS section? "The -P option assumes that the underlying file system is a fixed-block file system. UFS is a fixed-block file system, LFS is not. In addition, only regular files are overwritten, other types of files are not." cheers. alex > > -- > Pawel Jakub Dawidek http://www.wheelsystems.com > pjd@FreeBSD.org http://www.FreeBSD.org > FreeBSD committer Am I Evil? Yes, I Am! -- a13x From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 10:29:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 566111065673; Mon, 4 Oct 2010 10:29:48 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id F10928FC13; Mon, 4 Oct 2010 10:29:47 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 52F0045E6F; Mon, 4 Oct 2010 12:29:46 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id B6E7B45CD8; Mon, 4 Oct 2010 12:29:40 +0200 (CEST) Date: Mon, 4 Oct 2010 12:29:15 +0200 From: Pawel Jakub Dawidek To: Alexander Best Message-ID: <20101004102915.GG7322@garage.freebsd.pl> References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qM81t570OJUP5TU/" Content-Disposition: inline In-Reply-To: <20101004095845.GA99361@freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 10:29:48 -0000 --qM81t570OJUP5TU/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 04, 2010 at 09:58:45AM +0000, Alexander Best wrote: > On Mon Oct 4 10, Pawel Jakub Dawidek wrote: > > On Mon, Oct 04, 2010 at 06:17:46AM +0000, Xin LI wrote: > > > Author: delphij > > > Date: Mon Oct 4 06:17:45 2010 > > > New Revision: 213398 > > > URL: http://svn.freebsd.org/changeset/base/213398 > > >=20 > > > Log: > > > Clarify the combination effect of -P and -f to make it clear. > >=20 > > While you're at it, it would be nice to add a note that this doesn't > > work with all file systems. In case of eg. ZFS the data won't be > > overwritten. >=20 > isn't this detail already being covered by the existing note in the BUGS > section? >=20 > "The -P option assumes that the underlying file system is a fixed-bl= ock > file system. UFS is a fixed-block file system, LFS is not. In addi= tion, > only regular files are overwritten, other types of files are not." I missed that. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --qM81t570OJUP5TU/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkyprHsACgkQForvXbEpPzTtZwCg1IYn5vNGx2633UvJTrpa2qxb 4YoAnibzIvwcWqm4fVyhxEWWaB6fR+f6 =0UEr -----END PGP SIGNATURE----- --qM81t570OJUP5TU/-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 10:43:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28F33106566B; Mon, 4 Oct 2010 10:43:33 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id AB0918FC0C; Mon, 4 Oct 2010 10:43:31 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 6FD2145E6F; Mon, 4 Oct 2010 12:43:29 +0200 (CEST) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 05DD9456B1; Mon, 4 Oct 2010 12:43:22 +0200 (CEST) Date: Mon, 4 Oct 2010 12:42:57 +0200 From: Pawel Jakub Dawidek To: Dmitry Morozovsky Message-ID: <20101004104257.GH7322@garage.freebsd.pl> References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VkVuOCYP9O7H3CXI" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, Alexander Best , svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 10:43:33 -0000 --VkVuOCYP9O7H3CXI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 04, 2010 at 02:35:54PM +0400, Dmitry Morozovsky wrote: > On Mon, 4 Oct 2010, Alexander Best wrote: >=20 > AB> On Mon Oct 4 10, Pawel Jakub Dawidek wrote: > AB> > On Mon, Oct 04, 2010 at 06:17:46AM +0000, Xin LI wrote: > AB> > > Author: delphij > AB> > > Date: Mon Oct 4 06:17:45 2010 > AB> > > New Revision: 213398 > AB> > > URL: http://svn.freebsd.org/changeset/base/213398 > AB> > >=20 > AB> > > Log: > AB> > > Clarify the combination effect of -P and -f to make it clear. > AB> >=20 > AB> > While you're at it, it would be nice to add a note that this doesn't > AB> > work with all file systems. In case of eg. ZFS the data won't be > AB> > overwritten. > AB>=20 > AB> isn't this detail already being covered by the existing note in the B= UGS > AB> section? > AB>=20 > AB> "The -P option assumes that the underlying file system is a fixe= d-block > AB> file system. UFS is a fixed-block file system, LFS is not. In = addition, > AB> only regular files are overwritten, other types of files are not= ." >=20 > Maybe s/LFS/ZFS/ then, as LFS is no more relevant for FreeBSD users while= ZFS=20 > now is? That's what I thought too. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --VkVuOCYP9O7H3CXI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkypr7EACgkQForvXbEpPzT8XgCfXnIv1tb27sTPFJ3ZpQYkMNxx NQ4AoKNQek1o4ouwJW9Vtr5INwncsKfp =jM+W -----END PGP SIGNATURE----- --VkVuOCYP9O7H3CXI-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 10:47:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61F7D106564A; Mon, 4 Oct 2010 10:47:30 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id DDE928FC12; Mon, 4 Oct 2010 10:47:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id o94AZsRQ096262; Mon, 4 Oct 2010 14:35:54 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Mon, 4 Oct 2010 14:35:54 +0400 (MSD) From: Dmitry Morozovsky To: Alexander Best In-Reply-To: <20101004095845.GA99361@freebsd.org> Message-ID: References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (woozle.rinet.ru [0.0.0.0]); Mon, 04 Oct 2010 14:35:54 +0400 (MSD) Cc: svn-src-head@freebsd.org, Xin LI , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 10:47:30 -0000 On Mon, 4 Oct 2010, Alexander Best wrote: AB> On Mon Oct 4 10, Pawel Jakub Dawidek wrote: AB> > On Mon, Oct 04, 2010 at 06:17:46AM +0000, Xin LI wrote: AB> > > Author: delphij AB> > > Date: Mon Oct 4 06:17:45 2010 AB> > > New Revision: 213398 AB> > > URL: http://svn.freebsd.org/changeset/base/213398 AB> > > AB> > > Log: AB> > > Clarify the combination effect of -P and -f to make it clear. AB> > AB> > While you're at it, it would be nice to add a note that this doesn't AB> > work with all file systems. In case of eg. ZFS the data won't be AB> > overwritten. AB> AB> isn't this detail already being covered by the existing note in the BUGS AB> section? AB> AB> "The -P option assumes that the underlying file system is a fixed-block AB> file system. UFS is a fixed-block file system, LFS is not. In addition, AB> only regular files are overwritten, other types of files are not." Maybe s/LFS/ZFS/ then, as LFS is no more relevant for FreeBSD users while ZFS now is? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 10:48:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27272106566B; Mon, 4 Oct 2010 10:48:48 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16E318FC1D; Mon, 4 Oct 2010 10: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 o94Amlam010440; Mon, 4 Oct 2010 10:48:47 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94Amlao010438; Mon, 4 Oct 2010 10:48:47 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201010041048.o94Amlao010438@svn.freebsd.org> From: Poul-Henning Kamp Date: Mon, 4 Oct 2010 10:48: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: r213401 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 10:48:48 -0000 Author: phk Date: Mon Oct 4 10:48:47 2010 New Revision: 213401 URL: http://svn.freebsd.org/changeset/base/213401 Log: Certain static code analysis tools (FlexeLint being one) are very suspicious about 'l' and '1' being confused in numeric constants. The fear being that some old fart programmer might still think that he is using a Remmington Noiseless as input terminal device. An easy way to placate this fear is to use capital 'L' or to put the 'u' in unsigned constants in front of the 'l'. Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Mon Oct 4 07:00:47 2010 (r213400) +++ head/sys/sys/time.h Mon Oct 4 10:48:47 2010 (r213401) @@ -95,11 +95,11 @@ bintime_mul(struct bintime *bt, u_int x) { uint64_t p1, p2; - p1 = (bt->frac & 0xffffffffllu) * x; + p1 = (bt->frac & 0xffffffffull) * x; p2 = (bt->frac >> 32) * x + (p1 >> 32); bt->sec *= x; bt->sec += (p2 >> 32); - bt->frac = (p2 << 32) | (p1 & 0xffffffffllu); + bt->frac = (p2 << 32) | (p1 & 0xffffffffull); } #define bintime_clear(a) ((a)->sec = (a)->frac = 0) From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 11:42:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id EFEAE1065673; Mon, 4 Oct 2010 11:42:48 +0000 (UTC) Date: Mon, 4 Oct 2010 11:42:48 +0000 From: Alexander Best To: Pawel Jakub Dawidek Message-ID: <20101004114248.GA16641@freebsd.org> References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> <20101004104257.GH7322@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101004104257.GH7322@garage.freebsd.pl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI , Dmitry Morozovsky Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 11:42:49 -0000 On Mon Oct 4 10, Pawel Jakub Dawidek wrote: > On Mon, Oct 04, 2010 at 02:35:54PM +0400, Dmitry Morozovsky wrote: > > On Mon, 4 Oct 2010, Alexander Best wrote: > > > > AB> On Mon Oct 4 10, Pawel Jakub Dawidek wrote: > > AB> > On Mon, Oct 04, 2010 at 06:17:46AM +0000, Xin LI wrote: > > AB> > > Author: delphij > > AB> > > Date: Mon Oct 4 06:17:45 2010 > > AB> > > New Revision: 213398 > > AB> > > URL: http://svn.freebsd.org/changeset/base/213398 > > AB> > > > > AB> > > Log: > > AB> > > Clarify the combination effect of -P and -f to make it clear. > > AB> > > > AB> > While you're at it, it would be nice to add a note that this doesn't > > AB> > work with all file systems. In case of eg. ZFS the data won't be > > AB> > overwritten. > > AB> > > AB> isn't this detail already being covered by the existing note in the BUGS > > AB> section? > > AB> > > AB> "The -P option assumes that the underlying file system is a fixed-block > > AB> file system. UFS is a fixed-block file system, LFS is not. In addition, > > AB> only regular files are overwritten, other types of files are not." > > > > Maybe s/LFS/ZFS/ then, as LFS is no more relevant for FreeBSD users while ZFS > > now is? > > That's what I thought too. good point. ZFS should really be added to the list and LFS should go away. are there any other relevant filesystems without a fixed-block size that need to be mentioned? what about afs? or tmpfs? also: is this really something belonging into a BUGS section? personally i think the BUGS section in rm(1) should be renamed to CAVEATS. cheers. alex > > -- > Pawel Jakub Dawidek http://www.wheelsystems.com > pjd@FreeBSD.org http://www.FreeBSD.org > FreeBSD committer Am I Evil? Yes, I Am! -- a13x From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 12:36:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E36D106566B; Mon, 4 Oct 2010 12:36:11 +0000 (UTC) (envelope-from ivoras@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 EC1D28FC08; Mon, 4 Oct 2010 12:36:10 +0000 (UTC) Received: by qyk8 with SMTP id 8so3105831qyk.13 for ; Mon, 04 Oct 2010 05:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=R+gp7XJLK/xr317vRjBKtUPBJXdImFnoSYf+G5ibvms=; b=VJNt2f1i/44vfhfV1P+mlaf0mqSw+7l40exnL1WHHUetf6hQbvHUv1YBtGRBsRDQrl DMS5r8Ucx6ekqHa3p9n/CBpNxjyNKYu2BIaChGyUpC5GpbUCg8qRJDtk/rztQVGEDZlw u1zsPFmuabSXK78PcIG+DTkqa5Xbyobh3gXV0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=cnRexLlOfO8IDmRTpzZytUtkQxEaGH/WZPs/BYk5d7xrLGeTKVe2lIpmuDUtqBaV1Z eFYE2a+tQAhgSJocbPB9gjQuDT9VHrve02wUxfSFzbNJ0VY26ndGwxe/Cfpt6EDzFXNI ABLXxOik6lBBrtlFq4fYg3Bpqx4T92Rec2hbc= Received: by 10.224.1.42 with SMTP id 42mr6757640qad.91.1286193914988; Mon, 04 Oct 2010 05:05:14 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.234.81 with HTTP; Mon, 4 Oct 2010 05:04:53 -0700 (PDT) In-Reply-To: <20101004114248.GA16641@freebsd.org> References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> <20101004104257.GH7322@garage.freebsd.pl> <20101004114248.GA16641@freebsd.org> From: Ivan Voras Date: Mon, 4 Oct 2010 14:04:53 +0200 X-Google-Sender-Auth: vLqsa03tETecH0-h5cEe9eUAPYA Message-ID: To: Alexander Best Content-Type: text/plain; charset=UTF-8 Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Dmitry Morozovsky , Xin LI , svn-src-head@freebsd.org Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 12:36:11 -0000 On 4 October 2010 13:42, Alexander Best wrote: > good point. ZFS should really be added to the list and LFS should go away. are > there any other relevant filesystems without a fixed-block size that need to be > mentioned? what about afs? or tmpfs? (it's not that the block sizes aren't fixed, it's that the assignment of blocks to the file is not fixed). From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 14:32:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AB8E106564A; Mon, 4 Oct 2010 14:32:14 +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 786F58FC19; Mon, 4 Oct 2010 14:32: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 o94EWEXE016882; Mon, 4 Oct 2010 14:32:14 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94EWEAg016879; Mon, 4 Oct 2010 14:32:14 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010041432.o94EWEAg016879@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 4 Oct 2010 14:32: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: r213402 - head/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 14:32:14 -0000 Author: gnn Date: Mon Oct 4 14:32:14 2010 New Revision: 213402 URL: http://svn.freebsd.org/changeset/base/213402 Log: Fix punctuation and grammar, mostly by ending sentences with a period. MFC after: 1 day Modified: head/lib/libpmc/pmc.westmere.3 head/lib/libpmc/pmc.westmereuc.3 Modified: head/lib/libpmc/pmc.westmere.3 ============================================================================== --- head/lib/libpmc/pmc.westmere.3 Mon Oct 4 10:48:47 2010 (r213401) +++ head/lib/libpmc/pmc.westmere.3 Mon Oct 4 14:32:14 2010 (r213402) @@ -388,7 +388,7 @@ requests include both L1D demand RFO mis .It Li L2_RQSTS.RFOS .Pq Event 24H , Umask 0CH Counts all L2 store RFO requests. L2 RFO requests include both L1D demand -RFO misses as well as L1D RFO prefetches.. +RFO misses as well as L1D RFO prefetches. .It Li L2_RQSTS.IFETCH_HIT .Pq Event 24H , Umask 10H Counts number of instruction fetches that hit the L2 cache. L2 instruction @@ -474,13 +474,13 @@ This is a demand RFO request .It Li L2_WRITE.RFO.S_STATE .Pq Event 27H , Umask 02H Counts number of L2 store RFO requests where the cache line to be loaded is -in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch,. -This is a demand RFO request +in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch. +This is a demand RFO request. .It Li L2_WRITE.RFO.M_STATE .Pq Event 27H , Umask 08H Counts number of L2 store RFO requests where the cache line to be loaded is in the M (modified) state. The L1D prefetcher does not issue a RFO prefetch. -This is a demand RFO request +This is a demand RFO request. .It Li L2_WRITE.RFO.HIT .Pq Event 27H , Umask 0EH Counts number of L2 store RFO requests where the cache line to be loaded is @@ -491,7 +491,7 @@ This is a demand RFO request .Pq Event 27H , Umask 0FH Counts all L2 store RFO requests.The L1D prefetcher does not issue a RFO prefetch. -This is a demand RFO request +This is a demand RFO request. .It Li L2_WRITE.LOCK.I_STATE .Pq Event 27H , Umask 10H Counts number of L2 demand lock RFO requests where the cache line to be @@ -539,13 +539,13 @@ Counts all L1 writebacks to the L2. Counts uncore Last Level Cache references. Because cache hierarchy, cache sizes and other implementation-specific characteristics; value comparison to estimate performance differences is not recommended. -see Table A-1 +See Table A-1. .It Li L3_LAT_CACHE.MISS .Pq Event 2EH , Umask 01H Counts uncore Last Level Cache misses. Because cache hierarchy, cache sizes and other implementation-specific characteristics; value comparison to estimate performance differences is not recommended. -see Table A-1 +See Table A-1. .It Li CPU_CLK_UNHALTED.THREAD_P .Pq Event 3CH , Umask 00H Counts the number of thread cycles while the thread is not in a halt state. @@ -601,16 +601,16 @@ Counts Extended Page walk cycles. .It Li L1D.REPL .Pq Event 51H , Umask 01H Counts the number of lines brought into the L1 data cache. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_REPL .Pq Event 51H , Umask 02H Counts the number of modified lines brought into the L1 data cache. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_EVICT .Pq Event 51H , Umask 04H Counts the number of modified lines evicted from the L1 data cache due to replacement. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_SNOOP_EVICT .Pq Event 51H , Umask 08H Counts the number of modified lines evicted from the L1 data cache due to @@ -628,22 +628,22 @@ accepted into the fill buffer. .Pq Event 60H , Umask 01H Counts weighted cycles of offcore demand data read requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_CODE .Pq Event 60H , Umask 02H Counts weighted cycles of offcore demand code read requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.RFO .Pq Event 60H , Umask 04H Counts weighted cycles of offcore demand RFO requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.ANY.READ .Pq Event 60H , Umask 08H Counts weighted cycles of offcore read requests of any kind. Include L2 prefetch requests. -counter 0 +Ccounter 0. .It Li CACHE_LOCK_CYCLES.L1D_L2 .Pq Event 63H , Umask 01H Cycle count during which the L1D and L2 are locked. A lock is asserted when @@ -915,7 +915,7 @@ ports. This is a core count only and can .It Li UOPS_EXECUTED.PORT015 .Pq Event B1H , Umask 40H Counts number of Uops executed that where issued on port 0, 1, or 5. -use cmask=1, invert=1 to count stall cycles +Use cmask=1, invert=1 to count stall cycles. .It Li UOPS_EXECUTED.PORT234 .Pq Event B1H , Umask 80H Counts number of Uops executed that where issued on port 2, 3, or 4. @@ -928,18 +928,18 @@ Counts weighted cycles of snoopq request Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.INVALIDATE .Pq Event B3H , Umask 02H -Counts weighted cycles of snoopq invalidate requests. Counter 0 only +Counts weighted cycles of snoopq invalidate requests. Counter 0 only. Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.CODE .Pq Event B3H , Umask 04H -Counts weighted cycles of snoopq requests for code. Counter 0 only +Counts weighted cycles of snoopq requests for code. Counter 0 only. Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS.CODE .Pq Event B4H , Umask 01H -Counts the number of snoop code requests +Counts the number of snoop code requests. .It Li SNOOPQ_REQUESTS.DATA .Pq Event B4H , Umask 02H -Counts the number of snoop data requests +Counts the number of snoop data requests. .It Li SNOOPQ_REQUESTS.INVALIDATE .Pq Event B4H , Umask 04H Counts the number of snoop invalidate requests @@ -947,7 +947,7 @@ Counts the number of snoop invalidate re .Pq Event B7H , Umask 01H see Section 30.6.1.3, Off-core Response Performance Monitoring in the Processor Core. -Requires programming MSR 01A6H +Requires programming MSR 01A6H. .It Li SNOOP_RESPONSE.HIT .Pq Event B8H , Umask 01H Counts HIT snoop response sent by this thread in response to a snoop @@ -963,8 +963,8 @@ request. .It Li OFF_CORE_RESPONSE_1 .Pq Event BBH , Umask 01H see Section 30.6.1.3, Off-core Response Performance Monitoring in the -Processor Core -Use MSR 01A7H +Processor Core. +Use MSR 01A7H. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 01H See Table A-1 @@ -1007,21 +1007,21 @@ Counts the number of machine clears due Counts the number of times that a program writes to a code section. Self-modifying code causes a sever penalty in all Intel 64 and IA-32 processors. The modified cache line is written back to the L2 and L3caches. -.It Li BR_INST_RETIRED.ALL_BRANCHES +.It Li BR_INST_RETIRED.ANY_P .Pq Event C4H , Umask 00H -See Table A-1 +See Table A-1. .It Li BR_INST_RETIRED.CONDITIONAL .Pq Event C4H , Umask 01H Counts the number of conditional branch instructions retired. .It Li BR_INST_RETIRED.NEAR_CALL .Pq Event C4H , Umask 02H -Counts the number of direct & indirect near unconditional calls retired +Counts the number of direct & indirect near unconditional calls retired. .It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 04H -Counts the number of branch instructions retired -.It Li BR_MISP_RETIRED.ALL_BRANCHES +Counts the number of branch instructions retired. +.It Li BR_MISP_RETIRED.ANY_P .Pq Event C5H , Umask 00H -See Table A-1 +See Table A-1. .It Li BR_MISP_RETIRED.CONDITIONAL .Pq Event C5H , Umask 01H Counts mispredicted conditional retired calls. Modified: head/lib/libpmc/pmc.westmereuc.3 ============================================================================== --- head/lib/libpmc/pmc.westmereuc.3 Mon Oct 4 10:48:47 2010 (r213401) +++ head/lib/libpmc/pmc.westmereuc.3 Mon Oct 4 14:32:14 2010 (r213402) @@ -267,10 +267,10 @@ Number of responses to code or data read has the referenced line cached in the M state. .It Li SNP_RESP_TO_REMOTE_HOME.HITM .Pq Event 07H , Umask 24H -Number of HITM snoop responses to a remote home +Number of HITM snoop responses to a remote home. .It Li L3_HITS.READ .Pq Event 08H , Umask 01H -Number of code read, data read and RFO requests that hit in the L3 +Number of code read, data read and RFO requests that hit in the L3. .It Li L3_HITS.WRITE .Pq Event 08H , Umask 02H Number of writeback requests that hit in the L3. Writebacks from the cores @@ -715,7 +715,7 @@ qualified by mask value written to MSR 3 supported: 0: NONE 40000000_00000000H:RSPFWDI 40001A00_00000000H:RSPFWDS 40001D00_00000000H:RSPIWB -Match opcode/address by writing MSR 396H with mask supported mask value +Match opcode/address by writing MSR 396H with mask supported mask value. .It Li ADDR_OPCODE_MATCH.REMOTE .Pq Event 35H , Umask 02H Counts number of requests from the remote socket, address/opcode of request @@ -723,7 +723,7 @@ is qualified by mask value written to MS are supported: 0: NONE 40000000_00000000H:RSPFWDI 40001A00_00000000H:RSPFWDS 40001D00_00000000H:RSPIWB -Match opcode/address by writing MSR 396H with mask supported mask value +Match opcode/address by writing MSR 396H with mask supported mask value. .It Li ADDR_OPCODE_MATCH.LOCAL .Pq Event 35H , Umask 04H Counts number of requests from the local socket, address/opcode of request @@ -731,7 +731,7 @@ is qualified by mask value written to MS are supported: 0: NONE 40000000_00000000H:RSPFWDI 40001A00_00000000H:RSPFWDS 40001D00_00000000H:RSPIWB -Match opcode/address by writing MSR 396H with mask supported mask value +Match opcode/address by writing MSR 396H with mask supported mask value. .It Li QPI_TX_STALLED_SINGLE_FLIT.HOME.LINK_0 .Pq Event 40H , Umask 01H Counts cycles the Quickpath outbound link 0 HOME virtual channel is stalled From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 15:28:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F8BA1065673; Mon, 4 Oct 2010 15:28:01 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EFF38FC1B; Mon, 4 Oct 2010 15: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 o94FS1jg018330; Mon, 4 Oct 2010 15:28:01 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94FS1Ja018328; Mon, 4 Oct 2010 15:28:01 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201010041528.o94FS1Ja018328@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 4 Oct 2010 15: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: r213403 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 15:28:01 -0000 Author: ume Date: Mon Oct 4 15:28:01 2010 New Revision: 213403 URL: http://svn.freebsd.org/changeset/base/213403 Log: Clear errno for each method dispatch. Spotted by: Kostik Belousov MFC after: 2 weeks Modified: head/lib/libc/net/nsdispatch.c Modified: head/lib/libc/net/nsdispatch.c ============================================================================== --- head/lib/libc/net/nsdispatch.c Mon Oct 4 14:32:14 2010 (r213402) +++ head/lib/libc/net/nsdispatch.c Mon Oct 4 15:28:01 2010 (r213403) @@ -707,11 +707,13 @@ _nsdispatch(void *retval, const ns_dtab va_end(ap); } else { cache_flag = 0; + errno = 0; va_start(ap, defaults); result = method(retval, mdata, ap); va_end(ap); } #else /* NS_CACHING */ + errno = 0; va_start(ap, defaults); result = method(retval, mdata, ap); va_end(ap); From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 15:30:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16DB0106566B; Mon, 4 Oct 2010 15:30:09 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id B645C8FC16; Mon, 4 Oct 2010 15:30:08 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.4/8.14.4) with ESMTP/inet6 id o94FU2SI096918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Oct 2010 00:30:03 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Tue, 05 Oct 2010 00:30:02 +0900 Message-ID: From: Hajimu UMEMOTO To: Kostik Belousov In-Reply-To: <20101003184925.GA87647@deviant.kiev.zoral.com.ua> References: <201008130639.o7D6dsk1022779@svn.freebsd.org> <20101003184925.GA87647@deviant.kiev.zoral.com.ua> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.2 (i386-portbld-freebsd8.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.1-STABLE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Tue, 05 Oct 2010 00:30:03 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on asuka.mahoroba.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211276 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 15:30:09 -0000 Hi, >>>>> On Sun, 3 Oct 2010 21:49:26 +0300 >>>>> Kostik Belousov said: kostikbel> I suspect there is some subtle issue with the commit present. kostikbel> When getprotobyname_r() is unable to find the protocol, it seems kostikbel> that established behaviour is to return 0 and set *protoent to NULL. The behavior you mentioned is questionable to me. Though I cannot find the manpage of getprotobyname_r(3), there is following description in the manpage of gethostbyname_r(3) on CentOS: Glibc2 also has reentrant versions gethostbyname_r() and gethostbyname2_r(). These return 0 on success and non-zero on error. When getprotobyname_r(3) is unable to find the protocol, it should be treated as error, IMHO. My intention is that when getprotobyname_r(3) ends up with error but errno is zero, the return code should be non-zero (-1). kostikbel> The getprotobyname_r() in HEAD and stable/8, when the protocol kostikbel> cannot be found, return whatever value was present in errno at the time kostikbel> of the call. In anyway, errno should be cleared. I've just committed to clear errno for each method dispatch. kostikbel> When run with the argument "tcp1" on Linux, I get kostikbel> Res 0 errno 0 Success pres (nil) kostikbel> On the recent FreeBSD I get kostikbel> Res 25 errno 25 Inappropriate ioctl for device pres 0x0 kostikbel> (ENOTTY is from stdio). Now, it shows: Res -1 errno 22 Unknown error: 0 pres 0x0 (When strerror(3) is called with 0 for its argument, it set errno to EINVAL.) Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 15:39:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 061271065674; Mon, 4 Oct 2010 15:39:54 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA1EF8FC18; Mon, 4 Oct 2010 15:39:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o94FdrbD018621; Mon, 4 Oct 2010 15:39:53 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94Fdr6e018619; Mon, 4 Oct 2010 15:39:53 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010041539.o94Fdr6e018619@svn.freebsd.org> From: Gordon Tetlow Date: Mon, 4 Oct 2010 15:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213404 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 15:39:54 -0000 Author: gordon Date: Mon Oct 4 15:39:53 2010 New Revision: 213404 URL: http://svn.freebsd.org/changeset/base/213404 Log: Add updating entry for manpath.config deprecation. Approved by: wes (mentor) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 4 15:28:01 2010 (r213403) +++ head/UPDATING Mon Oct 4 15:39:53 2010 (r213404) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +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 + migrate local entries to the new format. + 20100915: A workaround for a fixed ld bug has been removed in kernel code, so make sure that your system ld is built from sources after From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 16:02:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7FA01065747; Mon, 4 Oct 2010 16:02:12 +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 D6A7D8FC0A; Mon, 4 Oct 2010 16:02: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 o94G2CDF019221; Mon, 4 Oct 2010 16:02:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94G2CkR019219; Mon, 4 Oct 2010 16:02:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010041602.o94G2CkR019219@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 4 Oct 2010 16:02: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: r213406 - head/libexec/rtld-elf/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 16:02:13 -0000 Author: nwhitehorn Date: Mon Oct 4 16:02:11 2010 New Revision: 213406 URL: http://svn.freebsd.org/changeset/base/213406 Log: Fix two subtle problems in PPC32 RTLD. The first is a concurrency issue where long PLT calls in multi-threaded environments could end up with incorrect jmptab values. The second is that, after the addition of extended PLT support, I forgot to update the PLT icache synchronization code to cover the extended PLT instead of just the basic PLT. MFC after: 10 days Modified: head/libexec/rtld-elf/powerpc/reloc.c Modified: head/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Mon Oct 4 15:48:03 2010 (r213405) +++ head/libexec/rtld-elf/powerpc/reloc.c Mon Oct 4 16:02:11 2010 (r213406) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "debug.h" @@ -481,6 +482,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr jmptab = obj->pltgot + JMPTAB_BASE(N); jmptab[reloff] = target; + powerpc_mb(); /* Order jmptab update before next changes */ if (reloff < PLT_EXTENDED_BEGIN) { /* for extended PLT entries, we keep the old code */ @@ -489,7 +491,8 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr /* li r11,reloff */ /* b pltcall # use indirect pltcall routine */ - wherep[0] = 0x39600000 | reloff; + + /* first instruction same as before */ wherep[1] = 0x48000000 | (distance & 0x03fffffc); __syncicache(wherep, 8); } @@ -577,7 +580,7 @@ init_pltgot(Obj_Entry *obj) * Sync the icache for the byte range represented by the * trampoline routines and call slots. */ - __syncicache(pltcall, 72 + N * 8); + __syncicache(obj->pltgot, JMPTAB_BASE(N)*4); } void From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 16:07:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2058106566C; Mon, 4 Oct 2010 16:07: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 C153B8FC19; Mon, 4 Oct 2010 16:07: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 o94G7mFt019384; Mon, 4 Oct 2010 16:07:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94G7mcQ019381; Mon, 4 Oct 2010 16:07:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010041607.o94G7mcQ019381@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 4 Oct 2010 16:07: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: r213407 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 16:07:48 -0000 Author: nwhitehorn Date: Mon Oct 4 16:07:48 2010 New Revision: 213407 URL: http://svn.freebsd.org/changeset/base/213407 Log: Follow exactly the steps in architecture manual for correctly invalidating TLB entries instead of trying to cut corners. Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon Oct 4 16:02:11 2010 (r213406) +++ head/sys/powerpc/aim/mmu_oea.c Mon Oct 4 16:07:48 2010 (r213407) @@ -425,9 +425,9 @@ tlbie(vm_offset_t va) { mtx_lock_spin(&tlbie_mtx); + __asm __volatile("ptesync"); __asm __volatile("tlbie %0" :: "r"(va)); - __asm __volatile("tlbsync"); - powerpc_sync(); + __asm __volatile("eieio; tlbsync; ptesync"); mtx_unlock_spin(&tlbie_mtx); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon Oct 4 16:02:11 2010 (r213406) +++ head/sys/powerpc/aim/mmu_oea64.c Mon Oct 4 16:07:48 2010 (r213407) @@ -211,14 +211,14 @@ TLBIE(uint64_t vpn) { mfmsr %0; \ mr %1, %0; \ insrdi %1,%5,1,0; \ - mtmsrd %1; \ + mtmsrd %1; isync; \ ptesync; \ \ sld %1,%2,%4; \ or %1,%1,%3; \ tlbie %1; \ \ - mtmsrd %0; \ + mtmsrd %0; isync; \ eieio; \ tlbsync; \ ptesync;" From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 16:34:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA865106564A; Mon, 4 Oct 2010 16:34:16 +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 E81C08FC08; Mon, 4 Oct 2010 16:34:15 +0000 (UTC) Received: by bwz15 with SMTP id 15so5011567bwz.13 for ; Mon, 04 Oct 2010 09:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=qb8tCAYXX+BDzVbd4uXo2qXm2dlt5P1XlnwGHIuUXp8=; b=WMT9i4cmovYx4VD9qA+cm1MU1ocGvCp2WTaYV3AqFleCqIa8yytDN5+iarrL6EbGkN NzWjHyuPCateo18mS45Lv7SvQJcJcqLUWNNX+OeqkFlD3IlFMn4EgQ1nsR8p7l39N8B8 xGNP+8Y3FGlkmEWuttY7mnrtLCneeY0+6OvVA= 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=ZsQiDDOWBIObU6GRfFP/poAM/4eXG50Q3HCxEF7QGJSp18vb4r5wstysgiq6W2GAfe u2G72m6w1SMWfDRqIieAzydbH4vbpPqLiWDdxsSavOK6FJ+r/wJzz0m227t6f4YB4Puv TUw033IWyUw+u0dWJcSinOQszdX8uy+6cMbdQ= MIME-Version: 1.0 Received: by 10.204.117.136 with SMTP id r8mr7198977bkq.119.1286208200665; Mon, 04 Oct 2010 09:03:20 -0700 (PDT) Received: by 10.220.192.196 with HTTP; Mon, 4 Oct 2010 09:03:20 -0700 (PDT) In-Reply-To: <20101004114248.GA16641@freebsd.org> References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> <20101004104257.GH7322@garage.freebsd.pl> <20101004114248.GA16641@freebsd.org> Date: Mon, 4 Oct 2010 12:03:20 -0400 Message-ID: From: Ben Kaduk To: Alexander Best 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: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 16:34:17 -0000 On Mon, Oct 4, 2010 at 7:42 AM, Alexander Best wrote: > On Mon Oct =A04 10, Pawel Jakub Dawidek wrote: >> On Mon, Oct 04, 2010 at 02:35:54PM +0400, Dmitry Morozovsky wrote: >> > On Mon, 4 Oct 2010, Alexander Best wrote: >> > AB> =A0 =A0 =A0"The -P option assumes that the underlying file system = is a fixed-block >> > AB> =A0 =A0 =A0file system. =A0UFS is a fixed-block file system, LFS i= s not. =A0In addition, >> > AB> =A0 =A0 =A0only regular files are overwritten, other types of file= s are not." >> > >> > Maybe s/LFS/ZFS/ then, as LFS is no more relevant for FreeBSD users wh= ile ZFS >> > now is? >> >> That's what I thought too. > > good point. ZFS should really be added to the list and LFS should go away= . are > there any other relevant filesystems without a fixed-block size that need= to be > mentioned? what about afs? or tmpfs? I'm not fully up-to-speed on the AFS fileserver backend, but it is certainly the case that AFS cannot guarantee that rm -P will actually overwrite the data on-disk. There are probably several mechanisms by which this could happen, the easiest to see of which would be if a filesystem like ZFS was used as the backing store for the fileserver partitions. > > also: is this really something belonging into a BUGS section? personally = i > think the BUGS section in rm(1) should be renamed to CAVEATS. BUGS is easier to find than CAVEATS, though I guess rm(1) is short enough that we can expect people to read the whole thing. -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 16:49:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55B52106566B; Mon, 4 Oct 2010 16:49:41 +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 39A0B8FC14; Mon, 4 Oct 2010 16:49: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 o94GnfET020350; Mon, 4 Oct 2010 16:49:41 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94Gnfa0020348; Mon, 4 Oct 2010 16:49:41 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201010041649.o94Gnfa0020348@svn.freebsd.org> From: Alan Cox Date: Mon, 4 Oct 2010 16:49: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: r213408 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 16:49:41 -0000 Author: alc Date: Mon Oct 4 16:49:40 2010 New Revision: 213408 URL: http://svn.freebsd.org/changeset/base/213408 Log: If vm_map_find() is asked to allocate a superpage-aligned region of virtual addresses that is greater than a superpage in size but not a multiple of the superpage size, then vm_map_find() is not always expanding the kernel pmap to support the last few small pages being allocated. These failures are not commonplace, so this was first noticed by someone porting FreeBSD to a new architecture. Previously, we grew the kernel page table in vm_map_findspace() when we found the first available virtual address. This works most of the time because we always grow the kernel pmap or page table by an amount that is a multiple of the superpage size. Now, instead, we defer the call to pmap_growkernel() until we are committed to a range of virtual addresses in vm_map_insert(). In general, there is another reason to prefer calling pmap_growkernel() in vm_map_insert(). It makes it possible for someone to do the equivalent of an mmap(MAP_FIXED) on the kernel map. Reported by: Svatopluk Kraus Reviewed by: kib@ MFC after: 3 weeks Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Oct 4 16:07:48 2010 (r213407) +++ head/sys/vm/vm_map.c Mon Oct 4 16:49:40 2010 (r213408) @@ -1163,6 +1163,9 @@ vm_map_insert(vm_map_t map, vm_object_t } charged: + /* Expand the kernel pmap, if necessary. */ + if (map == kernel_map && end > kernel_vm_end) + pmap_growkernel(end); if (object != NULL) { /* * OBJ_ONEMAPPING must be cleared unless this mapping @@ -1299,7 +1302,7 @@ vm_map_findspace(vm_map_t map, vm_offset vm_offset_t *addr) /* OUT */ { vm_map_entry_t entry; - vm_offset_t end, st; + vm_offset_t st; /* * Request must fit within min/max VM address and must avoid @@ -1313,7 +1316,7 @@ vm_map_findspace(vm_map_t map, vm_offset /* Empty tree means wide open address space. */ if (map->root == NULL) { *addr = start; - goto found; + return (0); } /* @@ -1323,7 +1326,7 @@ vm_map_findspace(vm_map_t map, vm_offset map->root = vm_map_entry_splay(start, map->root); if (start + length <= map->root->start) { *addr = start; - goto found; + return (0); } /* @@ -1334,7 +1337,7 @@ vm_map_findspace(vm_map_t map, vm_offset st = (start > map->root->end) ? start : map->root->end; if (length <= map->root->end + map->root->adj_free - st) { *addr = st; - goto found; + return (0); } /* With max_free, can immediately tell if no solution. */ @@ -1352,22 +1355,13 @@ vm_map_findspace(vm_map_t map, vm_offset entry = entry->left; else if (entry->adj_free >= length) { *addr = entry->end; - goto found; + return (0); } else entry = entry->right; } /* Can't get here, so panic if we do. */ panic("vm_map_findspace: max_free corrupt"); - -found: - /* Expand the kernel pmap, if necessary. */ - if (map == kernel_map) { - end = round_page(*addr + length); - if (end > kernel_vm_end) - pmap_growkernel(end); - } - return (0); } int From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 17:22:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CCCC1065672; Mon, 4 Oct 2010 17:22:19 +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 2C0448FC26; Mon, 4 Oct 2010 17:22: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 o94HMJ1S021247; Mon, 4 Oct 2010 17:22:19 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94HMJxe021245; Mon, 4 Oct 2010 17:22:19 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010041722.o94HMJxe021245@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 4 Oct 2010 17:22: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: r213409 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 17:22:19 -0000 Author: gnn Date: Mon Oct 4 17:22:18 2010 New Revision: 213409 URL: http://svn.freebsd.org/changeset/base/213409 Log: Fix two aliases that had the same name but were pointing to different events. These are now disamiguated. MFC after: 1 week Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Mon Oct 4 16:49:40 2010 (r213408) +++ head/sys/dev/hwpmc/pmc_events.h Mon Oct 4 17:22:18 2010 (r213409) @@ -2243,11 +2243,11 @@ __PMC_EV_ALIAS("UOPS_RETIRED.MACRO_FUSED __PMC_EV_ALIAS("MACHINE_CLEARS.CYCLES", IAP_EVENT_C3H_01H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.MEM_ORDER", IAP_EVENT_C3H_02H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.SMC", IAP_EVENT_C3H_04H) \ -__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_00H) \ +__PMC_EV_ALIAS("BR_INST_RETIRED.ANY_P", IAP_EVENT_C4H_00H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.CONDITIONAL", IAP_EVENT_C4H_01H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_CALL", IAP_EVENT_C4H_02H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_04H) \ -__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \ +__PMC_EV_ALIAS("BR_MISP_RETIRED.ANY_P", IAP_EVENT_C5H_00H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_CALL", IAP_EVENT_C5H_02H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 17:41:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF9591065670; Mon, 4 Oct 2010 17:41:02 +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 4B7AF8FC12; Mon, 4 Oct 2010 17:41:01 +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 o94Heib7067744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Oct 2010 20:40:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o94Heip7025973; Mon, 4 Oct 2010 20:40:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o94Hei1D025972; Mon, 4 Oct 2010 20:40:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Oct 2010 20:40:44 +0300 From: Kostik Belousov To: Hajimu UMEMOTO Message-ID: <20101004174044.GU2392@deviant.kiev.zoral.com.ua> References: <201008130639.o7D6dsk1022779@svn.freebsd.org> <20101003184925.GA87647@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TegBI+r9roYdcP94" Content-Disposition: inline In-Reply-To: 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: r211276 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 17:41:02 -0000 --TegBI+r9roYdcP94 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 05, 2010 at 12:30:02AM +0900, Hajimu UMEMOTO wrote: > Hi, >=20 > >>>>> On Sun, 3 Oct 2010 21:49:26 +0300 > >>>>> Kostik Belousov said: >=20 > kostikbel> I suspect there is some subtle issue with the commit present. > kostikbel> When getprotobyname_r() is unable to find the protocol, it see= ms > kostikbel> that established behaviour is to return 0 and set *protoent to= NULL. >=20 > The behavior you mentioned is questionable to me. Though I cannot > find the manpage of getprotobyname_r(3), there is following > description in the manpage of gethostbyname_r(3) on CentOS: >=20 > Glibc2 also has reentrant versions gethostbyname_r() and > gethostbyname2_r(). These return 0 on success and non-zero on > error. >=20 > When getprotobyname_r(3) is unable to find the protocol, it should be > treated as error, IMHO. My intention is that when getprotobyname_r(3) > ends up with error but errno is zero, the return code should be > non-zero (-1). >=20 > kostikbel> The getprotobyname_r() in HEAD and stable/8, when the protocol > kostikbel> cannot be found, return whatever value was present in errno at= the time > kostikbel> of the call. >=20 > In anyway, errno should be cleared. I've just committed to clear > errno for each method dispatch. >=20 > kostikbel> When run with the argument "tcp1" on Linux, I get > kostikbel> Res 0 errno 0 Success pres (nil) > kostikbel> On the recent FreeBSD I get > kostikbel> Res 25 errno 25 Inappropriate ioctl for device pres 0x0 > kostikbel> (ENOTTY is from stdio). >=20 > Now, it shows: >=20 > Res -1 errno 22 Unknown error: 0 pres 0x0 >=20 > (When strerror(3) is called with 0 for its argument, it set errno to > EINVAL.) Yes, I saw that commit. And there is a software in wild that does expect return value 0 and NULL returned pointer when protocol was not found, as opposed to some processing error. The interpretation of non-zero error code is "We did something wrong, or system configuration is wrong, etc". While zero error code and NULL pointer is perceived as "Wrong protocol name supplied". Solaris uses different API, I think we better follow Linux if we selected the Linux API variant. --TegBI+r9roYdcP94 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyqEZsACgkQC3+MBN1Mb4jaLQCg51fw0ir7iYv4G4ZTz8azNHgw P1wAnAzvFVgqbS+dViZxbBFNlrEJMroz =aFBi -----END PGP SIGNATURE----- --TegBI+r9roYdcP94-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 18:01:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A5D81065673; Mon, 4 Oct 2010 18:01:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 692F68FC15; Mon, 4 Oct 2010 18:01: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 o94I1NHu022269; Mon, 4 Oct 2010 18:01:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94I1NR0022267; Mon, 4 Oct 2010 18:01:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010041801.o94I1NR0022267@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 4 Oct 2010 18:01: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: r213410 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 18:01:23 -0000 Author: yongari Date: Mon Oct 4 18:01:23 2010 New Revision: 213410 URL: http://svn.freebsd.org/changeset/base/213410 Log: Consistently use ifHCOutOctets/ifHCInOctets instead of Octets as these names are used in data sheet. Also use UnicastPkts, MulticastPkts and BroadcastPkts instead of UcastPkts, McastPkts and BcastPkts to clarify its meaning. Suggested by: bde Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Oct 4 17:22:18 2010 (r213409) +++ head/sys/dev/bge/if_bge.c Mon Oct 4 18:01:23 2010 (r213410) @@ -5092,11 +5092,11 @@ bge_add_sysctl_stats(struct bge_softc *s NULL, "BGE RX Statistics"); children = SYSCTL_CHILDREN(tree); BGE_SYSCTL_STAT(sc, ctx, "Inbound Octets", - children, rxstats.ifHCInOctets, "Octets"); + children, rxstats.ifHCInOctets, "ifHCInOctets"); BGE_SYSCTL_STAT(sc, ctx, "Fragments", children, rxstats.etherStatsFragments, "Fragments"); BGE_SYSCTL_STAT(sc, ctx, "Inbound Unicast Packets", - children, rxstats.ifHCInUcastPkts, "UcastPkts"); + children, rxstats.ifHCInUcastPkts, "UnicastPkts"); BGE_SYSCTL_STAT(sc, ctx, "Inbound Multicast Packets", children, rxstats.ifHCInMulticastPkts, "MulticastPkts"); BGE_SYSCTL_STAT(sc, ctx, "FCS Errors", @@ -5128,7 +5128,7 @@ bge_add_sysctl_stats(struct bge_softc *s NULL, "BGE TX Statistics"); children = SYSCTL_CHILDREN(tree); BGE_SYSCTL_STAT(sc, ctx, "Outbound Octets", - children, txstats.ifHCOutOctets, "Octets"); + children, txstats.ifHCOutOctets, "ifHCOutOctets"); BGE_SYSCTL_STAT(sc, ctx, "TX Collisions", children, txstats.etherStatsCollisions, "Collisions"); BGE_SYSCTL_STAT(sc, ctx, "XON Sent", @@ -5156,7 +5156,7 @@ bge_add_sysctl_stats(struct bge_softc *s children, txstats.dot3StatsLateCollisions, "LateCollisions"); BGE_SYSCTL_STAT(sc, ctx, "Outbound Unicast Packets", - children, txstats.ifHCOutUcastPkts, "UcastPkts"); + children, txstats.ifHCOutUcastPkts, "UnicastPkts"); BGE_SYSCTL_STAT(sc, ctx, "Outbound Multicast Packets", children, txstats.ifHCOutMulticastPkts, "MulticastPkts"); BGE_SYSCTL_STAT(sc, ctx, "Outbound Broadcast Packets", @@ -5210,7 +5210,7 @@ bge_add_sysctl_stats_regs(struct bge_sof &stats->ifHCInOctets, "Inbound Octets"); BGE_SYSCTL_STAT_ADD64(ctx, child, "Fragments", &stats->etherStatsFragments, "Fragments"); - BGE_SYSCTL_STAT_ADD64(ctx, child, "UcastPkts", + BGE_SYSCTL_STAT_ADD64(ctx, child, "UnicastPkts", &stats->ifHCInUcastPkts, "Inbound Unicast Packets"); BGE_SYSCTL_STAT_ADD64(ctx, child, "MulticastPkts", &stats->ifHCInMulticastPkts, "Inbound Multicast Packets"); @@ -5238,7 +5238,7 @@ bge_add_sysctl_stats_regs(struct bge_sof tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", CTLFLAG_RD, NULL, "BGE TX Statistics"); child = SYSCTL_CHILDREN(tree); - BGE_SYSCTL_STAT_ADD64(ctx, child, "Octets", + BGE_SYSCTL_STAT_ADD64(ctx, child, "ifHCOutOctets", &stats->ifHCOutOctets, "Outbound Octets"); BGE_SYSCTL_STAT_ADD64(ctx, child, "Collisions", &stats->etherStatsCollisions, "TX Collisions"); @@ -5260,11 +5260,11 @@ bge_add_sysctl_stats_regs(struct bge_sof &stats->dot3StatsExcessiveCollisions, "Excessive Collisions"); BGE_SYSCTL_STAT_ADD64(ctx, child, "LateCollisions", &stats->dot3StatsLateCollisions, "Late Collisions"); - BGE_SYSCTL_STAT_ADD64(ctx, child, "UcastPkts", + BGE_SYSCTL_STAT_ADD64(ctx, child, "UnicastPkts", &stats->ifHCOutUcastPkts, "Outbound Unicast Packets"); - BGE_SYSCTL_STAT_ADD64(ctx, child, "McastPkts", + BGE_SYSCTL_STAT_ADD64(ctx, child, "MulticastPkts", &stats->ifHCOutMulticastPkts, "Outbound Multicast Packets"); - BGE_SYSCTL_STAT_ADD64(ctx, child, "BcastPkts", + BGE_SYSCTL_STAT_ADD64(ctx, child, "BroadcastPkts", &stats->ifHCOutBroadcastPkts, "Outbound Broadcast Packets"); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 18:09:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B6E2106564A; Mon, 4 Oct 2010 18:09:02 +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 40D068FC0C; Mon, 4 Oct 2010 18: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 o94I92xj022470; Mon, 4 Oct 2010 18:09:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94I92KT022467; Mon, 4 Oct 2010 18:09:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010041809.o94I92KT022467@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 4 Oct 2010 18: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: r213411 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 18:09:02 -0000 Author: yongari Date: Mon Oct 4 18:09:01 2010 New Revision: 213411 URL: http://svn.freebsd.org/changeset/base/213411 Log: Enable fix for read DMA FIFO overruns on controllers that have this fix. Note, we still need workaround for controllers that lacks this fix and it needs more work in RX BD updating. Submitted by: davidch Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Oct 4 18:01:23 2010 (r213410) +++ head/sys/dev/bge/if_bge.c Mon Oct 4 18:09:01 2010 (r213411) @@ -1858,6 +1858,19 @@ bge_blockinit(struct bge_softc *sc) sc->bge_asicrev == BGE_ASICREV_BCM57780) val |= BGE_RDMAMODE_TSO6_ENABLE; } + if (sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) { + /* + * Enable fix for read DMA FIFO overruns. + * The fix is to limit the number of RX BDs + * the hardware would fetch at a fime. + */ + CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, + CSR_READ_4(sc, BGE_RDMA_RSRVCTRL) | + BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); + } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Mon Oct 4 18:01:23 2010 (r213410) +++ head/sys/dev/bge/if_bgereg.h Mon Oct 4 18:09:01 2010 (r213411) @@ -1431,6 +1431,7 @@ */ #define BGE_RDMA_MODE 0x4800 #define BGE_RDMA_STATUS 0x4804 +#define BGE_RDMA_RSRVCTRL 0x4900 /* Read DMA mode register */ #define BGE_RDMAMODE_RESET 0x00000001 @@ -1462,6 +1463,9 @@ #define BGE_RDMASTAT_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_RDMASTAT_LOCWRITE_TOOBIG 0x00000200 +/* Read DMA Reserved Control register */ +#define BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004 + /* * Write DMA control registers */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 18:16:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B38E106566C; Mon, 4 Oct 2010 18:16:39 +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 0AE118FC1C; Mon, 4 Oct 2010 18:16: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 o94IGcEv022699; Mon, 4 Oct 2010 18:16:38 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94IGcDx022697; Mon, 4 Oct 2010 18:16:38 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010041816.o94IGcDx022697@svn.freebsd.org> From: Dimitry Andric Date: Mon, 4 Oct 2010 18:16: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: r213412 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 18:16:39 -0000 Author: dim Date: Mon Oct 4 18:16:38 2010 New Revision: 213412 URL: http://svn.freebsd.org/changeset/base/213412 Log: Change libvgl's set4pixels() and set2lines() functions from plain 'inline' to 'static inline'. Otherwise, a C99 compiler (such as clang) will output an undefined symbol for those functions in the resulting object file. (Even gcc will do this, when you use "-std=c99".) This should fix the "undefined reference to `set4pixels'" errors that some people were seeing during ports building, when their world was compiled with clang. Approved by: rpaulo (mentor) Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Mon Oct 4 18:09:01 2010 (r213411) +++ head/lib/libvgl/simple.c Mon Oct 4 18:16:38 2010 (r213412) @@ -249,8 +249,8 @@ VGLFilledBox(VGLBitmap *object, int x1, for (y=y1; y<=y2; y++) VGLLine(object, x1, y, x2, y, color); } -void -inline set4pixels(VGLBitmap *object, int x, int y, int xc, int yc, u_long color) +static inline void +set4pixels(VGLBitmap *object, int x, int y, int xc, int yc, u_long color) { if (x!=0) { VGLSetXY(object, xc+x, yc+y, color); @@ -290,8 +290,8 @@ VGLEllipse(VGLBitmap *object, int xc, in } } -void -inline set2lines(VGLBitmap *object, int x, int y, int xc, int yc, u_long color) +static inline void +set2lines(VGLBitmap *object, int x, int y, int xc, int yc, u_long color) { if (x!=0) { VGLLine(object, xc+x, yc+y, xc-x, yc+y, color); From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 19:39:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C3E410656C2; Mon, 4 Oct 2010 19:39:52 +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 3AF538FC17; Mon, 4 Oct 2010 19:39: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 o94Jdq89024744; Mon, 4 Oct 2010 19:39:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94JdqCn024742; Mon, 4 Oct 2010 19:39:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010041939.o94JdqCn024742@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 19:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213413 - stable/8/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 19:39:52 -0000 Author: marius Date: Mon Oct 4 19:39:51 2010 New Revision: 213413 URL: http://svn.freebsd.org/changeset/base/213413 Log: MFC: r213053 Remove an explicit assignment of the CFLAGS variable intended for debugging purposes only. Modified: stable/8/usr.bin/tftp/Makefile Directory Properties: stable/8/usr.bin/tftp/ (props changed) Modified: stable/8/usr.bin/tftp/Makefile ============================================================================== --- stable/8/usr.bin/tftp/Makefile Mon Oct 4 18:16:38 2010 (r213412) +++ stable/8/usr.bin/tftp/Makefile Mon Oct 4 19:39:51 2010 (r213413) @@ -1,7 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -CFLAGS=-g -Wall WARNS= 3 PROG= tftp SRCS= main.c tftp.c tftp-utils.c tftp-io.c tftp-file.c tftp-transfer.c tftp-options.c From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 19:40:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A935010656C3; Mon, 4 Oct 2010 19:40:01 +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 9761F8FC12; Mon, 4 Oct 2010 19:40: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 o94Je1Dw024787; Mon, 4 Oct 2010 19:40:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94Je1pr024785; Mon, 4 Oct 2010 19:40:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010041940.o94Je1pr024785@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 19:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213414 - stable/7/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 19:40:01 -0000 Author: marius Date: Mon Oct 4 19:40:01 2010 New Revision: 213414 URL: http://svn.freebsd.org/changeset/base/213414 Log: MFC: r213053 Remove an explicit assignment of the CFLAGS variable intended for debugging purposes only. Modified: stable/7/usr.bin/tftp/Makefile Directory Properties: stable/7/usr.bin/tftp/ (props changed) Modified: stable/7/usr.bin/tftp/Makefile ============================================================================== --- stable/7/usr.bin/tftp/Makefile Mon Oct 4 19:39:51 2010 (r213413) +++ stable/7/usr.bin/tftp/Makefile Mon Oct 4 19:40:01 2010 (r213414) @@ -1,7 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -CFLAGS=-g -Wall WARNS= 3 PROG= tftp SRCS= main.c tftp.c tftp-utils.c tftp-io.c tftp-file.c tftp-transfer.c tftp-options.c From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 19:51:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 642F1106566C; Mon, 4 Oct 2010 19:51:15 +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 52A138FC08; Mon, 4 Oct 2010 19:51: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 o94JpFSv025121; Mon, 4 Oct 2010 19:51:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94JpFbH025118; Mon, 4 Oct 2010 19:51:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010041951.o94JpFbH025118@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 19:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213415 - in stable/8: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 19:51:15 -0000 Author: marius Date: Mon Oct 4 19:51:15 2010 New Revision: 213415 URL: http://svn.freebsd.org/changeset/base/213415 Log: MFC: 213075 Try to adhere to style.Makefile(5). Modified: stable/8/libexec/tftpd/Makefile stable/8/usr.bin/tftp/Makefile Directory Properties: stable/8/libexec/tftpd/ (props changed) stable/8/usr.bin/tftp/ (props changed) Modified: stable/8/libexec/tftpd/Makefile ============================================================================== --- stable/8/libexec/tftpd/Makefile Mon Oct 4 19:40:01 2010 (r213414) +++ stable/8/libexec/tftpd/Makefile Mon Oct 4 19:51:15 2010 (r213415) @@ -2,13 +2,11 @@ # $FreeBSD$ PROG= tftpd -SRCS= tftpd.c tftp-io.c tftp-utils.c tftp-file.c tftp-transfer.c tftp-options.c +MAN= tftpd.8 +SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c +SRCS+= tftpd.c WARNS= 3 WFORMAT=0 -MAN= tftpd.8 -CFLAGS+=-I${.CURDIR}/../../usr.bin/tftp -I${.CURDIR}/../../libexec/tftpd -.PATH: ${.CURDIR}/../../usr.bin/tftp -COPTFLAGS = -O LDFLAGS= -lwrap .include Modified: stable/8/usr.bin/tftp/Makefile ============================================================================== --- stable/8/usr.bin/tftp/Makefile Mon Oct 4 19:40:01 2010 (r213414) +++ stable/8/usr.bin/tftp/Makefile Mon Oct 4 19:51:15 2010 (r213415) @@ -1,12 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -WARNS= 3 +.PATH: ${.CURDIR}/../../libexec/tftpd + PROG= tftp -SRCS= main.c tftp.c tftp-utils.c tftp-io.c tftp-file.c tftp-transfer.c tftp-options.c +SRCS= main.c tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c +SRCS+= tftp-utils.c tftp.c +WARNS= 3 +CFLAGS+=-I${.CURDIR}/../../libexec/tftpd DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap -CFLAGS+=-I${.CURDIR}/../../libexec/tftpd -I${.CURDIR}/../../usr.bin/tftp -.PATH: ${.CURDIR}/../../libexec/tftpd .include From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 19:51:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E96141065693; Mon, 4 Oct 2010 19:51:16 +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 BB01D8FC1F; Mon, 4 Oct 2010 19:51: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 o94JpGsK025156; Mon, 4 Oct 2010 19:51:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94JpGBH025153; Mon, 4 Oct 2010 19:51:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010041951.o94JpGBH025153@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 19:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213416 - in stable/7: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 19:51:17 -0000 Author: marius Date: Mon Oct 4 19:51:16 2010 New Revision: 213416 URL: http://svn.freebsd.org/changeset/base/213416 Log: MFC: r213075 Try to adhere to style.Makefile(5). Modified: stable/7/libexec/tftpd/Makefile stable/7/usr.bin/tftp/Makefile Directory Properties: stable/7/libexec/tftpd/ (props changed) stable/7/usr.bin/tftp/ (props changed) Modified: stable/7/libexec/tftpd/Makefile ============================================================================== --- stable/7/libexec/tftpd/Makefile Mon Oct 4 19:51:15 2010 (r213415) +++ stable/7/libexec/tftpd/Makefile Mon Oct 4 19:51:16 2010 (r213416) @@ -2,13 +2,11 @@ # $FreeBSD$ PROG= tftpd -SRCS= tftpd.c tftp-io.c tftp-utils.c tftp-file.c tftp-transfer.c tftp-options.c +MAN= tftpd.8 +SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c +SRCS+= tftpd.c WARNS= 3 WFORMAT=0 -MAN= tftpd.8 -CFLAGS+=-I${.CURDIR}/../../usr.bin/tftp -I${.CURDIR}/../../libexec/tftpd -.PATH: ${.CURDIR}/../../usr.bin/tftp -COPTFLAGS = -O LDFLAGS= -lwrap .include Modified: stable/7/usr.bin/tftp/Makefile ============================================================================== --- stable/7/usr.bin/tftp/Makefile Mon Oct 4 19:51:15 2010 (r213415) +++ stable/7/usr.bin/tftp/Makefile Mon Oct 4 19:51:16 2010 (r213416) @@ -1,12 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -WARNS= 3 +.PATH: ${.CURDIR}/../../libexec/tftpd + PROG= tftp -SRCS= main.c tftp.c tftp-utils.c tftp-io.c tftp-file.c tftp-transfer.c tftp-options.c +SRCS= main.c tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c +SRCS+= tftp-utils.c tftp.c +WARNS= 3 +CFLAGS+=-I${.CURDIR}/../../libexec/tftpd DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap -CFLAGS+=-I${.CURDIR}/../../libexec/tftpd -I${.CURDIR}/../../usr.bin/tftp -.PATH: ${.CURDIR}/../../libexec/tftpd .include From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 19:59:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7E0A1065673; Mon, 4 Oct 2010 19:59:08 +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 C07AB8FC27; Mon, 4 Oct 2010 19:59:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o94Jx8h8025423; Mon, 4 Oct 2010 19:59:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94Jx8ZI025414; Mon, 4 Oct 2010 19:59:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010041959.o94Jx8ZI025414@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 19:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213417 - in stable/8: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 19:59:09 -0000 Author: marius Date: Mon Oct 4 19:59:08 2010 New Revision: 213417 URL: http://svn.freebsd.org/changeset/base/213417 Log: MFC: r213099 Make WARNS=6 clean. Modified: stable/8/libexec/tftpd/Makefile stable/8/libexec/tftpd/tftp-file.c stable/8/libexec/tftpd/tftp-options.c stable/8/libexec/tftpd/tftp-utils.c stable/8/libexec/tftpd/tftp-utils.h stable/8/libexec/tftpd/tftpd.c stable/8/usr.bin/tftp/Makefile stable/8/usr.bin/tftp/main.c Directory Properties: stable/8/libexec/tftpd/ (props changed) stable/8/usr.bin/tftp/ (props changed) Modified: stable/8/libexec/tftpd/Makefile ============================================================================== --- stable/8/libexec/tftpd/Makefile Mon Oct 4 19:51:16 2010 (r213416) +++ stable/8/libexec/tftpd/Makefile Mon Oct 4 19:59:08 2010 (r213417) @@ -5,7 +5,7 @@ PROG= tftpd MAN= tftpd.8 SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c SRCS+= tftpd.c -WARNS= 3 +WARNS= 6 WFORMAT=0 LDFLAGS= -lwrap Modified: stable/8/libexec/tftpd/tftp-file.c ============================================================================== --- stable/8/libexec/tftpd/tftp-file.c Mon Oct 4 19:51:16 2010 (r213416) +++ stable/8/libexec/tftpd/tftp-file.c Mon Oct 4 19:59:08 2010 (r213417) @@ -103,13 +103,13 @@ static size_t convert_to_net(char *buffer, size_t count, int init) { size_t i; - static size_t n = 0, read = 0; + static size_t n = 0, in = 0; static int newline = 0; if (init) { newline = 0; n = 0; - read = 0; + in = 0; return 0 ; } @@ -124,13 +124,13 @@ convert_to_net(char *buffer, size_t coun } while (i < count) { - if (n == read) { + if (n == in) { /* When done we're done */ if (feof(file)) break; /* Otherwise read another bunch */ - read = fread(convbuffer, 1, count, file); - if (read == 0) break; + in = fread(convbuffer, 1, count, file); + if (in == 0) break; n = 0; } @@ -250,7 +250,7 @@ read_close(void) int -synchnet(int peer) +synchnet(int peer __unused) { return 0; Modified: stable/8/libexec/tftpd/tftp-options.c ============================================================================== --- stable/8/libexec/tftpd/tftp-options.c Mon Oct 4 19:51:16 2010 (r213416) +++ stable/8/libexec/tftpd/tftp-options.c Mon Oct 4 19:59:08 2010 (r213417) @@ -79,7 +79,8 @@ int options_extra_enabled = 1; */ int -option_tsize(int peer, struct tftphdr *tp, int mode, struct stat *stbuf) +option_tsize(int peer __unused, struct tftphdr *tp __unused, int mode, + struct stat *stbuf) { if (options[OPT_TSIZE].o_request == NULL) @@ -159,21 +160,19 @@ option_rollover(int peer) int option_blksize(int peer) { - int *maxdgram; - char maxbuffer[100]; + u_long maxdgram; size_t len; if (options[OPT_BLKSIZE].o_request == NULL) return (0); /* maximum size of an UDP packet according to the system */ - len = sizeof(maxbuffer); + len = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &len, NULL, 0) < 0) { + &maxdgram, &len, NULL, 0) < 0) { tftp_log(LOG_ERR, "sysctl: net.inet.udp.maxdgram"); return (acting_as_client ? 1 : 0); } - maxdgram = (int *)maxbuffer; int size = atoi(options[OPT_BLKSIZE].o_request); if (size < BLKSIZE_MIN || size > BLKSIZE_MAX) { @@ -191,20 +190,20 @@ option_blksize(int peer) } } - if (size > *maxdgram) { + if (size > (int)maxdgram) { if (acting_as_client) { tftp_log(LOG_ERR, "Invalid blocksize (%d bytes), " "net.inet.udp.maxdgram sysctl limits it to " - "%d bytes.\n", size, *maxdgram); + "%d bytes.\n", size, maxdgram); send_error(peer, EBADOP); return (1); } else { tftp_log(LOG_WARNING, "Invalid blocksize (%d bytes), " "net.inet.udp.maxdgram sysctl limits it to " - "%d bytes.\n", size, *maxdgram); - size = *maxdgram; + "%d bytes.\n", size, maxdgram); + size = maxdgram; /* No reason to return */ } } @@ -220,10 +219,9 @@ option_blksize(int peer) } int -option_blksize2(int peer) +option_blksize2(int peer __unused) { - int *maxdgram; - char maxbuffer[100]; + u_long maxdgram; int size, i; size_t len; @@ -236,13 +234,12 @@ option_blksize2(int peer) return (0); /* maximum size of an UDP packet according to the system */ - len = sizeof(maxbuffer); + len = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &len, NULL, 0) < 0) { + &maxdgram, &len, NULL, 0) < 0) { tftp_log(LOG_ERR, "sysctl: net.inet.udp.maxdgram"); return (acting_as_client ? 1 : 0); } - maxdgram = (int *)maxbuffer; size = atoi(options[OPT_BLKSIZE2].o_request); for (i = 0; sizes[i] != 0; i++) { @@ -254,13 +251,13 @@ option_blksize2(int peer) return (acting_as_client ? 1 : 0); } - if (size > *maxdgram) { + if (size > (int)maxdgram) { for (i = 0; sizes[i+1] != 0; i++) { - if (*maxdgram < sizes[i+1]) break; + if ((int)maxdgram < sizes[i+1]) break; } tftp_log(LOG_INFO, "Invalid blocksize2 (%d bytes), net.inet.udp.maxdgram " - "sysctl limits it to %d bytes.\n", size, *maxdgram); + "sysctl limits it to %d bytes.\n", size, maxdgram); size = sizes[i]; /* No need to return */ } @@ -279,7 +276,7 @@ option_blksize2(int peer) * Append the available options to the header */ uint16_t -make_options(int peer, char *buffer, uint16_t size) { +make_options(int peer __unused, char *buffer, uint16_t size) { int i; char *value; const char *option; Modified: stable/8/libexec/tftpd/tftp-utils.c ============================================================================== --- stable/8/libexec/tftpd/tftp-utils.c Mon Oct 4 19:51:16 2010 (r213416) +++ stable/8/libexec/tftpd/tftp-utils.c Mon Oct 4 19:59:08 2010 (r213417) @@ -59,7 +59,7 @@ int acting_as_client; * first timeout) to 'timeoutnetwork' (i.e. the last timeout) */ int -settimeouts(int _timeoutpacket, int _timeoutnetwork, int _maxtimeouts) +settimeouts(int _timeoutpacket, int _timeoutnetwork, int _maxtimeouts __unused) { int i; @@ -91,7 +91,7 @@ unmappedaddr(struct sockaddr_in6 *sin6) !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) return; sin4 = (struct sockaddr_in *)sin6; - addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; + memcpy(&addr, &sin6->sin6_addr.s6_addr[12], sizeof(addr)); port = sin6->sin6_port; memset(sin4, 0, sizeof(struct sockaddr_in)); sin4->sin_addr.s_addr = addr; @@ -170,7 +170,7 @@ struct packettypes packettypes[] = { { 0, NULL }, }; -char * +const char * packettype(int type) { static char failed[100]; @@ -231,7 +231,7 @@ debug_finds(char *s) return (i); } -char * +const char * debug_show(int d) { static char s[100]; @@ -317,4 +317,3 @@ printstats(const char *direction, int ve printf(" [%.0f bits/sec]", (ts->amount*8.)/delta); putchar('\n'); } - Modified: stable/8/libexec/tftpd/tftp-utils.h ============================================================================== --- stable/8/libexec/tftpd/tftp-utils.h Mon Oct 4 19:51:16 2010 (r213416) +++ stable/8/libexec/tftpd/tftp-utils.h Mon Oct 4 19:59:08 2010 (r213417) @@ -64,17 +64,17 @@ ssize_t get_field(int peer, char *buffer */ struct packettypes { int value; - char *name; + const char *const name; }; extern struct packettypes packettypes[]; -char *packettype(int); +const char *packettype(int); /* * RP_ */ struct rp_errors { int error; - char *desc; + const char *const desc; }; extern struct rp_errors rp_errors[]; char *rp_strerror(int error); @@ -89,15 +89,15 @@ char *rp_strerror(int error); #define DEBUG_ACCESS 0x0008 struct debugs { int value; - char *name; - char *desc; + const char *const name; + const char *const desc; }; extern int debug; extern struct debugs debugs[]; extern int packetdroppercentage; int debug_find(char *s); int debug_finds(char *s); -char *debug_show(int d); +const char *debug_show(int d); /* * Log routines Modified: stable/8/libexec/tftpd/tftpd.c ============================================================================== --- stable/8/libexec/tftpd/tftpd.c Mon Oct 4 19:51:16 2010 (r213416) +++ stable/8/libexec/tftpd/tftpd.c Mon Oct 4 19:59:08 2010 (r213417) @@ -97,7 +97,7 @@ static int suppress_naks; static int logging; static int ipchroot; static int create_new = 0; -static char *newfile_format = "%Y%m%d"; +static const char *newfile_format = "%Y%m%d"; static int increase_name = 0; static mode_t mask = S_IWGRP | S_IWOTH; @@ -785,7 +785,6 @@ static void tftp_xmitfile(int peer, const char *mode) { uint16_t block; - uint32_t amount; time_t now; struct tftp_stats ts; @@ -799,13 +798,12 @@ tftp_xmitfile(int peer, const char *mode read_close(); if (debug&DEBUG_SIMPLE) tftp_log(LOG_INFO, "Sent %d bytes in %d seconds", - amount, time(NULL) - now); + ts.amount, time(NULL) - now); } static void tftp_recvfile(int peer, const char *mode) { - uint32_t filesize; uint16_t block; struct timeval now1, now2; struct tftp_stats ts; @@ -820,6 +818,7 @@ tftp_recvfile(int peer, const char *mode tftp_receive(peer, &block, &ts, NULL, 0); write_close(); + gettimeofday(&now2, NULL); if (debug&DEBUG_SIMPLE) { double f; @@ -832,9 +831,8 @@ tftp_recvfile(int peer, const char *mode (now2.tv_usec - now1.tv_usec) / 100000.0; tftp_log(LOG_INFO, "Download of %d bytes in %d blocks completed after %0.1f seconds\n", - filesize, block, f); + ts.amount, block, f); } return; } - Modified: stable/8/usr.bin/tftp/Makefile ============================================================================== --- stable/8/usr.bin/tftp/Makefile Mon Oct 4 19:51:16 2010 (r213416) +++ stable/8/usr.bin/tftp/Makefile Mon Oct 4 19:59:08 2010 (r213417) @@ -1,12 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../../libexec/tftpd +.PATH: ${.CURDIR}/../../libexec/tftpd PROG= tftp SRCS= main.c tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c SRCS+= tftp-utils.c tftp.c -WARNS= 3 +WARNS= 6 CFLAGS+=-I${.CURDIR}/../../libexec/tftpd DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap Modified: stable/8/usr.bin/tftp/main.c ============================================================================== --- stable/8/usr.bin/tftp/main.c Mon Oct 4 19:51:16 2010 (r213416) +++ stable/8/usr.bin/tftp/main.c Mon Oct 4 19:59:08 2010 (r213417) @@ -222,8 +222,8 @@ urihandling(char *URI) char uri[ARG_MAX]; char *host = NULL; char *path = NULL; - char *options = NULL; - char *mode = "octet"; + char *opts = NULL; + const char *tmode = "octet"; char *s; char line[MAXLINE]; int i; @@ -241,14 +241,14 @@ urihandling(char *URI) if ((s = strchr(path, ';')) != NULL) { *s = '\0'; - options = s + 1; + opts = s + 1; - if (strncmp(options, "mode=", 5) == 0) { - mode = options; - mode += 5; + if (strncmp(opts, "mode=", 5) == 0) { + tmode = opts; + tmode += 5; for (i = 0; modes[i].m_name != NULL; i++) { - if (strcmp(modes[i].m_name, mode) == 0) + if (strcmp(modes[i].m_name, tmode) == 0) break; } if (modes[i].m_name == NULL) { @@ -697,7 +697,7 @@ tail(char *filename) } static const char * -command_prompt() +command_prompt(void) { return ("tftp> "); @@ -964,27 +964,25 @@ setblocksize(int argc, char *argv[]) if (argc != 1) { int size = atoi(argv[1]); size_t max; - char maxbuffer[100]; - int *maxdgram; + u_long maxdgram; - max = sizeof(maxbuffer); + max = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &max, NULL, 0) < 0) { + &maxdgram, &max, NULL, 0) < 0) { perror("sysctl: net.inet.udp.maxdgram"); return; } - maxdgram = (int *)maxbuffer; if (size < BLKSIZE_MIN || size > BLKSIZE_MAX) { printf("Blocksize should be between %d and %d bytes.\n", BLKSIZE_MIN, BLKSIZE_MAX); return; - } else if (size > *maxdgram - 4) { - printf("Blocksize can't be bigger than %d bytes due " + } else if (size > (int)maxdgram - 4) { + printf("Blocksize can't be bigger than %ld bytes due " "to the net.inet.udp.maxdgram sysctl limitation.\n", - *maxdgram - 4); + maxdgram - 4); asprintf(&options[OPT_BLKSIZE].o_request, - "%d", *maxdgram - 4); + "%ld", maxdgram - 4); } else { asprintf(&options[OPT_BLKSIZE].o_request, "%d", size); } @@ -1005,21 +1003,19 @@ setblocksize2(int argc, char *argv[]) int size = atoi(argv[1]); int i; size_t max; - char maxbuffer[100]; - int *maxdgram; + u_long maxdgram; int sizes[] = { 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 0 }; - max = sizeof(maxbuffer); + max = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &max, NULL, 0) < 0) { + &maxdgram, &max, NULL, 0) < 0) { perror("sysctl: net.inet.udp.maxdgram"); return; } - maxdgram = (int *)maxbuffer; for (i = 0; sizes[i] != 0; i++) { if (sizes[i] == size) break; @@ -1034,12 +1030,12 @@ setblocksize2(int argc, char *argv[]) printf("Blocksize2 should be between " "%d and %d bytes.\n", BLKSIZE_MIN, BLKSIZE_MAX); return; - } else if (size > *maxdgram - 4) { - printf("Blocksize2 can't be bigger than %d bytes due " + } else if (size > (int)maxdgram - 4) { + printf("Blocksize2 can't be bigger than %ld bytes due " "to the net.inet.udp.maxdgram sysctl limitation.\n", - *maxdgram - 4); + maxdgram - 4); for (i = 0; sizes[i+1] != 0; i++) { - if (*maxdgram < sizes[i+1]) break; + if ((int)maxdgram < sizes[i+1]) break; } asprintf(&options[OPT_BLKSIZE2].o_request, "%d", sizes[i]); From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 19:59:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 261F01065771; Mon, 4 Oct 2010 19:59:12 +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 118718FC2B; Mon, 4 Oct 2010 19:59: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 o94JxCMO025466; Mon, 4 Oct 2010 19:59:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94JxBP6025457; Mon, 4 Oct 2010 19:59:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010041959.o94JxBP6025457@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 19:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213418 - in stable/7: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 19:59:12 -0000 Author: marius Date: Mon Oct 4 19:59:11 2010 New Revision: 213418 URL: http://svn.freebsd.org/changeset/base/213418 Log: MFC: r213099 Make WARNS=6 clean. Modified: stable/7/libexec/tftpd/Makefile stable/7/libexec/tftpd/tftp-file.c stable/7/libexec/tftpd/tftp-options.c stable/7/libexec/tftpd/tftp-utils.c stable/7/libexec/tftpd/tftp-utils.h stable/7/libexec/tftpd/tftpd.c stable/7/usr.bin/tftp/Makefile stable/7/usr.bin/tftp/main.c Directory Properties: stable/7/libexec/tftpd/ (props changed) stable/7/usr.bin/tftp/ (props changed) Modified: stable/7/libexec/tftpd/Makefile ============================================================================== --- stable/7/libexec/tftpd/Makefile Mon Oct 4 19:59:08 2010 (r213417) +++ stable/7/libexec/tftpd/Makefile Mon Oct 4 19:59:11 2010 (r213418) @@ -5,7 +5,7 @@ PROG= tftpd MAN= tftpd.8 SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c SRCS+= tftpd.c -WARNS= 3 +WARNS= 6 WFORMAT=0 LDFLAGS= -lwrap Modified: stable/7/libexec/tftpd/tftp-file.c ============================================================================== --- stable/7/libexec/tftpd/tftp-file.c Mon Oct 4 19:59:08 2010 (r213417) +++ stable/7/libexec/tftpd/tftp-file.c Mon Oct 4 19:59:11 2010 (r213418) @@ -103,13 +103,13 @@ static size_t convert_to_net(char *buffer, size_t count, int init) { size_t i; - static size_t n = 0, read = 0; + static size_t n = 0, in = 0; static int newline = 0; if (init) { newline = 0; n = 0; - read = 0; + in = 0; return 0 ; } @@ -124,13 +124,13 @@ convert_to_net(char *buffer, size_t coun } while (i < count) { - if (n == read) { + if (n == in) { /* When done we're done */ if (feof(file)) break; /* Otherwise read another bunch */ - read = fread(convbuffer, 1, count, file); - if (read == 0) break; + in = fread(convbuffer, 1, count, file); + if (in == 0) break; n = 0; } @@ -250,7 +250,7 @@ read_close(void) int -synchnet(int peer) +synchnet(int peer __unused) { return 0; Modified: stable/7/libexec/tftpd/tftp-options.c ============================================================================== --- stable/7/libexec/tftpd/tftp-options.c Mon Oct 4 19:59:08 2010 (r213417) +++ stable/7/libexec/tftpd/tftp-options.c Mon Oct 4 19:59:11 2010 (r213418) @@ -79,7 +79,8 @@ int options_extra_enabled = 1; */ int -option_tsize(int peer, struct tftphdr *tp, int mode, struct stat *stbuf) +option_tsize(int peer __unused, struct tftphdr *tp __unused, int mode, + struct stat *stbuf) { if (options[OPT_TSIZE].o_request == NULL) @@ -159,21 +160,19 @@ option_rollover(int peer) int option_blksize(int peer) { - int *maxdgram; - char maxbuffer[100]; + u_long maxdgram; size_t len; if (options[OPT_BLKSIZE].o_request == NULL) return (0); /* maximum size of an UDP packet according to the system */ - len = sizeof(maxbuffer); + len = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &len, NULL, 0) < 0) { + &maxdgram, &len, NULL, 0) < 0) { tftp_log(LOG_ERR, "sysctl: net.inet.udp.maxdgram"); return (acting_as_client ? 1 : 0); } - maxdgram = (int *)maxbuffer; int size = atoi(options[OPT_BLKSIZE].o_request); if (size < BLKSIZE_MIN || size > BLKSIZE_MAX) { @@ -191,20 +190,20 @@ option_blksize(int peer) } } - if (size > *maxdgram) { + if (size > (int)maxdgram) { if (acting_as_client) { tftp_log(LOG_ERR, "Invalid blocksize (%d bytes), " "net.inet.udp.maxdgram sysctl limits it to " - "%d bytes.\n", size, *maxdgram); + "%d bytes.\n", size, maxdgram); send_error(peer, EBADOP); return (1); } else { tftp_log(LOG_WARNING, "Invalid blocksize (%d bytes), " "net.inet.udp.maxdgram sysctl limits it to " - "%d bytes.\n", size, *maxdgram); - size = *maxdgram; + "%d bytes.\n", size, maxdgram); + size = maxdgram; /* No reason to return */ } } @@ -220,10 +219,9 @@ option_blksize(int peer) } int -option_blksize2(int peer) +option_blksize2(int peer __unused) { - int *maxdgram; - char maxbuffer[100]; + u_long maxdgram; int size, i; size_t len; @@ -236,13 +234,12 @@ option_blksize2(int peer) return (0); /* maximum size of an UDP packet according to the system */ - len = sizeof(maxbuffer); + len = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &len, NULL, 0) < 0) { + &maxdgram, &len, NULL, 0) < 0) { tftp_log(LOG_ERR, "sysctl: net.inet.udp.maxdgram"); return (acting_as_client ? 1 : 0); } - maxdgram = (int *)maxbuffer; size = atoi(options[OPT_BLKSIZE2].o_request); for (i = 0; sizes[i] != 0; i++) { @@ -254,13 +251,13 @@ option_blksize2(int peer) return (acting_as_client ? 1 : 0); } - if (size > *maxdgram) { + if (size > (int)maxdgram) { for (i = 0; sizes[i+1] != 0; i++) { - if (*maxdgram < sizes[i+1]) break; + if ((int)maxdgram < sizes[i+1]) break; } tftp_log(LOG_INFO, "Invalid blocksize2 (%d bytes), net.inet.udp.maxdgram " - "sysctl limits it to %d bytes.\n", size, *maxdgram); + "sysctl limits it to %d bytes.\n", size, maxdgram); size = sizes[i]; /* No need to return */ } @@ -279,7 +276,7 @@ option_blksize2(int peer) * Append the available options to the header */ uint16_t -make_options(int peer, char *buffer, uint16_t size) { +make_options(int peer __unused, char *buffer, uint16_t size) { int i; char *value; const char *option; Modified: stable/7/libexec/tftpd/tftp-utils.c ============================================================================== --- stable/7/libexec/tftpd/tftp-utils.c Mon Oct 4 19:59:08 2010 (r213417) +++ stable/7/libexec/tftpd/tftp-utils.c Mon Oct 4 19:59:11 2010 (r213418) @@ -59,7 +59,7 @@ int acting_as_client; * first timeout) to 'timeoutnetwork' (i.e. the last timeout) */ int -settimeouts(int _timeoutpacket, int _timeoutnetwork, int _maxtimeouts) +settimeouts(int _timeoutpacket, int _timeoutnetwork, int _maxtimeouts __unused) { int i; @@ -91,7 +91,7 @@ unmappedaddr(struct sockaddr_in6 *sin6) !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) return; sin4 = (struct sockaddr_in *)sin6; - addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; + memcpy(&addr, &sin6->sin6_addr.s6_addr[12], sizeof(addr)); port = sin6->sin6_port; memset(sin4, 0, sizeof(struct sockaddr_in)); sin4->sin_addr.s_addr = addr; @@ -170,7 +170,7 @@ struct packettypes packettypes[] = { { 0, NULL }, }; -char * +const char * packettype(int type) { static char failed[100]; @@ -231,7 +231,7 @@ debug_finds(char *s) return (i); } -char * +const char * debug_show(int d) { static char s[100]; @@ -317,4 +317,3 @@ printstats(const char *direction, int ve printf(" [%.0f bits/sec]", (ts->amount*8.)/delta); putchar('\n'); } - Modified: stable/7/libexec/tftpd/tftp-utils.h ============================================================================== --- stable/7/libexec/tftpd/tftp-utils.h Mon Oct 4 19:59:08 2010 (r213417) +++ stable/7/libexec/tftpd/tftp-utils.h Mon Oct 4 19:59:11 2010 (r213418) @@ -64,17 +64,17 @@ ssize_t get_field(int peer, char *buffer */ struct packettypes { int value; - char *name; + const char *const name; }; extern struct packettypes packettypes[]; -char *packettype(int); +const char *packettype(int); /* * RP_ */ struct rp_errors { int error; - char *desc; + const char *const desc; }; extern struct rp_errors rp_errors[]; char *rp_strerror(int error); @@ -89,15 +89,15 @@ char *rp_strerror(int error); #define DEBUG_ACCESS 0x0008 struct debugs { int value; - char *name; - char *desc; + const char *const name; + const char *const desc; }; extern int debug; extern struct debugs debugs[]; extern int packetdroppercentage; int debug_find(char *s); int debug_finds(char *s); -char *debug_show(int d); +const char *debug_show(int d); /* * Log routines Modified: stable/7/libexec/tftpd/tftpd.c ============================================================================== --- stable/7/libexec/tftpd/tftpd.c Mon Oct 4 19:59:08 2010 (r213417) +++ stable/7/libexec/tftpd/tftpd.c Mon Oct 4 19:59:11 2010 (r213418) @@ -97,7 +97,7 @@ static int suppress_naks; static int logging; static int ipchroot; static int create_new = 0; -static char *newfile_format = "%Y%m%d"; +static const char *newfile_format = "%Y%m%d"; static int increase_name = 0; static mode_t mask = S_IWGRP | S_IWOTH; @@ -785,7 +785,6 @@ static void tftp_xmitfile(int peer, const char *mode) { uint16_t block; - uint32_t amount; time_t now; struct tftp_stats ts; @@ -799,13 +798,12 @@ tftp_xmitfile(int peer, const char *mode read_close(); if (debug&DEBUG_SIMPLE) tftp_log(LOG_INFO, "Sent %d bytes in %d seconds", - amount, time(NULL) - now); + ts.amount, time(NULL) - now); } static void tftp_recvfile(int peer, const char *mode) { - uint32_t filesize; uint16_t block; struct timeval now1, now2; struct tftp_stats ts; @@ -820,6 +818,7 @@ tftp_recvfile(int peer, const char *mode tftp_receive(peer, &block, &ts, NULL, 0); write_close(); + gettimeofday(&now2, NULL); if (debug&DEBUG_SIMPLE) { double f; @@ -832,9 +831,8 @@ tftp_recvfile(int peer, const char *mode (now2.tv_usec - now1.tv_usec) / 100000.0; tftp_log(LOG_INFO, "Download of %d bytes in %d blocks completed after %0.1f seconds\n", - filesize, block, f); + ts.amount, block, f); } return; } - Modified: stable/7/usr.bin/tftp/Makefile ============================================================================== --- stable/7/usr.bin/tftp/Makefile Mon Oct 4 19:59:08 2010 (r213417) +++ stable/7/usr.bin/tftp/Makefile Mon Oct 4 19:59:11 2010 (r213418) @@ -1,12 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../../libexec/tftpd +.PATH: ${.CURDIR}/../../libexec/tftpd PROG= tftp SRCS= main.c tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c SRCS+= tftp-utils.c tftp.c -WARNS= 3 +WARNS= 6 CFLAGS+=-I${.CURDIR}/../../libexec/tftpd DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap Modified: stable/7/usr.bin/tftp/main.c ============================================================================== --- stable/7/usr.bin/tftp/main.c Mon Oct 4 19:59:08 2010 (r213417) +++ stable/7/usr.bin/tftp/main.c Mon Oct 4 19:59:11 2010 (r213418) @@ -222,8 +222,8 @@ urihandling(char *URI) char uri[ARG_MAX]; char *host = NULL; char *path = NULL; - char *options = NULL; - char *mode = "octet"; + char *opts = NULL; + const char *tmode = "octet"; char *s; char line[MAXLINE]; int i; @@ -241,14 +241,14 @@ urihandling(char *URI) if ((s = strchr(path, ';')) != NULL) { *s = '\0'; - options = s + 1; + opts = s + 1; - if (strncmp(options, "mode=", 5) == 0) { - mode = options; - mode += 5; + if (strncmp(opts, "mode=", 5) == 0) { + tmode = opts; + tmode += 5; for (i = 0; modes[i].m_name != NULL; i++) { - if (strcmp(modes[i].m_name, mode) == 0) + if (strcmp(modes[i].m_name, tmode) == 0) break; } if (modes[i].m_name == NULL) { @@ -697,7 +697,7 @@ tail(char *filename) } static const char * -command_prompt() +command_prompt(void) { return ("tftp> "); @@ -964,27 +964,25 @@ setblocksize(int argc, char *argv[]) if (argc != 1) { int size = atoi(argv[1]); size_t max; - char maxbuffer[100]; - int *maxdgram; + u_long maxdgram; - max = sizeof(maxbuffer); + max = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &max, NULL, 0) < 0) { + &maxdgram, &max, NULL, 0) < 0) { perror("sysctl: net.inet.udp.maxdgram"); return; } - maxdgram = (int *)maxbuffer; if (size < BLKSIZE_MIN || size > BLKSIZE_MAX) { printf("Blocksize should be between %d and %d bytes.\n", BLKSIZE_MIN, BLKSIZE_MAX); return; - } else if (size > *maxdgram - 4) { - printf("Blocksize can't be bigger than %d bytes due " + } else if (size > (int)maxdgram - 4) { + printf("Blocksize can't be bigger than %ld bytes due " "to the net.inet.udp.maxdgram sysctl limitation.\n", - *maxdgram - 4); + maxdgram - 4); asprintf(&options[OPT_BLKSIZE].o_request, - "%d", *maxdgram - 4); + "%ld", maxdgram - 4); } else { asprintf(&options[OPT_BLKSIZE].o_request, "%d", size); } @@ -1005,21 +1003,19 @@ setblocksize2(int argc, char *argv[]) int size = atoi(argv[1]); int i; size_t max; - char maxbuffer[100]; - int *maxdgram; + u_long maxdgram; int sizes[] = { 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 0 }; - max = sizeof(maxbuffer); + max = sizeof(maxdgram); if (sysctlbyname("net.inet.udp.maxdgram", - maxbuffer, &max, NULL, 0) < 0) { + &maxdgram, &max, NULL, 0) < 0) { perror("sysctl: net.inet.udp.maxdgram"); return; } - maxdgram = (int *)maxbuffer; for (i = 0; sizes[i] != 0; i++) { if (sizes[i] == size) break; @@ -1034,12 +1030,12 @@ setblocksize2(int argc, char *argv[]) printf("Blocksize2 should be between " "%d and %d bytes.\n", BLKSIZE_MIN, BLKSIZE_MAX); return; - } else if (size > *maxdgram - 4) { - printf("Blocksize2 can't be bigger than %d bytes due " + } else if (size > (int)maxdgram - 4) { + printf("Blocksize2 can't be bigger than %ld bytes due " "to the net.inet.udp.maxdgram sysctl limitation.\n", - *maxdgram - 4); + maxdgram - 4); for (i = 0; sizes[i+1] != 0; i++) { - if (*maxdgram < sizes[i+1]) break; + if ((int)maxdgram < sizes[i+1]) break; } asprintf(&options[OPT_BLKSIZE2].o_request, "%d", sizes[i]); From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 20:00:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A370F1065675; Mon, 4 Oct 2010 20:00:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 3A11D8FC19; Mon, 4 Oct 2010 20:00:15 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o94K0C08012819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Oct 2010 07:00:14 +1100 Date: Tue, 5 Oct 2010 07:00:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Poul-Henning Kamp In-Reply-To: <201010041048.o94Amlao010438@svn.freebsd.org> Message-ID: <20101005065627.S1603@besplex.bde.org> References: <201010041048.o94Amlao010438@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213401 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 20:00:17 -0000 On Mon, 4 Oct 2010, Poul-Henning Kamp wrote: > Log: > Certain static code analysis tools (FlexeLint being one) are very > suspicious about 'l' and '1' being confused in numeric constants. > The fear being that some old fart programmer might still think that > he is using a Remmington Noiseless as input terminal device. > > An easy way to placate this fear is to use capital 'L' or to put > the 'u' in unsigned constants in front of the 'l'. A better way would be to fix the benign type mismatches and style bugs in this code. "long long" shouldn't exist, so all uses of it are style bugs at best, so "ll" suffixes are style bugs at best. Here they are also type mismatches. > Modified: > head/sys/sys/time.h > > Modified: head/sys/sys/time.h > ============================================================================== > --- head/sys/sys/time.h Mon Oct 4 07:00:47 2010 (r213400) > +++ head/sys/sys/time.h Mon Oct 4 10:48:47 2010 (r213401) > @@ -95,11 +95,11 @@ bintime_mul(struct bintime *bt, u_int x) > { > uint64_t p1, p2; > > - p1 = (bt->frac & 0xffffffffllu) * x; > + p1 = (bt->frac & 0xffffffffull) * x; > p2 = (bt->frac >> 32) * x + (p1 >> 32); > bt->sec *= x; > bt->sec += (p2 >> 32); > - bt->frac = (p2 << 32) | (p1 & 0xffffffffllu); > + bt->frac = (p2 << 32) | (p1 & 0xffffffffull); > } > > #define bintime_clear(a) ((a)->sec = (a)->frac = 0) > Type mismatches: there are no long longs here; there are only uint64_t's, which may be shorter than unsigned long long. The uint64_t's here are: - p1 and p2 declared explicitly above: - bt_frac^Wfrac is uint64_t - bt_sec^Wsec is time_t, which is int32_t on some arches and int64_t on others. Also, the long long suffixes have no effect here, except for non-C compilers that complain about 0xffffffff being larger than INT_MAX. The constants are naturally ordinary unsigned int ones on all supported arches (they equal to 2**32-1, and all supported arches have 32-bit unsigned ints). Unsigned ints combine with uint64_t values in all sub-expressions to give the correct a uint64_t result, so no further promotions are needed to get the correct uint64_t result for the whole expression. Older places in this file need to convert sub-expressions in this file to uint64_t, and they do this using careful casts to uint64_t, even starting with bogus long long constants which wouldn't need to be cast if they were unsigned long long constants, even if unsigbed long long were larger than uint64_t. These places spell their long long mistakes as "LL" suffixes while the newer places now spell them as "ull" suffixes. I once policed this better, and had removed most long longs in the kernel before C99 made the mistake of standardizing them. C99 also standardized uint64_t, so there was even less need to use long long. Fixes for older long longs in this file: % Index: time.h % =================================================================== % RCS file: /home/ncvs/src/sys/sys/time.h,v % retrieving revision 1.65 % diff -u -2 -r1.65 time.h % --- time.h 7 Apr 2004 04:19:49 -0000 1.65 % +++ time.h 7 Apr 2004 11:28:54 -0000 % @@ -118,6 +118,5 @@ % % bt->sec = ts->tv_sec; % - /* 18446744073 = int(2^64 / 1000000000) */ % - bt->frac = ts->tv_nsec * (uint64_t)18446744073LL; % + bt->frac = ts->tv_nsec * (((uint64_t)1 << 63) / (1000000000 >> 1)); % } % % @@ -135,6 +134,5 @@ % % bt->sec = tv->tv_sec; % - /* 18446744073709 = int(2^64 / 1000000) */ % - bt->frac = tv->tv_usec * (uint64_t)18446744073709LL; % + bt->frac = tv->tv_usec * (((uint64_t)1 << 63) / (1000000 >> 1)); % } % #endif /* __BSD_VISIBLE */ This also calculates 2**64 / 10**N in the correct way. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 20:02:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A396106564A; Mon, 4 Oct 2010 20:02:48 +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 78DF28FC1C; Mon, 4 Oct 2010 20:02: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 o94K2m9F025646; Mon, 4 Oct 2010 20:02:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94K2mca025644; Mon, 4 Oct 2010 20:02:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010042002.o94K2mca025644@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 20:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213419 - stable/8/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 20:02:48 -0000 Author: marius Date: Mon Oct 4 20:02:48 2010 New Revision: 213419 URL: http://svn.freebsd.org/changeset/base/213419 Log: MFC: r213102 Remove the duplicate logging of failed read requests, whose error message also was inappropriate as it triggered for every EACCESS and ENOTFOUND, not just the case the -n option is intended to deal with and thus really spammed us with ~20 messages in the default configuration when booting a diskless FreeBSD client, introduced with r207608 (commited to stable/8 in 213038) again. Modified: stable/8/libexec/tftpd/tftpd.c Directory Properties: stable/8/libexec/tftpd/ (props changed) Modified: stable/8/libexec/tftpd/tftpd.c ============================================================================== --- stable/8/libexec/tftpd/tftpd.c Mon Oct 4 19:59:11 2010 (r213418) +++ stable/8/libexec/tftpd/tftpd.c Mon Oct 4 20:02:48 2010 (r213419) @@ -604,7 +604,6 @@ tftp_rrq(int peer, char *recvbuffer, ssi */ if (suppress_naks && *filename != '/' && ecode == ENOTFOUND) exit(0); - tftp_log(LOG_ERR, "Prevent NAK storm"); send_error(peer, ecode); exit(1); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 20:02:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43CCC106564A; Mon, 4 Oct 2010 20:02:55 +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 325018FC08; Mon, 4 Oct 2010 20:02: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 o94K2tId025685; Mon, 4 Oct 2010 20:02:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94K2tm3025683; Mon, 4 Oct 2010 20:02:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010042002.o94K2tm3025683@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 20:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213420 - stable/7/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 20:02:55 -0000 Author: marius Date: Mon Oct 4 20:02:54 2010 New Revision: 213420 URL: http://svn.freebsd.org/changeset/base/213420 Log: MFC: r213102 Remove the duplicate logging of failed read requests, whose error message also was inappropriate as it triggered for every EACCESS and ENOTFOUND, not just the case the -n option is intended to deal with and thus really spammed us with ~20 messages in the default configuration when booting a diskless FreeBSD client, introduced with r207608 commited to stable/7 in r213039) again. Modified: stable/7/libexec/tftpd/tftpd.c Directory Properties: stable/7/libexec/tftpd/ (props changed) Modified: stable/7/libexec/tftpd/tftpd.c ============================================================================== --- stable/7/libexec/tftpd/tftpd.c Mon Oct 4 20:02:48 2010 (r213419) +++ stable/7/libexec/tftpd/tftpd.c Mon Oct 4 20:02:54 2010 (r213420) @@ -604,7 +604,6 @@ tftp_rrq(int peer, char *recvbuffer, ssi */ if (suppress_naks && *filename != '/' && ecode == ENOTFOUND) exit(0); - tftp_log(LOG_ERR, "Prevent NAK storm"); send_error(peer, ecode); exit(1); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 20:13:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CB52106567A; Mon, 4 Oct 2010 20:13: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 331D98FC13; Mon, 4 Oct 2010 20:13: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 o94KDK5o026008; Mon, 4 Oct 2010 20:13:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94KDKd8026005; Mon, 4 Oct 2010 20:13:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010042013.o94KDKd8026005@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 20:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213421 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 20:13:20 -0000 Author: marius Date: Mon Oct 4 20:13:19 2010 New Revision: 213421 URL: http://svn.freebsd.org/changeset/base/213421 Log: MFC: r213105, r213147 Improve r56796; the reply handler actually may remove the request from the chain in which case it shouldn't be removed twice. Reported by: Staale Kristoffersen Modified: stable/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Mon Oct 4 20:02:54 2010 (r213420) +++ stable/8/sys/dev/mpt/mpt.c Mon Oct 4 20:13:19 2010 (r213421) @@ -844,13 +844,14 @@ mpt_complete_request_chain(struct mpt_so MSG_REQUEST_HEADER *msg_hdr; u_int cb_index; - TAILQ_REMOVE(chain, req, links); msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf; ioc_status_frame.Function = msg_hdr->Function; ioc_status_frame.MsgContext = msg_hdr->MsgContext; cb_index = MPT_CONTEXT_TO_CBI(le32toh(msg_hdr->MsgContext)); mpt_reply_handlers[cb_index](mpt, req, msg_hdr->MsgContext, &ioc_status_frame); + if (mpt_req_on_pending_list(mpt, req) != 0) + TAILQ_REMOVE(chain, req, links); } } Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Mon Oct 4 20:02:54 2010 (r213420) +++ stable/8/sys/dev/mpt/mpt.h Mon Oct 4 20:13:19 2010 (r213421) @@ -1157,19 +1157,13 @@ mpt_tag_2_req(struct mpt_softc *mpt, uin KASSERT(mpt->tgt_cmd_ptrs[rtg], ("no cmd backpointer")); return (mpt->tgt_cmd_ptrs[rtg]); } - +#endif static __inline int mpt_req_on_free_list(struct mpt_softc *, request_t *); static __inline int mpt_req_on_pending_list(struct mpt_softc *, request_t *); -static __inline void -mpt_req_spcl(struct mpt_softc *, request_t *, const char *, int); -static __inline void -mpt_req_not_spcl(struct mpt_softc *, request_t *, const char *, int); - - /* * Is request on freelist? */ @@ -1202,6 +1196,12 @@ mpt_req_on_pending_list(struct mpt_softc return (0); } +#ifdef INVARIANTS +static __inline void +mpt_req_spcl(struct mpt_softc *, request_t *, const char *, int); +static __inline void +mpt_req_not_spcl(struct mpt_softc *, request_t *, const char *, int); + /* * Make sure that req *is* part of one of the special lists */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 20:13:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 232191065771; Mon, 4 Oct 2010 20:13:22 +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 1C4FA8FC2A; Mon, 4 Oct 2010 20:13: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 o94KDM2s026039; Mon, 4 Oct 2010 20:13:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94KDLAv026036; Mon, 4 Oct 2010 20:13:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010042013.o94KDLAv026036@svn.freebsd.org> From: Marius Strobl Date: Mon, 4 Oct 2010 20:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213422 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 20:13:23 -0000 Author: marius Date: Mon Oct 4 20:13:21 2010 New Revision: 213422 URL: http://svn.freebsd.org/changeset/base/213422 Log: MFC: r213105, r213147 Improve r56796; the reply handler actually may remove the request from the chain in which case it shouldn't be removed twice. Reported by: Staale Kristoffersen Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Oct 4 20:13:19 2010 (r213421) +++ stable/7/sys/dev/mpt/mpt.c Mon Oct 4 20:13:21 2010 (r213422) @@ -842,13 +842,14 @@ mpt_complete_request_chain(struct mpt_so MSG_REQUEST_HEADER *msg_hdr; u_int cb_index; - TAILQ_REMOVE(chain, req, links); msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf; ioc_status_frame.Function = msg_hdr->Function; ioc_status_frame.MsgContext = msg_hdr->MsgContext; cb_index = MPT_CONTEXT_TO_CBI(le32toh(msg_hdr->MsgContext)); mpt_reply_handlers[cb_index](mpt, req, msg_hdr->MsgContext, &ioc_status_frame); + if (mpt_req_on_pending_list(mpt, req) != 0) + TAILQ_REMOVE(chain, req, links); } } Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Oct 4 20:13:19 2010 (r213421) +++ stable/7/sys/dev/mpt/mpt.h Mon Oct 4 20:13:21 2010 (r213422) @@ -1155,19 +1155,13 @@ mpt_tag_2_req(struct mpt_softc *mpt, uin KASSERT(mpt->tgt_cmd_ptrs[rtg], ("no cmd backpointer")); return (mpt->tgt_cmd_ptrs[rtg]); } - +#endif static __inline int mpt_req_on_free_list(struct mpt_softc *, request_t *); static __inline int mpt_req_on_pending_list(struct mpt_softc *, request_t *); -static __inline void -mpt_req_spcl(struct mpt_softc *, request_t *, const char *, int); -static __inline void -mpt_req_not_spcl(struct mpt_softc *, request_t *, const char *, int); - - /* * Is request on freelist? */ @@ -1200,6 +1194,12 @@ mpt_req_on_pending_list(struct mpt_softc return (0); } +#ifdef INVARIANTS +static __inline void +mpt_req_spcl(struct mpt_softc *, request_t *, const char *, int); +static __inline void +mpt_req_not_spcl(struct mpt_softc *, request_t *, const char *, int); + /* * Make sure that req *is* part of one of the special lists */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 20:49:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53910106564A; Mon, 4 Oct 2010 20:49:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42AAE8FC16; Mon, 4 Oct 2010 20:49: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 o94KndMl026978; Mon, 4 Oct 2010 20:49:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94Knd5h026976; Mon, 4 Oct 2010 20:49:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010042049.o94Knd5h026976@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 4 Oct 2010 20:49: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: r213423 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 20:49:39 -0000 Author: yongari Date: Mon Oct 4 20:49:38 2010 New Revision: 213423 URL: http://svn.freebsd.org/changeset/base/213423 Log: Move updating TX packet counter to the inside of send loop. axe(4) controllers combine multiple TX requests into single one if there is room in TX buffer of controller. Updating TX packet counter at the end of TX completion resulted in incorrect TX packet counter as axe(4) thought it sent 1 packet. There is no easy way to know how many combined TX were completed in the callback. Because this change updates TX packet counter before actual transmission, it may not be ideal one. But I believe it's better than showing fake 8kpps under high TX load. With this change, TX shows 221kpps on Linksus USB200M. Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Oct 4 20:13:21 2010 (r213422) +++ head/sys/dev/usb/net/if_axe.c Mon Oct 4 20:49:38 2010 (r213423) @@ -912,7 +912,6 @@ axe_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); - ifp->if_opackets++; /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: @@ -958,6 +957,17 @@ tr_setup: pos += m->m_pkthdr.len; /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + ifp->if_opackets++; + + /* * if there's a BPF listener, bounce a copy * of this frame to him: */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 21:01:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEB441065672; Mon, 4 Oct 2010 21:01:27 +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 AE0E28FC1C; Mon, 4 Oct 2010 21:01: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 o94L1RcM027340; Mon, 4 Oct 2010 21:01:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94L1RQx027338; Mon, 4 Oct 2010 21:01:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010042101.o94L1RQx027338@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 4 Oct 2010 21:01: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: r213424 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 21:01:27 -0000 Author: yongari Date: Mon Oct 4 21:01:27 2010 New Revision: 213424 URL: http://svn.freebsd.org/changeset/base/213424 Log: Make upper stack know driver's output status. This change increased TX performance from 221kpps to 231kpps. Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Oct 4 20:49:38 2010 (r213423) +++ head/sys/dev/usb/net/if_axe.c Mon Oct 4 21:01:27 2010 (r213424) @@ -912,12 +912,15 @@ axe_bulk_write_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - if ((sc->sc_flags & AXE_FLAG_LINK) == 0) { + if ((sc->sc_flags & AXE_FLAG_LINK) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { /* - * don't send anything if there is no link ! + * Don't send anything if there is no link or + * controller is busy. */ return; } @@ -988,6 +991,7 @@ tr_setup: usbd_xfer_set_frame_len(xfer, 0, pos); usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; default: /* Error */ @@ -995,6 +999,7 @@ tr_setup: usbd_errstr(error)); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ @@ -1127,7 +1132,7 @@ axe_stop(struct usb_ether *ue) AXE_LOCK_ASSERT(sc, MA_OWNED); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->sc_flags &= ~AXE_FLAG_LINK; /* From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 21:24:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 768AC1065670; Mon, 4 Oct 2010 21:24:10 +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 65ADC8FC21; Mon, 4 Oct 2010 21:24: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 o94LOAfG027806; Mon, 4 Oct 2010 21:24:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94LOAJw027804; Mon, 4 Oct 2010 21:24:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042124.o94LOAJw027804@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 21:24: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: r213425 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 21:24:10 -0000 Author: hselasky Date: Mon Oct 4 21:24:10 2010 New Revision: 213425 URL: http://svn.freebsd.org/changeset/base/213425 Log: The root mount hold reference was not released on USB controller attach failures during boot. Fix this. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Mon Oct 4 21:01:27 2010 (r213424) +++ head/sys/dev/usb/controller/usb_controller.c Mon Oct 4 21:24:10 2010 (r213425) @@ -121,6 +121,16 @@ usb_probe(device_t dev) return (0); } +static void +usb_root_mount_rel(struct usb_bus *bus) +{ + if (bus->bus_roothold != NULL) { + DPRINTF("Releasing root mount hold %p\n", bus->bus_roothold); + root_mount_rel(bus->bus_roothold); + bus->bus_roothold = NULL; + } +} + /*------------------------------------------------------------------------* * usb_attach *------------------------------------------------------------------------*/ @@ -164,10 +174,7 @@ usb_detach(device_t dev) usb_callout_drain(&bus->power_wdog); /* Let the USB explore process detach all devices. */ - if (bus->bus_roothold != NULL) { - root_mount_rel(bus->bus_roothold); - bus->bus_roothold = NULL; - } + usb_root_mount_rel(bus); USB_BUS_LOCK(bus); if (usb_proc_msignal(&bus->explore_proc, @@ -244,10 +251,7 @@ usb_bus_explore(struct usb_proc_msg *pm) (udev->hub->explore) (udev); USB_BUS_LOCK(bus); } - if (bus->bus_roothold != NULL) { - root_mount_rel(bus->bus_roothold); - bus->bus_roothold = NULL; - } + usb_root_mount_rel(bus); } /*------------------------------------------------------------------------* @@ -353,6 +357,7 @@ usb_bus_attach(struct usb_proc_msg *pm) default: device_printf(bus->bdev, "Unsupported USB revision\n"); + usb_root_mount_rel(bus); return; } @@ -394,6 +399,7 @@ usb_bus_attach(struct usb_proc_msg *pm) if (err) { device_printf(bus->bdev, "Root HUB problem, error=%s\n", usbd_errstr(err)); + usb_root_mount_rel(bus); } /* set softc - we are ready */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 21:30:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20ABD106564A; Mon, 4 Oct 2010 21:30:16 +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 0FCB78FC19; Mon, 4 Oct 2010 21:30: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 o94LUF9V027990; Mon, 4 Oct 2010 21:30:15 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94LUFlE027988; Mon, 4 Oct 2010 21:30:15 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042130.o94LUFlE027988@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 21:30: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: r213426 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 21:30:16 -0000 Author: hselasky Date: Mon Oct 4 21:30:15 2010 New Revision: 213426 URL: http://svn.freebsd.org/changeset/base/213426 Log: Add missing DRIVER_MODULE() entry for the musbotg driver. Add some more comments. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Mon Oct 4 21:24:10 2010 (r213425) +++ head/sys/dev/usb/controller/usb_controller.c Mon Oct 4 21:30:15 2010 (r213426) @@ -103,10 +103,14 @@ static driver_t usb_driver = { .size = 0, }; +/* Host Only Drivers */ DRIVER_MODULE(usbus, ohci, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, uhci, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, ehci, usb_driver, usb_devclass, 0, 0); + +/* Device Only Drivers */ DRIVER_MODULE(usbus, at91_udp, usb_driver, usb_devclass, 0, 0); +DRIVER_MODULE(usbus, musbotg, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, uss820, usb_driver, usb_devclass, 0, 0); /*------------------------------------------------------------------------* From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 21:38:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD367106566B; Mon, 4 Oct 2010 21:38:10 +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 BC5448FC0C; Mon, 4 Oct 2010 21:38: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 o94LcACB028214; Mon, 4 Oct 2010 21:38:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94LcAQ2028212; Mon, 4 Oct 2010 21:38:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042138.o94LcAQ2028212@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 21:38: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: r213427 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 21:38:11 -0000 Author: hselasky Date: Mon Oct 4 21:38:10 2010 New Revision: 213427 URL: http://svn.freebsd.org/changeset/base/213427 Log: Add missing USB 3.0 definitions. Correct some wrong ones. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb.h Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Mon Oct 4 21:30:15 2010 (r213426) +++ head/sys/dev/usb/usb.h Mon Oct 4 21:38:10 2010 (r213427) @@ -208,6 +208,7 @@ typedef struct usb_device_request usb_de #define UDESC_CS_INTERFACE 0x24 #define UDESC_CS_ENDPOINT 0x25 #define UDESC_HUB 0x29 +#define UDESC_SS_HUB 0x2A /* super speed */ #define UDESC_ENDPOINT_SS_COMP 0x30 /* super speed */ #define UR_SET_DESCRIPTOR 0x07 #define UR_GET_CONFIG 0x08 @@ -225,6 +226,7 @@ typedef struct usb_device_request usb_de #define UR_GET_TT_STATE 0x0a #define UR_STOP_TT 0x0b #define UR_SET_HUB_DEPTH 0x0c +#define USB_SS_HUB_DEPTH_MAX 5 #define UR_GET_PORT_ERR_COUNT 0x0d /* Feature numbers */ @@ -332,7 +334,7 @@ struct usb_devcap_ss_descriptor { uByte bDevCapabilityType; uByte bmAttributes; uWord wSpeedsSupported; - uByte bFunctionaltySupport; + uByte bFunctionalitySupport; uByte bU1DevExitLat; uByte bU2DevExitLat; } __packed; @@ -343,7 +345,7 @@ struct usb_devcap_container_id_descripto uByte bDescriptorType; uByte bDevCapabilityType; uByte bReserved; - uByte ContainerID; + uByte bContainerID; } __packed; typedef struct usb_devcap_container_id_descriptor usb_devcap_container_id_descriptor_t; @@ -356,6 +358,7 @@ typedef struct usb_devcap_container_id_d #define UDPROTO_FSHUB 0x00 #define UDPROTO_HSHUBSTT 0x01 #define UDPROTO_HSHUBMTT 0x02 +#define UDPROTO_SSHUB 0x03 #define UDCLASS_DIAGNOSTIC 0xdc #define UDCLASS_WIRELESS 0xe0 #define UDSUBCLASS_RF 0x01 @@ -533,7 +536,7 @@ typedef struct usb_endpoint_descriptor u struct usb_endpoint_ss_comp_descriptor { uByte bLength; uByte bDescriptorType; - uWord bMaxBurst; + uByte bMaxBurst; uByte bmAttributes; uWord wBytesPerInterval; } __packed; @@ -591,15 +594,15 @@ struct usb_hub_descriptor { typedef struct usb_hub_descriptor usb_hub_descriptor_t; struct usb_hub_ss_descriptor { - uByte bDescLength; + uByte bLength; uByte bDescriptorType; - uByte bNbrPorts; /* max 15 */ + uByte bNbrPorts; uWord wHubCharacteristics; uByte bPwrOn2PwrGood; /* delay in 2 ms units */ uByte bHubContrCurrent; uByte bHubHdrDecLat; uWord wHubDelay; - uByte DeviceRemovable[2]; /* max 15 ports */ + uByte DeviceRemovable[32]; /* max 255 ports */ } __packed; typedef struct usb_hub_ss_descriptor usb_hub_ss_descriptor_t; @@ -668,9 +671,25 @@ struct usb_port_status { #define UPS_SUSPEND 0x0004 #define UPS_OVERCURRENT_INDICATOR 0x0008 #define UPS_RESET 0x0010 +/* The link-state bits are valid for Super-Speed USB HUBs */ +#define UPS_PORT_LINK_STATE_GET(x) (((x) >> 5) & 0xF) +#define UPS_PORT_LINK_STATE_SET(x) (((x) & 0xF) << 5) +#define UPS_PORT_LS_U0 0x00 +#define UPS_PORT_LS_U1 0x01 +#define UPS_PORT_LS_U2 0x02 +#define UPS_PORT_LS_U3 0x03 +#define UPS_PORT_LS_SS_DIS 0x04 +#define UPS_PORT_LS_RX_DET 0x05 +#define UPS_PORT_LS_SS_INA 0x06 +#define UPS_PORT_LS_POLL 0x07 +#define UPS_PORT_LS_RECOVER 0x08 +#define UPS_PORT_LS_HOT_RST 0x09 +#define UPS_PORT_LS_COMP_MODE 0x0A +#define UPS_PORT_LS_LOOPBACK 0x0B #define UPS_PORT_POWER 0x0100 #define UPS_LOW_SPEED 0x0200 #define UPS_HIGH_SPEED 0x0400 +#define UPS_OTHER_SPEED 0x0600 /* currently FreeBSD specific */ #define UPS_PORT_TEST 0x0800 #define UPS_PORT_INDICATOR 0x1000 #define UPS_PORT_MODE_DEVICE 0x8000 /* currently FreeBSD specific */ @@ -680,6 +699,9 @@ struct usb_port_status { #define UPS_C_SUSPEND 0x0004 #define UPS_C_OVERCURRENT_INDICATOR 0x0008 #define UPS_C_PORT_RESET 0x0010 +#define UPS_C_BH_PORT_RESET 0x0020 +#define UPS_C_PORT_LINK_STATE 0x0040 +#define UPS_C_PORT_CONFIG_ERROR 0x0080 } __packed; typedef struct usb_port_status usb_port_status_t; From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 21:41:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35B60106564A; Mon, 4 Oct 2010 21:41:19 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 253FF8FC14; Mon, 4 Oct 2010 21:41: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 o94LfJsr028305; Mon, 4 Oct 2010 21:41:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94LfJiA028303; Mon, 4 Oct 2010 21:41:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010042141.o94LfJiA028303@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 4 Oct 2010 21:41: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: r213428 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 21:41:19 -0000 Author: pjd Date: Mon Oct 4 21:41:18 2010 New Revision: 213428 URL: http://svn.freebsd.org/changeset/base/213428 Log: We can't mask ignored signal, so install dummy signal hander for SIGCHLD before masking it. This fixes bogus reports about hooks running for too long and other problems related to garbage-collecting child processes. Reported by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Mon Oct 4 21:38:10 2010 (r213427) +++ head/sbin/hastd/hastd.c Mon Oct 4 21:41:18 2010 (r213428) @@ -685,6 +685,12 @@ main_loop(void) } } +static void +dummy_sighandler(int sig __unused) +{ + /* Nothing to do. */ +} + int main(int argc, char *argv[]) { @@ -743,6 +749,11 @@ main(int argc, char *argv[]) cfg = yy_config_parse(cfgpath, true); assert(cfg != NULL); + /* + * Because SIGCHLD is ignored by default, setup dummy handler for it, + * so we can mask it. + */ + PJDLOG_VERIFY(signal(SIGCHLD, dummy_sighandler) != SIG_ERR); PJDLOG_VERIFY(sigemptyset(&mask) == 0); PJDLOG_VERIFY(sigaddset(&mask, SIGHUP) == 0); PJDLOG_VERIFY(sigaddset(&mask, SIGINT) == 0); From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 21:42:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF3181065698; Mon, 4 Oct 2010 21:42:02 +0000 (UTC) (envelope-from swell.k@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 DC0D28FC19; Mon, 4 Oct 2010 21:42:01 +0000 (UTC) Received: by bwz15 with SMTP id 15so5410246bwz.13 for ; Mon, 04 Oct 2010 14:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:message-id:user-agent:mime-version:content-type; bh=1O29XTtDXksbvNthZs/2FSBGOx6/e6IXAfxS7qrqq04=; b=dqF9WqR4RlJfrIRPtcxsb0rkT1wfl0ZIdBqBmRzYLXQd4WdIyOl+Yyf3SIoy61EjeZ DrTgANI3GDt2Lqs1KYdqR4q7SqnwoMbesjkaqaZ9tpQVTSmdTz6PZ/oHBqJ9X15DavMQ Putc2osT1aZsJ7ZUVQiUK1OpHdVONYX8yhkak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type; b=K73fvtRKJ4BlJzcW33giBZDSvXjqnNRKuQPws7+482MXchPCismX8TyIL7be1vrBZz iJuFlfxy58fJCMaKdolyTFLYzVSl6XvCBEZRd5ZvzL3ALpsshJ9F9fK5eJqYWoaGMH4n TipMUk4Wg3LcfFxn0wDrMrUQaxWQAFJcIzErI= Received: by 10.204.51.67 with SMTP id c3mr7533282bkg.69.1286228520675; Mon, 04 Oct 2010 14:42:00 -0700 (PDT) Received: from localhost (tor-proxy.trit.net [208.75.88.34]) by mx.google.com with ESMTPS id f18sm4217358bkf.3.2010.10.04.14.41.46 (version=SSLv3 cipher=RC4-MD5); Mon, 04 Oct 2010 14:41:58 -0700 (PDT) From: Anonymous To: Dimitry Andric References: <201009212141.o8LLfjHX007646@svn.freebsd.org> <86mxqx7q9o.fsf@gmail.com> <4CA64BF1.9080401@FreeBSD.org> Date: Tue, 05 Oct 2010 01:39:31 +0400 Message-ID: <8639sl7i3w.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: r212979 - in head: gnu/lib/libobjc sys/boot/i386/boot2 sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 21:42:03 -0000 Dimitry Andric writes: > The particular case of libobjc is special, because it is the only > Makefile that both modifies CC, and takes the default CFLAGS from > make.conf. The only other cases where we *must* compile with gcc for > now, are boot2 for i386 and pc98, but these set their CFLAGS to a > hardcoded value. > > A solution could be to always use hardcoded CFLAGS for libobjc. > Otherwise, we could check for a GCC_CFLAGS in libobjc's Makefile, and > substitute these for the regular CFLAGS, iff clang is used to build > world. Does that sound acceptable? What are GCC_CFLAGS and "regular CFLAGS"? And note, you haven't explained why CLANG_FLAGS is bad. I've compiled the world with below src.conf a few times without issues >> CC = clang ${CLANG_FLAGS} >> CLANG_FLAGS = -Qunused-arguments # too much noise for `make -s' build No need to document the variable, it's temporary as the workaround. %% diff --git a/gnu/lib/libobjc/Makefile b/gnu/lib/libobjc/Makefile index 80d0240..b61bf91 100644 --- a/gnu/lib/libobjc/Makefile +++ b/gnu/lib/libobjc/Makefile @@ -16,6 +16,7 @@ SRCS= archive.c class.c encoding.c gc.c hash.c init.c linking.m misc.c \ selector.c sendmsg.c thr.c thr-objc.c exception.c # XXX: clang cannot compile libobjc yet +CLANG_FLAGS= # clear clang-specific user cflags CC:=${CC:C/^(.*\/)?clang$/gcc/1} INCS= encoding.h hash.h objc-api.h objc-decls.h objc-list.h objc.h runtime.h \ diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index b91a43b..ed5727e 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -3,6 +3,7 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big +CLANG_FLAGS= # clear clang-specific user cflags CC:=${CC:C/^(.*\/)?clang$/gcc/1} FILES= boot boot1 boot2 diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile index dfd8607..e605c8a 100644 --- a/sys/boot/pc98/boot2/Makefile +++ b/sys/boot/pc98/boot2/Makefile @@ -3,6 +3,7 @@ .include # XXX: clang can compile the boot code just fine, but boot2 gets too big +CLANG_FLAGS= # clear clang-specific user cflags CC:=${CC:C/^(.*\/)?clang$/gcc/1} FILES= boot boot1 boot2 %% From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 21:43:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F6A5106564A; Mon, 4 Oct 2010 21:43:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8B878FC19; Mon, 4 Oct 2010 21:43: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 o94Lh6bh028375; Mon, 4 Oct 2010 21:43:06 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94Lh6HS028371; Mon, 4 Oct 2010 21:43:06 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010042143.o94Lh6HS028371@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 4 Oct 2010 21:43: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: r213429 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 21:43:07 -0000 Author: pjd Date: Mon Oct 4 21:43:06 2010 New Revision: 213429 URL: http://svn.freebsd.org/changeset/base/213429 Log: hook_check() is now only used to report about long-running hooks, so the argument is redundant, remove it. MFC after: 3 days Modified: head/sbin/hastd/hastd.c head/sbin/hastd/hooks.c head/sbin/hastd/hooks.h Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Mon Oct 4 21:41:18 2010 (r213428) +++ head/sbin/hastd/hastd.c Mon Oct 4 21:43:06 2010 (r213429) @@ -659,7 +659,7 @@ main_loop(void) assert(maxfd + 1 <= (int)FD_SETSIZE); ret = select(maxfd + 1, &rfds, NULL, NULL, &seltimeout); if (ret == 0) - hook_check(false); + hook_check(); else if (ret == -1) { if (errno == EINTR) continue; Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Mon Oct 4 21:41:18 2010 (r213428) +++ head/sbin/hastd/hooks.c Mon Oct 4 21:43:06 2010 (r213429) @@ -293,24 +293,14 @@ hook_check_one(pid_t pid, int status) } void -hook_check(bool sigchld) +hook_check(void) { struct hookproc *hp, *hp2; - int status; time_t now; - pid_t pid; assert(hooks_initialized); /* - * If SIGCHLD was received, garbage collect finished processes. - */ - if (sigchld) { - while ((pid = wait3(&status, WNOHANG, NULL)) > 0) - hook_check_one(pid, status); - } - - /* * Report about processes that are running for a long time. */ now = time(NULL); Modified: head/sbin/hastd/hooks.h ============================================================================== --- head/sbin/hastd/hooks.h Mon Oct 4 21:41:18 2010 (r213428) +++ head/sbin/hastd/hooks.h Mon Oct 4 21:43:06 2010 (r213429) @@ -41,7 +41,7 @@ void hook_init(void); void hook_fini(void); void hook_check_one(pid_t pid, int status); -void hook_check(bool sigchld); +void hook_check(void); void hook_exec(const char *path, ...); void hook_execv(const char *path, va_list ap); From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 21:44:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FCD71065673; Mon, 4 Oct 2010 21:44:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F80A8FC12; Mon, 4 Oct 2010 21:44: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 o94LiR2w028449; Mon, 4 Oct 2010 21:44:27 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94LiRVe028447; Mon, 4 Oct 2010 21:44:27 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010042144.o94LiRVe028447@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 4 Oct 2010 21:44: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: r213430 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 21:44:27 -0000 Author: pjd Date: Mon Oct 4 21:44:26 2010 New Revision: 213430 URL: http://svn.freebsd.org/changeset/base/213430 Log: Decrease report interval to 5 seconds, as this also means we will check for signals every 5 seconds and not every 10 seconds as before. MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Mon Oct 4 21:43:06 2010 (r213429) +++ head/sbin/hastd/hastd.c Mon Oct 4 21:44:26 2010 (r213430) @@ -69,7 +69,7 @@ bool sigexit_received = false; struct pidfh *pfh; /* How often check for hooks running for too long. */ -#define REPORT_INTERVAL 10 +#define REPORT_INTERVAL 5 static void usage(void) From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 22:04:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52C3D106566C; Mon, 4 Oct 2010 22:04:23 +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 425C88FC21; Mon, 4 Oct 2010 22:04: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 o94M4NJH028902; Mon, 4 Oct 2010 22:04:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94M4ND7028900; Mon, 4 Oct 2010 22:04:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042204.o94M4ND7028900@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 22:04: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: r213431 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 22:04:23 -0000 Author: hselasky Date: Mon Oct 4 22:04:22 2010 New Revision: 213431 URL: http://svn.freebsd.org/changeset/base/213431 Log: Correct IOCTL return code. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Mon Oct 4 21:44:26 2010 (r213430) +++ head/sys/dev/usb/usb_dev.c Mon Oct 4 22:04:22 2010 (r213431) @@ -1456,7 +1456,7 @@ usb_static_ioctl(struct cdev *dev, u_lon struct usb_read_dir *urd; void* data; } u; - int err = ENOTTY; + int err; u.data = data; switch (cmd) { @@ -1472,6 +1472,7 @@ usb_static_ioctl(struct cdev *dev, u_lon break; case USB_GET_TEMPLATE: *(int *)data = usb_template; + err = 0; break; case USB_SET_TEMPLATE: err = priv_check(curthread, PRIV_DRIVER); @@ -1479,6 +1480,9 @@ usb_static_ioctl(struct cdev *dev, u_lon break; usb_template = *(int *)data; break; + default: + err = ENOTTY; + break; } return (err); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 22:21:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83DDD1065672; Mon, 4 Oct 2010 22:21:30 +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 72A6E8FC14; Mon, 4 Oct 2010 22:21: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 o94MLU0N029257; Mon, 4 Oct 2010 22:21:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94MLU93029252; Mon, 4 Oct 2010 22:21:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042221.o94MLU93029252@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 22:21: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: r213432 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 22:21:30 -0000 Author: hselasky Date: Mon Oct 4 22:21:30 2010 New Revision: 213432 URL: http://svn.freebsd.org/changeset/base/213432 Log: Serialise USB re-enumeration with the USB explore thread. This patch can solve problems when multiple USB devices are re-enumerated at the same time on the same bus. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Mon Oct 4 22:04:22 2010 (r213431) +++ head/sys/dev/usb/usb_dev.c Mon Oct 4 22:21:30 2010 (r213432) @@ -964,7 +964,6 @@ usb_dev_uninit(void *arg) if (usb_dev != NULL) { destroy_dev(usb_dev); usb_dev = NULL; - } mtx_destroy(&usb_ref_lock); sx_destroy(&usb_sym_lock); @@ -1058,21 +1057,45 @@ usb_ioctl(struct cdev *dev, u_long cmd, err = usb_ioctl_f_sub(f, cmd, addr, td); } KASSERT(f != NULL, ("fifo not found")); - if (err == ENOIOCTL) { - err = (f->methods->f_ioctl) (f, cmd, addr, fflags); - DPRINTFN(2, "f_ioctl cmd 0x%lx = %d\n", cmd, err); - if (err == ENOIOCTL) { - if (usb_usb_ref_device(cpd, &refs)) { - err = ENXIO; - goto done; - } - err = (f->methods->f_ioctl_post) (f, cmd, addr, fflags); - DPRINTFN(2, "f_ioctl_post cmd 0x%lx = %d\n", cmd, err); - } + if (err != ENOIOCTL) + goto done; + + err = (f->methods->f_ioctl) (f, cmd, addr, fflags); + + DPRINTFN(2, "f_ioctl cmd 0x%lx = %d\n", cmd, err); + + if (err != ENOIOCTL) + goto done; + + if (usb_usb_ref_device(cpd, &refs)) { + err = ENXIO; + goto done; } - if (err == ENOIOCTL) { + + err = (f->methods->f_ioctl_post) (f, cmd, addr, fflags); + + DPRINTFN(2, "f_ioctl_post cmd 0x%lx = %d\n", cmd, err); + + if (err == ENOIOCTL) err = ENOTTY; + + if (err) + goto done; + + /* Wait for re-enumeration, if any */ + + while (f->udev->re_enumerate_wait != 0) { + + usb_unref_device(cpd, &refs); + + usb_pause_mtx(NULL, hz / 128); + + if (usb_ref_device(cpd, &refs, 1 /* need uref */)) { + err = ENXIO; + goto done; + } } + done: usb_unref_device(cpd, &refs); return (err); Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Mon Oct 4 22:04:22 2010 (r213431) +++ head/sys/dev/usb/usb_device.h Mon Oct 4 22:21:30 2010 (r213432) @@ -160,6 +160,7 @@ struct usb_device { uint8_t hs_port_no; /* high-speed HUB port number */ uint8_t driver_added_refcount; /* our driver added generation count */ uint8_t power_mode; /* see USB_POWER_XXX */ + uint8_t re_enumerate_wait; /* set if re-enum. is in progress */ uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Mon Oct 4 22:04:22 2010 (r213431) +++ head/sys/dev/usb/usb_generic.c Mon Oct 4 22:21:30 2010 (r213432) @@ -109,7 +109,7 @@ static int usb_gen_fill_deviceinfo(struc static int ugen_re_enumerate(struct usb_fifo *); static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int); static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *); -static int ugen_fs_uninit(struct usb_fifo *f); +static int ugen_fs_uninit(struct usb_fifo *f); /* structures */ @@ -951,23 +951,19 @@ ugen_re_enumerate(struct usb_fifo *f) if (error) { return (error); } - /* get the device unconfigured */ - error = ugen_set_config(f, USB_UNCONFIG_INDEX); - if (error) { - return (error); + if (udev->flags.usb_mode != USB_MODE_HOST) { + /* not possible in device side mode */ + return (ENOTTY); } - /* do a bus-reset */ - mtx_lock(f->priv_mtx); - error = usbd_req_re_enumerate(udev, f->priv_mtx); - mtx_unlock(f->priv_mtx); - - if (error) { - return (ENXIO); + /* make sure all FIFO's are gone */ + /* else there can be a deadlock */ + if (ugen_fs_uninit(f)) { + /* ignore any errors */ + DPRINTFN(6, "no FIFOs\n"); } - /* restore configuration to index 0 */ - error = ugen_set_config(f, 0); - if (error) { - return (error); + if (udev->re_enumerate_wait == 0) { + udev->re_enumerate_wait = 1; + usb_needs_explore(udev->bus, 0); } return (0); } @@ -1775,9 +1771,11 @@ ugen_set_power_mode(struct usb_fifo *f, /* if we are powered off we need to re-enumerate first */ if (old_mode == USB_POWER_MODE_OFF) { - err = ugen_re_enumerate(f); - if (err) - return (err); + if (udev->flags.usb_mode == USB_MODE_HOST) { + if (udev->re_enumerate_wait == 0) + udev->re_enumerate_wait = 1; + } + /* set power mode will wake up the explore thread */ } /* set new power mode */ Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon Oct 4 22:04:22 2010 (r213431) +++ head/sys/dev/usb/usb_hub.c Mon Oct 4 22:21:30 2010 (r213432) @@ -236,6 +236,26 @@ uhub_explore_sub(struct uhub_softc *sc, /* nothing to do */ goto done; } + /* check if device should be re-enumerated */ + + if (child->flags.usb_mode == USB_MODE_HOST) { + usbd_enum_lock(child); + if (child->re_enumerate_wait) { + err = usbd_set_config_index(child, USB_UNCONFIG_INDEX); + if (err == 0) + err = usbd_req_re_enumerate(child, NULL); + if (err == 0) + err = usbd_set_config_index(child, 0); + if (err == 0) { + err = usb_probe_and_attach(child, + USB_IFACE_INDEX_ANY); + } + child->re_enumerate_wait = 0; + err = 0; + } + usbd_enum_unlock(child); + } + /* check if probe and attach should be done */ if (child->driver_added_refcount != refcount) { @@ -1763,6 +1783,8 @@ static uint8_t usb_peer_should_wakeup(struct usb_device *udev) { return ((udev->power_mode == USB_POWER_MODE_ON) || + (udev->driver_added_refcount != udev->bus->driver_added_refcount) || + (udev->re_enumerate_wait != 0) || (udev->pwr_save.type_refs[UE_ISOCHRONOUS] != 0) || (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 22:45:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C94311065672; Mon, 4 Oct 2010 22:45:17 +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 B8DF18FC15; Mon, 4 Oct 2010 22: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 o94MjHaD029973; Mon, 4 Oct 2010 22:45:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94MjHf9029971; Mon, 4 Oct 2010 22:45:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042245.o94MjHf9029971@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 22: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: r213433 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 22:45:17 -0000 Author: hselasky Date: Mon Oct 4 22:45:17 2010 New Revision: 213433 URL: http://svn.freebsd.org/changeset/base/213433 Log: Add more strict USB string filtering. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Mon Oct 4 22:21:30 2010 (r213432) +++ head/sys/dev/usb/usb_request.c Mon Oct 4 22:45:17 2010 (r213433) @@ -1018,14 +1018,21 @@ usbd_req_get_string_any(struct usb_devic } /* - * Filter by default - we don't allow greater and less than - * signs because they might confuse the dmesg printouts! + * Filter by default - We only allow alphanumerical + * and a few more to avoid any problems with scripts + * and daemons. */ - if ((*s == '<') || (*s == '>') || (!isprint(*s))) { - /* silently skip bad character */ - continue; + if (isalpha(*s) || + isdigit(*s) || + *s == '-' || + *s == '+' || + *s == ' ' || + *s == '.' || + *s == ',') { + /* allowed */ + s++; } - s++; + /* silently skip bad character */ } *s = 0; /* zero terminate resulting string */ return (USB_ERR_NORMAL_COMPLETION); From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 22:50:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92711106567A; Mon, 4 Oct 2010 22:50:08 +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 823BB8FC0C; Mon, 4 Oct 2010 22:50:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o94Mo84x030101; Mon, 4 Oct 2010 22:50:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94Mo8Mu030099; Mon, 4 Oct 2010 22:50:08 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042250.o94Mo8Mu030099@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 22:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213434 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 22:50:08 -0000 Author: hselasky Date: Mon Oct 4 22:50:08 2010 New Revision: 213434 URL: http://svn.freebsd.org/changeset/base/213434 Log: Add missing #if's Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb_handle_request.c Modified: head/sys/dev/usb/usb_handle_request.c ============================================================================== --- head/sys/dev/usb/usb_handle_request.c Mon Oct 4 22:45:17 2010 (r213433) +++ head/sys/dev/usb/usb_handle_request.c Mon Oct 4 22:50:08 2010 (r213434) @@ -438,8 +438,10 @@ usb_handle_remote_wakeup(struct usb_xfer USB_BUS_UNLOCK(bus); +#if USB_HAVE_POWERD /* In case we are out of sync, update the power state. */ usb_bus_power_update(udev->bus); +#endif return (0); /* success */ } From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 23:18:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1124C1065675; Mon, 4 Oct 2010 23:18:06 +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 F34238FC19; Mon, 4 Oct 2010 23:18: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 o94NI5NS030668; Mon, 4 Oct 2010 23:18:05 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94NI5HS030661; Mon, 4 Oct 2010 23:18:05 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042318.o94NI5HS030661@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 23:18: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: r213435 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 23:18:06 -0000 Author: hselasky Date: Mon Oct 4 23:18:05 2010 New Revision: 213435 URL: http://svn.freebsd.org/changeset/base/213435 Log: This commit adds full support for USB 3.0 devices in host and device mode in the USB core. The patch mostly consists of updating the USB HUB code to support USB 3.0 HUBs. This patch also add some more USB controller methods to support more active-alike USB controllers like the XHCI which needs to be informed about various device state events. USB 3.0 HUBs are not tested yet, due to lack of hardware, but are believed to work. After this update the initial device descriptor is only read twice when we know that the bMaxPacketSize is too small for a single packet transfer of this descriptor. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_parse.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_request.h head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usb_transfer.h head/sys/dev/usb/usbdi.h head/sys/dev/usb/usbdi_util.h Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Mon Oct 4 22:50:08 2010 (r213434) +++ head/sys/dev/usb/controller/usb_controller.c Mon Oct 4 23:18:05 2010 (r213435) @@ -107,6 +107,7 @@ static driver_t usb_driver = { DRIVER_MODULE(usbus, ohci, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, uhci, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, ehci, usb_driver, usb_devclass, 0, 0); +DRIVER_MODULE(usbus, xhci, usb_driver, usb_devclass, 0, 0); /* Device Only Drivers */ DRIVER_MODULE(usbus, at91_udp, usb_driver, usb_devclass, 0, 0); @@ -359,6 +360,11 @@ usb_bus_attach(struct usb_proc_msg *pm) device_printf(bus->bdev, "480Mbps Wireless USB v2.5\n"); break; + case USB_REV_3_0: + speed = USB_SPEED_SUPER; + device_printf(bus->bdev, "4.8Gbps Super Speed USB v3.0\n"); + break; + default: device_printf(bus->bdev, "Unsupported USB revision\n"); usb_root_mount_rel(bus); Modified: head/sys/dev/usb/usb_controller.h ============================================================================== --- head/sys/dev/usb/usb_controller.h Mon Oct 4 22:50:08 2010 (r213434) +++ head/sys/dev/usb/usb_controller.h Mon Oct 4 23:18:05 2010 (r213435) @@ -97,6 +97,9 @@ struct usb_bus_methods { void (*get_hw_ep_profile) (struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr); void (*set_stall) (struct usb_device *udev, struct usb_xfer *xfer, struct usb_endpoint *ep, uint8_t *did_stall); + + /* USB Device mode mandatory. USB Host mode optional. */ + void (*clear_stall) (struct usb_device *udev, struct usb_endpoint *ep); /* Optional transfer polling support */ @@ -106,6 +109,28 @@ struct usb_bus_methods { /* Optional fixed power mode support */ void (*get_power_mode) (struct usb_device *udev, int8_t *pmode); + + /* Optional endpoint uninit */ + + void (*endpoint_uninit) (struct usb_device *, struct usb_endpoint *); + + /* Optional device init */ + + usb_error_t (*device_init) (struct usb_device *); + + /* Optional device uninit */ + + void (*device_uninit) (struct usb_device *); + + /* Optional for device and host mode */ + + void (*start_dma_delay) (struct usb_xfer *); + + void (*device_state_change) (struct usb_device *); + + /* Optional for host mode */ + + usb_error_t (*set_address) (struct usb_device *, struct mtx *, uint16_t); }; /* Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Oct 4 22:50:08 2010 (r213434) +++ head/sys/dev/usb/usb_device.c Mon Oct 4 23:18:05 2010 (r213435) @@ -45,12 +45,16 @@ #include #include #include -#include #include #include #include #include + +#if USB_HAVE_UGEN +#include +#endif + #include "usbdevs.h" #define USB_DEBUG_VAR usb_debug @@ -79,7 +83,9 @@ /* function prototypes */ static void usb_init_endpoint(struct usb_device *, uint8_t, - struct usb_endpoint_descriptor *, struct usb_endpoint *); + struct usb_endpoint_descriptor *, + struct usb_endpoint_ss_comp_descriptor *, + struct usb_endpoint *); static void usb_unconfigure(struct usb_device *, uint8_t); static void usb_detach_device_sub(struct usb_device *, device_t *, uint8_t); @@ -90,7 +96,7 @@ static void usb_init_attach_arg(struct u static void usb_suspend_resume_sub(struct usb_device *, device_t, uint8_t); static void usbd_clear_stall_proc(struct usb_proc_msg *_pm); -usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); +static usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); static void usbd_set_device_strings(struct usb_device *); #if USB_HAVE_UGEN static void usb_notify_addq(const char *type, struct usb_device *); @@ -360,7 +366,9 @@ usbd_interface_count(struct usb_device * *------------------------------------------------------------------------*/ static void usb_init_endpoint(struct usb_device *udev, uint8_t iface_index, - struct usb_endpoint_descriptor *edesc, struct usb_endpoint *ep) + struct usb_endpoint_descriptor *edesc, + struct usb_endpoint_ss_comp_descriptor *ecomp, + struct usb_endpoint *ep) { struct usb_bus_methods *methods; @@ -370,6 +378,7 @@ usb_init_endpoint(struct usb_device *ude /* initialise USB endpoint structure */ ep->edesc = edesc; + ep->ecomp = ecomp; ep->iface_index = iface_index; TAILQ_INIT(&ep->endpoint_q.head); ep->endpoint_q.command = &usbd_pipe_start; @@ -640,7 +649,7 @@ done: * 0: Success * Else: Failure *------------------------------------------------------------------------*/ -usb_error_t +static usb_error_t usb_config_parse(struct usb_device *udev, uint8_t iface_index, uint8_t cmd) { struct usb_idesc_parse_state ips; @@ -763,8 +772,14 @@ usb_config_parse(struct usb_device *udev ep = udev->endpoints + temp; if (do_init) { + void *ecomp; + + ecomp = usb_ed_comp_foreach(udev->cdesc, (void *)ed); + if (ecomp != NULL) + DPRINTFN(5, "Found endpoint companion descriptor\n"); + usb_init_endpoint(udev, - ips.iface_index, ed, ep); + ips.iface_index, ed, ecomp, ep); } temp ++; @@ -904,8 +919,8 @@ done: /*------------------------------------------------------------------------* * usbd_set_endpoint_stall * - * This function is used to make a BULK or INTERRUPT endpoint - * send STALL tokens. + * This function is used to make a BULK or INTERRUPT endpoint send + * STALL tokens in USB device mode. * * Returns: * 0: Success @@ -1536,7 +1551,6 @@ usb_alloc_device(device_t parent_dev, st udev->bus = bus; udev->address = USB_START_ADDR; /* default value */ udev->plugtime = (usb_ticks_t)ticks; - usb_set_device_state(udev, USB_STATE_POWERED); /* * We need to force the power mode to "on" because there are plenty * of USB devices out there that do not work very well with @@ -1555,6 +1569,11 @@ usb_alloc_device(device_t parent_dev, st udev->ctrl_ep_desc.wMaxPacketSize[0] = USB_MAX_IPACKET; udev->ctrl_ep_desc.wMaxPacketSize[1] = 0; udev->ctrl_ep_desc.bInterval = 0; + + /* set up default endpoint companion descriptor */ + udev->ctrl_ep_comp_desc.bLength = sizeof(udev->ctrl_ep_comp_desc); + udev->ctrl_ep_comp_desc.bDescriptorType = UDESC_ENDPOINT_SS_COMP; + udev->ddesc.bMaxPacketSize = USB_MAX_IPACKET; udev->speed = speed; @@ -1579,6 +1598,7 @@ usb_alloc_device(device_t parent_dev, st /* init the default endpoint */ usb_init_endpoint(udev, 0, &udev->ctrl_ep_desc, + &udev->ctrl_ep_comp_desc, &udev->ctrl_ep); /* set device index */ @@ -1597,13 +1617,29 @@ usb_alloc_device(device_t parent_dev, st /* Create a link from /dev/ugenX.X to the default endpoint */ make_dev_alias(udev->ctrl_dev, "%s", udev->ugen_name); #endif + /* Initialise device */ + if (bus->methods->device_init != NULL) { + err = (bus->methods->device_init) (udev); + if (err != 0) { + DPRINTFN(0, "device init %d failed " + "(%s, ignored)\n", device_index, + usbd_errstr(err)); + goto done; + } + } + /* set powered device state after device init is complete */ + usb_set_device_state(udev, USB_STATE_POWERED); + if (udev->flags.usb_mode == USB_MODE_HOST) { err = usbd_req_set_address(udev, NULL, device_index); - /* This is the new USB device address from now on */ - - udev->address = device_index; + /* + * This is the new USB device address from now on, if + * the set address request didn't set it already. + */ + if (udev->address == USB_START_ADDR) + udev->address = device_index; /* * We ignore any set-address errors, hence there are @@ -1619,9 +1655,6 @@ usb_alloc_device(device_t parent_dev, st "(%s, ignored)\n", udev->address, usbd_errstr(err)); } - /* allow device time to set new address */ - usb_pause_mtx(NULL, - USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); } else { /* We are not self powered */ udev->flags.self_powered = 0; @@ -1640,45 +1673,16 @@ usb_alloc_device(device_t parent_dev, st } usb_set_device_state(udev, USB_STATE_ADDRESSED); - /* - * Get the first 8 bytes of the device descriptor ! - * - * NOTE: "usbd_do_request" will check the device descriptor - * next time we do a request to see if the maximum packet size - * changed! The 8 first bytes of the device descriptor - * contains the maximum packet size to use on control endpoint - * 0. If this value is different from "USB_MAX_IPACKET" a new - * USB control request will be setup! - */ - err = usbd_req_get_desc(udev, NULL, NULL, &udev->ddesc, - USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); - if (err) { - DPRINTFN(0, "getting device descriptor " - "at addr %d failed, %s\n", udev->address, - usbd_errstr(err)); + /* setup the device descriptor and the initial "wMaxPacketSize" */ + err = usbd_setup_device_desc(udev, NULL); + + if (err != 0) { /* XXX try to re-enumerate the device */ err = usbd_req_re_enumerate(udev, NULL); - if (err) { + if (err) goto done; - } } - DPRINTF("adding unit addr=%d, rev=%02x, class=%d, " - "subclass=%d, protocol=%d, maxpacket=%d, len=%d, speed=%d\n", - udev->address, UGETW(udev->ddesc.bcdUSB), - udev->ddesc.bDeviceClass, - udev->ddesc.bDeviceSubClass, - udev->ddesc.bDeviceProtocol, - udev->ddesc.bMaxPacketSize, - udev->ddesc.bLength, - udev->speed); - /* get the full device descriptor */ - err = usbd_req_get_device_desc(udev, NULL, &udev->ddesc); - if (err) { - DPRINTF("addr=%d, getting full desc failed\n", - udev->address); - goto done; - } /* * Setup temporary USB attach args so that we can figure out some * basic quirks for this device. @@ -2068,6 +2072,10 @@ usb_free_device(struct usb_device *udev, KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries")); #endif + /* Uninitialise device */ + if (bus->methods->device_uninit != NULL) + (bus->methods->device_uninit) (udev); + /* free device */ free(udev->serial, M_USB); free(udev->manufacturer, M_USB); @@ -2598,6 +2606,17 @@ usb_set_device_state(struct usb_device * DPRINTF("udev %p state %s -> %s\n", udev, usb_statestr(udev->state), usb_statestr(state)); udev->state = state; + + if (udev->bus->methods->device_state_change != NULL) + (udev->bus->methods->device_state_change) (udev); +} + +enum usb_dev_state +usb_get_device_state(struct usb_device *udev) +{ + if (udev == NULL) + return (USB_STATE_DETACHED); + return (udev->state); } uint8_t Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Mon Oct 4 22:50:08 2010 (r213434) +++ head/sys/dev/usb/usb_device.h Mon Oct 4 23:18:05 2010 (r213435) @@ -151,6 +151,7 @@ struct usb_device { uint8_t address; /* device addess */ uint8_t device_index; /* device index in "bus->devices" */ + uint8_t controller_slot_id; /* controller specific value */ uint8_t curr_config_index; /* current configuration index */ uint8_t curr_config_no; /* current configuration number */ uint8_t depth; /* distance from root HUB */ @@ -169,11 +170,12 @@ struct usb_device { struct usb_device_flags flags; struct usb_endpoint_descriptor ctrl_ep_desc; /* for endpoint 0 */ + struct usb_endpoint_ss_comp_descriptor ctrl_ep_comp_desc; /* for endpoint 0 */ struct usb_device_descriptor ddesc; /* device descriptor */ - char *serial; /* serial number */ - char *manufacturer; /* manufacturer string */ - char *product; /* product string */ + char *serial; /* serial number, can be NULL */ + char *manufacturer; /* manufacturer string, can be NULL */ + char *product; /* product string, can be NULL */ #if USB_HAVE_COMPAT_LINUX /* Linux compat */ @@ -213,8 +215,9 @@ void usb_free_device(struct usb_device * void usb_linux_free_device(struct usb_device *dev); uint8_t usb_peer_can_wakeup(struct usb_device *udev); struct usb_endpoint *usb_endpoint_foreach(struct usb_device *udev, struct usb_endpoint *ep); -void usb_set_device_state(struct usb_device *udev, - enum usb_dev_state state); +void usb_set_device_state(struct usb_device *, enum usb_dev_state); +enum usb_dev_state usb_get_device_state(struct usb_device *); + void usbd_enum_lock(struct usb_device *); void usbd_enum_unlock(struct usb_device *); void usbd_sr_lock(struct usb_device *); Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon Oct 4 22:50:08 2010 (r213434) +++ head/sys/dev/usb/usb_hub.c Mon Oct 4 23:18:05 2010 (r213435) @@ -2,7 +2,7 @@ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2010 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -110,6 +110,7 @@ struct uhub_softc { #define UHUB_PROTO(sc) ((sc)->sc_udev->ddesc.bDeviceProtocol) #define UHUB_IS_HIGH_SPEED(sc) (UHUB_PROTO(sc) != UDPROTO_FSHUB) #define UHUB_IS_SINGLE_TT(sc) (UHUB_PROTO(sc) == UDPROTO_HSHUBSTT) +#define UHUB_IS_SUPER_SPEED(sc) (UHUB_PROTO(sc) == UDPROTO_SSHUB) /* prototypes for type checking: */ @@ -236,6 +237,7 @@ uhub_explore_sub(struct uhub_softc *sc, /* nothing to do */ goto done; } + /* check if device should be re-enumerated */ if (child->flags.usb_mode == USB_MODE_HOST) { @@ -268,14 +270,14 @@ uhub_explore_sub(struct uhub_softc *sc, } /* start control transfer, if device mode */ - if (child->flags.usb_mode == USB_MODE_DEVICE) { + if (child->flags.usb_mode == USB_MODE_DEVICE) usbd_ctrl_transfer_setup(child); - } + /* if a HUB becomes present, do a recursive HUB explore */ - if (child->hub) { + if (child->hub) err = (child->hub->explore) (child); - } + done: return (err); } @@ -374,11 +376,17 @@ repeat: DPRINTF("Port %d is in Host Mode\n", portno); if (sc->sc_st.port_status & UPS_SUSPEND) { + /* + * NOTE: Should not get here in SuperSpeed + * mode, because the HUB should report this + * bit as zero. + */ DPRINTF("Port %d was still " "suspended, clearing.\n", portno); - err = usbd_req_clear_port_feature(sc->sc_udev, + err = usbd_req_clear_port_feature(udev, NULL, portno, UHF_PORT_SUSPEND); } + /* USB Host Mode */ /* wait for maximum device power up time */ @@ -439,11 +447,49 @@ repeat: case USB_SPEED_LOW: speed = USB_SPEED_LOW; break; + case USB_SPEED_SUPER: + if (udev->parent_hub == NULL) { + /* Root HUB - special case */ + switch (sc->sc_st.port_status & UPS_OTHER_SPEED) { + case 0: + speed = USB_SPEED_FULL; + break; + case UPS_LOW_SPEED: + speed = USB_SPEED_LOW; + break; + case UPS_HIGH_SPEED: + speed = USB_SPEED_HIGH; + break; + default: + speed = USB_SPEED_SUPER; + break; + } + } else { + speed = USB_SPEED_SUPER; + } + break; default: /* same speed like parent */ speed = udev->speed; break; } + if (speed == USB_SPEED_SUPER) { + err = usbd_req_set_hub_u1_timeout(udev, NULL, + portno, 128 - (2 * udev->depth)); + if (err) { + DPRINTFN(0, "port %d U1 timeout " + "failed, error=%s\n", + portno, usbd_errstr(err)); + } + err = usbd_req_set_hub_u2_timeout(udev, NULL, + portno, 128 - (2 * udev->depth)); + if (err) { + DPRINTFN(0, "port %d U2 timeout " + "failed, error=%s\n", + portno, usbd_errstr(err)); + } + } + /* * Figure out the device mode * @@ -486,6 +532,28 @@ error: } /*------------------------------------------------------------------------* + * usb_device_20_compatible + * + * Returns: + * 0: HUB does not support suspend and resume + * Else: HUB supports suspend and resume + *------------------------------------------------------------------------*/ +static uint8_t +usb_device_20_compatible(struct usb_device *udev) +{ + if (udev == NULL) + return (0); + switch (udev->speed) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: + case USB_SPEED_HIGH: + return (1); + default: + return (0); + } +} + +/*------------------------------------------------------------------------* * uhub_suspend_resume_port * * Returns: @@ -508,8 +576,14 @@ uhub_suspend_resume_port(struct uhub_sof /* first clear the port suspend change bit */ - err = usbd_req_clear_port_feature(udev, NULL, - portno, UHF_C_PORT_SUSPEND); + if (usb_device_20_compatible(udev)) { + err = usbd_req_clear_port_feature(udev, NULL, + portno, UHF_C_PORT_SUSPEND); + } else { + err = usbd_req_clear_port_feature(udev, NULL, + portno, UHF_C_PORT_LINK_STATE); + } + if (err) { DPRINTF("clearing suspend failed.\n"); goto done; @@ -521,12 +595,24 @@ uhub_suspend_resume_port(struct uhub_sof DPRINTF("reading port status failed.\n"); goto done; } - /* get current state */ + /* convert current state */ - if (sc->sc_st.port_status & UPS_SUSPEND) { - is_suspend = 1; + if (usb_device_20_compatible(udev)) { + if (sc->sc_st.port_status & UPS_SUSPEND) { + is_suspend = 1; + } else { + is_suspend = 0; + } } else { - is_suspend = 0; + switch (UPS_PORT_LINK_STATE_GET(sc->sc_st.port_status)) { + case UPS_PORT_LS_U0: + case UPS_PORT_LS_U1: + is_suspend = 0; + break; + default: + is_suspend = 1; + break; + } } DPRINTF("suspended=%u\n", is_suspend); @@ -541,7 +627,8 @@ uhub_suspend_resume_port(struct uhub_sof */ if (is_suspend == 0) usb_dev_resume_peer(child); - else if (child->flags.usb_mode == USB_MODE_DEVICE) + else if ((child->flags.usb_mode == USB_MODE_DEVICE) || + (usb_device_20_compatible(child) == 0)) usb_dev_suspend_peer(child); } done: @@ -563,6 +650,26 @@ uhub_root_intr(struct usb_bus *bus, cons usb_needs_explore(bus, 0); } +static uint8_t +uhub_is_too_deep(struct usb_device *udev) +{ + switch (udev->speed) { + case USB_SPEED_FULL: + case USB_SPEED_LOW: + case USB_SPEED_HIGH: + if (udev->depth > USB_HUB_MAX_DEPTH) + return (1); + break; + case USB_SPEED_SUPER: + if (udev->depth > USB_SS_HUB_DEPTH_MAX) + return (1); + break; + default: + break; + } + return (0); +} + /*------------------------------------------------------------------------* * uhub_explore * @@ -585,11 +692,11 @@ uhub_explore(struct usb_device *udev) DPRINTFN(11, "udev=%p addr=%d\n", udev, udev->address); - /* ignore hubs that are too deep */ - if (udev->depth > USB_HUB_MAX_DEPTH) { + /* ignore devices that are too deep */ + if (uhub_is_too_deep(udev)) return (USB_ERR_TOO_DEEP); - } + /* check if device is suspended */ if (udev->flags.self_suspended) { /* need to wait until the child signals resume */ DPRINTF("Device is suspended!\n"); @@ -656,7 +763,7 @@ uhub_explore(struct usb_device *udev) break; } } - if (sc->sc_st.port_change & UPS_C_SUSPEND) { + if (sc->sc_st.port_change & (UPS_C_SUSPEND | UPS_C_PORT_LINK_STATE)) { err = uhub_suspend_resume_port(sc, portno); if (err) { /* most likely the HUB is gone */ @@ -684,20 +791,81 @@ uhub_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } + /* - * The subclass for USB HUBs is ignored because it is 0 for - * some and 1 for others. + * The subclass for USB HUBs is currently ignored because it + * is 0 for some and 1 for others. */ - if ((uaa->info.bConfigIndex == 0) && - (uaa->info.bDeviceClass == UDCLASS_HUB)) { + if (uaa->info.bConfigIndex == 0 && + uaa->info.bDeviceClass == UDCLASS_HUB) return (0); - } + return (ENXIO); } +/* NOTE: The information returned by this function can be wrong. */ +usb_error_t +uhub_query_info(struct usb_device *udev, uint8_t *pnports, uint8_t *ptt) +{ + struct usb_hub_descriptor hubdesc20; + struct usb_hub_ss_descriptor hubdesc30; + usb_error_t err; + uint8_t nports; + uint8_t tt; + + if (udev->ddesc.bDeviceClass != UDCLASS_HUB) + return (USB_ERR_INVAL); + + nports = 0; + tt = 0; + + switch (udev->speed) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: + case USB_SPEED_HIGH: + /* assuming that there is one port */ + err = usbd_req_get_hub_descriptor(udev, NULL, &hubdesc20, 1); + if (err) { + DPRINTFN(0, "getting USB 2.0 HUB descriptor failed," + "error=%s\n", usbd_errstr(err)); + break; + } + nports = hubdesc20.bNbrPorts; + if (nports > 127) + nports = 127; + + if (udev->speed == USB_SPEED_HIGH) + tt = (UGETW(hubdesc20.wHubCharacteristics) >> 5) & 3; + break; + + case USB_SPEED_SUPER: + err = usbd_req_get_ss_hub_descriptor(udev, NULL, &hubdesc30, 1); + if (err) { + DPRINTFN(0, "Getting USB 3.0 HUB descriptor failed," + "error=%s\n", usbd_errstr(err)); + break; + } + nports = hubdesc30.bNbrPorts; + if (nports > 16) + nports = 16; + break; + + default: + err = USB_ERR_INVAL; + break; + } + + if (pnports != NULL) + *pnports = nports; + + if (ptt != NULL) + *ptt = tt; + + return (err); +} + static int uhub_attach(device_t dev) { @@ -706,7 +874,8 @@ uhub_attach(device_t dev) struct usb_device *udev = uaa->device; struct usb_device *parent_hub = udev->parent_hub; struct usb_hub *hub; - struct usb_hub_descriptor hubdesc; + struct usb_hub_descriptor hubdesc20; + struct usb_hub_ss_descriptor hubdesc30; uint16_t pwrdly; uint8_t x; uint8_t nports; @@ -733,38 +902,114 @@ uhub_attach(device_t dev) parent_hub ? parent_hub->flags.self_powered : 0); - if (udev->depth > USB_HUB_MAX_DEPTH) { - DPRINTFN(0, "hub depth, %d, exceeded. HUB ignored\n", - USB_HUB_MAX_DEPTH); + if (uhub_is_too_deep(udev)) { + DPRINTFN(0, "HUB at depth %d, " + "exceeds maximum. HUB ignored\n", (int)udev->depth); goto error; } + if (!udev->flags.self_powered && parent_hub && - (!parent_hub->flags.self_powered)) { - DPRINTFN(0, "bus powered HUB connected to " + !parent_hub->flags.self_powered) { + DPRINTFN(0, "Bus powered HUB connected to " "bus powered HUB. HUB ignored\n"); goto error; } /* get HUB descriptor */ - DPRINTFN(2, "getting HUB descriptor\n"); + DPRINTFN(2, "Getting HUB descriptor\n"); - /* assuming that there is one port */ - err = usbd_req_get_hub_descriptor(udev, NULL, &hubdesc, 1); + switch (udev->speed) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: + case USB_SPEED_HIGH: + /* assuming that there is one port */ + err = usbd_req_get_hub_descriptor(udev, NULL, &hubdesc20, 1); + if (err) { + DPRINTFN(0, "getting USB 2.0 HUB descriptor failed," + "error=%s\n", usbd_errstr(err)); + goto error; + } + /* get number of ports */ + nports = hubdesc20.bNbrPorts; - nports = hubdesc.bNbrPorts; + /* get power delay */ + pwrdly = ((hubdesc20.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + + USB_EXTRA_POWER_UP_TIME); - if (!err && (nports >= 8)) { /* get complete HUB descriptor */ - err = usbd_req_get_hub_descriptor(udev, NULL, &hubdesc, nports); - } - if (err) { - DPRINTFN(0, "getting hub descriptor failed," - "error=%s\n", usbd_errstr(err)); - goto error; - } - if (hubdesc.bNbrPorts != nports) { - DPRINTFN(0, "number of ports changed\n"); - goto error; + if (nports >= 8) { + /* check number of ports */ + if (nports > 127) { + DPRINTFN(0, "Invalid number of USB 2.0 ports," + "error=%s\n", usbd_errstr(err)); + goto error; + } + /* get complete HUB descriptor */ + err = usbd_req_get_hub_descriptor(udev, NULL, &hubdesc20, nports); + + if (err) { + DPRINTFN(0, "Getting USB 2.0 HUB descriptor failed," + "error=%s\n", usbd_errstr(err)); + goto error; + } + if (hubdesc20.bNbrPorts != nports) { + DPRINTFN(0, "Number of ports changed\n"); + goto error; + } + } + break; + case USB_SPEED_SUPER: + if (udev->parent_hub != NULL) { + err = usbd_req_set_hub_depth(udev, NULL, + udev->depth - 1); + if (err) { + DPRINTFN(0, "Setting USB 3.0 HUB depth failed," + "error=%s\n", usbd_errstr(err)); + goto error; + } + } + err = usbd_req_get_ss_hub_descriptor(udev, NULL, &hubdesc30, 1); + if (err) { + DPRINTFN(0, "Getting USB 3.0 HUB descriptor failed," + "error=%s\n", usbd_errstr(err)); + goto error; + } + /* get number of ports */ + nports = hubdesc30.bNbrPorts; + + /* get power delay */ + pwrdly = ((hubdesc30.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + + USB_EXTRA_POWER_UP_TIME); + + /* get complete HUB descriptor */ + if (nports >= 8) { + /* check number of ports */ + if (nports > ((udev->parent_hub != NULL) ? 15 : 127)) { + DPRINTFN(0, "Invalid number of USB 3.0 ports," + "error=%s\n", usbd_errstr(err)); + goto error; + } + /* get complete HUB descriptor */ + err = usbd_req_get_ss_hub_descriptor(udev, NULL, &hubdesc30, nports); + + if (err) { + DPRINTFN(0, "Getting USB 2.0 HUB descriptor failed," + "error=%s\n", usbd_errstr(err)); + goto error; + } + if (hubdesc30.bNbrPorts != nports) { + DPRINTFN(0, "Number of ports changed\n"); + goto error; + } + } + break; + default: + DPRINTF("Assuming HUB has only one port\n"); + /* default number of ports */ + nports = 1; + /* default power delay */ + pwrdly = ((10 * UHD_PWRON_FACTOR) + USB_EXTRA_POWER_UP_TIME); + break; } if (nports == 0) { DPRINTFN(0, "portless HUB\n"); @@ -785,7 +1030,7 @@ uhub_attach(device_t dev) /* initialize HUB structure */ hub->hubsoftc = sc; hub->explore = &uhub_explore; - hub->nports = hubdesc.bNbrPorts; + hub->nports = nports; hub->hubudev = udev; /* if self powered hub, give ports maximum current */ @@ -841,8 +1086,6 @@ uhub_attach(device_t dev) /* XXX should check for none, individual, or ganged power? */ removable = 0; - pwrdly = ((hubdesc.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + - USB_EXTRA_POWER_UP_TIME); for (x = 0; x != nports; x++) { /* set up data structures */ @@ -853,8 +1096,21 @@ uhub_attach(device_t dev) portno = x + 1; /* check if port is removable */ - if (!UHD_NOT_REMOV(&hubdesc, portno)) { + switch (udev->speed) { + case USB_SPEED_LOW: + case USB_SPEED_FULL: + case USB_SPEED_HIGH: + if (!UHD_NOT_REMOV(&hubdesc20, portno)) + removable++; + break; + case USB_SPEED_SUPER: + if (!UHD_NOT_REMOV(&hubdesc30, portno)) + removable++; + break; + default: + DPRINTF("Assuming removable port\n"); removable++; + break; } if (!err) { /* turn the power on */ @@ -915,9 +1171,8 @@ uhub_detach(device_t dev) struct usb_device *child; uint8_t x; - if (hub == NULL) { /* must be partially working */ + if (hub == NULL) /* must be partially working */ return (0); - } /* Make sure interrupt transfer is gone. */ usbd_transfer_unsetup(sc->sc_xfer, UHUB_N_TRANSFER); @@ -1789,6 +2044,7 @@ usb_peer_should_wakeup(struct usb_device (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && (udev->flags.usb_mode == USB_MODE_HOST) && + (usb_device_20_compatible(udev) != 0) && (usb_peer_can_wakeup(udev) == 0))); } @@ -1960,13 +2216,16 @@ usb_dev_resume_peer(struct usb_device *u /* reduce chance of instant resume failure by waiting a little bit */ usb_pause_mtx(NULL, USB_MS_TO_TICKS(20)); - /* resume current port (Valid in Host and Device Mode) */ - err = usbd_req_clear_port_feature(udev->parent_hub, - NULL, udev->port_no, UHF_PORT_SUSPEND); - if (err) { - DPRINTFN(0, "Resuming port failed\n"); - return; + if (usb_device_20_compatible(udev)) { + /* resume current port (Valid in Host and Device Mode) */ + err = usbd_req_clear_port_feature(udev->parent_hub, + NULL, udev->port_no, UHF_PORT_SUSPEND); + if (err) { + DPRINTFN(0, "Resuming port failed\n"); + return; + } } + /* resume settle time */ usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); @@ -2006,7 +2265,8 @@ usb_dev_resume_peer(struct usb_device *u usbd_sr_unlock(udev); /* check if peer has wakeup capability */ - if (usb_peer_can_wakeup(udev)) { + if (usb_peer_can_wakeup(udev) && + usb_device_20_compatible(udev)) { /* clear remote wakeup */ err = usbd_req_clear_device_feature(udev, NULL, UF_DEVICE_REMOTE_WAKEUP); @@ -2016,7 +2276,6 @@ usb_dev_resume_peer(struct usb_device *u usbd_errstr(err)); } } - return; } /*------------------------------------------------------------------------* @@ -2054,7 +2313,6 @@ repeat: /* check if all devices on the HUB are suspended */ for (x = 0; x != nports; x++) { - child = usb_bus_port_get_device(udev->bus, udev->hub->ports + x); @@ -2069,6 +2327,22 @@ repeat: } } + if (usb_peer_can_wakeup(udev) && + usb_device_20_compatible(udev)) { + /* + * This request needs to be done before we set + * "udev->flags.self_suspended": + */ + + /* allow device to do remote wakeup */ + err = usbd_req_set_device_feature(udev, + NULL, UF_DEVICE_REMOTE_WAKEUP); + if (err) { + DPRINTFN(0, "Setting device " + "remote wakeup failed\n"); + } + } + USB_BUS_LOCK(udev->bus); /* * Checking for suspend condition and setting suspended bit @@ -2086,6 +2360,17 @@ repeat: USB_BUS_UNLOCK(udev->bus); if (err != 0) { + if (usb_peer_can_wakeup(udev) && + usb_device_20_compatible(udev)) { + /* allow device to do remote wakeup */ + err = usbd_req_clear_device_feature(udev, + NULL, UF_DEVICE_REMOTE_WAKEUP); + if (err) { + DPRINTFN(0, "Setting device " + "remote wakeup failed\n"); + } + } + if (udev->flags.usb_mode == USB_MODE_DEVICE) { /* resume parent HUB first */ usb_dev_resume_peer(udev->parent_hub); @@ -2111,16 +2396,6 @@ repeat: usbd_sr_unlock(udev); - if (usb_peer_can_wakeup(udev)) { - /* allow device to do remote wakeup */ - err = usbd_req_set_device_feature(udev, - NULL, UF_DEVICE_REMOTE_WAKEUP); - if (err) { - DPRINTFN(0, "Setting device " - "remote wakeup failed\n"); - } - } - if (udev->bus->methods->device_suspend != NULL) { usb_timeout_t temp; @@ -2133,12 +2408,15 @@ repeat: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 23:19:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B98DF1065673; Mon, 4 Oct 2010 23:19:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A92BE8FC17; Mon, 4 Oct 2010 23:19: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 o94NJVxg030738; Mon, 4 Oct 2010 23:19:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94NJVG5030736; Mon, 4 Oct 2010 23:19:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010042319.o94NJVG5030736@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 4 Oct 2010 23:19: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: r213436 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 23:19:31 -0000 Author: yongari Date: Mon Oct 4 23:19:31 2010 New Revision: 213436 URL: http://svn.freebsd.org/changeset/base/213436 Log: Don't count input error twice. uether_rxbuf() already updated that counter. Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Oct 4 23:18:05 2010 (r213435) +++ head/sys/dev/usb/net/if_axe.c Mon Oct 4 23:19:31 2010 (r213436) @@ -863,13 +863,12 @@ axe_bulk_read_callback(struct usb_xfer * err = EINVAL; break; } - err = uether_rxbuf(ue, pc, pos, len); + uether_rxbuf(ue, pc, pos, len); pos += len + (len % 2); } - } else { - err = uether_rxbuf(ue, pc, 0, actlen); - } + } else + uether_rxbuf(ue, pc, 0, actlen); if (err != 0) ifp->if_ierrors++; From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 23:22:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89834106564A; Mon, 4 Oct 2010 23:22:03 +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 782B98FC20; Mon, 4 Oct 2010 23:22: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 o94NM346030840; Mon, 4 Oct 2010 23:22:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94NM3Sl030836; Mon, 4 Oct 2010 23:22:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042322.o94NM3Sl030836@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 23:22: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: r213437 - in head/sys: conf modules/usb modules/usb/xhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 23:22:03 -0000 Author: hselasky Date: Mon Oct 4 23:22:03 2010 New Revision: 213437 URL: http://svn.freebsd.org/changeset/base/213437 Log: Link the XHCI (USB 3.0 hardware driver) into the default kernel build. Approved by: thompsa (mentor) Added: head/sys/modules/usb/xhci/ head/sys/modules/usb/xhci/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 4 23:19:31 2010 (r213436) +++ head/sys/conf/files Mon Oct 4 23:22:03 2010 (r213437) @@ -1748,6 +1748,8 @@ dev/usb/controller/ohci_atmelarm.c optio dev/usb/controller/ohci_pci.c optional ohci pci dev/usb/controller/uhci.c optional uhci dev/usb/controller/uhci_pci.c optional uhci pci +dev/usb/controller/xhci.c optional xhci +dev/usb/controller/xhci_pci.c optional xhci pci dev/usb/controller/uss820dci.c optional uss820dci dev/usb/controller/uss820dci_atmelarm.c optional uss820dci at91rm9200 dev/usb/controller/usb_controller.c optional usb Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Oct 4 23:19:31 2010 (r213436) +++ head/sys/modules/usb/Makefile Mon Oct 4 23:22:03 2010 (r213437) @@ -26,7 +26,7 @@ # SUBDIR = usb -SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} +SUBDIR += ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci} SUBDIR += rum run uath upgt ural zyd ${_urtw} SUBDIR += atp uhid ukbd ums udbp ufm SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ Added: head/sys/modules/usb/xhci/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/xhci/Makefile Mon Oct 4 23:22:03 2010 (r213437) @@ -0,0 +1,38 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2010 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/controller + +KMOD= xhci +SRCS= bus_if.h device_if.h usb_if.h \ + opt_bus.h opt_usb.h \ + xhci_pci.c xhci.c \ + pci_if.h + +.include From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 23:25:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21DFD1065675; Mon, 4 Oct 2010 23:25:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD7658FC15; Mon, 4 Oct 2010 23:25: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 o94NPcdN030950; Mon, 4 Oct 2010 23:25:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94NPc9g030948; Mon, 4 Oct 2010 23:25:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010042325.o94NPc9g030948@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 4 Oct 2010 23:25: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: r213438 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 23:25:39 -0000 Author: yongari Date: Mon Oct 4 23:25:38 2010 New Revision: 213438 URL: http://svn.freebsd.org/changeset/base/213438 Log: RX buffer allocation failure is not an input error. Controller successfully received a frame but we failed to pass it to upper stack due to lack of resources. So update if_iqdrops counter instead of updating if_ierrors counter. Modified: head/sys/dev/usb/net/usb_ethernet.c Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Mon Oct 4 23:22:03 2010 (r213437) +++ head/sys/dev/usb/net/usb_ethernet.c Mon Oct 4 23:25:38 2010 (r213438) @@ -558,7 +558,7 @@ uether_rxbuf(struct usb_ether *ue, struc m = uether_newbuf(); if (m == NULL) { - ifp->if_ierrors++; + ifp->if_iqdrops++; return (ENOMEM); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 23:30:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C36E9106566C; Mon, 4 Oct 2010 23:30:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B30D18FC1A; Mon, 4 Oct 2010 23:30: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 o94NUiEB031081; Mon, 4 Oct 2010 23:30:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94NUiJu031079; Mon, 4 Oct 2010 23:30:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042330.o94NUiJu031079@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 23:30: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: r213439 - head/sys/dev/usb/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 23:30:44 -0000 Author: hselasky Date: Mon Oct 4 23:30:44 2010 New Revision: 213439 URL: http://svn.freebsd.org/changeset/base/213439 Log: Print out correct USB connection speed for USB 3.0 mass storage devices. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Mon Oct 4 23:25:38 2010 (r213438) +++ head/sys/dev/usb/storage/umass.c Mon Oct 4 23:30:44 2010 (r213439) @@ -231,6 +231,7 @@ TUNABLE_INT("hw.usb.umass.debug", &umass /* Approximate maximum transfer speeds (assumes 33% overhead). */ #define UMASS_FULL_TRANSFER_SPEED 1000 #define UMASS_HIGH_TRANSFER_SPEED 40000 +#define UMASS_SUPER_TRANSFER_SPEED 400000 #define UMASS_FLOPPY_TRANSFER_SPEED 20 #define UMASS_TIMEOUT 5000 /* ms */ @@ -2412,13 +2413,21 @@ umass_cam_action(struct cam_sim *sim, un if (sc->sc_quirks & FLOPPY_SPEED) { cpi->base_transfer_speed = UMASS_FLOPPY_TRANSFER_SPEED; - } else if (usbd_get_speed(sc->sc_udev) == - USB_SPEED_HIGH) { - cpi->base_transfer_speed = - UMASS_HIGH_TRANSFER_SPEED; } else { - cpi->base_transfer_speed = - UMASS_FULL_TRANSFER_SPEED; + switch (usbd_get_speed(sc->sc_udev)) { + case USB_SPEED_SUPER: + cpi->base_transfer_speed = + UMASS_SUPER_TRANSFER_SPEED; + break; + case USB_SPEED_HIGH: + cpi->base_transfer_speed = + UMASS_HIGH_TRANSFER_SPEED; + break; + default: + cpi->base_transfer_speed = + UMASS_FULL_TRANSFER_SPEED; + break; + } } cpi->max_lun = sc->sc_maxlun; } From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 05:15:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69C141065672; Tue, 5 Oct 2010 05:15:27 +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 594728FC19; Tue, 5 Oct 2010 05:15: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 o955FRxm040418; Tue, 5 Oct 2010 05:15:27 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o955FRLh040416; Tue, 5 Oct 2010 05:15:27 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201010050515.o955FRLh040416@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 5 Oct 2010 05:15: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: r213440 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 05:15:27 -0000 Author: ru Date: Tue Oct 5 05:15:27 2010 New Revision: 213440 URL: http://svn.freebsd.org/changeset/base/213440 Log: Show hostcache statistics. Submitted by: Maxim Dounin Modified: head/usr.bin/netstat/inet.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Mon Oct 4 23:30:44 2010 (r213439) +++ head/usr.bin/netstat/inet.c Tue Oct 5 05:15:27 2010 (r213440) @@ -690,6 +690,9 @@ tcp_stats(u_long off, const char *name, p(tcps_sc_sendcookie, "\t%lu cookie%s sent\n"); p(tcps_sc_recvcookie, "\t%lu cookie%s received\n"); + p(tcps_hc_added, "\t%lu hostcache entrie%s added\n"); + p1a(tcps_hc_bucketoverflow, "\t\t%lu bucket overflow\n"); + p(tcps_sack_recovery_episode, "\t%lu SACK recovery episode%s\n"); p(tcps_sack_rexmits, "\t%lu segment rexmit%s in SACK recovery episodes\n"); From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 05:49:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36B23106566B; Tue, 5 Oct 2010 05:49:39 +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 0AD328FC13; Tue, 5 Oct 2010 05:49: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 o955ncKW041394; Tue, 5 Oct 2010 05:49:38 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o955ncvu041392; Tue, 5 Oct 2010 05:49:38 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201010050549.o955ncvu041392@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 5 Oct 2010 05:49: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: r213441 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 05:49:39 -0000 Author: jchandra Date: Tue Oct 5 05:49:38 2010 New Revision: 213441 URL: http://svn.freebsd.org/changeset/base/213441 Log: Fix asm for XKPHYS read for o32, constriants needed for input registers that are clobbered. Fixes a crash when compiled without DEBUG Modified: head/sys/mips/rmi/rmi_mips_exts.h Modified: head/sys/mips/rmi/rmi_mips_exts.h ============================================================================== --- head/sys/mips/rmi/rmi_mips_exts.h Tue Oct 5 05:15:27 2010 (r213440) +++ head/sys/mips/rmi/rmi_mips_exts.h Tue Oct 5 05:49:38 2010 (r213441) @@ -39,7 +39,7 @@ #define CPU_BLOCKID_MMU 4 #define CPU_BLOCKID_PRF 5 -#define LSU_CERRLOG_REGID 9 +#define LSU_CERRLOG_REGID 9 #if defined(__mips_n64) || defined(__mips_n32) static __inline uint64_t @@ -481,14 +481,15 @@ xlr_paddr_lw(uint64_t paddr) __asm__ __volatile__( ".set push \n\t" ".set mips64 \n\t" - "dsll32 %1, %1, 0 \n\t" - "dsll32 %2, %2, 0 \n\t" /* get rid of the */ - "dsrl32 %2, %2, 0 \n\t" /* sign extend */ - "or %0, %1, %2 \n\t" - "lw %0, 0(%0) \n\t" + "dsll32 $8, %1, 0 \n\t" + "dsll32 $9, %2, 0 \n\t" /* get rid of the */ + "dsrl32 $9, $9, 0 \n\t" /* sign extend */ + "or $9, $8, $8 \n\t" + "lw %0, 0($9) \n\t" ".set pop \n" - : "=&r"(val) - : "r"(addrh), "r"(addrl)); + : "=r"(val) + : "r"(addrh), "r"(addrl) + : "$8", "$9"); return (val); } @@ -505,14 +506,14 @@ xlr_paddr_ld(uint64_t paddr) __asm__ __volatile__( ".set push \n\t" ".set mips64 \n\t" - "dsll32 %2, %2, 0 \n\t" - "dsll32 %3, %3, 0 \n\t" /* get rid of the */ - "dsrl32 %3, %3, 0 \n\t" /* sign extend */ - "or %0, %2, %3 \n\t" + "dsll32 %0, %2, 0 \n\t" + "dsll32 %1, %3, 0 \n\t" /* get rid of the */ + "dsrl32 %1, %1, 0 \n\t" /* sign extend */ + "or %0, %0, %1 \n\t" "lw %1, 4(%0) \n\t" "lw %0, 0(%0) \n\t" ".set pop \n" - : "=&r"(valh), "=r"(vall) + : "=&r"(valh), "=&r"(vall) : "r"(addrh), "r"(addrl)); return (((uint64_t)valh << 32) | vall); From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 06:31:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDB46106564A; Tue, 5 Oct 2010 06:31:11 +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 BC5CB8FC13; Tue, 5 Oct 2010 06:31: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 o956VBbC042709; Tue, 5 Oct 2010 06:31:11 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o956VBqI042707; Tue, 5 Oct 2010 06:31:11 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201010050631.o956VBqI042707@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 5 Oct 2010 06:31: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: r213442 - head/usr.sbin/services_mkdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 06:31:11 -0000 Author: ru Date: Tue Oct 5 06:31:11 2010 New Revision: 213442 URL: http://svn.freebsd.org/changeset/base/213442 Log: Revise markup, mainly. Modified: head/usr.sbin/services_mkdb/services_mkdb.8 Modified: head/usr.sbin/services_mkdb/services_mkdb.8 ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.8 Tue Oct 5 05:49:38 2010 (r213441) +++ head/usr.sbin/services_mkdb/services_mkdb.8 Tue Oct 5 06:31:11 2010 (r213442) @@ -34,20 +34,23 @@ .Os .Sh NAME .Nm services_mkdb -.Nd generate the services databases +.Nd generate the services database .Sh SYNOPSIS .Nm .Op Fl q .Op Fl o Ar database -.Op file +.Op Ar file .Nm .Fl u -.Op file +.Op Ar file .Sh DESCRIPTION +The .Nm +utility creates a .Xr db 3 -database for the specified file. +database for the specified +.Ar file . If no file is specified, then .Pa /etc/services is used. @@ -68,11 +71,8 @@ Print the services file to stdout, omitt .Pp The databases are used by the C library services routines (see .Xr getservent 3 ) . -.Pp -.Nm -exits zero on success, non-zero on failure. .Sh FILES -.Bl -tag -width 24n -compact +.Bl -tag -width ".Pa /var/db/services.db.tmp" -compact .It Pa /var/db/services.db The current services database. .It Pa /var/db/services.db.tmp @@ -80,6 +80,8 @@ A temporary file. .It Pa /etc/services The current services file. .El +.Sh EXIT STATUS +.Ex -std .Sh SEE ALSO .Xr db 3 , .Xr getservent 3 , From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 06:44:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFF8E106566C; Tue, 5 Oct 2010 06:44:47 +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 CD96A8FC1C; Tue, 5 Oct 2010 06:44: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 o956ilxd043150; Tue, 5 Oct 2010 06:44:47 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o956ilpF043147; Tue, 5 Oct 2010 06:44:47 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201010050644.o956ilpF043147@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 5 Oct 2010 06:44: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: r213443 - in head/sys/mips/rmi: . dev/nlge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 06:44:48 -0000 Author: jchandra Date: Tue Oct 5 06:44:47 2010 New Revision: 213443 URL: http://svn.freebsd.org/changeset/base/213443 Log: Clear any pending interrupts after disabling FMN interrupts. Add debugging sysctl and counters for message ring threads (intial version). Update watermark values, and and decrease the maximum threads to 3 (this will leave a few CPUs for other processes) Minor comment fix in nlge. Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/fmn.c Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Tue Oct 5 06:31:11 2010 (r213442) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Tue Oct 5 06:44:47 2010 (r213443) @@ -903,7 +903,7 @@ nlna_hw_init(struct nlna_softc *sc) /* * Register message ring handler for the NA block, messages from - * the GMAC will have sourec station id to the first bucket of the + * the GMAC will have source station id to the first bucket of the * NA FMN station, so register just that station id. */ if (register_msgring_handler(sc->station_id, sc->station_id + 1, Modified: head/sys/mips/rmi/fmn.c ============================================================================== --- head/sys/mips/rmi/fmn.c Tue Oct 5 06:31:11 2010 (r213442) +++ head/sys/mips/rmi/fmn.c Tue Oct 5 06:44:47 2010 (r213443) @@ -93,9 +93,9 @@ static struct proc *msgring_proc; /* all /* * The maximum number of software message handler threads to be started - * per core. Default is 2 per core + * per core. Default is 3 per core */ -static int msgring_maxthreads = 2; +static int msgring_maxthreads = 3; TUNABLE_INT("hw.fmn.maxthreads", &msgring_maxthreads); /* @@ -148,8 +148,8 @@ xlr_msgring_cpu_init(void) * For sending FMN messages, we need credits on the destination * bucket. Program the credits this core has on the 128 possible * destination buckets. - * We cannot use a loop, because the the first argument has to - * be a constant integer value. + * We cannot use a loop here, because the the first argument has + * to be a constant integer value. */ MSGRNG_CC_INIT_CPU_DEST(0, cc_config->counters); MSGRNG_CC_INIT_CPU_DEST(1, cc_config->counters); @@ -262,23 +262,30 @@ msgrng_setconfig(int running, int nthr) switch (running) { case 0: break; /* keep default */ case 1: - watermark = 16; break; - case 2: watermark = 32; break; - case 3: + case 2: watermark = 48; break; + case 3: + watermark = 56; break; } wm_intr_value = 0x2; /* set watermark enable interrupt */ } mflags = msgrng_access_enable(); config = (watermark << 24) | (IRQ_MSGRING << 16) | (1 << 8) | wm_intr_value; - /* clear any pending interrupts */ + /* clear pending interrupts, they will get re-raised if still valid */ write_c0_eirr64(1ULL << IRQ_MSGRING); msgrng_write_config(config); msgrng_restore(mflags); } +/* Debug counters */ +static int msgring_nintr[XLR_MAX_CORES]; +static int msgring_badintr[XLR_MAX_CORES]; +static int msgring_wakeup_sleep[XLR_MAX_CORES * XLR_NTHREADS]; +static int msgring_wakeup_nosleep[XLR_MAX_CORES * XLR_NTHREADS]; +static int msgring_nmsgs[XLR_MAX_CORES * XLR_NTHREADS]; + static int msgring_process_fast_intr(void *arg) { @@ -289,10 +296,11 @@ msgring_process_fast_intr(void *arg) core = xlr_core_id(); mthd = &msgring_threads[core]; - + msgring_nintr[core]++; mtx_lock_spin(&mthd->lock); nt = mthd->running; if(nt >= mthd->nthreads) { + msgring_badintr[core]++; mtx_unlock_spin(&mthd->lock); return (FILTER_HANDLED); } @@ -302,7 +310,8 @@ msgring_process_fast_intr(void *arg) /* default value with interrupts disabled */ msgrng_write_config((1 << 24) | (IRQ_MSGRING << 16) | (1 << 8)); - + /* clear pending interrupts */ + write_c0_eirr64(1ULL << IRQ_MSGRING); msgrng_restore(mflags); mtx_unlock_spin(&mthd->lock); @@ -310,9 +319,11 @@ msgring_process_fast_intr(void *arg) mthd->threads[nt].needed = 1; thread_lock(td); if (TD_AWAITING_INTR(td)) { + msgring_wakeup_sleep[core*4+nt]++; TD_CLR_IWAIT(td); sched_add(td, SRQ_INTR); - } + } else + msgring_wakeup_nosleep[core*4+nt]++; thread_unlock(td); return (FILTER_HANDLED); } @@ -338,12 +349,8 @@ msgring_process(void *arg) sched_bind(td, xlr_hwtid_to_cpuid[hwtid]); thread_unlock(td); - /* - * Mark ourselves as a running thread, and update the - * message watermark config for this thread - */ mtx_lock_spin(&mthd->lock); - ++mthd->nthreads; + ++mthd->nthreads; /* Active thread count */ mtx_unlock_spin(&mthd->lock); /* start processing messages */ @@ -355,6 +362,7 @@ msgring_process(void *arg) atomic_store_rel_int(&mthd->threads[tid].needed, 0); nmsgs = xlr_msgring_handler(0xff, 0); + msgring_nmsgs[hwtid] += nmsgs; mtx_lock_spin(&mthd->lock); --mthd->running; @@ -384,7 +392,6 @@ create_msgring_thread(int hwtid) core = hwtid / 4; tid = hwtid % 4; - mthd = &msgring_threads[core]; if (tid == 0) { mtx_init(&mthd->lock, "msgrngcore", NULL, MTX_SPIN); @@ -412,7 +419,6 @@ register_msgring_handler(int startb, int int i; static int msgring_int_enabled = 0; - printf("register handler %d-%d %p %p\n", startb, endb, action, arg); KASSERT(startb >= 0 && startb <= endb && endb < MSGRNG_NSTATIONS, ("Invalid value for for bucket range %d,%d", startb, endb)); @@ -436,6 +442,9 @@ register_msgring_handler(int startb, int return (0); } +/* + * Start message ring processing threads on other CPUs, after SMP start + */ static void start_msgring_threads(void *arg) { @@ -451,4 +460,38 @@ start_msgring_threads(void *arg) } } -SYSINIT(start_msgring_threads, SI_SUB_SMP, SI_ORDER_MIDDLE, start_msgring_threads, NULL); +SYSINIT(start_msgring_threads, SI_SUB_SMP, SI_ORDER_MIDDLE, + start_msgring_threads, NULL); + +/* + * DEBUG support, XXX: static buffer, not locked + */ +static int +sys_print_debug(SYSCTL_HANDLER_ARGS) +{ + int error, nb, i, fs; + static char xprintb[4096], *buf; + + buf = xprintb; + fs = sizeof(xprintb); + nb = snprintf(buf, fs, + "\nID INTR ER WU-SLP WU-ERR MSGS\n"); + buf += nb; + fs -= nb; + for (i = 0; i < 32; i++) { + if ((xlr_hw_thread_mask & (1 << i)) == 0) + continue; + nb = snprintf(buf, fs, + "%2d: %8d %4d %8d %8d %8d\n", i, + msgring_nintr[i/4], msgring_badintr[i/4], + msgring_wakeup_sleep[i], msgring_wakeup_nosleep[i], + msgring_nmsgs[i]); + buf += nb; + fs -= nb; + } + error = SYSCTL_OUT(req, xprintb, buf - xprintb); + return (error); +} + +SYSCTL_PROC(_debug, OID_AUTO, msgring, CTLTYPE_STRING | CTLFLAG_RD, 0, 0, + sys_print_debug, "A", "msgring debug info"); From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 07:11:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEC78106566B; Tue, 5 Oct 2010 07:11:05 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mxf2.bahnhof.se (mxf2.bahnhof.se [213.80.101.26]) by mx1.freebsd.org (Postfix) with ESMTP id 766BE8FC0C; Tue, 5 Oct 2010 07:11:05 +0000 (UTC) Received: from localhost (mxf2.local [127.0.0.1]) by mxf2-reinject (Postfix) with ESMTP id 738EC9695EE; Tue, 5 Oct 2010 09:11:04 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF2) X-Spam-Score: 2.777 X-Spam-Level: ** X-Spam-Status: No, score=2.777 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.708, SPF_NEUTRAL=1.069] Received: from mxf2.bahnhof.se ([127.0.0.1]) by localhost (mxf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qogmWhSqadiU; Tue, 5 Oct 2010 09:11:00 +0200 (CEST) Received: from [10.32.0.4] (h-90-99.A163.priv.bahnhof.se [79.136.90.99]) by mxf2.bahnhof.se (Postfix) with ESMTP id 8F5919695F0; Tue, 5 Oct 2010 09:11:00 +0200 (CEST) Message-ID: <4CAACF80.5050009@gmail.com> Date: Tue, 05 Oct 2010 09:10:56 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Hans Petter Selasky References: <201010042322.o94NM3Sl030836@svn.freebsd.org> In-Reply-To: <201010042322.o94NM3Sl030836@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: r213437 - in head/sys: conf modules/usb modules/usb/xhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 07:11:05 -0000 On 2010-10-05 01:22, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Oct 4 23:22:03 2010 > New Revision: 213437 > URL: http://svn.freebsd.org/changeset/base/213437 > > Log: > Link the XHCI (USB 3.0 hardware driver) into the default kernel build. > > Approved by: thompsa (mentor) > > Added: > head/sys/modules/usb/xhci/ > head/sys/modules/usb/xhci/Makefile (contents, props changed) > Modified: > head/sys/conf/files > head/sys/modules/usb/Makefile > Shouldn't this be added to the corresponding kernel config files as well as NOTES? Keep up the good work! Regards! //Niclas From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 07:23:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5F171065672; Tue, 5 Oct 2010 07:23:23 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe05.swip.net [212.247.154.129]) by mx1.freebsd.org (Postfix) with ESMTP id F35D38FC13; Tue, 5 Oct 2010 07:23:22 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=5OBHFxb9I47YZ7HELXzI6cL6pwPTRnd5uxbD1DPQ4WY= c=1 sm=1 a=9K2t8jtHIR0A:10 a=N659UExz7-8A:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=6I5d2MoRAAAA:8 a=qdzqg5b0uzwOTfB2W-kA:9 a=oG94X9NZwVmPWv5Nk-UWUYuNLdYA:4 a=pILNOxqGKmIA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:117 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 30364603; Tue, 05 Oct 2010 09:13:19 +0200 Received-SPF: softfail receiver=mailfe05.swip.net; client-ip=188.126.201.140; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: Niclas Zeising Date: Tue, 5 Oct 2010 09:14:30 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <201010042322.o94NM3Sl030836@svn.freebsd.org> <4CAACF80.5050009@gmail.com> In-Reply-To: <4CAACF80.5050009@gmail.com> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201010050914.30675.hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r213437 - in head/sys: conf modules/usb modules/usb/xhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 07:23:23 -0000 On Tuesday 05 October 2010 09:10:56 Niclas Zeising wrote: > On 2010-10-05 01:22, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Mon Oct 4 23:22:03 2010 > > New Revision: 213437 > > URL: http://svn.freebsd.org/changeset/base/213437 > > > > Log: > > Link the XHCI (USB 3.0 hardware driver) into the default kernel build. > > > > Approved by: thompsa (mentor) > > > > Added: > > head/sys/modules/usb/xhci/ > > head/sys/modules/usb/xhci/Makefile (contents, props changed) > > > > Modified: > > head/sys/conf/files > > head/sys/modules/usb/Makefile > > Shouldn't this be added to the corresponding kernel config files as well > as NOTES? > Keep up the good work! > Regards! > //Niclas Yes, but I'm not sure who will do that. --HPS From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 07:24:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490951065670; Tue, 5 Oct 2010 07:24:14 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mxf3.bahnhof.se (mxf3.bahnhof.se [213.80.101.27]) by mx1.freebsd.org (Postfix) with ESMTP id F19788FC28; Tue, 5 Oct 2010 07:24:13 +0000 (UTC) Received: from localhost (mxf3.local [127.0.0.1]) by mxf3-reinject (Postfix) with ESMTP id CA959133450C; Tue, 5 Oct 2010 09:24:12 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF2) X-Spam-Score: 2.819 X-Spam-Level: ** X-Spam-Status: No, score=2.819 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.44, SPF_NEUTRAL=1.379] Received: from mxf3.bahnhof.se ([127.0.0.1]) by localhost (mxf3.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bIIoVJch4g56; Tue, 5 Oct 2010 09:24:08 +0200 (CEST) Received: from [10.32.0.4] (h-90-99.A163.priv.bahnhof.se [79.136.90.99]) by mxf3.bahnhof.se (Postfix) with ESMTP id 9E06E13344E8; Tue, 5 Oct 2010 09:24:08 +0200 (CEST) Message-ID: <4CAAD294.9020801@gmail.com> Date: Tue, 05 Oct 2010 09:24:04 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Hans Petter Selasky References: <201010042322.o94NM3Sl030836@svn.freebsd.org> <4CAACF80.5050009@gmail.com> <201010050914.30675.hselasky@freebsd.org> In-Reply-To: <201010050914.30675.hselasky@freebsd.org> Content-Type: text/plain; charset=windows-1252; 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: r213437 - in head/sys: conf modules/usb modules/usb/xhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 07:24:14 -0000 On 2010-10-05 09:14, Hans Petter Selasky wrote: > On Tuesday 05 October 2010 09:10:56 Niclas Zeising wrote: >> On 2010-10-05 01:22, Hans Petter Selasky wrote: >>> Author: hselasky >>> Date: Mon Oct 4 23:22:03 2010 >>> New Revision: 213437 >>> URL: http://svn.freebsd.org/changeset/base/213437 >>> >>> Log: >>> Link the XHCI (USB 3.0 hardware driver) into the default kernel build. >>> >>> Approved by: thompsa (mentor) >>> >>> Added: >>> head/sys/modules/usb/xhci/ >>> head/sys/modules/usb/xhci/Makefile (contents, props changed) >>> >>> Modified: >>> head/sys/conf/files >>> head/sys/modules/usb/Makefile >> >> Shouldn't this be added to the corresponding kernel config files as well >> as NOTES? >> Keep up the good work! >> Regards! >> //Niclas > > Yes, but I'm not sure who will do that. > > --HPS > Can't you do it? :) Check with thompsa just in case, there is no rush. Regards! //Niclas -- From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 07:42:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66057106566B; Tue, 5 Oct 2010 07:42:00 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53D6E8FC41; Tue, 5 Oct 2010 07:42: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 o957g0em045047; Tue, 5 Oct 2010 07:42:00 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o957g0bG045045; Tue, 5 Oct 2010 07:42:00 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201010050742.o957g0bG045045@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 5 Oct 2010 07:42: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: r213448 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 07:42:00 -0000 Author: jchandra Date: Tue Oct 5 07:41:59 2010 New Revision: 213448 URL: http://svn.freebsd.org/changeset/base/213448 Log: Network driver support for more XLR/XLS chip versions. Obtained from: Sriram Gorti (srgorti at netlogicmicro dot com) Modified: head/sys/mips/rmi/board.c Modified: head/sys/mips/rmi/board.c ============================================================================== --- head/sys/mips/rmi/board.c Tue Oct 5 07:21:14 2010 (r213447) +++ head/sys/mips/rmi/board.c Tue Oct 5 07:41:59 2010 (r213448) @@ -62,6 +62,88 @@ xlr_pcmcia_present(void) } static void +xlr_chip_specific_overrides(struct xlr_board_info* board) +{ + struct xlr_gmac_block_t *blk0, *blk1, *blk2; + uint32_t chipid; + uint32_t revision; + + blk0 = &board->gmac_block[0]; + blk1 = &board->gmac_block[1]; + blk2 = &board->gmac_block[2]; + + chipid = xlr_processor_id(); + revision = xlr_revision(); + + if (revision == 0x04) { /* B2 */ + switch (chipid) { + case 0x07: /* XLR 508 */ + case 0x08: /* XLR 516 */ + case 0x09: /* XLR 532 */ + /* NA[12] not available */ + memset(blk1, 0, sizeof(*blk1)); + memset(blk2, 0, sizeof(*blk2)); + break; + case 0x06: /* XLR 308 */ + /* NA0 has 3 ports */ + blk0->gmac_port[3].valid = 0; + blk0->num_ports--; + /* NA[12] not available */ + memset(blk1, 0, sizeof(*blk1)); + memset(blk2, 0, sizeof(*blk2)); + break; + default: + break; + } + } else if (revision == 0x91) { /* C4 */ + switch (chipid) { + case 0x0B: /* XLR 508 */ + case 0x0A: /* XLR 516 */ + case 0x08: /* XLR 532 */ + /* NA[12] not available */ + memset(blk1, 0, sizeof(*blk1)); + memset(blk2, 0, sizeof(*blk2)); + break; + case 0x0F: /* XLR 308 */ + /* NA0 has 3 ports */ + blk0->gmac_port[3].valid = 0; + blk0->num_ports--; + /* NA[12] not available */ + memset(blk1, 0, sizeof(*blk1)); + memset(blk2, 0, sizeof(*blk2)); + break; + default: + break; + } + } else { /* other pre-production silicon */ + switch (chipid) { + /* XLR 5xx */ + case 0x0B: + case 0x0A: + case 0x07: + case 0x08: + case 0x09: + /* NA[12] not available */ + memset(blk1, 0, sizeof(*blk1)); + memset(blk2, 0, sizeof(*blk2)); + break; + /* XLR 3xx */ + case 0x0F: + case 0x06: + /* NA0 has 3 ports */ + blk0->gmac_port[3].valid = 0; + blk0->num_ports--; + /* NA[12] not available */ + memset(blk1, 0, sizeof(*blk1)); + memset(blk2, 0, sizeof(*blk2)); + break; + default: + break; + } + } +} + +static void xlr_board_specific_overrides(struct xlr_board_info* board) { struct xlr_gmac_block_t *blk1, *blk2; @@ -116,6 +198,35 @@ quad1_xaui(void) } static void +xls_chip_specific_overrides(struct xlr_board_info* board) +{ + struct xlr_gmac_block_t *blk0, *blk1; + uint32_t chipid; + + blk0 = &board->gmac_block[0]; + blk1 = &board->gmac_block[1]; + chipid = xlr_processor_id(); + + switch (chipid) { + case 0x8E: /* XLS208 */ + case 0x8F: /* XLS204 */ + /* NA1 is not available */ + memset(blk1, 0, sizeof(*blk1)); + break; + case 0xCE: /* XLS108 */ + case 0xCF: /* XLS104 */ + /* NA0 has 3 ports */ + blk0->gmac_port[3].valid = 0; + blk0->num_ports--; + /* NA1 is not available */ + memset(blk1, 0, sizeof(*blk1)); + break; + default: + break; + } +} + +static void xls_board_specific_overrides(struct xlr_board_info* board) { struct xlr_gmac_block_t *blk0, *blk1; @@ -172,22 +283,15 @@ xls_board_specific_overrides(struct xlr_ break; case RMI_XLR_BOARD_ARIZONA_VIII: - /* There is just one Octal PHY on the board and it is - * connected to the MII interface for NA Quad 0. */ - blk1->gmac_port[0].mii_addr = XLR_IO_GMAC_0_OFFSET; - blk1->gmac_port[1].mii_addr = XLR_IO_GMAC_0_OFFSET; - blk1->gmac_port[2].mii_addr = XLR_IO_GMAC_0_OFFSET; - blk1->gmac_port[3].mii_addr = XLR_IO_GMAC_0_OFFSET; - /* Board 8.3 (Lite) has XLS108 */ - if (xlr_boot1_info.board_minor_version == 3) { - /* NA0 has 3 ports */ - blk0->gmac_port[3].valid = 1; - blk0->num_ports--; - /* NA1 is completely disabled */ - blk1->enabled = 0; + if (blk1->enabled) { + /* There is just one Octal PHY on the board and it is + * connected to the MII interface for NA Quad 0. */ + blk1->gmac_port[0].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[1].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[2].mii_addr = XLR_IO_GMAC_0_OFFSET; + blk1->gmac_port[3].mii_addr = XLR_IO_GMAC_0_OFFSET; } - break; case RMI_XLR_BOARD_ARIZONA_XI: @@ -285,16 +389,20 @@ xlr_board_info_setup() * if (CPU is XLS) { * // initialize per XLS architecture * // default inits (per chip spec) + * // chip-specific overrides * // board-specific overrides * } else if (CPU is XLR) { * // initialize per XLR architecture * // default inits (per chip spec) + * // chip-specific overrides * // board-specific overrides * } * - * Within each CPU-specific initialization, all the default - * initializations are done first. This is followed up with - * board specific overrides. + * For each CPU family, all the default initializations + * are done for a fully-loaded device of that family. + * This configuration is then adjusted for the actual + * chip id. This is followed up with board specific + * overrides. */ /* start with a clean slate */ @@ -377,6 +485,7 @@ xlr_board_info_setup() /* ---------------- Network Acc 2 ---------------- */ xlr_board_info.gmac_block[2].enabled = 0; /* disabled on XLS */ + xls_chip_specific_overrides(&xlr_board_info); xls_board_specific_overrides(&xlr_board_info); } else { /* XLR */ @@ -456,7 +565,9 @@ xlr_board_info_setup() blk2->gmac_port[0].tx_bucket_id = blk2->station_txbase; blk2->gmac_port[0].mdint_id = 2; - /* Done with default setup. Now do board-specific tweaks. */ + /* Done with default setup. Now handle chip and board-specific + variations. */ + xlr_chip_specific_overrides(&xlr_board_info); xlr_board_specific_overrides(&xlr_board_info); } return 0; From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 15:27:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67D84106566B; Tue, 5 Oct 2010 15:27:45 +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 4C5048FC26; Tue, 5 Oct 2010 15:27: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 o95FRjA5060835; Tue, 5 Oct 2010 15:27:45 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95FRjAN060833; Tue, 5 Oct 2010 15:27:45 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010051527.o95FRjAN060833@svn.freebsd.org> From: Ed Maste Date: Tue, 5 Oct 2010 15:27: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: r213451 - head/lib/libgeom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 15:27:45 -0000 Author: emaste Date: Tue Oct 5 15:27:44 2010 New Revision: 213451 URL: http://svn.freebsd.org/changeset/base/213451 Log: Handle null return from XML_ParserCreate and fix a few memory leaks on error conditions. Submitted by: Mark Johnston MFC after: 2 weeks Modified: head/lib/libgeom/geom_xml2tree.c Modified: head/lib/libgeom/geom_xml2tree.c ============================================================================== --- head/lib/libgeom/geom_xml2tree.c Tue Oct 5 09:20:46 2010 (r213450) +++ head/lib/libgeom/geom_xml2tree.c Tue Oct 5 15:27:44 2010 (r213451) @@ -339,21 +339,27 @@ geom_xml2tree(struct gmesh *gmp, char *p memset(gmp, 0, sizeof *gmp); LIST_INIT(&gmp->lg_class); parser = XML_ParserCreate(NULL); + if (parser == NULL) + return (ENOMEM); mt = calloc(1, sizeof *mt); - if (mt == NULL) + if (mt == NULL) { + XML_ParserFree(parser); return (ENOMEM); + } mt->mesh = gmp; XML_SetUserData(parser, mt); XML_SetElementHandler(parser, StartElement, EndElement); XML_SetCharacterDataHandler(parser, CharData); i = XML_Parse(parser, p, strlen(p), 1); - if (i != 1) - return (-1); XML_ParserFree(parser); + if (i != 1) { + free(mt); + return (-1); + } gmp->lg_ident = calloc(sizeof *gmp->lg_ident, mt->nident + 1); + free(mt); if (gmp->lg_ident == NULL) return (ENOMEM); - free(mt); i = 0; /* Collect all identifiers */ LIST_FOREACH(cl, &gmp->lg_class, lg_class) { From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 15:31:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 889A7106564A; Tue, 5 Oct 2010 15:31:56 +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 5D3708FC16; Tue, 5 Oct 2010 15:31:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o95FVuDg060998; Tue, 5 Oct 2010 15:31:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95FVuO2060993; Tue, 5 Oct 2010 15:31:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010051531.o95FVuO2060993@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Oct 2010 15:31: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: r213452 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 15:31:56 -0000 Author: kib Date: Tue Oct 5 15:31:56 2010 New Revision: 213452 URL: http://svn.freebsd.org/changeset/base/213452 Log: Display PCID capability of CPU and add CPUID define for it. MFC after: 1 week Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/include/specialreg.h head/sys/i386/i386/identcpu.c head/sys/i386/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Tue Oct 5 15:27:44 2010 (r213451) +++ head/sys/amd64/amd64/identcpu.c Tue Oct 5 15:31:56 2010 (r213452) @@ -278,7 +278,7 @@ printcpuinfo(void) "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022" + "\022PCID" /* Process-context Identifiers */ "\023DCA" /* Direct Cache Access */ "\024SSE4.1" "\025SSE4.2" Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Tue Oct 5 15:27:44 2010 (r213451) +++ head/sys/amd64/include/specialreg.h Tue Oct 5 15:31:56 2010 (r213452) @@ -126,6 +126,7 @@ #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 +#define CPUID2_PCID 0x00020000 #define CPUID2_DCA 0x00040000 #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Tue Oct 5 15:27:44 2010 (r213451) +++ head/sys/i386/i386/identcpu.c Tue Oct 5 15:31:56 2010 (r213452) @@ -742,7 +742,7 @@ printcpuinfo(void) "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022" + "\022PCID" /* Process-context Identifiers */ "\023DCA" /* Direct Cache Access */ "\024SSE4.1" "\025SSE4.2" Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Tue Oct 5 15:27:44 2010 (r213451) +++ head/sys/i386/include/specialreg.h Tue Oct 5 15:31:56 2010 (r213452) @@ -123,6 +123,7 @@ #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 +#define CPUID2_PCID 0x00020000 #define CPUID2_DCA 0x00040000 #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 15:40:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BCB5106566C; Tue, 5 Oct 2010 15:40:59 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B0F68FC0A; Tue, 5 Oct 2010 15:40:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o95FexAo061281; Tue, 5 Oct 2010 15:40:59 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95Fexpb061277; Tue, 5 Oct 2010 15:40:59 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201010051540.o95Fexpb061277@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 5 Oct 2010 15:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213453 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 15:40:59 -0000 Author: ume Date: Tue Oct 5 15:40:59 2010 New Revision: 213453 URL: http://svn.freebsd.org/changeset/base/213453 Log: When no protocol entry is found, getproto*_r(3) should return zero. Spotted by: Kostik Belousov MFC after: 2 weeks Modified: head/lib/libc/net/getproto.c head/lib/libc/net/getprotoent.c head/lib/libc/net/getprotoname.c Modified: head/lib/libc/net/getproto.c ============================================================================== --- head/lib/libc/net/getproto.c Tue Oct 5 15:31:56 2010 (r213452) +++ head/lib/libc/net/getproto.c Tue Oct 5 15:40:59 2010 (r213453) @@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct pro if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); } Modified: head/lib/libc/net/getprotoent.c ============================================================================== --- head/lib/libc/net/getprotoent.c Tue Oct 5 15:31:56 2010 (r213452) +++ head/lib/libc/net/getprotoent.c Tue Oct 5 15:40:59 2010 (r213453) @@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, cha if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); } Modified: head/lib/libc/net/getprotoname.c ============================================================================== --- head/lib/libc/net/getprotoname.c Tue Oct 5 15:31:56 2010 (r213452) +++ head/lib/libc/net/getprotoname.c Tue Oct 5 15:40:59 2010 (r213453) @@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struc if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 15:44:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C9FD1065675; Tue, 5 Oct 2010 15:44:36 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id BB08A8FC18; Tue, 5 Oct 2010 15:44:35 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.14.4/8.14.4) with ESMTP/inet6 id o95FiSQV035963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Oct 2010 00:44:29 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Wed, 06 Oct 2010 00:44:28 +0900 Message-ID: From: Hajimu UMEMOTO To: Kostik Belousov In-Reply-To: <20101004174044.GU2392@deviant.kiev.zoral.com.ua> References: <201008130639.o7D6dsk1022779@svn.freebsd.org> <20101003184925.GA87647@deviant.kiev.zoral.com.ua> <20101004174044.GU2392@deviant.kiev.zoral.com.ua> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8 Emacs/23.2 (i386-portbld-freebsd8.1) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.1-STABLE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Wed, 06 Oct 2010 00:44:29 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on asuka.mahoroba.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211276 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 15:44:36 -0000 Hi, >>>>> On Mon, 4 Oct 2010 20:40:44 +0300 >>>>> Kostik Belousov said: kostikbel> Yes, I saw that commit. And there is a software in wild that does expect kostikbel> return value 0 and NULL returned pointer when protocol was not found, kostikbel> as opposed to some processing error. The interpretation of non-zero kostikbel> error code is "We did something wrong, or system configuration is wrong, kostikbel> etc". While zero error code and NULL pointer is perceived as "Wrong kostikbel> protocol name supplied". Okay, I found the description in Ubuntu's manpage. So, I've committed to return zero when no protocol entry is found. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 15:48:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 5FD861065672; Tue, 5 Oct 2010 15:48:51 +0000 (UTC) Date: Tue, 5 Oct 2010 15:48:51 +0000 From: Alexander Best To: Xin LI Message-ID: <20101005154851.GA73547@freebsd.org> References: <201010040617.o946HkOO002409@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010040617.o946HkOO002409@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 15:48:51 -0000 thanks a lot. :) -- a13x From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 15:52:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5B0B106566B; Tue, 5 Oct 2010 15:52:37 +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 01FCB8FC16; Tue, 5 Oct 2010 15:52:36 +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 o95FqUOT037694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Oct 2010 18:52:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o95FqUnG027829; Tue, 5 Oct 2010 18:52:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o95FqU6N027828; Tue, 5 Oct 2010 18:52:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 5 Oct 2010 18:52:30 +0300 From: Kostik Belousov To: Hajimu UMEMOTO Message-ID: <20101005155230.GA2392@deviant.kiev.zoral.com.ua> References: <201008130639.o7D6dsk1022779@svn.freebsd.org> <20101003184925.GA87647@deviant.kiev.zoral.com.ua> <20101004174044.GU2392@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W1uEbMXJ1Mj4g6TI" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, 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: r211276 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 15:52:37 -0000 --W1uEbMXJ1Mj4g6TI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 06, 2010 at 12:44:28AM +0900, Hajimu UMEMOTO wrote: > Hi, >=20 > >>>>> On Mon, 4 Oct 2010 20:40:44 +0300 > >>>>> Kostik Belousov said: >=20 > kostikbel> Yes, I saw that commit. And there is a software in wild that d= oes expect > kostikbel> return value 0 and NULL returned pointer when protocol was not= found, > kostikbel> as opposed to some processing error. The interpretation of non= -zero > kostikbel> error code is "We did something wrong, or system configuration= is wrong, > kostikbel> etc". While zero error code and NULL pointer is perceived as "= Wrong > kostikbel> protocol name supplied". >=20 > Okay, I found the description in Ubuntu's manpage. So, I've committed > to return zero when no protocol entry is found. >=20 > Sincerely, Thank you. --W1uEbMXJ1Mj4g6TI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyrSb4ACgkQC3+MBN1Mb4haCQCcDxQNfpIT+oWOXOfNTe4gpwZC g58AoLkQQcP4Iy3/Qk5TKS5tcbmA40x3 =b8DJ -----END PGP SIGNATURE----- --W1uEbMXJ1Mj4g6TI-- From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 16:14:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60085106566B; Tue, 5 Oct 2010 16:14:08 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC398FC08; Tue, 5 Oct 2010 16:14:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o95GE8Jb062377; Tue, 5 Oct 2010 16:14:08 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95GE80i062375; Tue, 5 Oct 2010 16:14:08 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010051614.o95GE80i062375@svn.freebsd.org> From: Gordon Tetlow Date: Tue, 5 Oct 2010 16:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213454 - head/usr.bin/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 16:14:08 -0000 Author: gordon Date: Tue Oct 5 16:14:08 2010 New Revision: 213454 URL: http://svn.freebsd.org/changeset/base/213454 Log: Add reference to intro(1) in SEE ALSO section. PR: docs/151216 Approved by: wes (mentor, implicit) Modified: head/usr.bin/man/man.1 Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Tue Oct 5 15:40:59 2010 (r213453) +++ head/usr.bin/man/man.1 Tue Oct 5 16:14:08 2010 (r213454) @@ -290,6 +290,7 @@ System configuration file. Local configuration files. .El .Sh SEE ALSO +.Xr intro 1 , .Xr apropos 1 , .Xr locale 1 , .Xr manpath 1 , From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 17:06:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2AAE106564A; Tue, 5 Oct 2010 17:06:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E23FA8FC1B; Tue, 5 Oct 2010 17:06: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 o95H6pPr063979; Tue, 5 Oct 2010 17:06:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95H6p9Y063975; Tue, 5 Oct 2010 17:06:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201010051706.o95H6p9Y063975@svn.freebsd.org> From: Alan Cox Date: Tue, 5 Oct 2010 17:06: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: r213455 - in head/sys/i386: i386 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 17:06:52 -0000 Author: alc Date: Tue Oct 5 17:06:51 2010 New Revision: 213455 URL: http://svn.freebsd.org/changeset/base/213455 Log: Initialize KPTmap in locore so that vm86.c can call vtophys() (or really pmap_kextract()) before pmap_bootstrap() is called. Document the set of pmap functions that may be called before pmap_bootstrap() is called. Tested by: bde@ Reviewed by: kib@ Discussed with: jhb@ MFC after: 6 weeks Modified: head/sys/i386/i386/locore.s head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Tue Oct 5 16:14:08 2010 (r213454) +++ head/sys/i386/i386/locore.s Tue Oct 5 17:06:51 2010 (r213455) @@ -104,6 +104,9 @@ IdlePTD: .long 0 /* phys addr of kernel IdlePDPT: .long 0 /* phys addr of kernel PDPT */ #endif + .globl KPTmap +KPTmap: .long 0 /* address of kernel page tables */ + .globl KPTphys KPTphys: .long 0 /* phys addr of kernel page tables */ @@ -715,6 +718,8 @@ no_kernend: /* Allocate Kernel Page Tables */ ALLOCPAGES(NKPT) movl %esi,R(KPTphys) + addl $(KERNBASE-(KPTDI<<(PDRSHIFT-PAGE_SHIFT+PTESHIFT))),%esi + movl %esi,R(KPTmap) /* Allocate Page Table Directory */ #ifdef PAE @@ -778,6 +783,11 @@ no_kernend: shrl $PAGE_SHIFT,%ecx fillkptphys($PG_RW) +/* Map page table pages. */ + movl R(KPTphys),%eax + movl $NKPT,%ecx + fillkptphys($PG_RW) + /* Map page directory. */ #ifdef PAE movl R(IdlePDPT), %eax Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Oct 5 16:14:08 2010 (r213454) +++ head/sys/i386/i386/pmap.c Tue Oct 5 17:06:51 2010 (r213455) @@ -247,7 +247,7 @@ struct sysmaps { caddr_t CADDR2; }; static struct sysmaps sysmaps_pcpu[MAXCPU]; -pt_entry_t *CMAP1 = 0, *KPTmap; +pt_entry_t *CMAP1 = 0; static pt_entry_t *CMAP3; static pd_entry_t *KPTD; caddr_t CADDR1 = 0, ptvmmap = 0; @@ -362,12 +362,11 @@ pmap_bootstrap(vm_paddr_t firstaddr) int i; /* - * XXX The calculation of virtual_avail is wrong. It's NKPT*PAGE_SIZE too - * large. It should instead be correctly calculated in locore.s and - * not based on 'first' (which is a physical address, not a virtual - * address, for the start of unused physical memory). The kernel - * page tables are NOT double mapped and thus should not be included - * in this calculation. + * Initialize the first available kernel virtual address. However, + * using "firstaddr" may waste a few pages of the kernel virtual + * address space, because locore may not have mapped every physical + * page that it allocated. Preferably, locore would provide a first + * unused virtual address in addition to "firstaddr". */ virtual_avail = (vm_offset_t) KERNBASE + firstaddr; @@ -437,6 +436,10 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * KPTmap is used by pmap_kextract(). + * + * KPTmap is first initialized by locore. However, that initial + * KPTmap can only support NKPT page table pages. Here, a larger + * KPTmap is created that can support KVA_PAGES page table pages. */ SYSMAP(pt_entry_t *, KPTD, KPTmap, KVA_PAGES) @@ -1386,6 +1389,8 @@ retry: /* * Add a wired page to the kva. * Note: not SMP coherent. + * + * This function may be used before pmap_bootstrap() is called. */ PMAP_INLINE void pmap_kenter(vm_offset_t va, vm_paddr_t pa) @@ -1408,6 +1413,8 @@ pmap_kenter_attr(vm_offset_t va, vm_padd /* * Remove a page from the kernel pagetables. * Note: not SMP coherent. + * + * This function may be used before pmap_bootstrap() is called. */ PMAP_INLINE void pmap_kremove(vm_offset_t va) Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Tue Oct 5 16:14:08 2010 (r213454) +++ head/sys/i386/include/pmap.h Tue Oct 5 17:06:51 2010 (r213455) @@ -191,12 +191,21 @@ extern pdpt_entry_t *IdlePDPT; extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */ /* - * virtual address to page table entry and - * to physical address. - * Note: these work recursively, thus vtopte of a pte will give - * the corresponding pde that in turn maps it. + * Translate a virtual address to the kernel virtual address of its page table + * entry (PTE). This can be used recursively. If the address of a PTE as + * previously returned by this macro is itself given as the argument, then the + * address of the page directory entry (PDE) that maps the PTE will be + * returned. + * + * This macro may be used before pmap_bootstrap() is called. */ #define vtopte(va) (PTmap + i386_btop(va)) + +/* + * Translate a virtual address to its physical address. + * + * This macro may be used before pmap_bootstrap() is called. + */ #define vtophys(va) pmap_kextract((vm_offset_t)(va)) #ifdef XEN @@ -272,14 +281,18 @@ pte_load_store_ma(pt_entry_t *ptep, pt_e * table pages, and not user page table pages, and (2) it provides access to * a kernel page table page after the corresponding virtual addresses have * been promoted to a 2/4MB page mapping. + * + * KPTmap is first initialized by locore to support just NPKT page table + * pages. Later, it is reinitialized by pmap_bootstrap() to allow for + * expansion of the kernel page table. */ extern pt_entry_t *KPTmap; /* - * Routine: pmap_kextract - * Function: - * Extract the physical page address associated - * kernel virtual address. + * Extract from the kernel page table the physical address that is mapped by + * the given virtual address "va". + * + * This function may be used before pmap_bootstrap() is called. */ static __inline vm_paddr_t pmap_kextract(vm_offset_t va) @@ -486,6 +499,11 @@ extern vm_offset_t virtual_end; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) +/* + * Only the following functions or macros may be used before pmap_bootstrap() + * is called: pmap_kenter(), pmap_kextract(), pmap_kremove(), vtophys(), and + * vtopte(). + */ void pmap_bootstrap(vm_paddr_t); int pmap_cache_bits(int mode, boolean_t is_pde); int pmap_change_attr(vm_offset_t, vm_size_t, int); From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 18:08:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FB1F1065703; Tue, 5 Oct 2010 18:08:08 +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 3F0E68FC08; Tue, 5 Oct 2010 18:08:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o95I88pZ066001; Tue, 5 Oct 2010 18:08:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95I8819065995; Tue, 5 Oct 2010 18:08:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010051808.o95I8819065995@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 5 Oct 2010 18:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213456 - in head/sys/powerpc: aim include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 18:08:08 -0000 Author: nwhitehorn Date: Tue Oct 5 18:08:07 2010 New Revision: 213456 URL: http://svn.freebsd.org/changeset/base/213456 Log: Handle vector assist traps without a kernel panic, by setting denormalized values to zero. A correct solution would involve emulating vector operations on denormalized values, but this has little effect on accuracy and is much less complicated for now. MFC after: 2 weeks Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/trap.c head/sys/powerpc/include/altivec.h head/sys/powerpc/include/pcb.h head/sys/powerpc/include/trap_aim.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Tue Oct 5 17:06:51 2010 (r213455) +++ head/sys/powerpc/aim/machdep.c Tue Oct 5 18:08:07 2010 (r213456) @@ -489,8 +489,8 @@ powerpc_init(vm_offset_t startkernel, vm bcopy(generictrap, (void *)EXC_SC, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_FPA, (size_t)&trapsize); bcopy(generictrap, (void *)EXC_VEC, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_VECAST, (size_t)&trapsize); - bcopy(generictrap, (void *)EXC_THRM, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_VECAST_G4, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_VECAST_G5, (size_t)&trapsize); __syncicache(EXC_RSVD, EXC_LAST - EXC_RSVD); /* Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Tue Oct 5 17:06:51 2010 (r213455) +++ head/sys/powerpc/aim/trap.c Tue Oct 5 18:08:07 2010 (r213456) @@ -203,9 +203,19 @@ trap(struct trapframe *frame) enable_vec(td); break; - case EXC_VECAST: - printf("Vector assist exception!\n"); - sig = SIGILL; + case EXC_VECAST_G4: + case EXC_VECAST_G5: + /* + * We get a VPU assist exception for IEEE mode + * vector operations on denormalized floats. + * Emulating this is a giant pain, so for now, + * just switch off IEEE mode and treat them as + * zero. + */ + + save_vec(td); + td->td_pcb->pcb_vec.vscr |= ALTIVEC_VSCR_NJ; + enable_vec(td); break; case EXC_ALI: Modified: head/sys/powerpc/include/altivec.h ============================================================================== --- head/sys/powerpc/include/altivec.h Tue Oct 5 17:06:51 2010 (r213455) +++ head/sys/powerpc/include/altivec.h Tue Oct 5 18:08:07 2010 (r213456) @@ -29,6 +29,9 @@ #ifndef _MACHINE_ALTIVEC_H_ #define _MACHINE_ALTIVEC_H_ +#define ALTIVEC_VSCR_NJ 0x00010000 /* Enable non-Java mode */ +#define ALTIVEC_VSCR_SAT 0x00000001 /* Saturation status bit */ + void enable_vec(struct thread *); void save_vec(struct thread *); Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Tue Oct 5 17:06:51 2010 (r213455) +++ head/sys/powerpc/include/pcb.h Tue Oct 5 18:08:07 2010 (r213456) @@ -59,7 +59,7 @@ struct pcb { uint32_t vr[32][4]; register_t vrsave; register_t spare[2]; - register_t vscr; + register_t vscr; /* aligned at vector element 3 */ } pcb_vec __aligned(16); /* Vector processor */ unsigned int pcb_veccpu; /* which CPU had our vector stuff. */ Modified: head/sys/powerpc/include/trap_aim.h ============================================================================== --- head/sys/powerpc/include/trap_aim.h Tue Oct 5 17:06:51 2010 (r213455) +++ head/sys/powerpc/include/trap_aim.h Tue Oct 5 18:08:07 2010 (r213456) @@ -54,9 +54,12 @@ /* The following is only available on the 601: */ #define EXC_RUNMODETRC 0x2000 /* Run Mode/Trace Exception */ +/* The following are only available on 970(G5): */ +#define EXC_VECAST_G5 0x1700 /* AltiVec Assist */ + /* The following are only available on 7400(G4): */ #define EXC_VEC 0x0f20 /* AltiVec Unavailable */ -#define EXC_VECAST 0x1600 /* AltiVec Assist */ +#define EXC_VECAST_G4 0x1600 /* AltiVec Assist */ /* The following are only available on 604/750/7400: */ #define EXC_PERF 0x0f00 /* Performance Monitoring */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 18:34:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 568EF1065672; Tue, 5 Oct 2010 18:34:44 +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 473818FC1F; Tue, 5 Oct 2010 18:34: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 o95IYihC066902; Tue, 5 Oct 2010 18:34:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95IYiDX066899; Tue, 5 Oct 2010 18:34:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010051834.o95IYiDX066899@svn.freebsd.org> From: Andriy Gapon Date: Tue, 5 Oct 2010 18:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213457 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 18:34:44 -0000 Author: avg Date: Tue Oct 5 18:34:43 2010 New Revision: 213457 URL: http://svn.freebsd.org/changeset/base/213457 Log: New src committer: Sergey Kandaurov Please welcome Sergey Kandaurov aka pluknet as a new src committer. He is going to work on a variety of things from manul pages to freebsd32 compat layer and beyond. I will be his mentor and kib will be a co-mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Oct 5 18:08:07 2010 (r213456) +++ svnadmin/conf/access Tue Oct 5 18:34:43 2010 (r213457) @@ -177,6 +177,7 @@ philip phk pho pjd +pluknet ps qingli rafan Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Oct 5 18:08:07 2010 (r213456) +++ svnadmin/conf/mentors Tue Oct 5 18:34:43 2010 (r213457) @@ -23,6 +23,7 @@ hselasky thompsa jinmei gnn mm delphij nork imp +pluknet avg Co-mentor: kib randi cperciva rdivacky rpaulo rstone emaste Co-mentor: jkoshy From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 18:38:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F3AE106566B; Tue, 5 Oct 2010 18:38:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24BB28FC1D; Tue, 5 Oct 2010 18:38: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 o95IcOSq067058; Tue, 5 Oct 2010 18:38:24 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95IcODk067055; Tue, 5 Oct 2010 18:38:24 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010051838.o95IcODk067055@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 5 Oct 2010 18:38: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: r213458 - in head: sys/compat/x86bios usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 18:38:24 -0000 Author: jkim Date: Tue Oct 5 18:38:23 2010 New Revision: 213458 URL: http://svn.freebsd.org/changeset/base/213458 Log: Prefer pmap_unmapbios() over pmap_unmapdev(). The binary does not change after this because pmap_unmapbios() is a macro for pmap_unmapdev() on amd64. Modified: head/sys/compat/x86bios/x86bios.c head/usr.sbin/pw/pw_user.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Tue Oct 5 18:34:43 2010 (r213457) +++ head/sys/compat/x86bios/x86bios.c Tue Oct 5 18:38:23 2010 (r213458) @@ -679,7 +679,7 @@ x86bios_unmap_mem(void) free(x86bios_map, M_DEVBUF); if (x86bios_ivt != NULL) #ifdef X86BIOS_NATIVE_ARCH - pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); + pmap_unmapbios((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); #else free(x86bios_ivt, M_DEVBUF); #endif Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Tue Oct 5 18:34:43 2010 (r213457) +++ head/usr.sbin/pw/pw_user.c Tue Oct 5 18:38:23 2010 (r213458) @@ -151,14 +151,14 @@ pw_user(struct userconf * cnf, int mode, cnf->home = arg->val; } + dmode = S_IRWXU | S_IRWXG | S_IRWXO; if ((arg = getarg(args, 'M')) != NULL) { dmode_c = arg->val; if ((set = setmode(dmode_c)) == NULL) errx(EX_DATAERR, "invalid directory creation mode '%s'", dmode_c); - dmode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); + cnf->homemode = getmode(set, dmode); free(set); - cnf->homemode = dmode; } /* @@ -186,7 +186,7 @@ pw_user(struct userconf * cnf, int mode, if (strchr(cnf->home+1, '/') == NULL) { strcpy(dbuf, "/usr"); strncat(dbuf, cnf->home, MAXPATHLEN-5); - if (mkdir(dbuf, cnf->homemode) != -1 || errno == EEXIST) { + if (mkdir(dbuf, dmode) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); /* * Skip first "/" and create symlink: @@ -202,7 +202,7 @@ pw_user(struct userconf * cnf, int mode, while ((p = strchr(++p, '/')) != NULL) { *p = '\0'; if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, cnf->homemode) == -1) + if (mkdir(dbuf, dmode) == -1) goto direrr; chown(dbuf, 0, 0); } else if (!S_ISDIR(st.st_mode)) @@ -211,7 +211,7 @@ pw_user(struct userconf * cnf, int mode, } } if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, cnf->homemode) == -1) { + if (mkdir(dbuf, dmode) == -1) { direrr: err(EX_OSFILE, "mkdir '%s'", dbuf); } chown(dbuf, 0, 0); From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 18:44:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 6F63D106564A; Tue, 5 Oct 2010 18:44:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 5 Oct 2010 14:44:36 -0400 User-Agent: KMail/1.6.2 References: <201010051838.o95IcODk067055@svn.freebsd.org> In-Reply-To: <201010051838.o95IcODk067055@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010051444.37992.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r213458 - in head: sys/compat/x86bios usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 18:44:45 -0000 On Tuesday 05 October 2010 02:38 pm, Jung-uk Kim wrote: > Author: jkim > Date: Tue Oct 5 18:38:23 2010 > New Revision: 213458 > URL: http://svn.freebsd.org/changeset/base/213458 > > Log: > Prefer pmap_unmapbios() over pmap_unmapdev(). The binary does > not change after this because pmap_unmapbios() is a macro for > pmap_unmapdev() on amd64. Sorry, I screwed up commit. I'll revert the unrelated patch for pw_user.c. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 18:47:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2211D1065672; Tue, 5 Oct 2010 18:47:52 +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 12A7A8FC1F; Tue, 5 Oct 2010 18:47: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 o95IlpAq067358; Tue, 5 Oct 2010 18:47:51 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95IlpCF067356; Tue, 5 Oct 2010 18:47:51 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010051847.o95IlpCF067356@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 5 Oct 2010 18:47: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: r213459 - head/usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 18:47:52 -0000 Author: jkim Date: Tue Oct 5 18:47:51 2010 New Revision: 213459 URL: http://svn.freebsd.org/changeset/base/213459 Log: Revert the unrelated patch crept in the previous commit. Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Tue Oct 5 18:38:23 2010 (r213458) +++ head/usr.sbin/pw/pw_user.c Tue Oct 5 18:47:51 2010 (r213459) @@ -151,14 +151,14 @@ pw_user(struct userconf * cnf, int mode, cnf->home = arg->val; } - dmode = S_IRWXU | S_IRWXG | S_IRWXO; if ((arg = getarg(args, 'M')) != NULL) { dmode_c = arg->val; if ((set = setmode(dmode_c)) == NULL) errx(EX_DATAERR, "invalid directory creation mode '%s'", dmode_c); - cnf->homemode = getmode(set, dmode); + dmode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); free(set); + cnf->homemode = dmode; } /* @@ -186,7 +186,7 @@ pw_user(struct userconf * cnf, int mode, if (strchr(cnf->home+1, '/') == NULL) { strcpy(dbuf, "/usr"); strncat(dbuf, cnf->home, MAXPATHLEN-5); - if (mkdir(dbuf, dmode) != -1 || errno == EEXIST) { + if (mkdir(dbuf, cnf->homemode) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); /* * Skip first "/" and create symlink: @@ -202,7 +202,7 @@ pw_user(struct userconf * cnf, int mode, while ((p = strchr(++p, '/')) != NULL) { *p = '\0'; if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, dmode) == -1) + if (mkdir(dbuf, cnf->homemode) == -1) goto direrr; chown(dbuf, 0, 0); } else if (!S_ISDIR(st.st_mode)) @@ -211,7 +211,7 @@ pw_user(struct userconf * cnf, int mode, } } if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, dmode) == -1) { + if (mkdir(dbuf, cnf->homemode) == -1) { direrr: err(EX_OSFILE, "mkdir '%s'", dbuf); } chown(dbuf, 0, 0); From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 19:04:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id C761B1065670; Tue, 5 Oct 2010 19:04:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 5 Oct 2010 15:04:10 -0400 User-Agent: KMail/1.6.2 References: <201010051847.o95IlpCF067356@svn.freebsd.org> In-Reply-To: <201010051847.o95IlpCF067356@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010051504.29255.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r213459 - head/usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 19:04:37 -0000 On Tuesday 05 October 2010 02:47 pm, Jung-uk Kim wrote: > Author: jkim > Date: Tue Oct 5 18:47:51 2010 > New Revision: 213459 > URL: http://svn.freebsd.org/changeset/base/213459 > > Log: > Revert the unrelated patch crept in the previous commit. (Talking to myself staring at keyboard) You shall check changes before hitting the Enter key... You shall check changes before hitting the Enter key... You shall check changes before hitting the Enter key... (Turning off voices in my head) Sorry, people. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 20:39:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F302106566C; Tue, 5 Oct 2010 20:39:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F271B8FC17; Tue, 5 Oct 2010 20:39: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 o95KdaTR070788; Tue, 5 Oct 2010 20:39:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95KdaUi070786; Tue, 5 Oct 2010 20:39:36 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201010052039.o95KdaUi070786@svn.freebsd.org> From: Christian Brueffer Date: Tue, 5 Oct 2010 20:39: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: r213460 - head/usr.bin/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 20:39:37 -0000 Author: brueffer Date: Tue Oct 5 20:39:36 2010 New Revision: 213460 URL: http://svn.freebsd.org/changeset/base/213460 Log: SEE ALSO should sorted by manpage section first. Modified: head/usr.bin/man/manpath.1 Modified: head/usr.bin/man/manpath.1 ============================================================================== --- head/usr.bin/man/manpath.1 Tue Oct 5 18:47:51 2010 (r213459) +++ head/usr.bin/man/manpath.1 Tue Oct 5 20:39:36 2010 (r213460) @@ -119,5 +119,5 @@ Local configuration files. .Sh SEE ALSO .Xr apropos 1 , .Xr man 1 , -.Xr man.conf 5 , -.Xr whatis 1 +.Xr whatis 1 , +.Xr man.conf 5 From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 20:56:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E16BB106564A; Tue, 5 Oct 2010 20:56:08 +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 B74E58FC08; Tue, 5 Oct 2010 20:56:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o95Ku855071332; Tue, 5 Oct 2010 20:56:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95Ku8Vw071330; Tue, 5 Oct 2010 20:56:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201010052056.o95Ku8Vw071330@svn.freebsd.org> From: Andrew Thompson Date: Tue, 5 Oct 2010 20:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213461 - head/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 20:56:09 -0000 Author: thompsa Date: Tue Oct 5 20:56:08 2010 New Revision: 213461 URL: http://svn.freebsd.org/changeset/base/213461 Log: Use the printf-like capability from kproc_create(). 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 Tue Oct 5 20:39:36 2010 (r213460) +++ head/sys/compat/ndis/subr_ntoskrnl.c Tue Oct 5 20:56:08 2010 (r213461) @@ -274,7 +274,6 @@ ntoskrnl_libinit() kdpc_queue *kq; callout_entry *e; int i; - char name[64]; mtx_init(&ntoskrnl_dispatchlock, "ntoskrnl dispatch lock", MTX_NDIS_LOCK, MTX_DEF|MTX_RECURSE); @@ -321,9 +320,8 @@ ntoskrnl_libinit() #endif kq = kq_queues + i; kq->kq_cpu = i; - sprintf(name, "Windows DPC %d", i); error = kproc_create(ntoskrnl_dpc_thread, kq, &p, - RFHIGHPID, NDIS_KSTACK_PAGES, name); + RFHIGHPID, NDIS_KSTACK_PAGES, "Windows DPC %d", i); if (error) panic("failed to launch DPC thread"); } @@ -334,9 +332,8 @@ ntoskrnl_libinit() for (i = 0; i < WORKITEM_THREADS; i++) { kq = wq_queues + i; - sprintf(name, "Windows Workitem %d", i); error = kproc_create(ntoskrnl_workitem_thread, kq, &p, - RFHIGHPID, NDIS_KSTACK_PAGES, name); + RFHIGHPID, NDIS_KSTACK_PAGES, "Windows Workitem %d", i); if (error) panic("failed to launch workitem thread"); } @@ -3382,7 +3379,6 @@ PsCreateSystemThread(handle, reqaccess, void *thrctx; { int error; - char tname[128]; thread_context *tc; struct proc *p; @@ -3393,9 +3389,8 @@ PsCreateSystemThread(handle, reqaccess, tc->tc_thrctx = thrctx; tc->tc_thrfunc = thrfunc; - sprintf(tname, "windows kthread %d", ntoskrnl_kth); error = kproc_create(ntoskrnl_thrfunc, tc, &p, - RFHIGHPID, NDIS_KSTACK_PAGES, tname); + RFHIGHPID, NDIS_KSTACK_PAGES, "Windows Kthread %d", ntoskrnl_kth); if (error) { free(tc, M_TEMP); From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 21:19:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5240106564A; Tue, 5 Oct 2010 21:19:20 +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 A57B08FC08; Tue, 5 Oct 2010 21:19: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 o95LJK1i072073; Tue, 5 Oct 2010 21:19:20 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95LJKBQ072070; Tue, 5 Oct 2010 21:19:20 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201010052119.o95LJKBQ072070@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 5 Oct 2010 21:19: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: r213462 - in head: share/mk usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 21:19:20 -0000 Author: gonzo Date: Tue Oct 5 21:19:20 2010 New Revision: 213462 URL: http://svn.freebsd.org/changeset/base/213462 Log: - Introduce WITH_GPIO knob and disable building gpioctl by default. Most systems do not need it. Modified: head/share/mk/bsd.own.mk head/usr.sbin/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Oct 5 20:56:08 2010 (r213461) +++ head/share/mk/bsd.own.mk Tue Oct 5 21:19:20 2010 (r213462) @@ -422,6 +422,7 @@ MK_${var}:= yes BSD_GREP \ ${_clang_no} \ FDT \ + GPIO \ HESIOD \ IDEA .if defined(WITH_${var}) && defined(WITHOUT_${var}) Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Oct 5 20:56:08 2010 (r213461) +++ head/usr.sbin/Makefile Tue Oct 5 21:19:20 2010 (r213462) @@ -27,7 +27,6 @@ SUBDIR= adduser \ fwcontrol \ getfmac \ getpmac \ - gpioctl \ gstat \ i2c \ ifmcstat \ @@ -160,6 +159,10 @@ SUBDIR+= freebsd-update SUBDIR+= gssd .endif +.if ${MK_GPIO} != "no" +SUBDIR+= gpioctl +.endif + .if ${MK_INET6} != "no" SUBDIR+= faithd SUBDIR+= ip6addrctl From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 21:42:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C861106566B; Tue, 5 Oct 2010 21:42:36 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id AF1AD8FC12; Tue, 5 Oct 2010 21:42:35 +0000 (UTC) Received: by wyb29 with SMTP id 29so6308953wyb.13 for ; Tue, 05 Oct 2010 14:42:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.134.129 with SMTP id j1mr9843086wbt.79.1286314610254; Tue, 05 Oct 2010 14:36:50 -0700 (PDT) Sender: andy@fud.org.nz Received: by 10.227.141.76 with HTTP; Tue, 5 Oct 2010 14:36:50 -0700 (PDT) In-Reply-To: <201010052119.o95LJKBQ072070@svn.freebsd.org> References: <201010052119.o95LJKBQ072070@svn.freebsd.org> Date: Wed, 6 Oct 2010 10:36:50 +1300 X-Google-Sender-Auth: X4kKy08t7Y-DxBv0qyM1Z7uYSOo Message-ID: From: Andrew Thompson To: Oleksandr Tymoshenko 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: r213462 - in head: share/mk usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 21:42:36 -0000 On 6 October 2010 10:19, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Tue Oct =A05 21:19:20 2010 > New Revision: 213462 > URL: http://svn.freebsd.org/changeset/base/213462 > > Log: > =A0- Introduce WITH_GPIO knob and disable building gpioctl > =A0 =A0 =A0by default. Most systems do not need it. > If you also want it in src.conf(5) then you can add the description in tools/build/options From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 21:53:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9B051065670; Tue, 5 Oct 2010 21:53:25 +0000 (UTC) (envelope-from gonzo@launchpad.bluezbox.com) Received: from launchpad.bluezbox.com (hq.bluezbox.com [70.38.37.145]) by mx1.freebsd.org (Postfix) with ESMTP id 84FFF8FC08; Tue, 5 Oct 2010 21:53:25 +0000 (UTC) Received: from [140.242.16.2] (helo=[172.23.2.112]) by launchpad.bluezbox.com with esmtpsa (SSLv3:DES-CBC3-SHA:168) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1P3Ewa-0008F5-Ac; Tue, 05 Oct 2010 14:21:05 -0700 Message-ID: <4CAB96AE.50906@bluezbox.com> Date: Tue, 05 Oct 2010 14:20:46 -0700 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Niclas Zeising References: <201009280328.o8S3SKLY058170@svn.freebsd.org> <4CA19904.1020702@gmail.com> In-Reply-To: <4CA19904.1020702@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@launchpad.bluezbox.com X-Spam-Level: ---- X-Spam-Report: Spam detection software, running on the system "hq.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 9/28/2010 12:28 AM, Niclas Zeising wrote: > > This should probably be made conditional on MK_GPIO. Done [...] Content analysis details: (-4.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r213238 - in head/usr.sbin: . gpioctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 21:53:25 -0000 On 9/28/2010 12:28 AM, Niclas Zeising wrote: > > This should probably be made conditional on MK_GPIO. Done From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 22:26:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 872021065674; Tue, 5 Oct 2010 22:26:01 +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 5D30E8FC1A; Tue, 5 Oct 2010 22:26: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 o95MQ1qt074089; Tue, 5 Oct 2010 22:26:01 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95MQ1cT074088; Tue, 5 Oct 2010 22:26:01 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201010052226.o95MQ1cT074088@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 5 Oct 2010 22:26: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: r213463 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 22:26:01 -0000 Author: gonzo Date: Tue Oct 5 22:26:01 2010 New Revision: 213463 URL: http://svn.freebsd.org/changeset/base/213463 Log: - Add WITH_GPIO entry to src.conf(5) man page Added: head/tools/build/options/WITH_GPIO (contents, props changed) Added: head/tools/build/options/WITH_GPIO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GPIO Tue Oct 5 22:26:01 2010 (r213463) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build gpioctl(8) as part of the base system. From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 23:03:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A362A1065675; Tue, 5 Oct 2010 23:03:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 933AB8FC23; Tue, 5 Oct 2010 23:03:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o95N3mod075279; Tue, 5 Oct 2010 23:03:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95N3mqF075275; Tue, 5 Oct 2010 23:03:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010052303.o95N3mqF075275@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 5 Oct 2010 23:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213464 - in head/sys/dev: bge mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 23:03:48 -0000 Author: yongari Date: Tue Oct 5 23:03:48 2010 New Revision: 213464 URL: http://svn.freebsd.org/changeset/base/213464 Log: Separate common flags into controller specific and PHY related flags. There should be no functional changes. This change will make it easy to add more quirk/flags in future. Reviewed by: davidch Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h head/sys/dev/mii/brgphy.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Oct 5 22:26:01 2010 (r213463) +++ head/sys/dev/bge/if_bge.c Tue Oct 5 23:03:48 2010 (r213464) @@ -2510,7 +2510,7 @@ bge_attach(device_t dev) sc->bge_asicrev != BGE_ASICREV_BCM5906 && sc->bge_chipid != BGE_CHIPID_BCM5705_A0 && sc->bge_chipid != BGE_CHIPID_BCM5705_A1) - sc->bge_flags |= BGE_FLAG_WIRESPEED; + sc->bge_phy_flags |= BGE_PHY_WIRESPEED; if (bge_has_eaddr(sc)) sc->bge_flags |= BGE_FLAG_EADDR; @@ -2547,30 +2547,30 @@ bge_attach(device_t dev) break; } - /* Set various bug flags. */ + /* Set various PHY bug flags. */ if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 || sc->bge_chipid == BGE_CHIPID_BCM5701_B0) - sc->bge_flags |= BGE_FLAG_CRC_BUG; + sc->bge_phy_flags |= BGE_PHY_CRC_BUG; if (sc->bge_chiprev == BGE_CHIPREV_5703_AX || sc->bge_chiprev == BGE_CHIPREV_5704_AX) - sc->bge_flags |= BGE_FLAG_ADC_BUG; + sc->bge_phy_flags |= BGE_PHY_ADC_BUG; if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0) - sc->bge_flags |= BGE_FLAG_5704_A0_BUG; + sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG; if (pci_get_subvendor(dev) == DELL_VENDORID) - sc->bge_flags |= BGE_FLAG_NO_3LED; + sc->bge_phy_flags |= BGE_PHY_NO_3LED; if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) - sc->bge_flags |= BGE_FLAG_ADJUST_TRIM; + sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; if (BGE_IS_5705_PLUS(sc) && - !(sc->bge_flags & BGE_FLAG_ADJUST_TRIM)) { + !(sc->bge_phy_flags & BGE_PHY_ADJUST_TRIM)) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5787) { if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && pci_get_device(dev) != BCOM_DEVICEID_BCM5756) - sc->bge_flags |= BGE_FLAG_JITTER_BUG; + sc->bge_phy_flags |= BGE_PHY_JITTER_BUG; } else if (sc->bge_asicrev != BGE_ASICREV_BCM5906) - sc->bge_flags |= BGE_FLAG_BER_BUG; + sc->bge_phy_flags |= BGE_PHY_BER_BUG; } /* @@ -5353,7 +5353,7 @@ bge_sysctl_debug_info(SYSCTL_HANDLER_ARG printf(" - PCI-X Bus\n"); if (sc->bge_flags & BGE_FLAG_PCIE) printf(" - PCI Express Bus\n"); - if (sc->bge_flags & BGE_FLAG_NO_3LED) + if (sc->bge_phy_flags & BGE_FLAG_NO_3LED) printf(" - No 3 LEDs\n"); if (sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) printf(" - RX Alignment Bug\n"); Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Tue Oct 5 22:26:01 2010 (r213463) +++ head/sys/dev/bge/if_bgereg.h Tue Oct 5 23:03:48 2010 (r213464) @@ -2663,29 +2663,30 @@ struct bge_softc { uint32_t bge_flags; #define BGE_FLAG_TBI 0x00000001 #define BGE_FLAG_JUMBO 0x00000002 -#define BGE_FLAG_WIRESPEED 0x00000004 #define BGE_FLAG_EADDR 0x00000008 #define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 #define BGE_FLAG_TSO 0x00000800 -#define BGE_FLAG_5700_FAMILY 0x00001000 -#define BGE_FLAG_5705_PLUS 0x00002000 -#define BGE_FLAG_5714_FAMILY 0x00004000 -#define BGE_FLAG_575X_PLUS 0x00008000 -#define BGE_FLAG_5755_PLUS 0x00010000 -#define BGE_FLAG_40BIT_BUG 0x00020000 -#define BGE_FLAG_4G_BNDRY_BUG 0x00040000 -#define BGE_FLAG_RX_ALIGNBUG 0x00100000 -#define BGE_FLAG_NO_3LED 0x00200000 -#define BGE_FLAG_ADC_BUG 0x00400000 -#define BGE_FLAG_5704_A0_BUG 0x00800000 -#define BGE_FLAG_JITTER_BUG 0x01000000 -#define BGE_FLAG_BER_BUG 0x02000000 -#define BGE_FLAG_ADJUST_TRIM 0x04000000 -#define BGE_FLAG_CRC_BUG 0x08000000 -#define BGE_FLAG_5788 0x20000000 +#define BGE_FLAG_5700_FAMILY 0x00010000 +#define BGE_FLAG_5705_PLUS 0x00020000 +#define BGE_FLAG_5714_FAMILY 0x00040000 +#define BGE_FLAG_575X_PLUS 0x00080000 +#define BGE_FLAG_5755_PLUS 0x00100000 +#define BGE_FLAG_5788 0x00200000 +#define BGE_FLAG_40BIT_BUG 0x01000000 +#define BGE_FLAG_4G_BNDRY_BUG 0x02000000 +#define BGE_FLAG_RX_ALIGNBUG 0x04000000 + uint32_t bge_phy_flags; +#define BGE_PHY_WIRESPEED 0x00000001 +#define BGE_PHY_ADC_BUG 0x00000002 +#define BGE_PHY_5704_A0_BUG 0x00000004 +#define BGE_PHY_JITTER_BUG 0x00000008 +#define BGE_PHY_BER_BUG 0x00000010 +#define BGE_PHY_ADJUST_TRIM 0x00000020 +#define BGE_PHY_CRC_BUG 0x00000040 +#define BGE_PHY_NO_3LED 0x00000080 uint32_t bge_chipid; uint32_t bge_asicrev; uint32_t bge_chiprev; Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Tue Oct 5 22:26:01 2010 (r213463) +++ head/sys/dev/mii/brgphy.c Tue Oct 5 23:03:48 2010 (r213464) @@ -1025,26 +1025,26 @@ brgphy_reset(struct mii_softc *sc) /* Handle any bge (NetXtreme/NetLink) workarounds. */ if (bge_sc) { /* Fix up various bugs */ - if (bge_sc->bge_flags & BGE_FLAG_5704_A0_BUG) + if (bge_sc->bge_phy_flags & BGE_PHY_5704_A0_BUG) brgphy_fixup_5704_a0_bug(sc); - if (bge_sc->bge_flags & BGE_FLAG_ADC_BUG) + if (bge_sc->bge_phy_flags & BGE_PHY_ADC_BUG) brgphy_fixup_adc_bug(sc); - if (bge_sc->bge_flags & BGE_FLAG_ADJUST_TRIM) + if (bge_sc->bge_phy_flags & BGE_PHY_ADJUST_TRIM) brgphy_fixup_adjust_trim(sc); - if (bge_sc->bge_flags & BGE_FLAG_BER_BUG) + if (bge_sc->bge_phy_flags & BGE_PHY_BER_BUG) brgphy_fixup_ber_bug(sc); - if (bge_sc->bge_flags & BGE_FLAG_CRC_BUG) + if (bge_sc->bge_phy_flags & BGE_PHY_CRC_BUG) brgphy_fixup_crc_bug(sc); - if (bge_sc->bge_flags & BGE_FLAG_JITTER_BUG) + if (bge_sc->bge_phy_flags & BGE_PHY_JITTER_BUG) brgphy_fixup_jitter_bug(sc); brgphy_jumbo_settings(sc, ifp->if_mtu); - if (bge_sc->bge_flags & BGE_FLAG_WIRESPEED) + if (bge_sc->bge_phy_flags & BGE_PHY_WIRESPEED) brgphy_ethernet_wirespeed(sc); /* Enable Link LED on Dell boxes */ - if (bge_sc->bge_flags & BGE_FLAG_NO_3LED) { + if (bge_sc->bge_phy_flags & BGE_PHY_NO_3LED) { PHY_WRITE(sc, BRGPHY_MII_PHY_EXTCTL, PHY_READ(sc, BRGPHY_MII_PHY_EXTCTL) & ~BRGPHY_PHY_EXTCTL_3_LED); From owner-svn-src-all@FreeBSD.ORG Tue Oct 5 23:24:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2284106566B; Tue, 5 Oct 2010 23:24:58 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C26618FC0C; Tue, 5 Oct 2010 23:24: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 o95NOw5o075779; Tue, 5 Oct 2010 23:24:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o95NOwFx075777; Tue, 5 Oct 2010 23:24:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010052324.o95NOwFx075777@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 5 Oct 2010 23:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213465 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 23:24:58 -0000 Author: yongari Date: Tue Oct 5 23:24:58 2010 New Revision: 213465 URL: http://svn.freebsd.org/changeset/base/213465 Log: Rearrange code a bit to correctly set PHY flags. This change make it easy to add more newer ASICs. Obtained from: OpenBSD Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Oct 5 23:03:48 2010 (r213464) +++ head/sys/dev/bge/if_bge.c Tue Oct 5 23:24:58 2010 (r213465) @@ -2558,10 +2558,10 @@ bge_attach(device_t dev) sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG; if (pci_get_subvendor(dev) == DELL_VENDORID) sc->bge_phy_flags |= BGE_PHY_NO_3LED; - if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) - sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; - if (BGE_IS_5705_PLUS(sc) && - !(sc->bge_phy_flags & BGE_PHY_ADJUST_TRIM)) { + if ((BGE_IS_5705_PLUS(sc)) && + sc->bge_asicrev != BGE_ASICREV_BCM5906 && + sc->bge_asicrev != BGE_ASICREV_BCM5785 && + sc->bge_asicrev != BGE_ASICREV_BCM57780) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || @@ -2569,7 +2569,9 @@ bge_attach(device_t dev) if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && pci_get_device(dev) != BCOM_DEVICEID_BCM5756) sc->bge_phy_flags |= BGE_PHY_JITTER_BUG; - } else if (sc->bge_asicrev != BGE_ASICREV_BCM5906) + if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M) + sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM; + } else sc->bge_phy_flags |= BGE_PHY_BER_BUG; } From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 00:03:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F0AED1065679; Wed, 6 Oct 2010 00:03:08 +0000 (UTC) Date: Wed, 6 Oct 2010 00:03:08 +0000 From: Alexander Best To: Jung-uk Kim Message-ID: <20101006000308.GA50596@freebsd.org> References: <201004281726.o3SHQ6xN095645@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004281726.o3SHQ6xN095645@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207330 - head/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 00:03:09 -0000 On Wed Apr 28 10, Jung-uk Kim wrote: > Author: jkim > Date: Wed Apr 28 17:26:05 2010 > New Revision: 207330 > URL: http://svn.freebsd.org/changeset/base/207330 > > Log: > Remove dead code. Calculated greatest common divisor was not used at all. > On top of that, LLVM+Clang mis-compiles this code because of its register > allocator bug. for future references: the bug jkim was refering to was http://llvm.org/bugs/show_bug.cgi?id=6941. it's been fixed now so even with this dead code in buffer.c no problems should occur when compiled with clang. cheers. alex > > Analyzed by: Andrew Reilly (areilly at bigpond dot net dot au) > Reviewed by: ariff, rdivacky > MFC after: 3 days > > Modified: > head/sys/dev/sound/pcm/buffer.c > > Modified: head/sys/dev/sound/pcm/buffer.c > ============================================================================== > --- head/sys/dev/sound/pcm/buffer.c Wed Apr 28 15:38:01 2010 (r207329) > +++ head/sys/dev/sound/pcm/buffer.c Wed Apr 28 17:26:05 2010 (r207330) > @@ -568,7 +568,6 @@ sndbuf_updateprevtotal(struct snd_dbuf * > unsigned int > snd_xbytes(unsigned int v, unsigned int from, unsigned int to) > { > - unsigned int w, x, y; > > if (from == to) > return v; > @@ -576,16 +575,6 @@ snd_xbytes(unsigned int v, unsigned int > if (from == 0 || to == 0 || v == 0) > return 0; > > - x = from; > - y = to; > - while (y != 0) { > - w = x % y; > - x = y; > - y = w; > - } > - from /= x; > - to /= x; > - > return (unsigned int)(((u_int64_t)v * to) / from); > } > -- a13x From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 00:13:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66B41106564A; Wed, 6 Oct 2010 00:13:56 +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 5474D8FC13; Wed, 6 Oct 2010 00:13: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 o960Duoh077101; Wed, 6 Oct 2010 00:13:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o960DumB077094; Wed, 6 Oct 2010 00:13:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010060013.o960DumB077094@svn.freebsd.org> From: Xin LI Date: Wed, 6 Oct 2010 00:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213467 - in stable/8: lib/libgeom sbin/geom/class/sched sbin/geom/core sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 00:13:56 -0000 Author: delphij Date: Wed Oct 6 00:13:55 2010 New Revision: 213467 URL: http://svn.freebsd.org/changeset/base/213467 Log: MFC r202454,202457,202458,202586,207842,207844,208099: Expose stripesize and stripeoffset via kernel sysctl as well as userland library and the geom(8) utility. Modified: stable/8/lib/libgeom/geom_util.c stable/8/lib/libgeom/geom_xml2tree.c stable/8/lib/libgeom/libgeom.3 stable/8/lib/libgeom/libgeom.h stable/8/sbin/geom/core/geom.c stable/8/sys/geom/geom_dump.c Directory Properties: stable/8/lib/libgeom/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/lib/libgeom/geom_util.c ============================================================================== --- stable/8/lib/libgeom/geom_util.c Tue Oct 5 23:27:06 2010 (r213466) +++ stable/8/lib/libgeom/geom_util.c Wed Oct 6 00:13:55 2010 (r213467) @@ -114,6 +114,32 @@ g_sectorsize(int fd) } /* + * Return stripe size of the given provider. + */ +off_t +g_stripesize(int fd) +{ + off_t stripesize; + + if (g_ioctl_arg(fd, DIOCGSTRIPESIZE, &stripesize) == -1) + return (-1); + return (stripesize); +} + +/* + * Return stripe size of the given provider. + */ +off_t +g_stripeoffset(int fd) +{ + off_t stripeoffset; + + if (g_ioctl_arg(fd, DIOCGSTRIPEOFFSET, &stripeoffset) == -1) + return (-1); + return (stripeoffset); +} + +/* * Return the correct provider name. */ char * Modified: stable/8/lib/libgeom/geom_xml2tree.c ============================================================================== --- stable/8/lib/libgeom/geom_xml2tree.c Tue Oct 5 23:27:06 2010 (r213466) +++ stable/8/lib/libgeom/geom_xml2tree.c Wed Oct 6 00:13:55 2010 (r213467) @@ -230,6 +230,16 @@ EndElement(void *userData, const char *n free(p); return; } + if (!strcmp(name, "stripesize") && mt->provider != NULL) { + mt->provider->lg_stripesize = strtoumax(p, NULL, 0); + free(p); + return; + } + if (!strcmp(name, "stripeoffset") && mt->provider != NULL) { + mt->provider->lg_stripeoffset = strtoumax(p, NULL, 0); + free(p); + return; + } if (!strcmp(name, "config")) { mt->config = NULL; Modified: stable/8/lib/libgeom/libgeom.3 ============================================================================== --- stable/8/lib/libgeom/libgeom.3 Tue Oct 5 23:27:06 2010 (r213466) +++ stable/8/lib/libgeom/libgeom.3 Wed Oct 6 00:13:55 2010 (r213467) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 8, 2008 +.Dd January 16, 2010 .Dt LIBGEOM 3 .Os .Sh NAME @@ -50,6 +50,8 @@ .Nm g_close , .Nm g_mediasize , .Nm g_sectorsize , +.Nm g_stripeoffset , +.Nm g_stripesize , .Nm g_flush , .Nm g_delete , .Nm g_device_path , @@ -101,6 +103,10 @@ .Fn g_mediasize "int fd" .Ft ssize_t .Fn g_sectorsize "int fd" +.Ft ssize_t +.Fn g_stripeoffset "int fd" +.Ft ssize_t +.Fn g_stripesize "int fd" .Ft int .Fn g_flush "int fd" .Ft int @@ -297,6 +303,14 @@ The function returns sector size of the given provider. .Pp The +.Fn g_stripeoffset +function returns stripe offset of the given provider. +.Pp +The +.Fn g_stripesize +function returns stripe size of the given provider. +.Pp +The .Fn g_flush function sends .Dv BIO_FLUSH Modified: stable/8/lib/libgeom/libgeom.h ============================================================================== --- stable/8/lib/libgeom/libgeom.h Tue Oct 5 23:27:06 2010 (r213466) +++ stable/8/lib/libgeom/libgeom.h Wed Oct 6 00:13:55 2010 (r213467) @@ -123,6 +123,8 @@ struct gprovider { char *lg_mode; off_t lg_mediasize; u_int lg_sectorsize; + off_t lg_stripeoffset; + off_t lg_stripesize; struct gconf lg_config; }; @@ -149,6 +151,8 @@ int g_open(const char *, int); int g_close(int); off_t g_mediasize(int); ssize_t g_sectorsize(int); +off_t g_stripeoffset(int); +off_t g_stripesize(int); int g_flush(int); int g_delete(int, off_t, off_t); int g_get_ident(int, char *, size_t); Modified: stable/8/sbin/geom/core/geom.c ============================================================================== --- stable/8/sbin/geom/core/geom.c Tue Oct 5 23:27:06 2010 (r213466) +++ stable/8/sbin/geom/core/geom.c Wed Oct 6 00:13:55 2010 (r213467) @@ -673,6 +673,10 @@ list_one_provider(struct gprovider *pp, printf("%sMediasize: %jd (%s)\n", prefix, (intmax_t)pp->lg_mediasize, buf); printf("%sSectorsize: %u\n", prefix, pp->lg_sectorsize); + if (pp->lg_stripesize > 0 || pp->lg_stripeoffset > 0) { + printf("%sStripesize: %ju\n", prefix, pp->lg_stripesize); + printf("%sStripeoffset: %ju\n", prefix, pp->lg_stripeoffset); + } printf("%sMode: %s\n", prefix, pp->lg_mode); LIST_FOREACH(conf, &pp->lg_config, lg_config) { printf("%s%s: %s\n", prefix, conf->lg_name, conf->lg_val); @@ -697,6 +701,10 @@ list_one_consumer(struct gconsumer *cp, printf("%sMediasize: %jd (%s)\n", prefix, (intmax_t)pp->lg_mediasize, buf); printf("%sSectorsize: %u\n", prefix, pp->lg_sectorsize); + if (pp->lg_stripesize > 0 || pp->lg_stripeoffset > 0) { + printf("%sStripesize: %ju\n", prefix, pp->lg_stripesize); + printf("%sStripeoffset: %ju\n", prefix, pp->lg_stripeoffset); + } printf("%sMode: %s\n", prefix, cp->lg_mode); } LIST_FOREACH(conf, &cp->lg_config, lg_config) { Modified: stable/8/sys/geom/geom_dump.c ============================================================================== --- stable/8/sys/geom/geom_dump.c Tue Oct 5 23:27:06 2010 (r213466) +++ stable/8/sys/geom/geom_dump.c Wed Oct 6 00:13:55 2010 (r213467) @@ -207,6 +207,10 @@ g_conf_provider(struct sbuf *sb, struct sbuf_printf(sb, "\t %jd\n", (intmax_t)pp->mediasize); sbuf_printf(sb, "\t %u\n", pp->sectorsize); + if (pp->stripesize > 0) { + sbuf_printf(sb, "\t %u\n", pp->stripesize); + sbuf_printf(sb, "\t %u\n", pp->stripeoffset); + } if (pp->geom->flags & G_GEOM_WITHER) ; else if (pp->geom->dumpconf != NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 01:23:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C72621065675; Wed, 6 Oct 2010 01:23: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 B6D478FC0C; Wed, 6 Oct 2010 01: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 o961NeBP078656; Wed, 6 Oct 2010 01:23:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o961NeZe078654; Wed, 6 Oct 2010 01:23:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010060123.o961NeZe078654@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Oct 2010 01: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: r213468 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 01:23:40 -0000 Author: yongari Date: Wed Oct 6 01:23:40 2010 New Revision: 213468 URL: http://svn.freebsd.org/changeset/base/213468 Log: Fix bge(4) build breakage when BGE_REGISTER_DEBUG is defined. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Oct 6 00:13:55 2010 (r213467) +++ head/sys/dev/bge/if_bge.c Wed Oct 6 01:23:40 2010 (r213468) @@ -5355,7 +5355,7 @@ bge_sysctl_debug_info(SYSCTL_HANDLER_ARG printf(" - PCI-X Bus\n"); if (sc->bge_flags & BGE_FLAG_PCIE) printf(" - PCI Express Bus\n"); - if (sc->bge_phy_flags & BGE_FLAG_NO_3LED) + if (sc->bge_phy_flags & BGE_PHY_NO_3LED) printf(" - No 3 LEDs\n"); if (sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) printf(" - RX Alignment Bug\n"); From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 04:30:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01DAB106564A; Wed, 6 Oct 2010 04:30:41 +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 E50888FC18; Wed, 6 Oct 2010 04:30: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 o964UeVv082866; Wed, 6 Oct 2010 04:30:40 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o964Uekv082864; Wed, 6 Oct 2010 04:30:40 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201010060430.o964Uekv082864@svn.freebsd.org> From: Tim Kientzle Date: Wed, 6 Oct 2010 04:30: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: r213469 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 04:30:41 -0000 Author: kientzle Date: Wed Oct 6 04:30:40 2010 New Revision: 213469 URL: http://svn.freebsd.org/changeset/base/213469 Log: Recognize both ! and ^ as markers for negated character classes. Submitted by: Mykola Dzham Modified: head/usr.bin/tar/pathmatch.c Modified: head/usr.bin/tar/pathmatch.c ============================================================================== --- head/usr.bin/tar/pathmatch.c Wed Oct 6 01:23:40 2010 (r213468) +++ head/usr.bin/tar/pathmatch.c Wed Oct 6 04:30:40 2010 (r213469) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); /* * Check whether a character 'c' is matched by a list specification [...]: - * * Leading '!' negates the class. + * * Leading '!' or '^' negates the class. * * - is a range of characters * * \ removes any special meaning for * @@ -60,7 +60,7 @@ pm_list(const char *start, const char *e (void)flags; /* UNUSED */ /* If this is a negated class, return success for nomatch. */ - if (*p == '!' && p < end) { + if ((*p == '!' || *p == '^') && p < end) { match = 0; nomatch = 1; ++p; From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 06:39:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBEF210656D9; Wed, 6 Oct 2010 06:39:47 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mxf1.bahnhof.se (mxf1.bahnhof.se [213.80.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 948D68FC08; Wed, 6 Oct 2010 06:39:47 +0000 (UTC) Received: from localhost (mxf1.local [127.0.0.1]) by mxf1-reinject (Postfix) with ESMTP id 679CE1E31E0; Wed, 6 Oct 2010 08:39:46 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF1) X-Spam-Score: 2.819 X-Spam-Level: ** X-Spam-Status: No, score=2.819 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.44, SPF_NEUTRAL=1.379] Received: from mxf1.bahnhof.se ([127.0.0.1]) by localhost (mxf1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l-uLo7VoG7QD; Wed, 6 Oct 2010 08:39:42 +0200 (CEST) Received: from [10.32.0.4] (h-90-99.A163.priv.bahnhof.se [79.136.90.99]) by mxf1.bahnhof.se (Postfix) with ESMTP id 56D2C1E3209; Wed, 6 Oct 2010 08:39:42 +0200 (CEST) Message-ID: <4CAC19A7.7070306@gmail.com> Date: Wed, 06 Oct 2010 08:39:35 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Oleksandr Tymoshenko References: <201010052226.o95MQ1cT074088@svn.freebsd.org> In-Reply-To: <201010052226.o95MQ1cT074088@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: r213463 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 06:39:48 -0000 On 2010-10-06 00:26, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Tue Oct 5 22:26:01 2010 > New Revision: 213463 > URL: http://svn.freebsd.org/changeset/base/213463 > > Log: > - Add WITH_GPIO entry to src.conf(5) man page > > Added: > head/tools/build/options/WITH_GPIO (contents, props changed) Thanks! (For this and previous commit) You have to re-generate src.conf as well, and commit that. There's a tool for it in the same direcotry as above. Regards! //Niclas From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 07:22:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ACC01065679; Wed, 6 Oct 2010 07:22:57 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D468B8FC08; Wed, 6 Oct 2010 07:22:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o967MuOR086166; Wed, 6 Oct 2010 07:22:56 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o967MuYa086164; Wed, 6 Oct 2010 07:22:56 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010060722.o967MuYa086164@svn.freebsd.org> From: Gordon Tetlow Date: Wed, 6 Oct 2010 07:22: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: r213470 - head/usr.bin/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 07:22:57 -0000 Author: gordon Date: Wed Oct 6 07:22:56 2010 New Revision: 213470 URL: http://svn.freebsd.org/changeset/base/213470 Log: If LANG/LC_CTYPE/LC_ALL is set and the localized man page contains a page also in the base set, the man utility when invoked with -a would display pages for each locale in the same tree: $ LANG=en_GB.ISO8859-15 man -wa man /usr/share/man/en.ISO8859-15/man1/man.1.gz /usr/share/man/man1/man.1.gz /usr/share/man/en.ISO8859-15/man7/man.7.gz /usr/share/man/man7/man.7.gz Use continue to break out of the loop for the current locale. This results in behavior more closely matching the old GNU man implementation: $ LANG=en_GB.ISO8859-15 man -wa man /usr/share/man/en.ISO8859-15/man1/man.1.gz /usr/share/man/en.ISO8859-15/man7/man.7.gz This will still search for a copy of the file in other manual path locations. If there was a /usr/local/man/man1/man.1.gz file, it would still be displayed. This is also consistent with the GNU man implementation. Submitted by: arundel Approved by: wes (mentor implicit) Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Wed Oct 6 04:30:40 2010 (r213469) +++ head/usr.bin/man/man.sh Wed Oct 6 07:22:56 2010 (r213470) @@ -368,7 +368,9 @@ man_find_and_display() { if find_file $p $sect $MACHINE "$1"; then found_page=yes man_display_page - if [ -z "$aflag" ]; then + if [ -n "$aflag" ]; then + continue 2 + else return fi fi @@ -378,7 +380,9 @@ man_find_and_display() { if find_file $p $sect $MACHINE_ARCH "$1"; then found_page=yes man_display_page - if [ -z "$aflag" ]; then + if [ -n "$aflag" ]; then + continue 2 + else return fi fi @@ -387,7 +391,9 @@ man_find_and_display() { if find_file $p $sect '' "$1"; then found_page=yes man_display_page - if [ -z "$aflag" ]; then + if [ -n "$aflag" ]; then + continue 2 + else return fi fi From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 07:34:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A475F1065675; Wed, 6 Oct 2010 07:34:41 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 945A18FC2C; Wed, 6 Oct 2010 07:34: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 o967Yfa2086437; Wed, 6 Oct 2010 07:34:41 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o967Yf6U086435; Wed, 6 Oct 2010 07:34:41 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201010060734.o967Yf6U086435@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Oct 2010 07:34: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: r213471 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 07:34:41 -0000 Author: netchild Date: Wed Oct 6 07:34:41 2010 New Revision: 213471 URL: http://svn.freebsd.org/changeset/base/213471 Log: Fix a comparision of an uninitialised pointer. Submitted by: arundel Found by: clang analysis (automatic service by uqs@) Reviewed by: rdivacky Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Wed Oct 6 07:22:56 2010 (r213470) +++ head/sys/compat/linux/linux_futex.c Wed Oct 6 07:34:41 2010 (r213471) @@ -431,7 +431,7 @@ linux_sys_futex(struct thread *td, struc int op_ret, val, ret, nrwake; struct linux_emuldata *em; struct waiting_proc *wp; - struct futex *f, *f2; + struct futex *f, *f2 = NULL; int error = 0; /* From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 07:49:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 079841065726; Wed, 6 Oct 2010 07:49:29 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D03688FC08; Wed, 6 Oct 2010 07:49: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 o967nS7J086736; Wed, 6 Oct 2010 07:49:28 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o967nSbZ086734; Wed, 6 Oct 2010 07:49:28 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201010060749.o967nSbZ086734@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Oct 2010 07:49: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: r213472 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 07:49:29 -0000 Author: netchild Date: Wed Oct 6 07:49:28 2010 New Revision: 213472 URL: http://svn.freebsd.org/changeset/base/213472 Log: Add some missing files to optionally delete. Submitted by: Paul B Mahol Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 6 07:34:41 2010 (r213471) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 6 07:49:28 2010 (r213472) @@ -141,6 +141,7 @@ OLD_FILES+=usr/share/man/man8/authpf.8.g .endif .if ${MK_BIND} == no +OLD_FILES+=etc/periodic/daily/470.status-named OLD_FILES+=usr/bin/dig OLD_FILES+=usr/bin/host OLD_FILES+=usr/bin/nslookup @@ -943,6 +944,7 @@ OLD_FILES+=rescue/ping6 #.endif .if ${MK_IPFILTER} == no +OLD_FILES+=etc/periodic/security/510.ipfdenied OLD_FILES+=rescue/ipf OLD_FILES+=sbin/ipf OLD_FILES+=sbin/ipfs @@ -1517,6 +1519,20 @@ OLD_FILES+=usr/share/man/man8/verify_krb # to be filled in #.endif +.if ${MK_LOCATE} == no +OLD_FILES+=etc/locate.rc +OLD_FILES+=etc/periodic/weekly/310.locate +OLD_FILES+=usr/bin/locate +OLD_FILES+=usr/libexec/locate.bigram +OLD_FILES+=usr/libexec/locate.code +OLD_FILES+=usr/libexec/locate.concatdb +OLD_FILES+=usr/libexec/locate.mklocatedb +OLD_FILES+=usr/libexec/locate.updatedb +OLD_FILES+=usr/share/man/man1/locate.1.gz +OLD_FILES+=usr/share/man/man8/locate.updatedb.8.gz +OLD_FILES+=usr/share/man/man8/updatedb.8.gz +.endif + .if ${MK_LPR} == no OLD_FILES+=etc/hosts.lpd OLD_FILES+=etc/printcap @@ -1549,6 +1565,7 @@ OLD_FILES+=usr/share/man/man8/pac.8.gz .endif .if ${MK_MAIL} == no +OLD_FILES+=etc/periodic/daily/130.clean-msgs OLD_FILES+=usr/bin/Mail OLD_FILES+=usr/bin/biff OLD_FILES+=usr/bin/from @@ -1772,7 +1789,12 @@ OLD_FILES+=usr/share/man/man8/tftp-proxy .endif .if ${MK_PKGTOOLS} == no +OLD_FILES+=etc/periodic/daily/490.status-pkg-changes OLD_FILES+=etc/periodic/weekly/400.status-pkg +OLD_FILES+=usr/include/pkg.h +OLD_FILES+=usr/lib/libpkg.a +OLD_FILES+=usr/lib/libpkg.so +OLD_LIBS+=usr/lib/libpkg.so.0 OLD_FILES+=usr/sbin/pkg_add OLD_FILES+=usr/sbin/pkg_create OLD_FILES+=usr/sbin/pkg_delete @@ -1976,6 +1998,11 @@ OLD_FILES+=usr/share/man/man8/rtquery.8. .endif .if ${MK_SENDMAIL} == no +OLD_FILES+=etc/periodic/daily/150.clean-hoststat +OLD_FILES+=etc/periodic/daily/210.backup-aliases +OLD_FILES+=etc/periodic/daily/440.status-mailq +OLD_FILES+=etc/periodic/daily/460.status-mail-rejects +OLD_FILES+=etc/periodic/daily/500.queuerun OLD_FILES+=bin/rmail OLD_FILES+=usr/bin/vacation OLD_FILES+=usr/include/libmilter/mfapi.h From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 08:05:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A0A31065679; Wed, 6 Oct 2010 08:05:54 +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 28E5D8FC2D; Wed, 6 Oct 2010 08:05: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 o9685sfq087128; Wed, 6 Oct 2010 08:05:54 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9685sNi087124; Wed, 6 Oct 2010 08:05:54 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201010060805.o9685sNi087124@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 6 Oct 2010 08:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213473 - in stable/8/lib: libc/stdio libc/stdtime libpam/modules/pam_echo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 08:05:54 -0000 Author: ru Date: Wed Oct 6 08:05:53 2010 New Revision: 213473 URL: http://svn.freebsd.org/changeset/base/213473 Log: MFC r203958: %U was macroized in mdoc(7), escape. Modified: stable/8/lib/libc/stdio/printf.3 stable/8/lib/libc/stdtime/strptime.3 stable/8/lib/libpam/modules/pam_echo/pam_echo.8 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libpam/ (props changed) Modified: stable/8/lib/libc/stdio/printf.3 ============================================================================== --- stable/8/lib/libc/stdio/printf.3 Wed Oct 6 07:49:28 2010 (r213472) +++ stable/8/lib/libc/stdio/printf.3 Wed Oct 6 08:05:53 2010 (r213473) @@ -812,7 +812,7 @@ available. The conversion formats .Cm \&%D , \&%O , and -.Cm %U +.Cm \&%U are not standard and are provided only for backward compatibility. The effect of padding the Modified: stable/8/lib/libc/stdtime/strptime.3 ============================================================================== --- stable/8/lib/libc/stdtime/strptime.3 Wed Oct 6 07:49:28 2010 (r213472) +++ stable/8/lib/libc/stdtime/strptime.3 Wed Oct 6 08:05:53 2010 (r213473) @@ -149,7 +149,7 @@ and 12PM is taken as noon. .Pp The -.Fa %U +.Fa \&%U and .Fa %W format specifiers accept any value within the range 00 to 53 Modified: stable/8/lib/libpam/modules/pam_echo/pam_echo.8 ============================================================================== --- stable/8/lib/libpam/modules/pam_echo/pam_echo.8 Wed Oct 6 07:49:28 2010 (r213472) +++ stable/8/lib/libpam/modules/pam_echo/pam_echo.8 Wed Oct 6 08:05:53 2010 (r213473) @@ -65,7 +65,7 @@ The current service name .It Cm %t The name of the controlling tty .Pq Dv PAM_TTY . -.It Cm %U +.It Cm \&%U The applicant's user name .Pq Dv PAM_RUSER . .It Cm %u From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 08:09:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 855B21065693; Wed, 6 Oct 2010 08:09:39 +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 754748FC1A; Wed, 6 Oct 2010 08:09: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 o9689d4f087231; Wed, 6 Oct 2010 08:09:39 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9689dKb087229; Wed, 6 Oct 2010 08:09:39 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201010060809.o9689dKb087229@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 6 Oct 2010 08:09: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: r213474 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 08:09:39 -0000 Author: jchandra Date: Wed Oct 6 08:09:39 2010 New Revision: 213474 URL: http://svn.freebsd.org/changeset/base/213474 Log: Fix n64 compile. Modified: head/sys/mips/rmi/fmn.c Modified: head/sys/mips/rmi/fmn.c ============================================================================== --- head/sys/mips/rmi/fmn.c Wed Oct 6 08:05:53 2010 (r213473) +++ head/sys/mips/rmi/fmn.c Wed Oct 6 08:09:39 2010 (r213474) @@ -397,7 +397,7 @@ create_msgring_thread(int hwtid) mtx_init(&mthd->lock, "msgrngcore", NULL, MTX_SPIN); mthd->running = mthd->nthreads = 0; } - error = kproc_kthread_add(msgring_process, (void *)hwtid, + error = kproc_kthread_add(msgring_process, (void *)(uintptr_t)hwtid, &msgring_proc, &td, RFSTOPPED, 2, "msgrngproc", "msgthr%d", hwtid); if (error) From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 08:15:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B13B0106566C; Wed, 6 Oct 2010 08:15:28 +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 9FE328FC13; Wed, 6 Oct 2010 08:15: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 o968FSou087398; Wed, 6 Oct 2010 08:15:28 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o968FSGU087395; Wed, 6 Oct 2010 08:15:28 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201010060815.o968FSGU087395@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 6 Oct 2010 08:15: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: r213475 - head/sys/mips/rmi/dev/nlge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 08:15:28 -0000 Author: jchandra Date: Wed Oct 6 08:15:28 2010 New Revision: 213475 URL: http://svn.freebsd.org/changeset/base/213475 Log: XLR/XLS network driver (nlge) updates: - nlge_ioctl handles IFF_UP and IFF_PROMISC flags - Translate table code, to enable flow based CPU assignment added disabled by default (can be enabled by a tunable). - Changed signature of nlge_port_disable to make it consistent with nlge_port_enable - Removed TXCSUM and VLAN_HW_TAGGING from i/f capabilities. Submitted by: Sriram Gorti (srgorti at netlogicmicro dot com) Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/nlge/if_nlge.h Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Wed Oct 6 08:09:39 2010 (r213474) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Wed Oct 6 08:15:28 2010 (r213475) @@ -155,6 +155,7 @@ static void nlna_config_pde(struct nlna_ static void nlna_config_parser(struct nlna_softc *); static void nlna_config_classifier(struct nlna_softc *); static void nlna_config_fifo_spill_area(struct nlna_softc *sc); +static void nlna_config_translate_table(struct nlna_softc *sc); static void nlna_config_common(struct nlna_softc *); static void nlna_disable_ports(struct nlna_softc *sc); static void nlna_enable_intr(struct nlna_softc *sc); @@ -188,7 +189,7 @@ static void nlge_mii_write_internal(xlr int regidx, int regval); void nlge_msgring_handler(int bucket, int size, int code, int stid, struct msgrng_msg *msg, void *data); -static void nlge_port_disable(int id, xlr_reg_t *base, int port_type); +static void nlge_port_disable(struct nlge_softc *sc); static void nlge_port_enable(struct nlge_softc *sc); static void nlge_read_mac_addr(struct nlge_softc *sc); static void nlge_sc_init(struct nlge_softc *sc, device_t dev, @@ -196,6 +197,7 @@ static void nlge_sc_init(struct nlge_sof static void nlge_set_mac_addr(struct nlge_softc *sc); static void nlge_set_port_attribs(struct nlge_softc *, struct xlr_gmac_port *); +static void nlge_mac_set_rx_mode(struct nlge_softc *sc); static void nlge_sgmii_init(struct nlge_softc *sc); static void nlge_start_locked(struct ifnet *ifp, struct nlge_softc *sc); @@ -303,6 +305,10 @@ DRIVER_MODULE(miibus, nlge, miibus_drive static uma_zone_t nl_tx_desc_zone; +/* Tunables. */ +static int flow_classification = 0; +TUNABLE_INT("hw.nlge.flow_classification", &flow_classification); + static __inline void atomic_incr_long(unsigned long *addr) { @@ -494,7 +500,7 @@ nlge_probe(device_t dev) sc = device_get_softc(dev); nlge_sc_init(sc, dev, port_info); - nlge_port_disable(sc->id, sc->base, sc->port_type); + nlge_port_disable(sc); return (0); } @@ -531,8 +537,7 @@ nlge_detach(device_t dev) ifp = sc->nlge_if; if (device_is_attached(dev)) { - ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); - nlge_port_disable(sc->id, sc->base, sc->port_type); + nlge_port_disable(sc); nlge_irq_fini(sc); ether_ifdetach(ifp); bus_generic_detach(dev); @@ -567,7 +572,7 @@ nlge_init(void *addr) if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; - nlge_gmac_config_speed(sc, 0); + nlge_gmac_config_speed(sc, 1); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; nlge_port_enable(sc); @@ -590,9 +595,33 @@ nlge_ioctl(struct ifnet *ifp, u_long com sc = ifp->if_softc; error = 0; ifr = (struct ifreq *)data; + switch(command) { case SIOCSIFFLAGS: + NLGE_LOCK(sc); + if (ifp->if_flags & IFF_UP) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + nlge_init(sc); + } + if (ifp->if_flags & IFF_PROMISC && + !(sc->if_flags & IFF_PROMISC)) { + sc->if_flags |= IFF_PROMISC; + nlge_mac_set_rx_mode(sc); + } else if (!(ifp->if_flags & IFF_PROMISC) && + sc->if_flags & IFF_PROMISC) { + sc->if_flags &= IFF_PROMISC; + nlge_mac_set_rx_mode(sc); + } + } else { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + nlge_port_disable(sc); + } + } + sc->if_flags = ifp->if_flags; + NLGE_UNLOCK(sc); + error = 0; break; + case SIOCSIFMEDIA: case SIOCGIFMEDIA: if (sc->mii_bus != NULL) { @@ -601,9 +630,7 @@ nlge_ioctl(struct ifnet *ifp, u_long com command); } break; - case SIOCSIFADDR: - // intentional fall thru - case SIOCSIFMTU: + default: error = ether_ioctl(ifp, command, data); break; @@ -755,7 +782,7 @@ nlge_start_locked(struct ifnet *ifp, str if (m == NULL) { return; } - + tx_desc = NULL; ret = prepare_fmn_message(sc, &msg, &n_entries, m, fr_stid, &tx_desc); if (ret) { @@ -805,6 +832,7 @@ nlge_rx(struct nlge_softc *sc, vm_paddr_ } ifp = sc->nlge_if; + /* align the data */ m->m_data += BYTE_OFFSET; m->m_pkthdr.len = m->m_len = len; @@ -1153,6 +1181,7 @@ nlna_config_pde(struct nlna_softc *sc) bucket_map |= (3ULL << bucket); } } + NLGE_WRITE(sc->base, R_PDE_CLASS_0, (bucket_map & 0xffffffff)); NLGE_WRITE(sc->base, R_PDE_CLASS_0 + 1, ((bucket_map >> 32) & 0xffffffff)); @@ -1188,6 +1217,7 @@ nlna_smp_update_pde(void *dummy __unused continue; nlna_disable_ports(na_sc[i]); nlna_config_pde(na_sc[i]); + nlna_config_translate_table(na_sc[i]); nlna_enable_ports(na_sc[i]); } } @@ -1196,22 +1226,94 @@ SYSINIT(nlna_smp_update_pde, SI_SUB_SMP, NULL); static void +nlna_config_translate_table(struct nlna_softc *sc) +{ + uint32_t cpu_mask; + uint32_t val; + int bkts[32]; /* one bucket is assumed for each cpu */ + int b1, b2, c1, c2, i, j, k; + int use_bkt; + + if (!flow_classification) + return; + + use_bkt = 1; + if (smp_started) + cpu_mask = xlr_hw_thread_mask; + else + return; + + printf("Using %s-based distribution\n", (use_bkt) ? "bucket" : "class"); + + j = 0; + for(i = 0; i < 32; i++) { + if ((1 << i) & cpu_mask){ + /* for each cpu, mark the 4+threadid bucket */ + bkts[j] = ((i / 4) * 8) + (i % 4); + j++; + } + } + + /*configure the 128 * 9 Translation table to send to available buckets*/ + k = 0; + c1 = 3; + c2 = 0; + for(i = 0; i < 64; i++) { + /* Get the next 2 pairs of (class, bucket): + (c1, b1), (c2, b2). + + c1, c2 limited to {0, 1, 2, 3} + i.e, the 4 classes defined by h/w + b1, b2 limited to { bkts[i], where 0 <= i < j} + i.e, the set of buckets computed in the + above loop. + */ + + c1 = (c1 + 1) & 3; + c2 = (c1 + 1) & 3; + b1 = bkts[k]; + k = (k + 1) % j; + b2 = bkts[k]; + k = (k + 1) % j; + PDEBUG("Translation table[%d] b1=%d b2=%d c1=%d c2=%d\n", + i, b1, b2, c1, c2); + val = ((c1 << 23) | (b1 << 17) | (use_bkt << 16) | + (c2 << 7) | (b2 << 1) | (use_bkt << 0)); + NLGE_WRITE(sc->base, R_TRANSLATETABLE + i, val); + c1 = c2; + } +} + +static void nlna_config_parser(struct nlna_softc *sc) { + uint32_t val; + /* - * Mark it as no classification. The parser extract is gauranteed to - * be zero with no classfication + * Mark it as ETHERNET type. */ - NLGE_WRITE(sc->base, R_L2TYPE_0, 0x00); NLGE_WRITE(sc->base, R_L2TYPE_0, 0x01); + if (!flow_classification) + return; + + /* Use 7bit CRChash for flow classification with 127 as CRC polynomial*/ + NLGE_WRITE(sc->base, R_PARSERCONFIGREG, ((0x7f << 8) | (1 << 1))); + /* configure the parser : L2 Type is configured in the bootloader */ /* extract IP: src, dest protocol */ NLGE_WRITE(sc->base, R_L3CTABLE, (9 << 20) | (1 << 19) | (1 << 18) | (0x01 << 16) | (0x0800 << 0)); NLGE_WRITE(sc->base, R_L3CTABLE + 1, - (12 << 25) | (4 << 21) | (16 << 14) | (4 << 10)); + (9 << 25) | (1 << 21) | (12 << 14) | (4 << 10) | (16 << 4) | 4); + + /* Configure to extract SRC port and Dest port for TCP and UDP pkts */ + NLGE_WRITE(sc->base, R_L4CTABLE, 6); + NLGE_WRITE(sc->base, R_L4CTABLE+2, 17); + val = ((0 << 21) | (2 << 17) | (2 << 11) | (2 << 7)); + NLGE_WRITE(sc->base, R_L4CTABLE+1, val); + NLGE_WRITE(sc->base, R_L4CTABLE+3, val); } static void @@ -1352,14 +1454,11 @@ nlna_reset_ports(struct nlna_softc *sc, static void nlna_disable_ports(struct nlna_softc *sc) { - struct xlr_gmac_block_t *blk; - xlr_reg_t *addr; int i; - blk = device_get_ivars(sc->nlna_dev); for (i = 0; i < sc->num_ports; i++) { - addr = xlr_io_mmio(blk->gmac_port[i].base_addr); - nlge_port_disable(i, addr, blk->gmac_port[i].type); + if (sc->child_sc[i] != NULL) + nlge_port_disable(sc->child_sc[i]); } } @@ -1398,9 +1497,17 @@ nlna_get_all_softc(device_t iodi_dev, st } static void -nlge_port_disable(int id, xlr_reg_t *base, int port_type) +nlge_port_disable(struct nlge_softc *sc) { + struct ifnet *ifp; + xlr_reg_t *base; uint32_t rd; + int id, port_type; + + id = sc->id; + port_type = sc->port_type; + base = sc->base; + ifp = sc->nlge_if; NLGE_UPDATE(base, R_RX_CONTROL, 0x0, 1 << O_RX_CONTROL__RxEnable); do { @@ -1428,6 +1535,10 @@ nlge_port_disable(int id, xlr_reg_t *bas default: panic("Unknown MAC type on port %d\n", id); } + + if (ifp) { + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + } } static void @@ -1466,6 +1577,26 @@ nlge_port_enable(struct nlge_softc *sc) } static void +nlge_mac_set_rx_mode(struct nlge_softc *sc) +{ + uint32_t regval; + + regval = NLGE_READ(sc->base, R_MAC_FILTER_CONFIG); + + if (sc->if_flags & IFF_PROMISC) { + regval |= (1 << O_MAC_FILTER_CONFIG__BROADCAST_EN) | + (1 << O_MAC_FILTER_CONFIG__PAUSE_FRAME_EN) | + (1 << O_MAC_FILTER_CONFIG__ALL_MCAST_EN) | + (1 << O_MAC_FILTER_CONFIG__ALL_UCAST_EN); + } else { + regval &= ~((1 << O_MAC_FILTER_CONFIG__PAUSE_FRAME_EN) | + (1 << O_MAC_FILTER_CONFIG__ALL_UCAST_EN)); + } + + NLGE_WRITE(sc->base, R_MAC_FILTER_CONFIG, regval); +} + +static void nlge_sgmii_init(struct nlge_softc *sc) { xlr_reg_t *mmio_gpio; @@ -1559,7 +1690,7 @@ nlge_intr(void *arg) if (intr_status & 0x2410) { /* update link status for port */ - nlge_gmac_config_speed(port_sc, 0); + nlge_gmac_config_speed(port_sc, 1); } else { printf("%s: Unsupported phy interrupt" " (0x%08x)\n", @@ -1745,7 +1876,7 @@ nlge_if_init(struct nlge_softc *sc) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_HWTAGGING; + ifp->if_capabilities = 0; ifp->if_capenable = ifp->if_capabilities; ifp->if_ioctl = nlge_ioctl; ifp->if_start = nlge_start; @@ -2108,7 +2239,7 @@ nlge_gmac_config_speed(struct nlge_softc if_link_state_change(sc->nlge_if, link_state); printf("%s: [%sMbps]\n", device_get_nameunit(sc->nlge_dev), speed_str[sc->speed]); - + return (0); } Modified: head/sys/mips/rmi/dev/nlge/if_nlge.h ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.h Wed Oct 6 08:09:39 2010 (r213474) +++ head/sys/mips/rmi/dev/nlge/if_nlge.h Wed Oct 6 08:15:28 2010 (r213475) @@ -1103,12 +1103,12 @@ struct nlge_port_set { * for a set of GMAC ports controlled by an NA is done from here. */ struct nlna_softc { - device_t nlna_dev; + device_t nlna_dev; - uint32_t num_ports; - int na_type; - int mac_type; - xlr_reg_t *base; + uint32_t num_ports; + int na_type; + int mac_type; + xlr_reg_t *base; struct callout tx_thr; struct fr_desc *frin_spill; @@ -1135,19 +1135,20 @@ struct nlge_softc { mii.c:miibus_attach() */ struct mii_data nlge_mii; struct nlge_port_set *mdio_pset; - device_t nlge_dev; + device_t nlge_dev; device_t mii_bus; - xlr_reg_t *base; - xlr_reg_t *mii_base; - xlr_reg_t *pcs_addr; - xlr_reg_t *serdes_addr; - int port_type; + xlr_reg_t *base; + xlr_reg_t *mii_base; + xlr_reg_t *pcs_addr; + xlr_reg_t *serdes_addr; + int port_type; + int if_flags; xlr_mac_speed_t speed; xlr_mac_duplex_t duplex; xlr_mac_link_t link; xlr_mac_fc_t flow_ctrl; - uint32_t id; - uint32_t instance; + uint32_t id; + uint32_t instance; uint32_t phy_addr; uint32_t tx_bucket_id; uint8_t dev_addr[ETHER_ADDR_LEN]; From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 09:05:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76763106566C; Wed, 6 Oct 2010 09:05:47 +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 65DB78FC08; Wed, 6 Oct 2010 09:05:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9695l8W088568; Wed, 6 Oct 2010 09:05:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9695ls6088565; Wed, 6 Oct 2010 09:05:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010060905.o9695ls6088565@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Oct 2010 09:05: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: r213476 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 09:05:47 -0000 Author: kib Date: Wed Oct 6 09:05:47 2010 New Revision: 213476 URL: http://svn.freebsd.org/changeset/base/213476 Log: Add cross-references to lrand48(3) and arc4random(3) from rand(3) and random(3). Submitted by: Valentin Nechayev MFC after: 1 week Modified: head/lib/libc/stdlib/rand.3 head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/rand.3 ============================================================================== --- head/lib/libc/stdlib/rand.3 Wed Oct 6 08:15:28 2010 (r213475) +++ head/lib/libc/stdlib/rand.3 Wed Oct 6 09:05:47 2010 (r213476) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 25, 1999 +.Dd October 6, 2010 .Dt RAND 3 .Os .Sh NAME @@ -100,7 +100,16 @@ provides the same functionality as A pointer to the context value .Fa ctx must be supplied by the caller. +.Pp +For better generator quality, use +.Xr random 3 +or +.Xr lrand48 3 . +Applications requiring cryptographic quality randomness should use +.Xr arc4random 3 . .Sh SEE ALSO +.Xr arc4random 3, +.Xr lrand48 3 , .Xr random 3 , .Xr random 4 .Sh STANDARDS Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Wed Oct 6 08:15:28 2010 (r213475) +++ head/lib/libc/stdlib/random.3 Wed Oct 6 09:05:47 2010 (r213476) @@ -173,6 +173,7 @@ detects that the state information has b messages are printed on the standard error output. .Sh SEE ALSO .Xr arc4random 3 , +.Xr lrand48 3 , .Xr rand 3 , .Xr srand 3 , .Xr random 4 From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 09:24:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A375106566C; Wed, 6 Oct 2010 09:24:34 +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 19C008FC1A; Wed, 6 Oct 2010 09:24: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 o969OXbp088961; Wed, 6 Oct 2010 09:24:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o969OXNK088959; Wed, 6 Oct 2010 09:24:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010060924.o969OXNK088959@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Oct 2010 09:24: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: r213477 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 09:24:34 -0000 Author: kib Date: Wed Oct 6 09:24:33 2010 New Revision: 213477 URL: http://svn.freebsd.org/changeset/base/213477 Log: Missed space. Submitted by: brueffer MFC after: 1 week Modified: head/lib/libc/stdlib/rand.3 Modified: head/lib/libc/stdlib/rand.3 ============================================================================== --- head/lib/libc/stdlib/rand.3 Wed Oct 6 09:05:47 2010 (r213476) +++ head/lib/libc/stdlib/rand.3 Wed Oct 6 09:24:33 2010 (r213477) @@ -108,7 +108,7 @@ or Applications requiring cryptographic quality randomness should use .Xr arc4random 3 . .Sh SEE ALSO -.Xr arc4random 3, +.Xr arc4random 3 , .Xr lrand48 3 , .Xr random 3 , .Xr random 4 From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 10:00:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89C22106566C; Wed, 6 Oct 2010 10:00:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7843E8FC0A; Wed, 6 Oct 2010 10:00: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 o96A0beO089761; Wed, 6 Oct 2010 10:00:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96A0bu2089759; Wed, 6 Oct 2010 10:00:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010061000.o96A0bu2089759@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Oct 2010 10:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213478 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 10:00:37 -0000 Author: kib Date: Wed Oct 6 10:00:37 2010 New Revision: 213478 URL: http://svn.freebsd.org/changeset/base/213478 Log: MFC r212998: For sparc64 relocations that directly put bits of the symbol value into the location, apply elf_relocaddr to the symbol value to have right values for the symbols from dpcpu segment. Modified: stable/8/sys/sparc64/sparc64/elf_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/elf_machdep.c Wed Oct 6 09:24:33 2010 (r213477) +++ stable/8/sys/sparc64/sparc64/elf_machdep.c Wed Oct 6 10:00:37 2010 (r213478) @@ -151,6 +151,7 @@ elf64_dump_thread(struct thread *td __un #define _RF_G 0x10000000 /* GOT offset */ #define _RF_B 0x08000000 /* Load address relative */ #define _RF_U 0x04000000 /* Unaligned */ +#define _RF_X 0x02000000 /* Bare symbols, needs proc */ #define _RF_SZ(s) (((s) & 0xff) << 8) /* memory target size */ #define _RF_RS(s) ( (s) & 0xff) /* right shift */ static const int reloc_target_flags[] = { @@ -163,10 +164,10 @@ static const int reloc_target_flags[] = _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(0), /* DISP_32 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(2), /* WDISP_30 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(2), /* WDISP_22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(10), /* HI22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 13 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* LO10 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(10), /* HI22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 13 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* LO10 */ _RF_G| _RF_SZ(32) | _RF_RS(0), /* GOT10 */ _RF_G| _RF_SZ(32) | _RF_RS(0), /* GOT13 */ _RF_G| _RF_SZ(32) | _RF_RS(10), /* GOT22 */ @@ -185,29 +186,29 @@ static const int reloc_target_flags[] = _RF_A|_RF_P| _RF_SZ(32) | _RF_RS(0), /* PCPLT32 */ _RF_A|_RF_P| _RF_SZ(32) | _RF_RS(10), /* PCPLT22 */ _RF_A|_RF_P| _RF_SZ(32) | _RF_RS(0), /* PCPLT10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 11 */ - _RF_S|_RF_A| _RF_SZ(64) | _RF_RS(0), /* 64 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 10 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 11 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(64) | _RF_RS(0), /* 64 */ _RF_S|_RF_A|/*extra*/ _RF_SZ(32) | _RF_RS(0), /* OLO10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(42), /* HH22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(32), /* HM10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(10), /* LM22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(42), /* HH22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(32), /* HM10 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(10), /* LM22 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(42), /* PC_HH22 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(32), /* PC_HM10 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(10), /* PC_LM22 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(2), /* WDISP16 */ _RF_S|_RF_A|_RF_P| _RF_SZ(32) | _RF_RS(2), /* WDISP19 */ _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* GLOB_JMP */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 7 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 5 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* 6 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 7 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 5 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* 6 */ _RF_S|_RF_A|_RF_P| _RF_SZ(64) | _RF_RS(0), /* DISP64 */ _RF_A| _RF_SZ(64) | _RF_RS(0), /* PLT64 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(10), /* HIX22 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* LOX10 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(22), /* H44 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(12), /* M44 */ - _RF_S|_RF_A| _RF_SZ(32) | _RF_RS(0), /* L44 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(10), /* HIX22 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* LOX10 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(22), /* H44 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(12), /* M44 */ + _RF_S|_RF_A|_RF_X| _RF_SZ(32) | _RF_RS(0), /* L44 */ _RF_S|_RF_A| _RF_SZ(64) | _RF_RS(0), /* REGISTER */ _RF_S|_RF_A| _RF_U| _RF_SZ(64) | _RF_RS(0), /* UA64 */ _RF_S|_RF_A| _RF_U| _RF_SZ(16) | _RF_RS(0), /* UA16 */ @@ -234,6 +235,7 @@ static const char *reloc_names[] = { #define RELOC_BASE_RELATIVE(t) ((reloc_target_flags[t] & _RF_B) != 0) #define RELOC_UNALIGNED(t) ((reloc_target_flags[t] & _RF_U) != 0) #define RELOC_USE_ADDEND(t) ((reloc_target_flags[t] & _RF_A) != 0) +#define RELOC_BARE_SYMBOL(t) ((reloc_target_flags[t] & _RF_X) != 0) #define RELOC_TARGET_SIZE(t) ((reloc_target_flags[t] >> 8) & 0xff) #define RELOC_VALUE_RIGHTSHIFT(t) (reloc_target_flags[t] & 0xff) @@ -330,6 +332,8 @@ elf_reloc(linker_file_t lf, Elf_Addr rel if (addr == 0) return (-1); value += addr; + if (RELOC_BARE_SYMBOL(rtype)) + value = elf_relocaddr(lf, value); } if (rtype == R_SPARC_OLO10) From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 12:41:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A72F1065673; Wed, 6 Oct 2010 12:41:43 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0994B8FC17; Wed, 6 Oct 2010 12:41: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 o96Cfglv003510; Wed, 6 Oct 2010 12:41:42 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96Cfgdh003508; Wed, 6 Oct 2010 12:41:42 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201010061241.o96Cfgdh003508@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Oct 2010 12:41: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: r213479 - head/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 12:41:43 -0000 Author: netchild Date: Wed Oct 6 12:41:42 2010 New Revision: 213479 URL: http://svn.freebsd.org/changeset/base/213479 Log: Fix regex for some socket- and acl-related syscall values. Submitted by: Mikhail PR: 149295 MFC-after: 2 weeks Modified: head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Wed Oct 6 10:00:37 2010 (r213478) +++ head/usr.bin/kdump/mksubr Wed Oct 6 12:41:42 2010 (r213479) @@ -324,7 +324,7 @@ auto_or_type "nfssvcname" "NFSSVC_[A-Z]+ auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" -auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" +auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" @@ -333,7 +333,7 @@ auto_switch_type "kldunloadfflagsname" " auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" -auto_switch_type "acltypename" "ACL_TYPE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/acl.h" +auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h" auto_switch_type "minheritname" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 14:29:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16E88106564A; Wed, 6 Oct 2010 14:29:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05CBB8FC18; Wed, 6 Oct 2010 14:29: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 o96ET0s6006855; Wed, 6 Oct 2010 14:29:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96ET0RW006850; Wed, 6 Oct 2010 14:29:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201010061429.o96ET0RW006850@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 6 Oct 2010 14:29: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: r213480 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 14:29:01 -0000 Author: glebius Date: Wed Oct 6 14:29:00 2010 New Revision: 213480 URL: http://svn.freebsd.org/changeset/base/213480 Log: Add support to Alcatel/TCTMobile X080S USB 3G modem. The device needs special eject command to reappear as modem. It also requires DIR_IN flag in the command message, so we supply some dummy data along with the command. Feedback from X080S owners appreciated. I have not a pure Alcatel/TCTMobile device, but another one under "Svyaznoy" (СвÑзной) brand, and I didn't yet managed to get it working. It is successfully recognized, it responds to AT commands, but it shuts up right after successfull CONNECT response. Reviewed by: hps Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_msctest.h head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Wed Oct 6 12:41:42 2010 (r213479) +++ head/sys/dev/usb/serial/u3g.c Wed Oct 6 14:29:00 2010 (r213480) @@ -93,6 +93,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3GINIT_WAIT 7 /* Device reappears after a delay */ #define U3GINIT_SAEL_M460 8 /* Requires vendor init */ #define U3GINIT_HUAWEISCSI 9 /* Requires Huawei SCSI init command */ +#define U3GINIT_TCT 10 /* Requires TCT Mobile init command */ enum { U3G_BULK_WR, @@ -492,6 +493,7 @@ static const struct usb_device_id u3g_de U3G_DEV(STELERA, E1011, 0), U3G_DEV(STELERA, E1012, 0), U3G_DEV(TCTMOBILE, X060S, 0), + U3G_DEV(TCTMOBILE, X080S, U3GINIT_TCT), U3G_DEV(TELIT, UC864E, 0), U3G_DEV(TELIT, UC864G, 0), U3G_DEV(TLAYTECH, TEU800, 0), @@ -669,6 +671,9 @@ u3g_test_autoinst(void *arg, struct usb_ case U3GINIT_CMOTECH: error = usb_msc_eject(udev, 0, MSC_EJECT_CMOTECH); break; + case U3GINIT_TCT: + error = usb_msc_eject(udev, 0, MSC_EJECT_TCT); + break; case U3GINIT_SIERRA: error = u3g_sierra_init(udev); break; Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Wed Oct 6 12:41:42 2010 (r213479) +++ head/sys/dev/usb/usb_msctest.c Wed Oct 6 14:29:00 2010 (r213480) @@ -97,6 +97,8 @@ static uint8_t scsi_cmotech_eject[] = static uint8_t scsi_huawei_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_tct_eject[] = { 0x06, 0xf5, 0x04, 0x02, 0x52, 0x70 }; +static uint8_t scsi_tct_dummy[4]; #define BULK_SIZE 64 /* dummy */ #define ERR_CSW_FAILED -1 @@ -619,6 +621,11 @@ usb_msc_eject(struct usb_device *udev, u &scsi_huawei_eject, sizeof(scsi_huawei_eject), USB_MS_HZ); break; + case MSC_EJECT_TCT: + err = bbb_command_start(sc, DIR_IN, 0, &scsi_tct_dummy, + sizeof(scsi_tct_dummy), &scsi_tct_eject, + sizeof(scsi_tct_eject), USB_MS_HZ); + break; default: printf("usb_msc_eject: unknown eject method (%d)\n", method); break; Modified: head/sys/dev/usb/usb_msctest.h ============================================================================== --- head/sys/dev/usb/usb_msctest.h Wed Oct 6 12:41:42 2010 (r213479) +++ head/sys/dev/usb/usb_msctest.h Wed Oct 6 14:29:00 2010 (r213480) @@ -33,6 +33,7 @@ enum { MSC_EJECT_ZTESTOR, MSC_EJECT_CMOTECH, MSC_EJECT_HUAWEI, + MSC_EJECT_TCT, }; int usb_iface_is_cdrom(struct usb_device *udev, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Oct 6 12:41:42 2010 (r213479) +++ head/sys/dev/usb/usbdevs Wed Oct 6 14:29:00 2010 (r213480) @@ -3148,6 +3148,7 @@ product TAUGA CAMERAMATE 0x0005 CameraMa /* TCTMobile products */ product TCTMOBILE X060S 0x0000 X060S 3G modem +product TCTMOBILE X080S 0xf000 X080S 3G modem /* TDK products */ product TDK UPA9664 0x0115 USB-PDC Adapter UPA9664 From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 14:29:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E133D1065670; Wed, 6 Oct 2010 14:29:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D116F8FC15; Wed, 6 Oct 2010 14:29: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 o96ETomu006939; Wed, 6 Oct 2010 14:29:50 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96ETosV006937; Wed, 6 Oct 2010 14:29:50 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201010061429.o96ETosV006937@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 6 Oct 2010 14:29: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: r213481 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 14:29:52 -0000 Author: glebius Date: Wed Oct 6 14:29:50 2010 New Revision: 213481 URL: http://svn.freebsd.org/changeset/base/213481 Log: Remove extra assignment. Modified: head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Wed Oct 6 14:29:00 2010 (r213480) +++ head/sys/dev/usb/usb_msctest.c Wed Oct 6 14:29:50 2010 (r213481) @@ -469,7 +469,6 @@ bbb_command_start(struct bbb_transfer *s sc->data_rem = data_len; sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; - sc->data_ptr = data_ptr; sc->cmd_len = cmd_len; bzero(&sc->cbw.CBWCDB, sizeof(sc->cbw.CBWCDB)); bcopy(cmd_ptr, &sc->cbw.CBWCDB, cmd_len); From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 14:43:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D60F7106566C; Wed, 6 Oct 2010 14:43:37 +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 A6DF38FC22; Wed, 6 Oct 2010 14:43: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 o96EhbrQ007996; Wed, 6 Oct 2010 14:43:37 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96EhbRi007993; Wed, 6 Oct 2010 14:43:37 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201010061443.o96EhbRi007993@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 6 Oct 2010 14:43: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: r213482 - in head: share/misc usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 14:43:37 -0000 Author: pluknet Date: Wed Oct 6 14:43:37 2010 New Revision: 213482 URL: http://svn.freebsd.org/changeset/base/213482 Log: Add myself to calendar.freebsd and committers-src.dot. Approved by: avg (mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Oct 6 14:29:50 2010 (r213481) +++ head/share/misc/committers-src.dot Wed Oct 6 14:43:37 2010 (r213482) @@ -165,6 +165,7 @@ philip [label="Philip Paeps\nphilip@FreB phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] pjd [label="Pawel Jakub Dawidek\npjd@FreeBSD.org\n2004/02/02"] +pluknet [label="Sergey Kandaurov\npluknet@FreeBSD.org\n2010\10\05"] ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31"] @@ -229,6 +230,8 @@ andre -> qingli anholt -> jkim +avg -> pluknet + benno -> grehan billf -> dougb @@ -377,6 +380,7 @@ kib -> ae kib -> dchagin kib -> lulf kib -> pho +kib -> pluknet kib -> rdivacky kib -> rmacklem kib -> stas Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Oct 6 14:29:50 2010 (r213481) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Oct 6 14:43:37 2010 (r213482) @@ -195,6 +195,7 @@ 07/02 Vasil Venelinov Dimov born in Shumen, Bulgaria, 1982 07/04 Motoyuki Konno born in Musashino, Tokyo, Japan, 1969 07/04 Florent Thoumie born in Montmorency, Val d'Oise, France, 1982 +07/05 Sergey Kandaurov born in Gubkin, Russian Federation, 1985 07/07 Andrew Thompson born in Lower Hutt, Wellington, New Zealand, 1979 07/07 Maxime Henrion born in Metz, France, 1981 07/07 George Reid born in Frimley, Hampshire, United Kingdom, 1983 From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 15:01:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD9791065670; Wed, 6 Oct 2010 15:01:37 +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 CD45C8FC0A; Wed, 6 Oct 2010 15:01: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 o96F1bK0008871; Wed, 6 Oct 2010 15:01:37 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96F1bj9008869; Wed, 6 Oct 2010 15:01:37 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201010061501.o96F1bj9008869@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 6 Oct 2010 15:01: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: r213483 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 15:01:38 -0000 Author: pluknet Date: Wed Oct 6 15:01:37 2010 New Revision: 213483 URL: http://svn.freebsd.org/changeset/base/213483 Log: Fix wrong slashes in a previous commit. Approved by: avg (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Oct 6 14:43:37 2010 (r213482) +++ head/share/misc/committers-src.dot Wed Oct 6 15:01:37 2010 (r213483) @@ -165,7 +165,7 @@ philip [label="Philip Paeps\nphilip@FreB phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] pjd [label="Pawel Jakub Dawidek\npjd@FreeBSD.org\n2004/02/02"] -pluknet [label="Sergey Kandaurov\npluknet@FreeBSD.org\n2010\10\05"] +pluknet [label="Sergey Kandaurov\npluknet@FreeBSD.org\n2010/10/05"] ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31"] From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 15:37:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3180106566C; Wed, 6 Oct 2010 15:37:55 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D26998FC0A; Wed, 6 Oct 2010 15:37:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o96FbteV009620; Wed, 6 Oct 2010 15:37:55 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96FbtK6009617; Wed, 6 Oct 2010 15:37:55 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201010061537.o96FbtK6009617@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 6 Oct 2010 15:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213484 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 15:37:56 -0000 Author: jchandra Date: Wed Oct 6 15:37:55 2010 New Revision: 213484 URL: http://svn.freebsd.org/changeset/base/213484 Log: PCI fix for XLR C revision chips, limit DMA address to the first 2GB physical address. Adds a dma tag to the XLR/XLS pci bus with the lowaddr if the CPU happens to be a XLR C rev. Submitted by: Sreekanth M. S. (kanthms at netlogicmicro dot com)) Modified: head/sys/mips/rmi/board.h head/sys/mips/rmi/xlr_pci.c Modified: head/sys/mips/rmi/board.h ============================================================================== --- head/sys/mips/rmi/board.h Wed Oct 6 15:01:37 2010 (r213483) +++ head/sys/mips/rmi/board.h Wed Oct 6 15:37:55 2010 (r213484) @@ -117,6 +117,35 @@ xlr_processor_id(void) } /* + * The processor is XLR and C-Series + */ +static __inline unsigned int +xlr_is_c_revision(void) +{ + int processor_id = xlr_processor_id(); + int revision_id = xlr_revision(); + + switch (processor_id) { + /* + * These are the relevant PIDs for XLR + * steppings (hawk and above). For these, + * PIDs, Rev-Ids of [5-9] indicate 'C'. + */ + case RMI_CHIP_XLR308_C: + case RMI_CHIP_XLR508_C: + case RMI_CHIP_XLR516_C: + case RMI_CHIP_XLR532_C: + case RMI_CHIP_XLR716: + case RMI_CHIP_XLR732: + if (revision_id >= 5 && revision_id <= 9) + return (1); + default: + return (0); + } + return (0); +} + +/* * RMI Engineering boards which are PCI cards * These should come up in PCI device mode (not yet) */ Modified: head/sys/mips/rmi/xlr_pci.c ============================================================================== --- head/sys/mips/rmi/xlr_pci.c Wed Oct 6 15:01:37 2010 (r213483) +++ head/sys/mips/rmi/xlr_pci.c Wed Oct 6 15:37:55 2010 (r213484) @@ -113,7 +113,7 @@ __FBSDID("$FreeBSD$"); #endif struct xlr_pcib_softc { - int junk; /* no softc */ + bus_dma_tag_t sc_pci_dmat; /* PCI DMA tag pointer */ }; static devclass_t pcib_devclass; @@ -300,7 +300,19 @@ xlr_pcib_write_config(device_t dev, u_in static int xlr_pcib_attach(device_t dev) { - + struct xlr_pcib_softc *sc; + sc = device_get_softc(dev); + + /* + * XLR C revision chips cannot do DMA above 2G physical address + * create a parent tag with this lowaddr + */ + if (xlr_is_c_revision()) { + if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, + 0x7fffffff, ~0, NULL, NULL, 0x7fffffff, + 0xff, 0x7fffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0) + panic("%s: bus_dma_tag_create failed", __func__); + } device_add_child(dev, "pci", 0); bus_generic_attach(dev); return (0); @@ -566,6 +578,15 @@ xlr_pci_release_resource(device_t bus, d return (rman_release_resource(r)); } +static bus_dma_tag_t +xlr_pci_get_dma_tag(device_t bus, device_t child) +{ + struct xlr_pcib_softc *sc; + + sc = device_get_softc(bus); + return (sc->sc_pci_dmat); +} + static int xlr_pci_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) @@ -618,6 +639,7 @@ static device_method_t xlr_pcib_methods[ DEVMETHOD(bus_write_ivar, xlr_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, xlr_pci_alloc_resource), DEVMETHOD(bus_release_resource, xlr_pci_release_resource), + DEVMETHOD(bus_get_dma_tag, xlr_pci_get_dma_tag), DEVMETHOD(bus_activate_resource, xlr_pci_activate_resource), DEVMETHOD(bus_deactivate_resource, xlr_pci_deactivate_resource), DEVMETHOD(bus_setup_intr, mips_platform_pci_setup_intr), From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 17:35:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387841065788; Wed, 6 Oct 2010 17:35:28 +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 1CFF28FC0C; Wed, 6 Oct 2010 17: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 o96HZSac012285; Wed, 6 Oct 2010 17:35:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96HZRwb012282; Wed, 6 Oct 2010 17:35:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010061735.o96HZRwb012282@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Oct 2010 17:35: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: r213485 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 17:35:28 -0000 Author: yongari Date: Wed Oct 6 17:35:27 2010 New Revision: 213485 URL: http://svn.freebsd.org/changeset/base/213485 Log: Overhaul MII register access routine and remove unnecessary BGE_MI_MODE register accesses. Previously bge(4) used to read BGE_MI_MODE register to detect whether it needs to disable autopolling feature or not. Because we don't touch autopolling in other part of driver there is no reason to read BGE_MI_MODE register given that we know default value in advance. In order to achieve the goal, check whether the controller has CPMU(Central Power Mangement Unit) capability. If controller has CPMU feature, use 500KHz MII management interface(mdio/mdc) frequency regardless core clock frequency. Otherwise use default MII clock. While I'm here, add CPMU register definition. In bge_miibus_readreg(), rearrange code a bit and remove goto statement. In bge_miibus_writereg(), make sure to restore autopolling even if MII write failed. The delay time inserted after accessing BGE_MI_MODE register increased from 40us to 80us. The default PHY address is now stored in softc. All PHYs supported by bge(4) currently uses PHY address 1 but it will be changed when we add newer controllers. This change will make it easier to change default PHY address depending on PHY models. Submitted by: davidch Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Oct 6 15:37:55 2010 (r213484) +++ head/sys/dev/bge/if_bge.c Wed Oct 6 17:35:27 2010 (r213485) @@ -768,38 +768,34 @@ static int bge_miibus_readreg(device_t dev, int phy, int reg) { struct bge_softc *sc; - uint32_t val, autopoll; + uint32_t val; int i; sc = device_get_softc(dev); - /* - * Broadcom's own driver always assumes the internal - * PHY is at GMII address 1. On some chips, the PHY responds - * to accesses at all addresses, which could cause us to - * bogusly attach the PHY 32 times at probe type. Always - * restricting the lookup to address 1 is simpler than - * trying to figure out which chips revisions should be - * special-cased. - */ - if (phy != 1) + /* Prevent the probe from finding incorrect devices. */ + if (phy != sc->bge_phy_addr) return (0); - /* Reading with autopolling on may trigger PCI errors */ - autopoll = CSR_READ_4(sc, BGE_MI_MODE); - if (autopoll & BGE_MIMODE_AUTOPOLL) { - BGE_CLRBIT(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL); - DELAY(40); + /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ + if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { + CSR_WRITE_4(sc, BGE_MI_MODE, + sc->bge_mi_mode & ~BGE_MIMODE_AUTOPOLL); + DELAY(80); } CSR_WRITE_4(sc, BGE_MI_COMM, BGE_MICMD_READ | BGE_MICOMM_BUSY | BGE_MIPHY(phy) | BGE_MIREG(reg)); + /* Poll for the PHY register access to complete. */ for (i = 0; i < BGE_TIMEOUT; i++) { DELAY(10); val = CSR_READ_4(sc, BGE_MI_COMM); - if (!(val & BGE_MICOMM_BUSY)) + if ((val & BGE_MICOMM_BUSY) == 0) { + DELAY(5); + val = CSR_READ_4(sc, BGE_MI_COMM); break; + } } if (i == BGE_TIMEOUT) { @@ -807,16 +803,12 @@ bge_miibus_readreg(device_t dev, int phy "PHY read timed out (phy %d, reg %d, val 0x%08x)\n", phy, reg, val); val = 0; - goto done; } - DELAY(5); - val = CSR_READ_4(sc, BGE_MI_COMM); - -done: - if (autopoll & BGE_MIMODE_AUTOPOLL) { - BGE_SETBIT(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL); - DELAY(40); + /* Restore the autopoll bit if necessary. */ + if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { + CSR_WRITE_4(sc, BGE_MI_MODE, sc->bge_mi_mode); + DELAY(80); } if (val & BGE_MICOMM_READFAIL) @@ -829,7 +821,6 @@ static int bge_miibus_writereg(device_t dev, int phy, int reg, int val) { struct bge_softc *sc; - uint32_t autopoll; int i; sc = device_get_softc(dev); @@ -838,11 +829,11 @@ bge_miibus_writereg(device_t dev, int ph (reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL)) return (0); - /* Reading with autopolling on may trigger PCI errors */ - autopoll = CSR_READ_4(sc, BGE_MI_MODE); - if (autopoll & BGE_MIMODE_AUTOPOLL) { - BGE_CLRBIT(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL); - DELAY(40); + /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ + if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { + CSR_WRITE_4(sc, BGE_MI_MODE, + sc->bge_mi_mode & ~BGE_MIMODE_AUTOPOLL); + DELAY(80); } CSR_WRITE_4(sc, BGE_MI_COMM, BGE_MICMD_WRITE | BGE_MICOMM_BUSY | @@ -857,17 +848,16 @@ bge_miibus_writereg(device_t dev, int ph } } - if (i == BGE_TIMEOUT) { + /* Restore the autopoll bit if necessary. */ + if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { + CSR_WRITE_4(sc, BGE_MI_MODE, sc->bge_mi_mode); + DELAY(80); + } + + if (i == BGE_TIMEOUT) device_printf(sc->bge_dev, "PHY write timed out (phy %d, reg %d, val %d)\n", phy, reg, val); - return (0); - } - - if (autopoll & BGE_MIMODE_AUTOPOLL) { - BGE_SETBIT(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL); - DELAY(40); - } return (0); } @@ -2502,6 +2492,9 @@ bge_attach(device_t dev) sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); + /* Set default PHY address. */ + sc->bge_phy_addr = 1; + /* * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the * 5705 A0 and A1 chips. @@ -2575,6 +2568,17 @@ bge_attach(device_t dev) sc->bge_phy_flags |= BGE_PHY_BER_BUG; } + /* Identify the chips that use an CPMU. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) + sc->bge_flags |= BGE_FLAG_CPMU_PRESENT; + if ((sc->bge_flags & BGE_FLAG_CPMU_PRESENT) != 0) + sc->bge_mi_mode = BGE_MIMODE_500KHZ_CONST; + else + sc->bge_mi_mode = BGE_MIMODE_BASE; + /* * All controllers that are not 5755 or higher have 4GB * boundary DMA bug. Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Wed Oct 6 15:37:55 2010 (r213484) +++ head/sys/dev/bge/if_bgereg.h Wed Oct 6 17:35:27 2010 (r213485) @@ -863,9 +863,12 @@ #define BGE_MISTS_LINK 0x00000001 #define BGE_MISTS_10MBPS 0x00000002 +#define BGE_MIMODE_CLK_10MHZ 0x00000001 #define BGE_MIMODE_SHORTPREAMBLE 0x00000002 #define BGE_MIMODE_AUTOPOLL 0x00000010 #define BGE_MIMODE_CLKCNT 0x001F0000 +#define BGE_MIMODE_500KHZ_CONST 0x00008000 +#define BGE_MIMODE_BASE 0x000C0000 /* @@ -1221,6 +1224,51 @@ /* Receive List Selector Status register */ #define BGE_RXLSSTAT_ERROR 0x00000004 +#define BGE_CPMU_CTRL 0x3600 +#define BGE_CPMU_LSPD_10MB_CLK 0x3604 +#define BGE_CPMU_LSPD_1000MB_CLK 0x360C +#define BGE_CPMU_LNK_AWARE_PWRMD 0x3610 +#define BGE_CPMU_HST_ACC 0x361C +#define BGE_CPMU_CLCK_STAT 0x3630 +#define BGE_CPMU_MUTEX_REQ 0x365C +#define BGE_CPMU_MUTEX_GNT 0x3660 +#define BGE_CPMU_PHY_STRAP 0x3664 + +/* Central Power Management Unit (CPMU) register */ +#define BGE_CPMU_CTRL_LINK_IDLE_MODE 0x00000200 +#define BGE_CPMU_CTRL_LINK_AWARE_MODE 0x00000400 +#define BGE_CPMU_CTRL_LINK_SPEED_MODE 0x00004000 +#define BGE_CPMU_CTRL_GPHY_10MB_RXONLY 0x00010000 + +/* Link Speed 10MB/No Link Power Mode Clock Policy register */ +#define BGE_CPMU_LSPD_10MB_MACCLK_MASK 0x001F0000 +#define BGE_CPMU_LSPD_10MB_MACCLK_6_25 0x00130000 + +/* Link Speed 1000MB Power Mode Clock Policy register */ +#define BGE_CPMU_LSPD_1000MB_MACCLK_62_5 0x00000000 +#define BGE_CPMU_LSPD_1000MB_MACCLK_12_5 0x00110000 +#define BGE_CPMU_LSPD_1000MB_MACCLK_MASK 0x001F0000 + +/* Link Aware Power Mode Clock Policy register */ +#define BGE_CPMU_LNK_AWARE_MACCLK_MASK 0x001F0000 +#define BGE_CPMU_LNK_AWARE_MACCLK_6_25 0x00130000 + +#define BGE_CPMU_HST_ACC_MACCLK_MASK 0x001F0000 +#define BGE_CPMU_HST_ACC_MACCLK_6_25 0x00130000 + +/* CPMU Clock Status register */ +#define BGE_CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001F0000 +#define BGE_CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 +#define BGE_CPMU_CLCK_STAT_MAC_CLCK_12_5 0x00110000 +#define BGE_CPMU_CLCK_STAT_MAC_CLCK_6_25 0x00130000 + +/* CPMU Mutex Request register */ +#define BGE_CPMU_MUTEX_REQ_DRIVER 0x00001000 +#define BGE_CPMU_MUTEX_GNT_DRIVER 0x00001000 + +/* CPMU GPHY Strap register */ +#define BGE_CPMU_PHY_STRAP_IS_SERDES 0x00000020 + /* * Mbuf Cluster Free registers (has nothing to do with BSD mbufs) */ @@ -2665,6 +2713,7 @@ struct bge_softc { #define BGE_FLAG_JUMBO 0x00000002 #define BGE_FLAG_EADDR 0x00000008 #define BGE_FLAG_MII_SERDES 0x00000010 +#define BGE_FLAG_CPMU_PRESENT 0x00000020 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 @@ -2707,7 +2756,9 @@ struct bge_softc { uint32_t bge_rx_max_coal_bds; uint32_t bge_tx_max_coal_bds; uint32_t bge_tx_buf_ratio; + uint32_t bge_mi_mode; int bge_if_flags; + int bge_phy_addr; int bge_txcnt; int bge_link; /* link state */ int bge_link_evt; /* pending link event */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 17:47:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C850E1065700; Wed, 6 Oct 2010 17:47:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B801C8FC1F; Wed, 6 Oct 2010 17:47: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 o96HlDYi012541; Wed, 6 Oct 2010 17:47:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96HlDht012539; Wed, 6 Oct 2010 17:47:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010061747.o96HlDht012539@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Oct 2010 17:47: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: r213486 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 17:47:13 -0000 Author: yongari Date: Wed Oct 6 17:47:13 2010 New Revision: 213486 URL: http://svn.freebsd.org/changeset/base/213486 Log: Remove bge_tx_buf_ratio, unused member of softc. Modified: head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Wed Oct 6 17:35:27 2010 (r213485) +++ head/sys/dev/bge/if_bgereg.h Wed Oct 6 17:47:13 2010 (r213486) @@ -2755,7 +2755,6 @@ struct bge_softc { uint32_t bge_tx_prodidx; uint32_t bge_rx_max_coal_bds; uint32_t bge_tx_max_coal_bds; - uint32_t bge_tx_buf_ratio; uint32_t bge_mi_mode; int bge_if_flags; int bge_phy_addr; From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 18:14:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7A9D1065695 for ; Wed, 6 Oct 2010 18:14:56 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 597AD8FC19 for ; Wed, 6 Oct 2010 18:14:56 +0000 (UTC) Received: (qmail 3831 invoked by uid 399); 6 Oct 2010 18:14:55 -0000 Received: from localhost (HELO ?192.168.0.145?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 6 Oct 2010 18:14:55 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4CACBCA4.3080006@FreeBSD.org> Date: Wed, 06 Oct 2010 11:15:00 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Alexander Leidinger References: <201010060749.o967nSbZ086734@svn.freebsd.org> In-Reply-To: <201010060749.o967nSbZ086734@svn.freebsd.org> X-Enigmail-Version: 1.2a1pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Paul B Mahol Subject: Re: svn commit: r213472 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 18:14:57 -0000 On 10/6/2010 12:49 AM, Alexander Leidinger wrote: > Author: netchild > Date: Wed Oct 6 07:49:28 2010 > New Revision: 213472 > URL: http://svn.freebsd.org/changeset/base/213472 > > Log: > Add some missing files to optionally delete. > > Submitted by: Paul B Mahol > > Modified: > head/tools/build/mk/OptionalObsoleteFiles.inc > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > ============================================================================== > --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 6 07:34:41 2010 (r213471) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 6 07:49:28 2010 (r213472) > @@ -141,6 +141,7 @@ OLD_FILES+=usr/share/man/man8/authpf.8.g > .endif > > .if ${MK_BIND} == no > +OLD_FILES+=etc/periodic/daily/470.status-named Traditionally we haven't deleted these. In the case of named-related files I would prefer that we did not because: 1. That check is off by default 2. If the user is not running named it won't do any harm 3. The default for installing named from the ports is to continue to use the infrastructure in the base (such as this script, and /etc/rc.d/named). I'm not sure what the right answer for all the periodic scripts is, but for this one I would like it not to be included in the obsolete files. At some point down the road we may have a more flexible structure in place for such things, but until we do ... Doug -- Breadth of IT experience, and | Nothin' ever doesn't change, depth of knowledge in the DNS. | but nothin' changes much. Yours for the right price. :) | -- OK Go http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 18:20:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DBF51065672; Wed, 6 Oct 2010 18:20:08 +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 0D8628FC16; Wed, 6 Oct 2010 18:20:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o96IK7bF013344; Wed, 6 Oct 2010 18:20:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96IK7LZ013342; Wed, 6 Oct 2010 18:20:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010061820.o96IK7LZ013342@svn.freebsd.org> From: Xin LI Date: Wed, 6 Oct 2010 18:20: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: r213487 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 18:20:08 -0000 Author: delphij Date: Wed Oct 6 18:20:07 2010 New Revision: 213487 URL: http://svn.freebsd.org/changeset/base/213487 Log: Add definition for FreeBSD 7.4, which will be used in a manual page change. Reviewed by: ru MFC after: 3 days Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Wed Oct 6 17:47:13 2010 (r213486) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Wed Oct 6 18:20:07 2010 (r213487) @@ -76,6 +76,7 @@ .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.2 7.2 .ds doc-operating-system-FreeBSD-7.3 7.3 +.ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-9.0 9.0 From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 18:20:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8CAE1065674; Wed, 6 Oct 2010 18:20:39 +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 A88E08FC20; Wed, 6 Oct 2010 18:20: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 o96IKdpv013405; Wed, 6 Oct 2010 18:20:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96IKdZD013403; Wed, 6 Oct 2010 18:20:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010061820.o96IKdZD013403@svn.freebsd.org> From: Xin LI Date: Wed, 6 Oct 2010 18:20: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: r213488 - head/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 18:20:39 -0000 Author: delphij Date: Wed Oct 6 18:20:39 2010 New Revision: 213488 URL: http://svn.freebsd.org/changeset/base/213488 Log: Use a defined FreeBSD version. MFC after: 3 days Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed Oct 6 18:20:07 2010 (r213487) +++ head/libexec/tftpd/tftpd.8 Wed Oct 6 18:20:39 2010 (r213488) @@ -245,14 +245,14 @@ and the and .Fl W options were introduced in -.Fx 7 . +.Fx 7.4 . .Pp Support for Timeout Interval and Transfer Size Options (RFC2349) was introduced in .Fx 5.0 , support for the TFTP Blocksize Option (RFC2348) and the blksize2 option was introduced in -.Fx 7 . +.Fx 7.4 . .Sh BUGS Files larger than 33488896 octets (65535 blocks) cannot be transferred without client and server supporting blocksize negotiation (RFC2348). From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 18:36:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D602A106566B; Wed, 6 Oct 2010 18:36:50 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C50FC8FC19; Wed, 6 Oct 2010 18:36: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 o96IaoPf013947; Wed, 6 Oct 2010 18:36:50 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96Iaosw013943; Wed, 6 Oct 2010 18:36:50 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201010061836.o96Iaosw013943@svn.freebsd.org> From: Doug Ambrisko Date: Wed, 6 Oct 2010 18:36: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: r213489 - in head/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 18:36:50 -0000 Author: ambrisko Date: Wed Oct 6 18:36:50 2010 New Revision: 213489 URL: http://svn.freebsd.org/changeset/base/213489 Log: Add the capability to read the complete contents of the NVRAM via sysctl dev.bce..nvram_dump Add the capability to write the complete contents of the NVRAM via sysctl dev.bce..nvram_write These are only available if the kernel option BCE_DEBUG is enabled. The nvram_write sysctl also requires the kernel option BCE_NVRAM_WRITE_SUPPORT to be enabled. These are to be used at your own caution. Since the MAC addresses are stored in the NVRAM, if you dump one NIC and restore it on another NIC the destination NIC's MAC addresses will not be preserved. A tool can be made using these sysctl's to manage the on-chip firmware. Reviewed by: davidch, yongari Modified: head/sys/conf/options head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Oct 6 18:20:39 2010 (r213488) +++ head/sys/conf/options Wed Oct 6 18:36:50 2010 (r213489) @@ -696,6 +696,7 @@ ED_SIC opt_ed.h # bce driver BCE_DEBUG opt_bce.h +BCE_NVRAM_WRITE_SUPPORT opt_bce.h SOCKBUF_DEBUG opt_global.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Wed Oct 6 18:20:39 2010 (r213488) +++ head/sys/dev/bce/if_bce.c Wed Oct 6 18:36:50 2010 (r213489) @@ -343,6 +343,12 @@ static int bce_miibus_read_reg (device static int bce_miibus_write_reg (device_t, int, int, int); static void bce_miibus_statchg (device_t); +#ifdef BCE_DEBUG +static int sysctl_nvram_dump(SYSCTL_HANDLER_ARGS); +#ifdef BCE_NVRAM_WRITE_SUPPORT +static int sysctl_nvram_write(SYSCTL_HANDLER_ARGS); +#endif +#endif /****************************************************************************/ /* BCE NVRAM Access Routines */ @@ -8342,6 +8348,57 @@ bce_sysctl_phy_read(SYSCTL_HANDLER_ARGS) } +static int +sysctl_nvram_dump(SYSCTL_HANDLER_ARGS) +{ + struct bce_softc *sc = (struct bce_softc *)arg1; + int error, i; + + if (sc->nvram_buf == NULL) { + sc->nvram_buf = malloc(sc->bce_flash_size, + M_TEMP, M_ZERO | M_WAITOK); + } + if (sc->nvram_buf == NULL) { + return(ENOMEM); + } + if (req->oldlen == sc->bce_flash_size) { + for (i = 0; i < sc->bce_flash_size; i++) { + bce_nvram_read(sc, i, &sc->nvram_buf[i], 1); + } + } + + error = SYSCTL_OUT(req, sc->nvram_buf, sc->bce_flash_size); + + return error; +} + +#ifdef BCE_NVRAM_WRITE_SUPPORT +static int +sysctl_nvram_write(SYSCTL_HANDLER_ARGS) +{ + struct bce_softc *sc = (struct bce_softc *)arg1; + int error; + + if (sc->nvram_buf == NULL) { + sc->nvram_buf = malloc(sc->bce_flash_size, + M_TEMP, M_ZERO | M_WAITOK); + } + if (sc->nvram_buf == NULL) { + return(ENOMEM); + } + bzero(sc->nvram_buf, sc->bce_flash_size); + error = SYSCTL_IN(req, sc->nvram_buf, sc->bce_flash_size); + + if (req->newlen == sc->bce_flash_size) { + bce_nvram_write(sc, 0, sc->nvram_buf , sc->bce_flash_size); + } + + + return error; +} +#endif + + /****************************************************************************/ /* Provides a sysctl interface to allow reading a CID. */ /* */ @@ -8566,6 +8623,16 @@ bce_add_sysctls(struct bce_softc *sc) "interrupts_tx", CTLFLAG_RD, &sc->interrupts_tx, 0, "Number of TX interrupts"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "nvram_dump", CTLTYPE_OPAQUE | CTLFLAG_RD, + (void *)sc, 0, + sysctl_nvram_dump, "S", ""); +#ifdef BCE_NVRAM_WRITE_SUPPORT + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "nvram_write", CTLTYPE_OPAQUE | CTLFLAG_WR, + (void *)sc, 0, + sysctl_nvram_write, "S", ""); +#endif #endif SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Wed Oct 6 18:20:39 2010 (r213488) +++ head/sys/dev/bce/if_bcereg.h Wed Oct 6 18:36:50 2010 (r213489) @@ -6790,6 +6790,7 @@ struct bce_softc /* Number of VLAN tagged frames stripped. */ u32 vlan_tagged_frames_stripped; #endif + uint8_t *nvram_buf; }; #endif /* __BCEREG_H_DEFINED */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 18:51:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 128A5106566C; Wed, 6 Oct 2010 18:51:23 +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 DBBFA8FC16; Wed, 6 Oct 2010 18:51: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 o96IpMcx014670; Wed, 6 Oct 2010 18:51:22 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96IpMCx014668; Wed, 6 Oct 2010 18:51:22 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010061851.o96IpMCx014668@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 6 Oct 2010 18:51: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: r213490 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 18:51:23 -0000 Author: jkim Date: Wed Oct 6 18:51:22 2010 New Revision: 213490 URL: http://svn.freebsd.org/changeset/base/213490 Log: Simplify timeout check in futex_wait() using itimerfix() and return error if the given timeout is invalid. Consistently use int type for timeout and correct a format string in futex_sleep(). Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Wed Oct 6 18:36:50 2010 (r213489) +++ head/sys/compat/linux/linux_futex.c Wed Oct 6 18:51:22 2010 (r213490) @@ -238,12 +238,12 @@ futex_get(uint32_t *uaddr, struct waitin } static int -futex_sleep(struct futex *f, struct waiting_proc *wp, unsigned long timeout) +futex_sleep(struct futex *f, struct waiting_proc *wp, int timeout) { int error; FUTEX_ASSERT_LOCKED(f); - LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %ld ref %d", + LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %d ref %d", f->f_uaddr, wp, timeout, f->f_refcount); error = sx_sleep(wp, &f->f_lck, PCATCH, "futex", timeout); if (wp->wp_flags & FUTEX_WP_REQUEUED) { @@ -327,8 +327,8 @@ futex_requeue(struct futex *f, int n, st static int futex_wait(struct futex *f, struct waiting_proc *wp, struct l_timespec *ts) { - struct l_timespec timeout = {0, 0}; - struct timeval tv = {0, 0}; + struct l_timespec timeout; + struct timeval tv; int timeout_hz; int error; @@ -336,26 +336,14 @@ futex_wait(struct futex *f, struct waiti error = copyin(ts, &timeout, sizeof(timeout)); if (error) return (error); - } - - tv.tv_usec = timeout.tv_sec * 1000000 + timeout.tv_nsec / 1000; - timeout_hz = tvtohz(&tv); - - if (timeout.tv_sec == 0 && timeout.tv_nsec == 0) + TIMESPEC_TO_TIMEVAL(&tv, &timeout); + error = itimerfix(&tv); + if (error) + return (error); + timeout_hz = tvtohz(&tv); + } else timeout_hz = 0; - /* - * If the user process requests a non null timeout, - * make sure we do not turn it into an infinite - * timeout because timeout_hz gets null. - * - * We use a minimal timeout of 1/hz. Maybe it would - * make sense to just return ETIMEDOUT without sleeping. - */ - if (((timeout.tv_sec != 0) || (timeout.tv_nsec != 0)) && - (timeout_hz == 0)) - timeout_hz = 1; - error = futex_sleep(f, wp, timeout_hz); if (error == EWOULDBLOCK) error = ETIMEDOUT; From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 19:07:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 9AE131065670; Wed, 6 Oct 2010 19:07:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Wed, 6 Oct 2010 15:07:24 -0400 User-Agent: KMail/1.6.2 References: <201010061851.o96IpMCx014668@svn.freebsd.org> In-Reply-To: <201010061851.o96IpMCx014668@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010061507.28054.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r213490 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 19:07:36 -0000 On Wednesday 06 October 2010 02:51 pm, Jung-uk Kim wrote: > Author: jkim > Date: Wed Oct 6 18:51:22 2010 > New Revision: 213490 > URL: http://svn.freebsd.org/changeset/base/213490 > > Log: > Simplify timeout check in futex_wait() using itimerfix() and > return error if the given timeout is invalid. Consistently use int > type for timeout and correct a format string in futex_sleep(). This also fixes a case where the pointer is non-NULL but the actual content is zero. Previously we were waiting forever in that case. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 20:35:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A07D4106566C; Wed, 6 Oct 2010 20:35:07 +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 9035B8FC16; Wed, 6 Oct 2010 20:35: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 o96KZ7GK017468; Wed, 6 Oct 2010 20:35:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96KZ74Y017466; Wed, 6 Oct 2010 20:35:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010062035.o96KZ74Y017466@svn.freebsd.org> From: Dimitry Andric Date: Wed, 6 Oct 2010 20:35: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: r213492 - head/contrib/llvm/tools/clang/lib/Driver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 20:35:07 -0000 Author: dim Date: Wed Oct 6 20:35:07 2010 New Revision: 213492 URL: http://svn.freebsd.org/changeset/base/213492 Log: Apply r207674 from the clangbsd project branch: Make "clang -print-multi-os-directory" return "." on amd64, matching gcc's behaviour. This is needed because some ports use the option to determine the installation directory for their libraries. Requested by: kwm Approved by: rpaulo (mentor) Modified: head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp Modified: head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp Wed Oct 6 19:32:12 2010 (r213491) +++ head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp Wed Oct 6 20:35:07 2010 (r213492) @@ -470,7 +470,7 @@ bool Driver::HandleImmediateArgs(const C break; case llvm::Triple::x86_64: - llvm::outs() << "x86_64" << "\n"; + llvm::outs() << "." << "\n"; break; case llvm::Triple::ppc64: From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 20:49:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C1571065670; Wed, 6 Oct 2010 20:49:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C2898FC1C; Wed, 6 Oct 2010 20:49: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 o96KnkUg017832; Wed, 6 Oct 2010 20:49:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96KnkrV017830; Wed, 6 Oct 2010 20:49:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201010062049.o96KnkrV017830@svn.freebsd.org> From: Warner Losh Date: Wed, 6 Oct 2010 20:49: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: r213493 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 20:49:46 -0000 Author: imp Date: Wed Oct 6 20:49:45 2010 New Revision: 213493 URL: http://svn.freebsd.org/changeset/base/213493 Log: Use more portable errx instead of errc. The latter doesn't buy us anyting anyway, since the error EAGAIN's error message doesn't add anything to the error strings that are there now. Modified: head/usr.bin/make/main.c Modified: head/usr.bin/make/main.c ============================================================================== --- head/usr.bin/make/main.c Wed Oct 6 20:35:07 2010 (r213492) +++ head/usr.bin/make/main.c Wed Oct 6 20:49:45 2010 (r213493) @@ -686,11 +686,9 @@ check_make_level(void) int level = (value == NULL) ? 0 : atoi(value); if (level < 0) { - errc(2, EAGAIN, "Invalid value for recursion level (%d).", - level); + errx(2, "Invalid value for recursion level (%d).", level); } else if (level > MKLVL_MAXVAL) { - errc(2, EAGAIN, "Max recursion level (%d) exceeded.", - MKLVL_MAXVAL); + errx(2, "Max recursion level (%d) exceeded.", MKLVL_MAXVAL); } else { char new_value[32]; sprintf(new_value, "%d", level + 1); From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 20:54:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 437E5106566B; Wed, 6 Oct 2010 20:54:18 +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 3385D8FC1B; Wed, 6 Oct 2010 20:54: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 o96KsImt017963; Wed, 6 Oct 2010 20:54:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96KsIsJ017961; Wed, 6 Oct 2010 20:54:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201010062054.o96KsIsJ017961@svn.freebsd.org> From: Warner Losh Date: Wed, 6 Oct 2010 20:54: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: r213494 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 20:54:18 -0000 Author: imp Date: Wed Oct 6 20:54:17 2010 New Revision: 213494 URL: http://svn.freebsd.org/changeset/base/213494 Log: Remove hack needed by 6.x machines and older machines to run newer makes on FreeBSD/pc98. The need for this hack has passed. If you are one of the rare people that may need this, then you should setenv MACHINE=pc98 as a workaround. Modified: head/usr.bin/make/main.c Modified: head/usr.bin/make/main.c ============================================================================== --- head/usr.bin/make/main.c Wed Oct 6 20:49:45 2010 (r213493) +++ head/usr.bin/make/main.c Wed Oct 6 20:54:17 2010 (r213494) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -931,26 +930,6 @@ main(int argc, char **argv) #endif /* - * Prior to 7.0, FreeBSD/pc98 kernel used to set the - * utsname.machine to "i386", and MACHINE was defined as - * "i386", so it could not be distinguished from FreeBSD/i386. - * Therefore, we had to check machine.ispc98 and adjust the - * MACHINE variable. NOTE: The code is still here to be able - * to compile new make binary on old FreeBSD/pc98 systems, and - * have the MACHINE variable set properly. - */ - if ((machine = getenv("MACHINE")) == NULL) { - int ispc98; - size_t len; - - len = sizeof(ispc98); - if (!sysctlbyname("machdep.ispc98", &ispc98, &len, NULL, 0)) { - if (ispc98) - machine = "pc98"; - } - } - - /* * Get the name of this type of MACHINE from utsname * so we can share an executable for similar machines. * (i.e. m68k: amiga hp300, mac68k, sun3, ...) @@ -958,7 +937,7 @@ main(int argc, char **argv) * Note that both MACHINE and MACHINE_ARCH are decided at * run-time. */ - if (machine == NULL) { + if ((machine = getenv("MACHINE")) == NULL) { static struct utsname utsname; if (uname(&utsname) == -1) From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 21:23:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B25C01065670; Wed, 6 Oct 2010 21:23:57 +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 A0E098FC1E; Wed, 6 Oct 2010 21:23: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 o96LNvqt018599; Wed, 6 Oct 2010 21:23:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96LNvE8018597; Wed, 6 Oct 2010 21:23:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010062123.o96LNvE8018597@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Oct 2010 21:23: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: r213495 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 21:23:57 -0000 Author: yongari Date: Wed Oct 6 21:23:57 2010 New Revision: 213495 URL: http://svn.freebsd.org/changeset/base/213495 Log: Add more comments to rings supported by the controller. Different versions of controller support different number of ring control blocks such that adjust code a bit to access known number of send/receive ring control blocks. Previously bge(4) blindly accessed 16 send/receive RCBs. Also move initializing standard receive producer ring producer index, jumbo receive producer ring producer index and mini receive producer ring producer index to the end of each receive producer ring initialization. Do not assume mini receive producer ring is available only when controller has jumbo frame capability, instead explicitly check ASIC version BCM5700 to disable mini receive producer ring. Additionally always enable send ring 0 regardless of controller versions. Previously bge(4) didn't enable send ring 0 if controller is BGE_IS_5705_PLUS. Becase bge(4) need 1 send ring to send frames at least, I have no idea how it would have worked so far. Submitted by: davidch Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Oct 6 20:54:17 2010 (r213494) +++ head/sys/dev/bge/if_bge.c Wed Oct 6 21:23:57 2010 (r213495) @@ -1092,9 +1092,10 @@ bge_init_rx_ring_jumbo(struct bge_softc sc->bge_jumbo = 0; + /* Enable the jumbo receive producer ring. */ rcb = &sc->bge_ldata.bge_info.bge_jumbo_rx_rcb; - rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, - BGE_RCB_FLAG_USE_EXT_RX_BD); + rcb->bge_maxlen_flags = + BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, BGE_JUMBO_RX_RING_CNT - 1); @@ -1473,7 +1474,7 @@ bge_blockinit(struct bge_softc *sc) bus_size_t vrcb; bge_hostaddr taddr; uint32_t val; - int i; + int i, limit; /* * Initialize the memory window pointer register so that @@ -1553,7 +1554,38 @@ bge_blockinit(struct bge_softc *sc) return (ENXIO); } - /* Initialize the standard RX ring control block */ + /* + * Summary of rings supported by the controller: + * + * Standard Receive Producer Ring + * - This ring is used to feed receive buffers for "standard" + * sized frames (typically 1536 bytes) to the controller. + * + * Jumbo Receive Producer Ring + * - This ring is used to feed receive buffers for jumbo sized + * frames (i.e. anything bigger than the "standard" frames) + * to the controller. + * + * Mini Receive Producer Ring + * - This ring is used to feed receive buffers for "mini" + * sized frames to the controller. + * - This feature required external memory for the controller + * but was never used in a production system. Should always + * be disabled. + * + * Receive Return Ring + * - After the controller has placed an incoming frame into a + * receive buffer that buffer is moved into a receive return + * ring. The driver is then responsible to passing the + * buffer up to the stack. Many versions of the controller + * support multiple RR rings. + * + * Send Ring + * - This ring is used for outgoing frames. Many versions of + * the controller support multiple send rings. + */ + + /* Initialize the standard receive producer ring control block. */ rcb = &sc->bge_ldata.bge_info.bge_std_rx_rcb; rcb->bge_hostaddr.bge_addr_lo = BGE_ADDR_LO(sc->bge_ldata.bge_rx_std_ring_paddr); @@ -1561,28 +1593,45 @@ bge_blockinit(struct bge_softc *sc) BGE_ADDR_HI(sc->bge_ldata.bge_rx_std_ring_paddr); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREREAD); - if (BGE_IS_5705_PLUS(sc)) + if (BGE_IS_5705_PLUS(sc)) { + /* + * Bits 31-16: Programmable ring size (512, 256, 128, 64, 32) + * Bits 15-2 : Reserved (should be 0) + * Bit 1 : 1 = Ring Disabled, 0 = Ring Enabled + * Bit 0 : Reserved + */ rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(512, 0); - else + } else { + /* + * Ring size is always XXX entries + * Bits 31-16: Maximum RX frame size + * Bits 15-2 : Reserved (should be 0) + * Bit 1 : 1 = Ring Disabled, 0 = Ring Enabled + * Bit 0 : Reserved + */ rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); + } rcb->bge_nicaddr = BGE_STD_RX_RINGS; + /* Write the standard receive producer ring control block. */ CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_HI, rcb->bge_hostaddr.bge_addr_hi); CSR_WRITE_4(sc, BGE_RX_STD_RCB_HADDR_LO, rcb->bge_hostaddr.bge_addr_lo); - CSR_WRITE_4(sc, BGE_RX_STD_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); CSR_WRITE_4(sc, BGE_RX_STD_RCB_NICADDR, rcb->bge_nicaddr); + /* Reset the standard receive producer ring producer index. */ + bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, 0); + /* - * Initialize the jumbo RX ring control block - * We set the 'ring disabled' bit in the flags - * field until we're actually ready to start + * Initialize the jumbo RX producer ring control + * block. We set the 'ring disabled' bit in the + * flags field until we're actually ready to start * using this ring (i.e. once we set the MTU * high enough to require it). */ if (BGE_IS_JUMBO_CAPABLE(sc)) { rcb = &sc->bge_ldata.bge_info.bge_jumbo_rx_rcb; - + /* Get the jumbo receive producer ring RCB parameters. */ rcb->bge_hostaddr.bge_addr_lo = BGE_ADDR_LO(sc->bge_ldata.bge_rx_jumbo_ring_paddr); rcb->bge_hostaddr.bge_addr_hi = @@ -1597,20 +1646,31 @@ bge_blockinit(struct bge_softc *sc) rcb->bge_hostaddr.bge_addr_hi); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_HADDR_LO, rcb->bge_hostaddr.bge_addr_lo); - + /* Program the jumbo receive producer ring RCB parameters. */ CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_NICADDR, rcb->bge_nicaddr); + /* Reset the jumbo receive producer ring producer index. */ + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0); + } - /* Set up dummy disabled mini ring RCB */ + /* Disable the mini receive producer ring RCB. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700) { rcb = &sc->bge_ldata.bge_info.bge_mini_rx_rcb; rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_RING_DISABLED); CSR_WRITE_4(sc, BGE_RX_MINI_RCB_MAXLEN_FLAGS, rcb->bge_maxlen_flags); + /* Reset the mini receive producer ring producer index. */ + bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0); } /* + * The BD ring replenish thresholds control how often the + * hardware fetches new BD's from the producer rings in host + * memory. Setting the value too low on a busy system can + * starve the hardware and recue the throughpout. + * * Set the BD ring replentish thresholds. The recommended * values are 1/8th the number of descriptors allocated to * each ring. @@ -1632,61 +1692,67 @@ bge_blockinit(struct bge_softc *sc) BGE_JUMBO_RX_RING_CNT/8); /* - * Disable all unused send rings by setting the 'ring disabled' - * bit in the flags field of all the TX send ring control blocks. - * These are located in NIC memory. - */ + * Disable all send rings by setting the 'ring disabled' bit + * in the flags field of all the TX send ring control blocks, + * located in NIC memory. + */ + if (!BGE_IS_5705_PLUS(sc)) + /* 5700 to 5704 had 16 send rings. */ + limit = BGE_TX_RINGS_EXTSSRAM_MAX; + else + limit = 1; vrcb = BGE_MEMWIN_START + BGE_SEND_RING_RCB; - for (i = 0; i < BGE_TX_RINGS_EXTSSRAM_MAX; i++) { + for (i = 0; i < limit; i++) { RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_RING_DISABLED)); RCB_WRITE_4(sc, vrcb, bge_nicaddr, 0); vrcb += sizeof(struct bge_rcb); } - /* Configure TX RCB 0 (we use only the first ring) */ + /* Configure send ring RCB 0 (we use only the first ring) */ vrcb = BGE_MEMWIN_START + BGE_SEND_RING_RCB; BGE_HOSTADDR(taddr, sc->bge_ldata.bge_tx_ring_paddr); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, taddr.bge_addr_hi); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); RCB_WRITE_4(sc, vrcb, bge_nicaddr, BGE_NIC_TXRING_ADDR(0, BGE_TX_RING_CNT)); - if (!(BGE_IS_5705_PLUS(sc))) - RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, - BGE_RCB_MAXLEN_FLAGS(BGE_TX_RING_CNT, 0)); + RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, + BGE_RCB_MAXLEN_FLAGS(BGE_TX_RING_CNT, 0)); - /* Disable all unused RX return rings */ + /* + * Disable all receive return rings by setting the + * 'ring diabled' bit in the flags field of all the receive + * return ring control blocks, located in NIC memory. + */ + if (!BGE_IS_5705_PLUS(sc)) + limit = BGE_RX_RINGS_MAX; + else if (sc->bge_asicrev == BGE_ASICREV_BCM5755) + limit = 4; + else + limit = 1; + /* Disable all receive return rings. */ vrcb = BGE_MEMWIN_START + BGE_RX_RETURN_RING_RCB; - for (i = 0; i < BGE_RX_RINGS_MAX; i++) { + for (i = 0; i < limit; i++) { RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, 0); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, 0); RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, - BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, - BGE_RCB_FLAG_RING_DISABLED)); + BGE_RCB_FLAG_RING_DISABLED); RCB_WRITE_4(sc, vrcb, bge_nicaddr, 0); bge_writembx(sc, BGE_MBX_RX_CONS0_LO + (i * (sizeof(uint64_t))), 0); vrcb += sizeof(struct bge_rcb); } - /* Initialize RX ring indexes */ - bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, 0); - if (BGE_IS_JUMBO_CAPABLE(sc)) - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0); - if (sc->bge_asicrev == BGE_ASICREV_BCM5700) - bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0); - /* - * Set up RX return ring 0 - * Note that the NIC address for RX return rings is 0x00000000. - * The return rings live entirely within the host, so the - * nicaddr field in the RCB isn't used. + * Set up receive return ring 0. Note that the NIC address + * for RX return rings is 0x0. The return rings live entirely + * within the host, so the nicaddr field in the RCB isn't used. */ vrcb = BGE_MEMWIN_START + BGE_RX_RETURN_RING_RCB; BGE_HOSTADDR(taddr, sc->bge_ldata.bge_rx_return_ring_paddr); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, taddr.bge_addr_hi); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); - RCB_WRITE_4(sc, vrcb, bge_nicaddr, 0x00000000); + RCB_WRITE_4(sc, vrcb, bge_nicaddr, 0); RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, 0)); From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 22:25:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08306106566B; Wed, 6 Oct 2010 22:25:22 +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 EA7A28FC17; Wed, 6 Oct 2010 22:25: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 o96MPLRx019859; Wed, 6 Oct 2010 22:25:21 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96MPLrW019853; Wed, 6 Oct 2010 22:25:21 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201010062225.o96MPLrW019853@svn.freebsd.org> From: Olivier Houchard Date: Wed, 6 Oct 2010 22:25: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: r213496 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 22:25:22 -0000 Author: cognet Date: Wed Oct 6 22:25:21 2010 New Revision: 213496 URL: http://svn.freebsd.org/changeset/base/213496 Log: if_ate.c: * Support for sam9 "EMAC" controller. * Support for rmii interface to phy. at91.c & at91sam9.c: * Eliminate separate at91sam9.c file. * Add new devices to at91sam9_devs table. at91_machdep.c & at at91sam9_machdep.c: * Automatic chip type determination. * Remove compile time chip dependencies. * Eliminate separate at91sam9_machdep.c file. at91_pmc.c: * Corrected support for all of the sam926? and sam9g20 chips. * Remove compile time chip dependencies. My apologies to Greg for taking so long to take care of it. Added: head/sys/arm/at91/at91_pio_sam9g20.h (contents, props changed) head/sys/arm/at91/at91_reset.S (contents, props changed) head/sys/arm/at91/at91_rst.c (contents, props changed) head/sys/arm/at91/at91_rstreg.h (contents, props changed) head/sys/arm/at91/at91_wdt.c (contents, props changed) head/sys/arm/at91/at91_wdtreg.h (contents, props changed) head/sys/arm/at91/at91reg.h (contents, props changed) head/sys/arm/at91/at91rm9200.c (contents, props changed) head/sys/arm/at91/at91sam9g20.c (contents, props changed) head/sys/arm/at91/board_sam9g20ek.c (contents, props changed) head/sys/arm/at91/std.sam9g20ek (contents, props changed) Deleted: head/sys/arm/at91/at91_pio_sam9.h head/sys/arm/at91/at91sam9.c head/sys/arm/at91/at91sam9_machdep.c Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_pio.c head/sys/arm/at91/at91_pio_rm9200.h head/sys/arm/at91/at91_pioreg.h head/sys/arm/at91/at91_pit.c head/sys/arm/at91/at91_pmc.c head/sys/arm/at91/at91_pmcreg.h head/sys/arm/at91/at91_pmcvar.h head/sys/arm/at91/at91_twi.c head/sys/arm/at91/at91_twireg.h head/sys/arm/at91/at91rm92reg.h head/sys/arm/at91/at91sam9g20reg.h head/sys/arm/at91/at91var.h head/sys/arm/at91/board_hl201.c head/sys/arm/at91/board_kb920x.c head/sys/arm/at91/files.at91 head/sys/arm/at91/files.at91sam9 head/sys/arm/at91/if_ate.c head/sys/arm/at91/if_atereg.h head/sys/arm/at91/if_macb.c head/sys/arm/at91/std.at91sam9 head/sys/arm/at91/std.kb920x head/sys/arm/at91/uart_cpu_at91rm9200usart.c head/sys/arm/at91/uart_dev_at91usart.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Wed Oct 6 21:23:57 2010 (r213495) +++ head/sys/arm/at91/at91.c Wed Oct 6 22:25:21 2010 (r213496) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2005 Olivier Houchard. All rights reserved. + * Copyright (c) 2010 Greg Ansley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,14 +44,23 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include +#include static struct at91_softc *at91_softc; static void at91_eoi(void *); +extern const struct pmap_devmap at91_devmap[]; + +uint32_t at91_chip_id; + +#ifdef AT91C_MASTER_CLOCK uint32_t at91_master_clock = AT91C_MASTER_CLOCK; +#else +uint32_t at91_master_clock; +#endif static int at91_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, @@ -99,6 +109,19 @@ at91_barrier(void *t, bus_space_handle_t { } +struct arm32_dma_range * +bus_dma_get_range(void) +{ + + return (NULL); +} + +int +bus_dma_get_range_nb(void) +{ + return (0); +} + bs_protos(generic); bs_protos(generic_armv4); @@ -212,6 +235,7 @@ struct bus_space at91_bs_tag = { static int at91_probe(device_t dev) { + device_set_desc(dev, "AT91 device bus"); arm_post_filter = at91_eoi; return (0); @@ -224,324 +248,38 @@ at91_identify(driver_t *drv, device_t pa BUS_ADD_CHILD(parent, 0, "atmelarm", 0); } -struct arm32_dma_range * -bus_dma_get_range(void) -{ - - return (NULL); -} - -int -bus_dma_get_range_nb(void) -{ - return (0); -} - -extern void irq_entry(void); - -static void -at91_add_child(device_t dev, int prio, const char *name, int unit, - bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) -{ - device_t kid; - struct at91_ivar *ivar; - - kid = device_add_child_ordered(dev, prio, name, unit); - if (kid == NULL) { - printf("Can't add child %s%d ordered\n", name, unit); - return; - } - ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); - if (ivar == NULL) { - device_delete_child(dev, kid); - printf("Can't add alloc ivar\n"); - return; - } - device_set_ivars(kid, ivar); - resource_list_init(&ivar->resources); - if (irq0 != -1) - bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq1 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); - if (irq2 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0) - bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); -} - -struct cpu_devs -{ - const char *name; - int unit; - bus_addr_t mem_base; - bus_size_t mem_len; - int irq0; - int irq1; - int irq2; -}; - -struct cpu_devs at91rm9200_devs[] = -{ - // All the "system" devices - { - "at91_st", 0, - AT91RM92_BASE + AT91RM92_ST_BASE, AT91RM92_ST_SIZE, - AT91RM92_IRQ_SYSTEM - }, - { - "at91_pio", 0, - AT91RM92_BASE + AT91RM92_PIOA_BASE, AT91RM92_PIO_SIZE, - AT91RM92_IRQ_SYSTEM - }, - { - "at91_pio", 1, - AT91RM92_BASE + AT91RM92_PIOB_BASE, AT91RM92_PIO_SIZE, - AT91RM92_IRQ_SYSTEM - }, - { - "at91_pio", 2, - AT91RM92_BASE + AT91RM92_PIOC_BASE, AT91RM92_PIO_SIZE, - AT91RM92_IRQ_SYSTEM - }, - { - "at91_pio", 3, - AT91RM92_BASE + AT91RM92_PIOD_BASE, AT91RM92_PIO_SIZE, - AT91RM92_IRQ_SYSTEM - }, - { - "at91_pmc", 0, - AT91RM92_BASE + AT91RM92_PMC_BASE, AT91RM92_PMC_SIZE, - AT91RM92_IRQ_SYSTEM - }, - { - "at91_aic", 0, - AT91RM92_BASE + AT91RM92_AIC_BASE, AT91RM92_AIC_SIZE, - 0 // Interrupt controller has no interrupts! - }, - { - "at91_rtc", 0, - AT91RM92_BASE + AT91RM92_RTC_BASE, AT91RM92_RTC_SIZE, - AT91RM92_IRQ_SYSTEM - }, - { - "at91_mc", 0, - AT91RM92_BASE + AT91RM92_MC_BASE, AT91RM92_MC_SIZE, - AT91RM92_IRQ_SYSTEM - }, - - // All other devices - { - "at91_tc", 0, - AT91RM92_BASE + AT91RM92_TC0_BASE, AT91RM92_TC_SIZE, - AT91RM92_IRQ_TC0, AT91RM92_IRQ_TC1, AT91RM92_IRQ_TC2 - }, - { - "at91_tc", 1, - AT91RM92_BASE + AT91RM92_TC1_BASE, AT91RM92_TC_SIZE, - AT91RM92_IRQ_TC3, AT91RM92_IRQ_TC4, AT91RM92_IRQ_TC5 - }, - { - "at91_udp", 0, - AT91RM92_BASE + AT91RM92_UDP_BASE, AT91RM92_UDP_SIZE, - AT91RM92_IRQ_UDP, AT91RM92_IRQ_PIOB - }, - { - "at91_mci", 0, - AT91RM92_BASE + AT91RM92_MCI_BASE, AT91RM92_MCI_SIZE, - AT91RM92_IRQ_MCI - }, - { - "at91_twi", 0, - AT91RM92_BASE + AT91RM92_TWI_BASE, AT91RM92_TWI_SIZE, - AT91RM92_IRQ_TWI - }, - { - "ate", 0, - AT91RM92_BASE + AT91RM92_EMAC_BASE, AT91RM92_EMAC_SIZE, - AT91RM92_IRQ_EMAC - }, -#ifndef SKYEYE_WORKAROUNDS - { - "uart", 0, - AT91RM92_BASE + AT91RM92_DBGU_BASE, AT91RM92_DBGU_SIZE, - AT91RM92_IRQ_SYSTEM - }, - { - "uart", 1, - AT91RM92_BASE + AT91RM92_USART0_BASE, AT91RM92_USART_SIZE, - AT91RM92_IRQ_USART0 - }, - { - "uart", 2, - AT91RM92_BASE + AT91RM92_USART1_BASE, AT91RM92_USART_SIZE, - AT91RM92_IRQ_USART1 - }, - { - "uart", 3, - AT91RM92_BASE + AT91RM92_USART2_BASE, AT91RM92_USART_SIZE, - AT91RM92_IRQ_USART2 - }, - { - "uart", 4, - AT91RM92_BASE + AT91RM92_USART3_BASE, AT91RM92_USART_SIZE, - AT91RM92_IRQ_USART3 - }, -#else - { - "uart", 0, - AT91RM92_BASE + AT91RM92_USART0_BASE, AT91RM92_USART_SIZE, - AT91RM92_IRQ_USART0 - }, -#endif - { - "at91_ssc", 0, - AT91RM92_BASE + AT91RM92_SSC0_BASE, AT91RM92_SSC_SIZE, - AT91RM92_IRQ_SSC0 - }, - { - "at91_ssc", 1, - AT91RM92_BASE + AT91RM92_SSC1_BASE, AT91RM92_SSC_SIZE, - AT91RM92_IRQ_SSC1 - }, - { - "at91_ssc", 2, - AT91RM92_BASE + AT91RM92_SSC2_BASE, AT91RM92_SSC_SIZE, - AT91RM92_IRQ_SSC2 - }, - { - "spi", 0, - AT91RM92_BASE + AT91RM92_SPI_BASE, AT91RM92_SPI_SIZE, - AT91RM92_IRQ_SPI - }, - { - "ohci", 0, - AT91RM92_OHCI_BASE, AT91RM92_OHCI_SIZE, - AT91RM92_IRQ_UHP - }, - { - "at91_cfata", 0, - AT91RM92_CF_BASE, AT91RM92_CF_SIZE, - -1 - }, - { 0, 0, 0, 0, 0 } -}; - -static void -at91_cpu_add_builtin_children(device_t dev, struct at91_softc *sc) -{ - int i; - struct cpu_devs *walker; - - // XXX should look at the device id in the DBGU register and - // XXX based on the CPU load in these devices - for (i = 0, walker = at91rm9200_devs; walker->name; i++, walker++) { - at91_add_child(dev, i, walker->name, walker->unit, - walker->mem_base, walker->mem_len, walker->irq0, - walker->irq1, walker->irq2); - } -} - -#define NORMDEV 50 - -/* - * Standard priority levels for the system. 0 is lowest and 7 is highest. - * These values are the ones Atmel uses for its Linux port, which differ - * a little form the ones that are in the standard distribution. Also, - * the ones marked with 'TWEEK' are different based on experience. - */ -static int irq_prio[32] = -{ - 7, /* Advanced Interrupt Controller (FIQ) */ - 7, /* System Peripherals */ - 1, /* Parallel IO Controller A */ - 1, /* Parallel IO Controller B */ - 1, /* Parallel IO Controller C */ - 1, /* Parallel IO Controller D */ - 5, /* USART 0 */ - 5, /* USART 1 */ - 5, /* USART 2 */ - 5, /* USART 3 */ - 0, /* Multimedia Card Interface */ - 2, /* USB Device Port */ - 4, /* Two-Wire Interface */ /* TWEEK */ - 5, /* Serial Peripheral Interface */ - 4, /* Serial Synchronous Controller 0 */ - 6, /* Serial Synchronous Controller 1 */ /* TWEEK */ - 4, /* Serial Synchronous Controller 2 */ - 0, /* Timer Counter 0 */ - 6, /* Timer Counter 1 */ /* TWEEK */ - 0, /* Timer Counter 2 */ - 0, /* Timer Counter 3 */ - 0, /* Timer Counter 4 */ - 0, /* Timer Counter 5 */ - 2, /* USB Host port */ - 3, /* Ethernet MAC */ - 0, /* Advanced Interrupt Controller (IRQ0) */ - 0, /* Advanced Interrupt Controller (IRQ1) */ - 0, /* Advanced Interrupt Controller (IRQ2) */ - 0, /* Advanced Interrupt Controller (IRQ3) */ - 0, /* Advanced Interrupt Controller (IRQ4) */ - 0, /* Advanced Interrupt Controller (IRQ5) */ - 0 /* Advanced Interrupt Controller (IRQ6) */ -}; - static int at91_attach(device_t dev) { struct at91_softc *sc = device_get_softc(dev); - int i; + const struct pmap_devmap *pdevmap; at91_softc = sc; sc->sc_st = &at91_bs_tag; - sc->sc_sh = AT91RM92_BASE; + sc->sc_sh = AT91_BASE; sc->dev = dev; - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_SYS_BASE, - AT91RM92_SYS_SIZE, &sc->sc_sys_sh) != 0) - panic("Enable to map IRQ registers"); + sc->sc_irq_rman.rm_type = RMAN_ARRAY; sc->sc_irq_rman.rm_descr = "AT91 IRQs"; - sc->sc_mem_rman.rm_type = RMAN_ARRAY; - sc->sc_mem_rman.rm_descr = "AT91 Memory"; if (rman_init(&sc->sc_irq_rman) != 0 || rman_manage_region(&sc->sc_irq_rman, 1, 31) != 0) panic("at91_attach: failed to set up IRQ rman"); - if (rman_init(&sc->sc_mem_rman) != 0 || - rman_manage_region(&sc->sc_mem_rman, 0xdff00000ul, - 0xdffffffful) != 0) + + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "AT91 Memory"; + if (rman_init(&sc->sc_mem_rman) != 0) panic("at91_attach: failed to set up memory rman"); - if (rman_manage_region(&sc->sc_mem_rman, AT91RM92_OHCI_BASE, - AT91RM92_OHCI_BASE + AT91RM92_OHCI_SIZE - 1) != 0) - panic("at91_attach: failed to set up ohci memory"); - if (rman_manage_region(&sc->sc_mem_rman, AT91RM92_CF_BASE, - AT91RM92_CF_BASE + AT91RM92_CF_SIZE - 1) != 0) - panic("at91_attach: failed to set up CompactFlash ATA memory"); - - for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_SVR + - i * 4, i); - /* Priority. */ - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_SMR + i * 4, - irq_prio[i]); - if (i < 8) - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_EOICR, - 1); + for ( pdevmap = at91_devmap; pdevmap->pd_va != 0; pdevmap++) { + if (rman_manage_region(&sc->sc_mem_rman, pdevmap->pd_va, + pdevmap->pd_va + pdevmap->pd_size - 1) != 0) + panic("at91_attach: failed to set up memory rman"); } - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_SPU, 32); - /* No debug. */ - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_DCR, 0); - /* Disable and clear all interrupts. */ - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_IDCR, 0xffffffff); - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_ICCR, 0xffffffff); - - /* XXX */ - /* Disable all interrupts for RTC (0xe24 == RTC_IDR) */ - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xe24, 0xffffffff); - /* DIsable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0x20c, 0xffffffff); - /* Disable all interrupts for the SDRAM controller */ - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xfa8, 0xffffffff); - at91_cpu_add_builtin_children(dev, sc); + + /* Our device list will be added automatically by the cpu device + * e.g. at91rm9200.c when it is identified. To ensure that the + * CPU and PMC are attached first any other "identified" devices + * call BUS_ADD_CHILD(9) with an "order" of at least 2. */ bus_generic_probe(dev); bus_generic_attach(dev); @@ -630,11 +368,11 @@ at91_setup_intr(device_t dev, device_t c { struct at91_softc *sc = device_get_softc(dev); - if (rman_get_start(ires) == AT91RM92_IRQ_SYSTEM && filt == NULL) + if (rman_get_start(ires) == sc->sc_irq_system && filt == NULL) panic("All system interrupt ISRs must be FILTER"); BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg, cookiep); - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_IECR, + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IECR, 1 << rman_get_start(ires)); return (0); } @@ -645,7 +383,7 @@ at91_teardown_intr(device_t dev, device_ { struct at91_softc *sc = device_get_softc(dev); - bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_IDCR, + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 1 << rman_get_start(res)); return (BUS_TEARDOWN_INTR(device_get_parent(dev), child, res, cookie)); } @@ -697,8 +435,7 @@ arm_mask_irq(uintptr_t nb) { bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_sys_sh, IC_IDCR, 1 << nb); - + at91_softc->sc_aic_sh, IC_IDCR, 1 << nb); } int @@ -708,12 +445,12 @@ arm_get_next_irq(int last __unused) int irq; irq = bus_space_read_4(at91_softc->sc_st, - at91_softc->sc_sys_sh, IC_IVR); + at91_softc->sc_aic_sh, IC_IVR); status = bus_space_read_4(at91_softc->sc_st, - at91_softc->sc_sys_sh, IC_ISR); + at91_softc->sc_aic_sh, IC_ISR); if (status == 0) { bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_sys_sh, IC_EOICR, 1); + at91_softc->sc_aic_sh, IC_EOICR, 1); return (-1); } return (irq); @@ -724,16 +461,15 @@ arm_unmask_irq(uintptr_t nb) { bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_sys_sh, IC_IECR, 1 << nb); - bus_space_write_4(at91_softc->sc_st, at91_softc->sc_sys_sh, + at91_softc->sc_aic_sh, IC_IECR, 1 << nb); + bus_space_write_4(at91_softc->sc_st, at91_softc->sc_aic_sh, IC_EOICR, 0); - } static void at91_eoi(void *unused) { - bus_space_write_4(at91_softc->sc_st, at91_softc->sc_sys_sh, + bus_space_write_4(at91_softc->sc_st, at91_softc->sc_aic_sh, IC_EOICR, 0); } @@ -761,6 +497,7 @@ static driver_t at91_driver = { at91_methods, sizeof(struct at91_softc), }; + static devclass_t at91_devclass; DRIVER_MODULE(atmelarm, nexus, at91_driver, at91_devclass, 0, 0); Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Wed Oct 6 21:23:57 2010 (r213495) +++ head/sys/arm/at91/at91_machdep.c Wed Oct 6 22:25:21 2010 (r213496) @@ -90,9 +90,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include -#include +#include +#include #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ #define KERNEL_PT_KERN 1 @@ -140,7 +141,7 @@ static void *boot_arg2; static struct trapframe proc0_tf; /* Static device mappings. */ -static const struct pmap_devmap at91rm9200_devmap[] = { +const struct pmap_devmap at91_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -153,60 +154,88 @@ static const struct pmap_devmap at91rm92 */ 0xdff00000, 0xfff00000, - 0x100000, + 0x00100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, - /* - * We can't just map the OHCI registers VA == PA, because - * AT91RM92_OHCI_BASE belongs to the userland address space. + /* We can't just map the OHCI registers VA == PA, because + * AT91xx_xxx_BASE belongs to the userland address space. * We could just choose a different virtual address, but a better * solution would probably be to just use pmap_mapdev() to allocate * KVA, as we don't need the OHCI controller before the vm * initialization is done. However, the AT91 resource allocation * system doesn't know how to use pmap_mapdev() yet. + * Care must be taken to ensure PA and VM address do not overlap + * between entries. */ { /* * Add the ohci controller, and anything else that might be * on this chip select for a VA/PA mapping. */ + /* Internal Memory 1MB */ AT91RM92_OHCI_BASE, AT91RM92_OHCI_PA_BASE, - AT91RM92_OHCI_SIZE, + 0x00100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, { - /* CompactFlash controller. */ + /* CompactFlash controller. Portion of EBI CS4 1MB */ AT91RM92_CF_BASE, AT91RM92_CF_PA_BASE, - AT91RM92_CF_SIZE, + 0x00100000, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* The next two should be good for the 9260, 9261 and 9G20 since + * addresses mapping is the same. */ { - 0, - 0, - 0, - 0, - 0, - } + /* Internal Memory 1MB */ + AT91SAM9G20_OHCI_BASE, + AT91SAM9G20_OHCI_PA_BASE, + 0x00100000, + VM_PROT_READ|VM_PROT_WRITE, + PTE_NOCACHE, + }, + { + /* EBI CS3 256MB */ + AT91SAM9G20_NAND_BASE, + AT91SAM9G20_NAND_PA_BASE, + AT91SAM9G20_NAND_SIZE, + VM_PROT_READ|VM_PROT_WRITE, + PTE_NOCACHE, + }, + { 0, 0, 0, 0, 0, } }; long at91_ramsize(void) { - uint32_t *SDRAMC = (uint32_t *)(AT91RM92_BASE + AT91RM92_SDRAMC_BASE); + uint32_t *SDRAMC = (uint32_t *)(AT91_BASE + AT91RM92_SDRAMC_BASE); uint32_t cr, mr; int banks, rows, cols, bw; - cr = SDRAMC[AT91RM92_SDRAMC_CR / 4]; - mr = SDRAMC[AT91RM92_SDRAMC_MR / 4]; - bw = (mr & AT91RM92_SDRAMC_MR_DBW_16) ? 1 : 2; - banks = (cr & AT91RM92_SDRAMC_CR_NB_4) ? 2 : 1; - rows = ((cr & AT91RM92_SDRAMC_CR_NR_MASK) >> 2) + 11; - cols = (cr & AT91RM92_SDRAMC_CR_NC_MASK) + 8; + if (at91_is_rm92()) { + SDRAMC = (uint32_t *)(AT91_BASE + AT91RM92_SDRAMC_BASE); + cr = SDRAMC[AT91RM92_SDRAMC_CR / 4]; + mr = SDRAMC[AT91RM92_SDRAMC_MR / 4]; + banks = (cr & AT91RM92_SDRAMC_CR_NB_4) ? 2 : 1; + rows = ((cr & AT91RM92_SDRAMC_CR_NR_MASK) >> 2) + 11; + cols = (cr & AT91RM92_SDRAMC_CR_NC_MASK) + 8; + bw = (mr & AT91RM92_SDRAMC_MR_DBW_16) ? 1 : 2; + } else { + /* This should be good for the 9260, 9261 and 9G20 as addresses + * and registers are the same */ + SDRAMC = (uint32_t *)(AT91_BASE + AT91SAM9G20_SDRAMC_BASE); + cr = SDRAMC[AT91SAM9G20_SDRAMC_CR / 4]; + mr = SDRAMC[AT91SAM9G20_SDRAMC_MR / 4]; + banks = (cr & AT91SAM9G20_SDRAMC_CR_NB_4) ? 2 : 1; + rows = ((cr & AT91SAM9G20_SDRAMC_CR_NR_MASK) >> 2) + 11; + cols = (cr & AT91SAM9G20_SDRAMC_CR_NC_MASK) + 8; + bw = (cr & AT91SAM9G20_SDRAMC_CR_DBW_16) ? 1 : 2; + } + return (1 << (cols + rows + banks + bw)); } @@ -326,13 +355,21 @@ initarm(void *arg, void *arg2) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - pmap_devmap_bootstrap(l1pagetable, at91rm9200_devmap); + pmap_devmap_bootstrap(l1pagetable, at91_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)); + cninit(); + + /* Get chip id so device drivers know about differences */ + at91_chip_id = *(volatile uint32_t *) + (AT91_BASE + AT91_DBGU_BASE + DBGU_C1R); + memsize = board_init(); + + printf("memsize = %d\n", memsize); physmem = memsize / PAGE_SIZE; /* Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Oct 6 21:23:57 2010 (r213495) +++ head/sys/arm/at91/at91_mci.c Wed Oct 6 22:25:21 2010 (r213496) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2006 Bernd Walter. All rights reserved. * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2010 Greg Ansley. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -52,16 +54,19 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + #include #include #include + #include #include #include #include "mmcbr_if.h" +#include "opt_at91.h" + #define BBSZ 512 struct at91_mci_softc { @@ -69,8 +74,9 @@ struct at91_mci_softc { device_t dev; int sc_cap; #define CAP_HAS_4WIRE 1 /* Has 4 wire bus */ -#define CAP_NEEDS_BOUNCE 2 /* broken hardware needing bounce */ +#define CAP_NEEDS_BYTESWAP 2 /* broken hardware needing bounce */ int flags; + int has_4wire; #define CMD_STARTED 1 #define STOP_STARTED 2 struct resource *irq_res; /* IRQ resource */ @@ -89,7 +95,7 @@ struct at91_mci_softc { static inline uint32_t RD4(struct at91_mci_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + return (bus_read_4(sc->mem_res, off)); } static inline void @@ -140,7 +146,13 @@ at91_mci_init(device_t dev) WR4(sc, MCI_IDR, 0xffffffff); /* Turn off interrupts */ WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); WR4(sc, MCI_MR, 0x834a); // XXX GROSS HACK FROM LINUX +#ifndef AT91_MCI_SLOT_B WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ +#else + /* XXX Really should add second "unit" but nobody using using + * a two slot card that we know of. XXX */ + WR4(sc, MCI_SDCR, 1); /* SLOT B, 1 bit bus */ +#endif } static void @@ -165,11 +177,16 @@ static int at91_mci_attach(device_t dev) { struct at91_mci_softc *sc = device_get_softc(dev); - int err; + struct sysctl_ctx_list *sctx; + struct sysctl_oid *soid; device_t child; + int err; sc->dev = dev; - sc->sc_cap = CAP_NEEDS_BOUNCE; + + sc->sc_cap = 0; + if (at91_is_rm92()) + sc->sc_cap |= CAP_NEEDS_BYTESWAP; err = at91_mci_activate(dev); if (err) goto out; @@ -201,13 +218,28 @@ at91_mci_attach(device_t dev) AT91_MCI_LOCK_DESTROY(sc); goto out; } + + sctx = device_get_sysctl_ctx(dev); + soid = device_get_sysctl_tree(dev); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "4wire", + CTLFLAG_RW, &sc->has_4wire, 0, "has 4 wire SD Card bus"); + +#ifdef AT91_MCI_HAS_4WIRE + sc->has_4wire = 1; +#endif + if (sc->has_4wire) + sc->sc_cap |= CAP_HAS_4WIRE; + + sc->host.f_min = at91_master_clock / 512; sc->host.f_min = 375000; - sc->host.f_max = at91_master_clock / 2; /* Typically 30MHz */ + sc->host.f_max = at91_master_clock / 2; + if (sc->host.f_max > 50000000) + sc->host.f_max = 50000000; /* Limit to 50MHz */ + sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; + sc->host.caps = 0; if (sc->sc_cap & CAP_HAS_4WIRE) - sc->host.caps = MMC_CAP_4_BIT_DATA; - else - sc->host.caps = 0; + sc->host.caps |= MMC_CAP_4_BIT_DATA; child = device_add_child(dev, "mmc", 0); device_set_ivars(dev, &sc->host); err = bus_generic_attach(dev); @@ -237,11 +269,13 @@ at91_mci_activate(device_t dev) RF_ACTIVE); if (sc->mem_res == NULL) goto errout; + rid = 0; sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->irq_res == NULL) goto errout; + return (0); errout: at91_mci_deactivate(dev); @@ -316,14 +350,16 @@ at91_mci_start_cmd(struct at91_mci_softc uint32_t *src, *dst; int i; struct mmc_data *data; - struct mmc_request *req; void *vaddr; bus_addr_t paddr; sc->curcmd = cmd; data = cmd->data; cmdr = cmd->opcode; - req = cmd->mrq; + + /* XXX Upper layers don't always set this */ + cmd->mrq = sc->req; + if (MMC_RSP(cmd->flags) == MMC_RSP_NONE) cmdr |= MCI_CMDR_RSPTYP_NO; else { @@ -364,26 +400,30 @@ at91_mci_start_cmd(struct at91_mci_softc if (cmdr & MCI_CMDR_TRDIR) vaddr = cmd->data->data; else { - if (sc->sc_cap & CAP_NEEDS_BOUNCE) { - vaddr = sc->bounce_buffer; - src = (uint32_t *)cmd->data->data; - dst = (uint32_t *)vaddr; + /* Use bounce buffer even if we don't need + * byteswap, since buffer may straddle a page + * boundry, and we don't handle multi-segment + * transfers in hardware. + * (page issues seen from 'bsdlabel -w' which + * uses raw geom access to the volume). + * Greg Ansley (gja (at) ansley.com) + */ + vaddr = sc->bounce_buffer; + src = (uint32_t *)cmd->data->data; + dst = (uint32_t *)vaddr; + if (sc->sc_cap & CAP_NEEDS_BYTESWAP) { for (i = 0; i < data->len / 4; i++) dst[i] = bswap32(src[i]); - } - else - vaddr = cmd->data->data; + } else + memcpy(dst, src, data->len); } data->xfer_len = 0; if (bus_dmamap_load(sc->dmatag, sc->map, vaddr, data->len, at91_mci_getaddr, &paddr, 0) != 0) { - if (req->cmd->flags & STOP_STARTED) - req->stop->error = MMC_ERR_NO_MEMORY; - else - req->cmd->error = MMC_ERR_NO_MEMORY; + cmd->error = MMC_ERR_NO_MEMORY; sc->req = NULL; sc->curcmd = NULL; - req->done(req); + cmd->mrq->done(cmd->mrq); return; } sc->mapped++; @@ -451,7 +491,7 @@ at91_mci_request(device_t brdev, device_ // XXX maybe the idea is naive... if (sc->req != NULL) { AT91_MCI_UNLOCK(sc); - return EBUSY; + return (EBUSY); } sc->req = req; sc->flags = 0; @@ -503,7 +543,7 @@ at91_mci_read_done(struct at91_mci_softc bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->dmatag, sc->map); sc->mapped--; - if (sc->sc_cap & CAP_NEEDS_BOUNCE) { + if (sc->sc_cap & CAP_NEEDS_BYTESWAP) { walker = (uint32_t *)cmd->data->data; len = cmd->data->len / 4; for (i = 0; i < len; i++) @@ -653,6 +693,13 @@ at91_mci_read_ivar(device_t bus, device_ *(int *)result = sc->host.ios.vdd; break; case MMCBR_IVAR_CAPS: + if (sc->has_4wire) { + sc->sc_cap |= CAP_HAS_4WIRE; + sc->host.caps |= MMC_CAP_4_BIT_DATA; + } else { + sc->sc_cap &= ~CAP_HAS_4WIRE; + sc->host.caps &= ~MMC_CAP_4_BIT_DATA; + } *(int *)result = sc->host.caps; break; case MMCBR_IVAR_MAX_DATA: Modified: head/sys/arm/at91/at91_pio.c ============================================================================== --- head/sys/arm/at91/at91_pio.c Wed Oct 6 21:23:57 2010 (r213495) +++ head/sys/arm/at91/at91_pio.c Wed Oct 6 22:25:21 2010 (r213496) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -58,7 +58,7 @@ struct at91_pio_softc static inline uint32_t RD4(struct at91_pio_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + return (bus_read_4(sc->mem_res, off)); } static inline void @@ -283,7 +283,7 @@ at91_pio_ioctl(struct cdev *dev, u_long void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, int use_pullup) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); PIO[PIO_ASR / 4] = periph_a_mask; PIO[PIO_PDR / 4] = periph_a_mask; @@ -296,7 +296,7 @@ at91_pio_use_periph_a(uint32_t pio, uint void at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask, int use_pullup) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); PIO[PIO_BSR / 4] = periph_b_mask; PIO[PIO_PDR / 4] = periph_b_mask; @@ -309,7 +309,7 @@ at91_pio_use_periph_b(uint32_t pio, uint void at91_pio_use_gpio(uint32_t pio, uint32_t gpio_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); PIO[PIO_PER / 4] = gpio_mask; } @@ -317,7 +317,7 @@ at91_pio_use_gpio(uint32_t pio, uint32_t void at91_pio_gpio_input(uint32_t pio, uint32_t input_enable_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); PIO[PIO_ODR / 4] = input_enable_mask; } @@ -325,7 +325,7 @@ at91_pio_gpio_input(uint32_t pio, uint32 void at91_pio_gpio_output(uint32_t pio, uint32_t output_enable_mask, int use_pullup) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); PIO[PIO_OER / 4] = output_enable_mask; if (use_pullup) @@ -337,7 +337,7 @@ at91_pio_gpio_output(uint32_t pio, uint3 void at91_pio_gpio_set(uint32_t pio, uint32_t data_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); PIO[PIO_SODR / 4] = data_mask; } @@ -345,7 +345,7 @@ at91_pio_gpio_set(uint32_t pio, uint32_t void at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); PIO[PIO_CODR / 4] = data_mask; } @@ -353,7 +353,7 @@ at91_pio_gpio_clear(uint32_t pio, uint32 uint8_t at91_pio_gpio_get(uint32_t pio, uint32_t data_mask) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); data_mask &= PIO[PIO_PDSR / 4]; @@ -363,7 +363,7 @@ at91_pio_gpio_get(uint32_t pio, uint32_t void at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, int use_deglitch) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); if (use_deglitch) PIO[PIO_IFER / 4] = data_mask; @@ -376,7 +376,7 @@ void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); if (enable_interrupt) PIO[PIO_IER / 4] = data_mask; @@ -388,7 +388,7 @@ at91_pio_gpio_set_interrupt(uint32_t pio uint32_t at91_pio_gpio_clear_interrupt(uint32_t pio) { - uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); /* reading this register will clear the interrupts */ return (PIO[PIO_ISR / 4]); } Modified: head/sys/arm/at91/at91_pio_rm9200.h ============================================================================== --- head/sys/arm/at91/at91_pio_rm9200.h Wed Oct 6 21:23:57 2010 (r213495) +++ head/sys/arm/at91/at91_pio_rm9200.h Wed Oct 6 22:25:21 2010 (r213496) @@ -1,5 +1,9 @@ /* $FreeBSD$ */ +#ifndef ARM_AT91_AT91_PIO_RM9200_H +#define ARM_AT91_AT91_PIO_RM9200_H + +#include /* * These defines come from an atmel file that says specifically that it * has no copyright. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 22:32:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6504B106564A; Wed, 6 Oct 2010 22:32:31 +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 5459E8FC08; Wed, 6 Oct 2010 22:32: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 o96MWVaA020073; Wed, 6 Oct 2010 22:32:31 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96MWVMp020070; Wed, 6 Oct 2010 22:32:31 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201010062232.o96MWVMp020070@svn.freebsd.org> From: Olivier Houchard Date: Wed, 6 Oct 2010 22:32: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: r213497 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 22:32:31 -0000 Author: cognet Date: Wed Oct 6 22:32:31 2010 New Revision: 213497 URL: http://svn.freebsd.org/changeset/base/213497 Log: Add the AT91SAM9G20EK config files. Submitted by: Greg Ansley Added: head/sys/arm/conf/SAM9G20EK (contents, props changed) head/sys/arm/conf/SAM9G20EK.hints (contents, props changed) Added: head/sys/arm/conf/SAM9G20EK ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SAM9G20EK Wed Oct 6 22:32:31 2010 (r213497) @@ -0,0 +1,153 @@ +# Kernel configuration for Atmel AT91SAM9G20EK Rev B. development card +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident SAM9G20EK + +include "../at91/std.sam9g20ek" + +#To statically compile in device wiring instead of /boot/device.hints +hints "SAM9G20EK.hints" +makeoptions MODULES_OVERRIDE="" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +#options MD_ROOT #MD is a potential root device +#options MD_ROOT_SIZE=4096 # 3MB ram disk +options NFSCLIENT #Network Filesystem Client +#options NFSSERVER #Network Filesystem Server +#options NFSLOCKD #Network Lock Manager +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP_NFSROOT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 +#options BOOTP_COMPAT + +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +options ALT_BREAK_TO_DEBUGGER + +#options MSDOSFS #MSDOS Filesystem +#options CD9660 #ISO 9660 Filesystem +#options PROCFS #Process filesystem (requires PSEUDOFS) +#options PSEUDOFS #Pseudo-filesystem framework +#options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +#options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +#options SYSCTL_OMIT_DESCR +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING + +# Debugging for use in -current +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +device random +device pty +device loop +device bpf +device ether +device md + +device uart # Serial Ports + +# Ethernet +device ate # Ethernet Driver +#device macb # Alternate Ethernet driver +device mii +option AT91_ATE_USE_RMII + +device at91_twi # TWI: Two Wire Interface (EEPROM) +device at91_wdt # WDT: Watchdog timer + +# NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware +# confilict on this card. Use one or the other. +# see board_sam9g20ek.c + +# SPI: Data Flash +#device at91_spi # SPI: +#device spibus +#device at45d # at45db642 and maybe others + +# MMC/SD +device at91_mci +device mmc +device mmcsd +option AT91_MCI_SLOT_B +option AT91_MCI_HAS_4WIRE + +# iic +device iic +device iicbus +device icee + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +device ohci # OHCI localbus->USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" +#device ulpt # Printer +#device udbp # USB Double Bulk Pipe devices + +# USB Ethernet, requires miibus +device miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs +#device uath # Atheros AR5523 wireless NICs +#device ural # Ralink Technology RT2500USB wireless NICs +#device zyd # ZyDAS zb1211/zb1211b wireless NICs + +# Wireless NIC cards +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm + Added: head/sys/arm/conf/SAM9G20EK.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SAM9G20EK.hints Wed Oct 6 22:32:31 2010 (r213497) @@ -0,0 +1,10 @@ +# $FreeBSD$ +# + +# EEPROM +hint.icee.0.at="iicbus0" +hint.icee.0.addr=0xa0 +hint.icee.0.type=16 +hint.icee.0.size=65536 +hint.icee.0.rd_sz=256 +hint.icee.0.wr_sz=256 From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 22:40:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F427106566B; Wed, 6 Oct 2010 22:40:28 +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 2DA6B8FC1B; Wed, 6 Oct 2010 22:40: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 o96MeSTJ020295; Wed, 6 Oct 2010 22:40:28 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96MeSG0020283; Wed, 6 Oct 2010 22:40:28 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201010062240.o96MeSG0020283@svn.freebsd.org> From: Olivier Houchard Date: Wed, 6 Oct 2010 22:40: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: r213498 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 22:40:28 -0000 Author: cognet Date: Wed Oct 6 22:40:27 2010 New Revision: 213498 URL: http://svn.freebsd.org/changeset/base/213498 Log: Add support for the AT91SAM9260 Submitted by: Greg Ansley Added: head/sys/arm/at91/at91sam9260.c (contents, props changed) head/sys/arm/at91/at91sam9260reg.h (contents, props changed) head/sys/arm/at91/board_qila9g20.c (contents, props changed) head/sys/arm/at91/std.qila9g20 (contents, props changed) Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91_pio_sam9g20.h head/sys/arm/at91/at91_pmc.c head/sys/arm/at91/at91_pmcreg.h head/sys/arm/at91/at91_rst.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/board_sam9g20ek.c head/sys/arm/at91/files.at91sam9 head/sys/arm/at91/std.at91sam9 head/sys/arm/at91/std.sam9g20ek Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Wed Oct 6 22:32:31 2010 (r213497) +++ head/sys/arm/at91/at91_machdep.c Wed Oct 6 22:40:27 2010 (r213498) @@ -368,8 +368,6 @@ initarm(void *arg, void *arg2) (AT91_BASE + AT91_DBGU_BASE + DBGU_C1R); memsize = board_init(); - - printf("memsize = %d\n", memsize); physmem = memsize / PAGE_SIZE; /* Modified: head/sys/arm/at91/at91_pio_sam9g20.h ============================================================================== --- head/sys/arm/at91/at91_pio_sam9g20.h Wed Oct 6 22:32:31 2010 (r213497) +++ head/sys/arm/at91/at91_pio_sam9g20.h Wed Oct 6 22:40:27 2010 (r213498) @@ -1,6 +1,9 @@ /* * Theses defines come from an atmel file that says specifically that it * has no copyright. + * + * These defines are also usable for the AT91SAM9260 which has pin multiplexing + * that is identical to the AT91SAM9G20. */ /* $FreeBSD$ */ Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Wed Oct 6 22:32:31 2010 (r213497) +++ head/sys/arm/at91/at91_pmc.c Wed Oct 6 22:40:27 2010 (r213498) @@ -331,6 +331,9 @@ at91_pmc_pll_rate(struct at91_pmc_clock div = (reg >> clk->pll_div_shift) & clk->pll_div_mask; mul = (reg >> clk->pll_mul_shift) & clk->pll_mul_mask; +// printf("pll = (%d / %d) * %d = %d\n", +// freq, div ,mul + 1, (freq/div) * (mul+1)); + if (div != 0 && mul != 0) { freq /= div; freq *= mul + 1; @@ -338,6 +341,8 @@ at91_pmc_pll_rate(struct at91_pmc_clock freq = 0; } clk->hz = freq; + + return (freq); } @@ -444,7 +449,8 @@ at91_pmc_init_clock(struct at91_pmc_soft mdiv = (mckr & PMC_MCKR_MDIV_MASK) >> 8; if (at91_is_sam9()) { - mck.hz /= (mdiv) ? (mdiv * 2) : 1; + if (mdiv > 0) + mck.hz /= mdiv * 2; } else mck.hz /= (1 + mdiv); Modified: head/sys/arm/at91/at91_pmcreg.h ============================================================================== --- head/sys/arm/at91/at91_pmcreg.h Wed Oct 6 22:32:31 2010 (r213497) +++ head/sys/arm/at91/at91_pmcreg.h Wed Oct 6 22:40:27 2010 (r213498) @@ -89,7 +89,7 @@ /* PMC Clock Generator Master Clock Register */ #define PMC_MCKR_PDIV (1 << 12) /* SAM9G20 Only */ #define PMC_MCKR_PLLADIV2 (1 << 12) /* SAM9G45 Only */ -#define PMC_MCKR_CSS_MASK (3 << 8) +#define PMC_MCKR_CSS_MASK (3 << 0) #define PMC_MCKR_MDIV_MASK (3 << 8) #define PMC_MCKR_PRES_MASK (7 << 2) Modified: head/sys/arm/at91/at91_rst.c ============================================================================== --- head/sys/arm/at91/at91_rst.c Wed Oct 6 22:32:31 2010 (r213497) +++ head/sys/arm/at91/at91_rst.c Wed Oct 6 22:40:27 2010 (r213498) @@ -198,8 +198,8 @@ cpu_reset(void) { if (rst_sc) { - if (at91_cpu_is(AT91_CPU_SAM9G20)) - cpu_reset_sam9g20(); + + cpu_reset_sam9g20(); /* May be null */ WR4(rst_sc, RST_MR, RST_MR_ERSTL(0xd) | RST_MR_URSTEN | RST_MR_KEY); Added: head/sys/arm/at91/at91sam9260.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91sam9260.c Wed Oct 6 22:40:27 2010 (r213498) @@ -0,0 +1,343 @@ +/*- + * Copyright (c) 2005 Olivier Houchard. All rights reserved. + * Copyright (c) 2010 Greg Ansley. 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 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 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 + +#define _ARM32_BUS_DMA_PRIVATE +#include + +#include +#include +#include +#include +#include + +struct at91sam9_softc { + device_t dev; + bus_space_tag_t sc_st; + bus_space_handle_t sc_sh; + bus_space_handle_t sc_sys_sh; + bus_space_handle_t sc_aic_sh; + bus_space_handle_t sc_dbg_sh; + bus_space_handle_t sc_matrix_sh; +}; + +/* + * Standard priority levels for the system. 0 is lowest and 7 is highest. + * These values are the ones Atmel uses for its Linux port + */ +static const int at91_irq_prio[32] = +{ + 7, /* Advanced Interrupt Controller */ + 7, /* System Peripherals */ + 1, /* Parallel IO Controller A */ + 1, /* Parallel IO Controller B */ + 1, /* Parallel IO Controller C */ + 0, /* Analog-to-Digital Converter */ + 5, /* USART 0 */ + 5, /* USART 1 */ + 5, /* USART 2 */ + 0, /* Multimedia Card Interface */ + 2, /* USB Device Port */ + 6, /* Two-Wire Interface */ + 5, /* Serial Peripheral Interface 0 */ + 5, /* Serial Peripheral Interface 1 */ + 5, /* Serial Synchronous Controller */ + 0, /* (reserved) */ + 0, /* (reserved) */ + 0, /* Timer Counter 0 */ + 0, /* Timer Counter 1 */ + 0, /* Timer Counter 2 */ + 2, /* USB Host port */ + 3, /* Ethernet */ + 0, /* Image Sensor Interface */ + 5, /* USART 3 */ + 5, /* USART 4 */ + 5, /* USART 5 */ + 0, /* Timer Counter 3 */ + 0, /* Timer Counter 4 */ + 0, /* Timer Counter 5 */ + 0, /* Advanced Interrupt Controller IRQ0 */ + 0, /* Advanced Interrupt Controller IRQ1 */ + 0, /* Advanced Interrupt Controller IRQ2 */ +}; + +#define DEVICE(_name, _id, _unit) \ + { \ + _name, _unit, \ + AT91SAM9260_ ## _id ##_BASE, \ + AT91SAM9260_ ## _id ## _SIZE, \ + AT91SAM9260_IRQ_ ## _id \ + } + +static const struct cpu_devs at91_devs[] = +{ + DEVICE("at91_pmc", PMC, 0), + DEVICE("at91_wdt", WDT, 0), + DEVICE("at91_rst", RSTC, 0), + DEVICE("at91_pit", PIT, 0), + DEVICE("at91_pio", PIOA, 0), + DEVICE("at91_pio", PIOB, 1), + DEVICE("at91_pio", PIOC, 2), + DEVICE("at91_twi", TWI, 0), + DEVICE("at91_mci", MCI, 0), + DEVICE("uart", DBGU, 0), + DEVICE("uart", USART0, 1), + DEVICE("uart", USART1, 2), + DEVICE("uart", USART2, 3), + DEVICE("uart", USART3, 4), + DEVICE("uart", USART4, 5), + DEVICE("uart", USART5, 6), + DEVICE("spi", SPI0, 0), + DEVICE("spi", SPI1, 1), + DEVICE("ate", EMAC, 0), + DEVICE("macb", EMAC, 0), + DEVICE("nand", NAND, 0), + DEVICE("ohci", OHCI, 0), + { 0, 0, 0, 0, 0 } +}; + +static void +at91_add_child(device_t dev, int prio, const char *name, int unit, + bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) +{ + device_t kid; + struct at91_ivar *ivar; + + kid = device_add_child_ordered(dev, prio, name, unit); + if (kid == NULL) { + printf("Can't add child %s%d ordered\n", name, unit); + return; + } + ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); + if (ivar == NULL) { + device_delete_child(dev, kid); + printf("Can't add alloc ivar\n"); + return; + } + device_set_ivars(kid, ivar); + resource_list_init(&ivar->resources); + if (irq0 != -1) { + bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); + if (irq0 != AT91SAM9260_IRQ_SYSTEM) + at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); + } + if (irq1 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); + if (irq2 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); + if (addr != 0 && addr < AT91SAM9260_BASE) + addr += AT91SAM9260_BASE; + if (addr != 0) + bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); +} + +static void +at91_cpu_add_builtin_children(device_t dev) +{ + int i; + const struct cpu_devs *walker; + + for (i = 1, walker = at91_devs; walker->name; i++, walker++) { + at91_add_child(dev, i, walker->name, walker->unit, + walker->mem_base, walker->mem_len, walker->irq0, + walker->irq1, walker->irq2); + } +} + +static uint32_t +at91_pll_outa(int freq) +{ + + if (freq > 195000000) + return (0x20000000); + else + return (0x20008000); +} + +static uint32_t +at91_pll_outb(int freq) +{ + return (0x4000); +} + +static void +at91_identify(driver_t *drv, device_t parent) +{ + + if (at91_cpu_is(AT91_CPU_SAM9260)) { + at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); + at91_cpu_add_builtin_children(parent); + } +} + +static int +at91_probe(device_t dev) +{ + + if (at91_cpu_is(AT91_CPU_SAM9260)) { + device_set_desc(dev, "AT91SAM9260"); + return (0); + } + return (ENXIO); +} + +static int +at91_attach(device_t dev) +{ + struct at91_pmc_clock *clk; + struct at91sam9_softc *sc = device_get_softc(dev); + int i; + + struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); + + sc->sc_st = at91sc->sc_st; + sc->sc_sh = at91sc->sc_sh; + sc->dev = dev; + + /* + * XXX These values work for the RM9200, SAM926[01], and SAM9260 + * will have to fix this when we want to support anything else. XXX + */ + if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_SYS_BASE, + AT91SAM9260_SYS_SIZE, &sc->sc_sys_sh) != 0) + panic("Enable to map system registers"); + + if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_DBGU_BASE, + AT91SAM9260_DBGU_SIZE, &sc->sc_dbg_sh) != 0) + panic("Enable to map DBGU registers"); + + if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_AIC_BASE, + AT91SAM9260_AIC_SIZE, &sc->sc_aic_sh) != 0) + panic("Enable to map system registers"); + + /* XXX Hack to tell atmelarm about the AIC */ + at91sc->sc_aic_sh = sc->sc_aic_sh; + at91sc->sc_irq_system = AT91SAM9260_IRQ_SYSTEM; + + for (i = 0; i < 32; i++) { + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + + i * 4, i); + /* Priority. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, + at91_irq_prio[i]); + if (i < 8) + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, + 1); + } + + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); + /* No debug. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); + /* Disable and clear all interrupts. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); + + /* Disable all interrupts for DBGU */ + bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); + + if (bus_space_subregion(sc->sc_st, sc->sc_sh, + AT91SAM9260_MATRIX_BASE, AT91SAM9260_MATRIX_SIZE, + &sc->sc_matrix_sh) != 0) + panic("Enable to map matrix registers"); + + /* activate NAND*/ + i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh, + AT91SAM9260_EBICSA); + bus_space_write_4(sc->sc_st, sc->sc_matrix_sh, + AT91SAM9260_EBICSA, + i | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); + + + /* Update USB device port clock info */ + clk = at91_pmc_clock_ref("udpck"); + clk->pmc_mask = PMC_SCER_UDP_SAM9; + at91_pmc_clock_deref(clk); + + /* Update USB host port clock info */ + clk = at91_pmc_clock_ref("uhpck"); + clk->pmc_mask = PMC_SCER_UHP_SAM9; + at91_pmc_clock_deref(clk); + + /* Each SOC has different PLL contraints */ + clk = at91_pmc_clock_ref("plla"); + clk->pll_min_in = SAM9260_PLL_A_MIN_IN_FREQ; /* 1 MHz */ + clk->pll_max_in = SAM9260_PLL_A_MAX_IN_FREQ; /* 32 MHz */ + clk->pll_min_out = SAM9260_PLL_A_MIN_OUT_FREQ; /* 80 MHz */ + clk->pll_max_out = SAM9260_PLL_A_MAX_OUT_FREQ; /* 240 MHz */ + clk->pll_mul_shift = SAM9260_PLL_A_MUL_SHIFT; + clk->pll_mul_mask = SAM9260_PLL_A_MUL_MASK; + clk->pll_div_shift = SAM9260_PLL_A_DIV_SHIFT; + clk->pll_div_mask = SAM9260_PLL_A_DIV_MASK; + clk->set_outb = at91_pll_outa; + at91_pmc_clock_deref(clk); + + /* + * Fudge MAX pll in frequence down below 3.0 Mhz to ensure + * PMC alogrithm choose the divisor that causes the input clock + * to be near the optimal 2 Mhz per datasheet. We know + * we are going to be using this for the USB clock at 96 Mhz. + * Causes no extra frequency deviation for all recomended crystal values. + */ + clk = at91_pmc_clock_ref("pllb"); + clk->pll_min_in = SAM9260_PLL_B_MIN_IN_FREQ; /* 1 MHz */ + clk->pll_max_in = SAM9260_PLL_B_MAX_IN_FREQ; /* 5 MHz */ + clk->pll_max_in = 2999999; /* ~3 MHz */ + clk->pll_min_out = SAM9260_PLL_B_MIN_OUT_FREQ; /* 70 MHz */ + clk->pll_max_out = SAM9260_PLL_B_MAX_OUT_FREQ; /* 130 MHz */ + clk->pll_mul_shift = SAM9260_PLL_B_MUL_SHIFT; + clk->pll_mul_mask = SAM9260_PLL_B_MUL_MASK; + clk->pll_div_shift = SAM9260_PLL_B_DIV_SHIFT; + clk->pll_div_mask = SAM9260_PLL_B_DIV_MASK; + clk->set_outb = at91_pll_outb; + at91_pmc_clock_deref(clk); + return (0); +} + +static device_method_t at91sam9260_methods[] = { + DEVMETHOD(device_probe, at91_probe), + DEVMETHOD(device_attach, at91_attach), + DEVMETHOD(device_identify, at91_identify), + {0, 0}, +}; + +static driver_t at91sam9260_driver = { + "at91sam9260", + at91sam9260_methods, + sizeof(struct at91sam9_softc), +}; + +static devclass_t at91sam9260_devclass; + +DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, 0, 0); Added: head/sys/arm/at91/at91sam9260reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91sam9260reg.h Wed Oct 6 22:40:27 2010 (r213498) @@ -0,0 +1,310 @@ +/*- + * Copyright (c) 2010 Greg Ansley. 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 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 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 AT91SAM9260REG_H_ +#define AT91SAM9260REG_H_ + +#ifndef AT91SAM9260_MASTER_CLOCK +#define AT91SAM9260_MASTER_CLOCK ((18432000 * 43)/6) +#endif + +/* Chip Specific limits */ +#define SAM9260_PLL_A_MIN_IN_FREQ 1000000 /* 1 Mhz */ +#define SAM9260_PLL_A_MAX_IN_FREQ 32000000 /* 32 Mhz */ +#define SAM9260_PLL_A_MIN_OUT_FREQ 80000000 /* 80 Mhz */ +#define SAM9260_PLL_A_MAX_OUT_FREQ 240000000 /* 240 Mhz */ +#define SAM9260_PLL_A_MUL_SHIFT 16 +#define SAM9260_PLL_A_MUL_MASK 0x3FF +#define SAM9260_PLL_A_DIV_SHIFT 0 +#define SAM9260_PLL_A_DIV_MASK 0xFF + +#define SAM9260_PLL_B_MIN_IN_FREQ 1000000 /* 1 Mhz */ +#define SAM9260_PLL_B_MAX_IN_FREQ 5000000 /* 5 Mhz */ +#define SAM9260_PLL_B_MIN_OUT_FREQ 70000000 /* 70 Mhz */ +#define SAM9260_PLL_B_MAX_OUT_FREQ 130000000 /* 130 Mhz */ +#define SAM9260_PLL_B_MUL_SHIFT 16 +#define SAM9260_PLL_B_MUL_MASK 0x3FF +#define SAM9260_PLL_B_DIV_SHIFT 0 +#define SAM9260_PLL_B_DIV_MASK 0xFF + +/* + * Memory map, from datasheet : + * 0x00000000 - 0x0ffffffff : Internal Memories + * 0x10000000 - 0x1ffffffff : Chip Select 0 + * 0x20000000 - 0x2ffffffff : Chip Select 1 + * 0x30000000 - 0x3ffffffff : Chip Select 2 + * 0x40000000 - 0x4ffffffff : Chip Select 3 + * 0x50000000 - 0x5ffffffff : Chip Select 4 + * 0x60000000 - 0x6ffffffff : Chip Select 5 + * 0x70000000 - 0x7ffffffff : Chip Select 6 + * 0x80000000 - 0x8ffffffff : Chip Select 7 + * 0x90000000 - 0xeffffffff : Undefined (Abort) + * 0xf0000000 - 0xfffffffff : Peripherals + */ + +#define AT91_CHIPSELECT_0 0x10000000 +#define AT91_CHIPSELECT_1 0x20000000 +#define AT91_CHIPSELECT_2 0x30000000 +#define AT91_CHIPSELECT_3 0x40000000 +#define AT91_CHIPSELECT_4 0x50000000 +#define AT91_CHIPSELECT_5 0x60000000 +#define AT91_CHIPSELECT_6 0x70000000 +#define AT91_CHIPSELECT_7 0x80000000 + + +#define AT91SAM9260_BASE 0xd0000000 + + +#define AT91SAM9260_EMAC_BASE 0xffc4000 +#define AT91SAM9260_EMAC_SIZE 0x4000 + +#define AT91SAM9260_RSTC_BASE 0xffffd00 +#define AT91SAM9260_RSTC_SIZE 0x10 + +#define RSTC_CR 0 +#define RSTC_PROCRST (1 << 0) +#define RSTC_PERRST (1 << 2) +#define RSTC_KEY (0xa5 << 24) + +/* USART*/ + +#define AT91SAM9260_USART_SIZE 0x4000 +#define AT91SAM9260_USART0_BASE 0xffb0000 +#define AT91SAM9260_USART0_PDC 0xffb0100 +#define AT91SAM9260_USART0_SIZE AT91SAM9260_USART_SIZE +#define AT91SAM9260_USART1_BASE 0xffb4000 +#define AT91SAM9260_USART1_PDC 0xffb4100 +#define AT91SAM9260_USART1_SIZE AT91SAM9260_USART_SIZE +#define AT91SAM9260_USART2_BASE 0xffb8000 +#define AT91SAM9260_USART2_PDC 0xffb8100 +#define AT91SAM9260_USART2_SIZE AT91SAM9260_USART_SIZE +#define AT91SAM9260_USART3_BASE 0xffd0000 +#define AT91SAM9260_USART3_PDC 0xffd0100 +#define AT91SAM9260_USART3_SIZE AT91SAM9260_USART_SIZE +#define AT91SAM9260_USART4_BASE 0xffd4000 +#define AT91SAM9260_USART4_PDC 0xffd4100 +#define AT91SAM9260_USART4_SIZE AT91SAM9260_USART_SIZE +#define AT91SAM9260_USART5_BASE 0xffd8000 +#define AT91SAM9260_USART5_PDC 0xffd8100 +#define AT91SAM9260_USART5_SIZE AT91SAM9260_USART_SIZE + +/*TC*/ +#define AT91SAM9260_TC0_BASE 0xffa0000 +#define AT91SAM9260_TC0_SIZE 0x4000 +#define AT91SAM9260_TC0C0_BASE 0xffa0000 +#define AT91SAM9260_TC0C1_BASE 0xffa0040 +#define AT91SAM9260_TC0C2_BASE 0xffa0080 + +#define AT91SAM9260_TC1_BASE 0xffdc000 +#define AT91SAM9260_TC1_SIZE 0x4000 + +/*SPI*/ + +#define AT91SAM9260_SPI0_BASE 0xffc8000 + +#define AT91SAM9260_SPI0_SIZE 0x4000 +#define AT91SAM9260_IRQ_SPI0 12 + +#define AT91SAM9260_SPI1_BASE 0xffcc000 +#define AT91SAM9260_SPI1_SIZE 0x4000 +#define AT91SAM9260_IRQ_SPI1 13 + +/* System Registers */ +#define AT91SAM9260_SYS_BASE 0xffff000 +#define AT91SAM9260_SYS_SIZE 0x1000 + +#define AT91SAM9260_MATRIX_BASE 0xfffee00 +#define AT91SAM9260_MATRIX_SIZE 0x1000 +#define AT91SAM9260_EBICSA 0x011C + +#define AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA (1 << 3) + +#define AT91SAM9260_DBGU_BASE 0xffff200 +#define AT91SAM9260_DBGU_SIZE 0x200 + +/* + * PIO + */ +#define AT91SAM9260_PIOA_BASE 0xffff400 +#define AT91SAM9260_PIOA_SIZE 0x200 +#define AT91SAM9260_PIOB_BASE 0xffff600 +#define AT91SAM9260_PIOB_SIZE 0x200 +#define AT91SAM9260_PIOC_BASE 0xffff800 +#define AT91SAM9260_PIOC_SIZE 0x200 + +#define AT91RM92_PMC_BASE 0xffffc00 +#define AT91RM92_PMC_SIZE 0x100 +/* IRQs : */ +/* + * 0: AIC + * 1: System peripheral (System timer, RTC, DBGU) + * 2: PIO Controller A + * 3: PIO Controller B + * 4: PIO Controller C + * 5: ADC + * 6: USART 0 + * 7: USART 1 + * 8: USART 2 + * 9: MMC Interface + * 10: USB device port + * 11: Two-wirte interface + * 12: SPI 0 + * 13: SPI 1 + * 14: SSC + * 15: - (reserved) + * 16: - (reserved) + * 17: Timer Counter 0 + * 18: Timer Counter 1 + * 19: Timer Counter 2 + * 20: USB Host port + * 21: EMAC + * 22: ISI + * 23: USART 3 + * 24: USART 4 + * 25: USART 2 + * 26: Timer Counter 3 + * 27: Timer Counter 4 + * 28: Timer Counter 5 + * 29: AIC IRQ0 + * 30: AIC IRQ1 + * 31: AIC IRQ2 + */ + +#define AT91SAM9260_IRQ_SYSTEM 1 +#define AT91SAM9260_IRQ_PIOA 2 +#define AT91SAM9260_IRQ_PIOB 3 +#define AT91SAM9260_IRQ_PIOC 4 +#define AT91SAM9260_IRQ_USART0 6 +#define AT91SAM9260_IRQ_USART1 7 +#define AT91SAM9260_IRQ_USART2 8 +#define AT91SAM9260_IRQ_MCI 9 +#define AT91SAM9260_IRQ_UDP 10 +#define AT91SAM9260_IRQ_TWI 11 +#define AT91SAM9260_IRQ_SPI0 12 +#define AT91SAM9260_IRQ_SPI1 13 +#define AT91SAM9260_IRQ_SSC0 14 +#define AT91SAM9260_IRQ_SSC1 15 +#define AT91SAM9260_IRQ_SSC2 16 +#define AT91SAM9260_IRQ_TC0 17 +#define AT91SAM9260_IRQ_TC1 18 +#define AT91SAM9260_IRQ_TC2 19 +#define AT91SAM9260_IRQ_UHP 20 +#define AT91SAM9260_IRQ_EMAC 21 +#define AT91SAM9260_IRQ_USART3 23 +#define AT91SAM9260_IRQ_USART4 24 +#define AT91SAM9260_IRQ_USART5 25 +#define AT91SAM9260_IRQ_AICBASE 29 + +/* Alias */ +#define AT91SAM9260_IRQ_DBGU AT91SAM9260_IRQ_SYSTEM +#define AT91SAM9260_IRQ_PMC AT91SAM9260_IRQ_SYSTEM +#define AT91SAM9260_IRQ_WDT AT91SAM9260_IRQ_SYSTEM +#define AT91SAM9260_IRQ_PIT AT91SAM9260_IRQ_SYSTEM +#define AT91SAM9260_IRQ_RSTC AT91SAM9260_IRQ_SYSTEM +#define AT91SAM9260_IRQ_OHCI AT91SAM9260_IRQ_UHP +#define AT91SAM9260_IRQ_NAND (-1) + +#define AT91SAM9260_AIC_BASE 0xffff000 +#define AT91SAM9260_AIC_SIZE 0x200 + +/* Timer */ + +#define AT91SAM9260_WDT_BASE 0xffffd40 +#define AT91SAM9260_WDT_SIZE 0x10 + +#define AT91SAM9260_PIT_BASE 0xffffd30 +#define AT91SAM9260_PIT_SIZE 10 + +#define AT91SAM9260_SMC_BASE 0xfffec00 +#define AT91SAM9260_SMC_SIZE 0x200 + +#define AT91SAM9260_PMC_BASE 0xffffc00 +#define AT91SAM9260_PMC_SIZE 0x100 + +#define AT91SAM9260_UDP_BASE 0xffa4000 +#define AT91SAM9260_UDP_SIZE 0x4000 + +#define AT91SAM9260_MCI_BASE 0xffa8000 +#define AT91SAM9260_MCI_SIZE 0x4000 + +#define AT91SAM9260_TWI_BASE 0xffaC000 +#define AT91SAM9260_TWI_SIZE 0x4000 + +/* XXX Needs to be carfully coordinated with + * other * soc's so phyical and vm address + * mapping are unique. XXX + */ +#define AT91SAM9260_OHCI_BASE 0xdfc00000 +#define AT91SAM9260_OHCI_PA_BASE 0x00500000 +#define AT91SAM9260_OHCI_SIZE 0x00100000 + +#define AT91SAM9260_NAND_BASE 0xe0000000 +#define AT91SAM9260_NAND_PA_BASE 0x40000000 +#define AT91SAM9260_NAND_SIZE 0x10000000 + + +/* SDRAMC */ +#define AT91SAM9260_SDRAMC_BASE 0xfffea00 +#define AT91SAM9260_SDRAMC_MR 0x00 +#define AT91SAM9260_SDRAMC_MR_MODE_NORMAL 0 +#define AT91SAM9260_SDRAMC_MR_MODE_NOP 1 +#define AT91SAM9260_SDRAMC_MR_MODE_PRECHARGE 2 +#define AT91SAM9260_SDRAMC_MR_MODE_LOAD_MODE_REGISTER 3 +#define AT91SAM9260_SDRAMC_MR_MODE_REFRESH 4 +#define AT91SAM9260_SDRAMC_TR 0x04 +#define AT91SAM9260_SDRAMC_CR 0x08 +#define AT91SAM9260_SDRAMC_CR_NC_8 0x0 +#define AT91SAM9260_SDRAMC_CR_NC_9 0x1 +#define AT91SAM9260_SDRAMC_CR_NC_10 0x2 +#define AT91SAM9260_SDRAMC_CR_NC_11 0x3 +#define AT91SAM9260_SDRAMC_CR_NC_MASK 0x00000003 +#define AT91SAM9260_SDRAMC_CR_NR_11 0x0 +#define AT91SAM9260_SDRAMC_CR_NR_12 0x4 +#define AT91SAM9260_SDRAMC_CR_NR_13 0x8 +#define AT91SAM9260_SDRAMC_CR_NR_RES 0xc +#define AT91SAM9260_SDRAMC_CR_NR_MASK 0x0000000c +#define AT91SAM9260_SDRAMC_CR_NB_2 0x00 +#define AT91SAM9260_SDRAMC_CR_NB_4 0x10 +#define AT91SAM9260_SDRAMC_CR_DBW_16 0x80 +#define AT91SAM9260_SDRAMC_CR_NB_MASK 0x00000010 +#define AT91SAM9260_SDRAMC_CR_NCAS_MASK 0x00000060 +#define AT91SAM9260_SDRAMC_CR_TWR_MASK 0x00000780 +#define AT91SAM9260_SDRAMC_CR_TRC_MASK 0x00007800 +#define AT91SAM9260_SDRAMC_CR_TRP_MASK 0x00078000 +#define AT91SAM9260_SDRAMC_CR_TRCD_MASK 0x00780000 +#define AT91SAM9260_SDRAMC_CR_TRAS_MASK 0x07800000 +#define AT91SAM9260_SDRAMC_CR_TXSR_MASK 0x78000000 +#define AT91SAM9260_SDRAMC_HSR 0x0c +#define AT91SAM9260_SDRAMC_LPR 0x10 +#define AT91SAM9260_SDRAMC_IER 0x14 +#define AT91SAM9260_SDRAMC_IDR 0x18 +#define AT91SAM9260_SDRAMC_IMR 0x1c +#define AT91SAM9260_SDRAMC_ISR 0x20 +#define AT91SAM9260_SDRAMC_MDR 0x24 + +#endif /* AT91SAM9260REG_H_*/ + Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Wed Oct 6 22:32:31 2010 (r213497) +++ head/sys/arm/at91/at91sam9g20.c Wed Oct 6 22:40:27 2010 (r213498) @@ -176,6 +176,30 @@ at91_cpu_add_builtin_children(device_t d } } +static uint32_t +at91_pll_outa(int freq) +{ + + switch (freq / 10000000) { + case 747 ... 801: return ((1 << 29) | (0 << 14)); + case 697 ... 746: return ((1 << 29) | (1 << 14)); + case 647 ... 696: return ((1 << 29) | (2 << 14)); + case 597 ... 646: return ((1 << 29) | (3 << 14)); + case 547 ... 596: return ((1 << 29) | (1 << 14)); + case 497 ... 546: return ((1 << 29) | (2 << 14)); + case 447 ... 496: return ((1 << 29) | (3 << 14)); + case 397 ... 446: return ((1 << 29) | (4 << 14)); + default: return (1 << 29); + } +} + +static uint32_t +at91_pll_outb(int freq) +{ + + return (0); +} + static void at91_identify(driver_t *drv, device_t parent) { @@ -284,6 +308,7 @@ at91_attach(device_t dev) clk->pll_mul_mask = SAM9G20_PLL_A_MUL_MASK; clk->pll_div_shift = SAM9G20_PLL_A_DIV_SHIFT; clk->pll_div_mask = SAM9G20_PLL_A_DIV_MASK; + clk->set_outb = at91_pll_outa; at91_pmc_clock_deref(clk); clk = at91_pmc_clock_ref("pllb"); @@ -295,6 +320,7 @@ at91_attach(device_t dev) clk->pll_mul_mask = SAM9G20_PLL_B_MUL_MASK; clk->pll_div_shift = SAM9G20_PLL_B_DIV_SHIFT; clk->pll_div_mask = SAM9G20_PLL_B_DIV_MASK; + clk->set_outb = at91_pll_outb; at91_pmc_clock_deref(clk); return (0); } Added: head/sys/arm/at91/board_qila9g20.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/board_qila9g20.c Wed Oct 6 22:40:27 2010 (r213498) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2009 Greg Ansley. 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 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 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. + */ + +/* Calao Systems QIL-9G20-Cxx + * http://www.calao-systems.com + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include + +#include +#include +#include +#include +#include +#include +//#include + +#define AT91SAM9G20_LED_BASE AT91SAM9G20_PIOA_BASE +#define AT91SAM9G20_LED_SIZE AT91SAM9G20_PIO_SIZE +#define AT91SAM9G20_IRQ_LED AT91SAM9G20_IRQ_PIOA + +long +board_init(void) +{ + + //at91_led_create("power", 0, 9, 0); + + /* PIOB's A periph: Turn USART 0's TX/RX pins */ + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB14_DRXD, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB15_DTXD, 1); + + /* PIOB's A periph: Turn USART 0's TX/RX pins */ + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB4_TXD0, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB5_RXD0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB22_DSR0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB23_DCD0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB24_DTR0, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB25_RI0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB26_RTS0, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB27_CTS0, 0); + + /* PIOB's A periph: Turn USART 1's TX/RX pins */ + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB6_TXD1, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB7_RXD1, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB28_RTS1, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB29_CTS1, 0); + + /* TWI Two-wire Serial Data */ + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA23_TWD, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA24_TWCK, 1); + + /* Multimedia Card */ + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA6_MCDA0, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA7_MCCDA, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA8_MCCK, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA9_MCDA1, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA10_MCDA2, 1); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA11_MCDA3, 1); + + /* SPI0 to DataFlash */ + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE, AT91C_PA0_SPI0_MISO, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE, AT91C_PA1_SPI0_MOSI, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE, AT91C_PA2_SPI0_SPCK, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE, AT91C_PA3_SPI0_NPCS0, 0); + + /* EMAC */ + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA19_ETXCK, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA21_EMDIO, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA20_EMDC, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA17_ERXDV, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA16_ETXEN, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA12_ETX0 , 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA13_ETX1, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA14_ERX0, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA15_ERX1, 0); + at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA18_ERXER, 0); + + + return (at91_ramsize()); +} Modified: head/sys/arm/at91/board_sam9g20ek.c ============================================================================== --- head/sys/arm/at91/board_sam9g20ek.c Wed Oct 6 22:32:31 2010 (r213497) +++ head/sys/arm/at91/board_sam9g20ek.c Wed Oct 6 22:40:27 2010 (r213498) @@ -23,7 +23,14 @@ * SUCH DAMAGE. */ -/* Atmel AT91SAM9G20EK Rev. B Development Card */ +/* + * This board file can be used for both: + * Atmel AT91SAM9260-B Development Card and + * Atmel AT91SAM9G20-EK Rev. B Development Card + * + * Since the AT91SAM9260 and AT91SAM9G20 have identical memory maps and + * pin configurations we can use the same file for both. + */ #include __FBSDID("$FreeBSD$"); @@ -38,16 +45,9 @@ __FBSDID("$FreeBSD$"); #include //#include -#define AT91SAM9G20_LED_BASE AT91SAM9G20_PIOA_BASE -#define AT91SAM9G20_LED_SIZE AT91SAM9G20_PIO_SIZE -#define AT91SAM9G20_IRQ_LED AT91SAM9G20_IRQ_PIOA - long board_init(void) { - - //at91_led_create("power", 0, 9, 0); - /* PIOB's A periph: Turn USART 0's TX/RX pins */ at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB14_DRXD, 0); at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB15_DTXD, 1); @@ -68,16 +68,13 @@ board_init(void) at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB28_RTS1, 1); at91_pio_use_periph_a(AT91SAM9G20_PIOB_BASE, AT91C_PB29_CTS1, 0); -#if 1 /* TWI Two-wire Serial Data */ at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA23_TWD, 1); at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA24_TWCK, 1); -#endif + #if 1 /* * Turn off Clock to DataFlash, conflicts with MCI clock. - * Remove resistor R42 if you need both DataFlash and SD Card - * access at the same time */ at91_pio_use_gpio(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA2); at91_pio_gpio_input(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA2); @@ -106,45 +103,6 @@ board_init(void) at91_pio_use_gpio(AT91SAM9G20_PIOA_BASE,AT91C_PIO_PA8); #endif -#if 0 - static int at91_base = AT91SAM9G20_BASE; - volatile uint32_t *PIO = (uint32_t *)(at91_base + AT91SAM9G20_PIOA_BASE); - volatile uint32_t *RST = (uint32_t *)(at91_base + AT91SAM9G20_RSTC_BASE); - /* - * Disable pull-up on: - * ERX0 (PA14) => PHY ADDR0 - * ERX1 (PA15) => PHY ADDR1 - * RXDV (PA17) => PHY normal mode (not Test mode) - * ERX2 (PA25) => PHY ADDR2 - * ERX3 (PA26) => PHY ADDR3 - * ECRS (PA28) => PHY ADDR4 => PHYADDR = 0x0 - * - * PHY has internal pull-down - */ - PIO[PIO_PUDR/4] = - AT91C_PA14_ERX0 | - AT91C_PA15_ERX1 | - AT91C_PA17_ERXDV | - AT91C_PA25_ERX2 | - AT91C_PA26_ERX3 | - AT91C_PA28_ECRS; - - - /* Reset PHY - 500ms */ - RST[2] = 0xA5000D01; - RST[0] = 0xA5000080; - while (!(RST[1] & (1 << 16))) ; - - PIO[PIO_PUER/4] = - AT91C_PA14_ERX0 | - AT91C_PA15_ERX1 | - AT91C_PA17_ERXDV | - AT91C_PA25_ERX2 | - AT91C_PA26_ERX3 | - AT91C_PA28_ECRS; -#endif - - /* EMAC */ at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA12_ETX0 , 0); at91_pio_use_periph_a(AT91SAM9G20_PIOA_BASE,AT91C_PA13_ETX1, 0); @@ -166,11 +124,5 @@ board_init(void) at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA28_ECRS, 0); at91_pio_use_periph_b(AT91SAM9G20_PIOA_BASE,AT91C_PA29_ECOL, 0); -#if 0 - /* Handle Missing ETXER line */ - at91_pio_use_gpio(AT91SAM9G20_PIOA_BASE,AT91C_PA22_ETXER); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 6 22:41:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBECB1065672; Wed, 6 Oct 2010 22:41:32 +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 CB8A88FC12; Wed, 6 Oct 2010 22:41: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 o96MfWxv020354; Wed, 6 Oct 2010 22:41:32 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96MfWd0020351; Wed, 6 Oct 2010 22:41:32 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201010062241.o96MfWd0020351@svn.freebsd.org> From: Olivier Houchard Date: Wed, 6 Oct 2010 22:41: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: r213499 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 22:41:33 -0000 Author: cognet Date: Wed Oct 6 22:41:32 2010 New Revision: 213499 URL: http://svn.freebsd.org/changeset/base/213499 Log: Add the QILA9G20 config files. Submitted by: Greg Ansley Added: head/sys/arm/conf/QILA9G20 (contents, props changed) head/sys/arm/conf/QILA9G20.hints (contents, props changed) Added: head/sys/arm/conf/QILA9G20 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/QILA9G20 Wed Oct 6 22:41:32 2010 (r213499) @@ -0,0 +1,153 @@ +# Kernel configuration for Calao Syatems QIL-A9G20 development card +# http://www.calao-systems.com +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident QILA9G20 + +include "../at91/std.qila9g20" + +#To statically compile in device wiring instead of /boot/device.hints +hints "QILA9G20.hints" +makeoptions MODULES_OVERRIDE="" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +#options MD_ROOT #MD is a potential root device +#options MD_ROOT_SIZE=4096 # 3MB ram disk +options NFSCLIENT #Network Filesystem Client +#options NFSSERVER #Network Filesystem Server +#options NFSLOCKD #Network Lock Manager +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP_NFSROOT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 +#options BOOTP_COMPAT + +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +options ALT_BREAK_TO_DEBUGGER + +#options MSDOSFS #MSDOS Filesystem +#options CD9660 #ISO 9660 Filesystem +#options PROCFS #Process filesystem (requires PSEUDOFS) +#options PSEUDOFS #Pseudo-filesystem framework +#options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +#options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +#options SYSCTL_OMIT_DESCR +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING + +# Debugging for use in -current +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +device random +device pty +device loop +device bpf +device ether +device md + +device uart # Serial Ports + +# Ethernet +device ate # Ethernet Driver +#device macb # Alternate Ethernet driver +device mii +option AT91_ATE_USE_RMII + +device at91_twi # TWI: Two Wire Interface (EEPROM) +device at91_wdt # WDT: Watchdog timer + +# NOTE: SPI DataFlash and mci/mmc/mmcsd have hardware +# confilict on this card. Use one or the other. +# see board_sam9g20ek.c + +# SPI: Data Flash +#device at91_spi # SPI: +#device spibus +#device at45d # at45db642 and maybe others + +# MMC/SD +device at91_mci +device mmc +device mmcsd +option AT91_MCI_HAS_4WIRE + +# iic +device iic +device iicbus +device icee + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +device ohci # OHCI localbus->USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" +#device ulpt # Printer +#device udbp # USB Double Bulk Pipe devices + +# USB Ethernet, requires miibus +device miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs +#device uath # Atheros AR5523 wireless NICs +#device ural # Ralink Technology RT2500USB wireless NICs +#device zyd # ZyDAS zb1211/zb1211b wireless NICs + +# Wireless NIC cards +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm + Added: head/sys/arm/conf/QILA9G20.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/QILA9G20.hints Wed Oct 6 22:41:32 2010 (r213499) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# Kernel configuration hits for Calao Syatems QIL-A9G20 development card +# http://www.calao-systems.com + +# STMicroelctrtronics M41T94 Real-Time Clock +# on SPI0 NPCS0 + +# STMicroelctrtronics M95640 8k x 8 EEPROM +# on SPI0 NPCS1 From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 00:29:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51148106566B; Thu, 7 Oct 2010 00:29:08 +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 4007D8FC12; Thu, 7 Oct 2010 00:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o970T8SL022941; Thu, 7 Oct 2010 00:29:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o970T8eS022939; Thu, 7 Oct 2010 00:29:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010070029.o970T8eS022939@svn.freebsd.org> From: Xin LI Date: Thu, 7 Oct 2010 00:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213503 - stable/8/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 00:29:08 -0000 Author: delphij Date: Thu Oct 7 00:29:07 2010 New Revision: 213503 URL: http://svn.freebsd.org/changeset/base/213503 Log: MFC r213044: In the past gunzip(1) write()'s after each inflate return. This is not optimal from a performance standpoint since the write buffer is not necessarily be filled up when the inflate rountine reached the end of input buffer and it's not the end of file. This problem gets uncovered by trying to pipe gunzip -c output to a GEOM device directly, which enforces the writes be multiple of sector size. Sponsored by: iXsystems, Inc. Reported by: jpaetzel Modified: stable/8/usr.bin/gzip/gzip.c Directory Properties: stable/8/usr.bin/gzip/ (props changed) Modified: stable/8/usr.bin/gzip/gzip.c ============================================================================== --- stable/8/usr.bin/gzip/gzip.c Wed Oct 6 23:47:52 2010 (r213502) +++ stable/8/usr.bin/gzip/gzip.c Thu Oct 7 00:29:07 2010 (r213503) @@ -916,6 +916,8 @@ gz_uncompress(int in, int out, char *pre switch (error) { /* Z_BUF_ERROR goes with Z_FINISH... */ case Z_BUF_ERROR: + if (z.avail_out > 0 && !done_reading) + continue; case Z_STREAM_END: case Z_OK: break; From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 00:30:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47C44106566B; Thu, 7 Oct 2010 00:30:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36E728FC19; Thu, 7 Oct 2010 00:30: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 o970UUfl023055; Thu, 7 Oct 2010 00:30:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o970UUJA023053; Thu, 7 Oct 2010 00:30:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010070030.o970UUJA023053@svn.freebsd.org> From: Xin LI Date: Thu, 7 Oct 2010 00:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213504 - stable/7/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 00:30:30 -0000 Author: delphij Date: Thu Oct 7 00:30:29 2010 New Revision: 213504 URL: http://svn.freebsd.org/changeset/base/213504 Log: MFC r210344: In the past gunzip(1) write()'s after each inflate return. This is not optimal from a performance standpoint since the write buffer is not necessarily be filled up when the inflate rountine reached the end of input buffer and it's not the end of file. This problem gets uncovered by trying to pipe gunzip -c output to a GEOM device directly, which enforces the writes be multiple of sector size. Sponsored by: iXsystems, Inc. Reported by: jpaetzel Modified: stable/7/usr.bin/gzip/gzip.c Directory Properties: stable/7/usr.bin/gzip/ (props changed) Modified: stable/7/usr.bin/gzip/gzip.c ============================================================================== --- stable/7/usr.bin/gzip/gzip.c Thu Oct 7 00:29:07 2010 (r213503) +++ stable/7/usr.bin/gzip/gzip.c Thu Oct 7 00:30:29 2010 (r213504) @@ -920,6 +920,8 @@ gz_uncompress(int in, int out, char *pre switch (error) { /* Z_BUF_ERROR goes with Z_FINISH... */ case Z_BUF_ERROR: + if (z.avail_out > 0 && !done_reading) + continue; case Z_STREAM_END: case Z_OK: break; From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 00:36:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CBF41065673; Thu, 7 Oct 2010 00:36:59 +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 E57628FC0C; Thu, 7 Oct 2010 00:36: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 o970awi4023286; Thu, 7 Oct 2010 00:36:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o970awKD023284; Thu, 7 Oct 2010 00:36:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010070036.o970awKD023284@svn.freebsd.org> From: Xin LI Date: Thu, 7 Oct 2010 00:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213505 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 00:36:59 -0000 Author: delphij Date: Thu Oct 7 00:36:58 2010 New Revision: 213505 URL: http://svn.freebsd.org/changeset/base/213505 Log: MFC r211059: Address an edge condition that we found at work, where the carp(4) interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at cold boot. This behavior is not observed when carp(4) interface is created slightly later, when the underlying interface is fully up. Before this change what happen at boot is roughly: - ifconfig creates em0 interface; - ifconfig clones a carp device using em0; (em0's link state is DOWN at this point) - carp state: INIT -> BACKUP [*] - carp state: BACKUP -> MASTER - [Some negotiate between em0 and switch] - em0 kicks up link state change event (em0's link state is now up DOWN at this point) - do_link_state_change() -> carp_carpdev_state() - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+] - carp state: INIT -> BACKUP - carp state: BACKUP -> MASTER At the [*] stage, em0 did not received any broadcast message from other node, and assume our node is the master, thus carp(4) sets the link state to "UP" after becoming a master. At [+], the master status is forcely set to "INIT", then an election is casted, after which our node would actually become a master. We believe that at the [*] stage, the master status should remain as "INIT" since the underlying parent interface's link state is not up. Obtained from: iXsystems, Inc. Reported by: jpaetzel Modified: stable/8/sys/netinet/ip_carp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ip_carp.c ============================================================================== --- stable/8/sys/netinet/ip_carp.c Thu Oct 7 00:30:29 2010 (r213504) +++ stable/8/sys/netinet/ip_carp.c Thu Oct 7 00:36:58 2010 (r213505) @@ -1379,7 +1379,8 @@ carp_setrun(struct carp_softc *sc, sa_fa CARP_SCLOCK_ASSERT(sc); if (SC2IFP(sc)->if_flags & IFF_UP && - sc->sc_vhid > 0 && (sc->sc_naddrs || sc->sc_naddrs6)) + sc->sc_vhid > 0 && (sc->sc_naddrs || sc->sc_naddrs6) && + sc->sc_carpdev->if_link_state == LINK_STATE_UP) SC2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; else { SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 00:37:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A30F41065698; Thu, 7 Oct 2010 00:37:40 +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 782A38FC1F; Thu, 7 Oct 2010 00:37: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 o970bear023348; Thu, 7 Oct 2010 00:37:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o970beMP023346; Thu, 7 Oct 2010 00:37:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010070037.o970beMP023346@svn.freebsd.org> From: Xin LI Date: Thu, 7 Oct 2010 00:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213506 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 00:37:40 -0000 Author: delphij Date: Thu Oct 7 00:37:40 2010 New Revision: 213506 URL: http://svn.freebsd.org/changeset/base/213506 Log: MFC r211059: Address an edge condition that we found at work, where the carp(4) interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at cold boot. This behavior is not observed when carp(4) interface is created slightly later, when the underlying interface is fully up. Before this change what happen at boot is roughly: - ifconfig creates em0 interface; - ifconfig clones a carp device using em0; (em0's link state is DOWN at this point) - carp state: INIT -> BACKUP [*] - carp state: BACKUP -> MASTER - [Some negotiate between em0 and switch] - em0 kicks up link state change event (em0's link state is now up DOWN at this point) - do_link_state_change() -> carp_carpdev_state() - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+] - carp state: INIT -> BACKUP - carp state: BACKUP -> MASTER At the [*] stage, em0 did not received any broadcast message from other node, and assume our node is the master, thus carp(4) sets the link state to "UP" after becoming a master. At [+], the master status is forcely set to "INIT", then an election is casted, after which our node would actually become a master. We believe that at the [*] stage, the master status should remain as "INIT" since the underlying parent interface's link state is not up. Obtained from: iXsystems, Inc. Reported by: jpaetzel Modified: stable/7/sys/netinet/ip_carp.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/ip_carp.c ============================================================================== --- stable/7/sys/netinet/ip_carp.c Thu Oct 7 00:36:58 2010 (r213505) +++ stable/7/sys/netinet/ip_carp.c Thu Oct 7 00:37:40 2010 (r213506) @@ -1349,7 +1349,8 @@ carp_setrun(struct carp_softc *sc, sa_fa CARP_SCLOCK_ASSERT(sc); if (SC2IFP(sc)->if_flags & IFF_UP && - sc->sc_vhid > 0 && (sc->sc_naddrs || sc->sc_naddrs6)) + sc->sc_vhid > 0 && (sc->sc_naddrs || sc->sc_naddrs6) && + sc->sc_carpdev->if_link_state == LINK_STATE_UP) SC2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; else { SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 06:34:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B381106564A; Thu, 7 Oct 2010 06:34:47 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B36D8FC0A; Thu, 7 Oct 2010 06:34: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 o976YlEx030727; Thu, 7 Oct 2010 06:34:47 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o976YlOG030724; Thu, 7 Oct 2010 06:34:47 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010070634.o976YlOG030724@svn.freebsd.org> From: Gordon Tetlow Date: Thu, 7 Oct 2010 06:34: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: r213507 - head/usr.bin/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 06:34:47 -0000 Author: gordon Date: Thu Oct 7 06:34:47 2010 New Revision: 213507 URL: http://svn.freebsd.org/changeset/base/213507 Log: Add the ability to display specific manual pages if passed on the commandline. This mirrors the old (undocumented) GNU man functionality. Also document this feature in the implementation notes section of the manpage. Submitted by: arundel Approved by: wes (mentor implicit) Modified: head/usr.bin/man/man.1 head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Thu Oct 7 00:37:40 2010 (r213506) +++ head/usr.bin/man/man.1 Thu Oct 7 06:34:47 2010 (r213507) @@ -225,6 +225,13 @@ will search the following paths when con .It .Pa /usr/share/man/man4 .El +.Ss Displaying Specific Manual Files +The +.Nm +utility also supports displaying a specific manual page if passed a path +to the file as long as it contains a +.Sq / +character. .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Thu Oct 7 00:37:40 2010 (r213506) +++ head/usr.bin/man/man.sh Thu Oct 7 06:34:47 2010 (r213507) @@ -356,6 +356,20 @@ man_display_page() { man_find_and_display() { local found_page locpath p path sect + # Check to see if it's a file. But only if it has a '/' in + # the filename. + case "$1" in + */*) if [ -f "$1" -a -r "$1" ]; then + decho "Found a usable page, displaying that" + found_page=yes + unset use_cat + manpage="$1" + man_display_page + return + fi + ;; + esac + IFS=: for sect in $MANSECT; do decho "Searching section $sect" 2 From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 08:36:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 775251065674; Thu, 7 Oct 2010 08:36:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66BA88FC12; Thu, 7 Oct 2010 08:36:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o978a2rR033382; Thu, 7 Oct 2010 08:36:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o978a2FL033380; Thu, 7 Oct 2010 08:36:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010070836.o978a2FL033380@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Oct 2010 08:36: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: r213508 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 08:36:02 -0000 Author: kib Date: Thu Oct 7 08:36:02 2010 New Revision: 213508 URL: http://svn.freebsd.org/changeset/base/213508 Log: The msdosfs lookup is case insensitive. Several aliases may be inserted for a single directory entry. As a consequnce, name cache purge done by lookup for fvp when DELETE op for namei is specified, might be not enough to expunge all namecache entries that were installed for this direntry. Explicitely call cache_purge(fvp) when msdosfs_rename() succeeded. PR: kern/93634 MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Thu Oct 7 06:34:47 2010 (r213507) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Thu Oct 7 08:36:02 2010 (r213508) @@ -1258,6 +1258,7 @@ abortit: } } + cache_purge(fvp); VOP_UNLOCK(fvp, 0); bad: if (xp) From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 09:03:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 38FCB1065679; Thu, 7 Oct 2010 09:03:43 +0000 (UTC) Date: Thu, 7 Oct 2010 09:03:43 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Message-ID: <20101007090343.GA9190@FreeBSD.org> References: <201010070836.o978a2FL033380@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201010070836.o978a2FL033380@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: r213508 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 09:03:43 -0000 On Thu, Oct 07, 2010 at 08:36:02AM +0000, Konstantin Belousov wrote: > The msdosfs lookup is case insensitive. Several aliases may be inserted for > a single directory entry. As a consequnce, name cache purge done by lookup > for fvp when DELETE op for namei is specified, might be not enough to > expunge all namecache entries that were installed for this direntry. > > Explicitely call cache_purge(fvp) when msdosfs_rename() succeeded. Maybe this text could be used as a comment in the code? ./danfe From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 09:07:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF6E4106564A; Thu, 7 Oct 2010 09:07:48 +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 AEA7A8FC16; Thu, 7 Oct 2010 09:07: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 o9797m4R034641; Thu, 7 Oct 2010 09:07:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9797m0r034638; Thu, 7 Oct 2010 09:07:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010070907.o9797m0r034638@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Oct 2010 09:07: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: r213509 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 09:07:48 -0000 Author: mav Date: Thu Oct 7 09:07:48 2010 New Revision: 213509 URL: http://svn.freebsd.org/changeset/base/213509 Log: Add ID for Vodafone (ZTE) Mobile Broadband K3565-Z modem. Reviewed by: hselasky 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 Thu Oct 7 08:36:02 2010 (r213508) +++ head/sys/dev/usb/serial/u3g.c Thu Oct 7 09:07:48 2010 (r213509) @@ -409,6 +409,7 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0078, 0), U3G_DEV(QUALCOMMINC, E0082, 0), U3G_DEV(QUALCOMMINC, E0086, 0), + U3G_DEV(QUALCOMMINC, E2000, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, MF626, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Oct 7 08:36:02 2010 (r213508) +++ head/sys/dev/usb/usbdevs Thu Oct 7 09:07:48 2010 (r213509) @@ -2657,6 +2657,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC E2000 0x2000 3G modem product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 09:30:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D24A3106566B; Thu, 7 Oct 2010 09:30:35 +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 C1CB38FC14; Thu, 7 Oct 2010 09:30: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 o979UZnl035563; Thu, 7 Oct 2010 09:30:35 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o979UZho035561; Thu, 7 Oct 2010 09:30:35 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201010070930.o979UZho035561@svn.freebsd.org> From: Olivier Houchard Date: Thu, 7 Oct 2010 09:30: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: r213510 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 09:30:35 -0000 Author: cognet Date: Thu Oct 7 09:30:35 2010 New Revision: 213510 URL: http://svn.freebsd.org/changeset/base/213510 Log: Add options I missed in the additionnal AT91 support commits. Submitted by: Greg Ansley Modified: head/sys/conf/options.arm Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Thu Oct 7 09:07:48 2010 (r213509) +++ head/sys/conf/options.arm Thu Oct 7 09:30:35 2010 (r213510) @@ -31,8 +31,11 @@ STARTUP_PAGETABLE_ADDR opt_global.h XSCALE_CACHE_READ_WRITE_ALLOCATE opt_global.h XSACLE_DISABLE_CCNT opt_timer.h VERBOSE_INIT_ARM opt_global.h +AT91_ATE_USE_RMII opt_at91.h AT91_BWCT opt_at91.h AT91_TSC opt_at91.h AT91_KWIKBYTE opt_at91.h +AT91_MCI_HAS_4WIRE opt_at91.h +AT91_MCI_SLOT_B opt_at91.h CPU_FA526 opt_global.h CPU_FA626TE opt_global.h From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 09:58:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77874106566C; Thu, 7 Oct 2010 09:58:52 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA978FC13; Thu, 7 Oct 2010 09:58:51 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3B2F4.dip.t-dialin.net [87.179.178.244]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id B5DA184400C; Thu, 7 Oct 2010 11:40:41 +0200 (CEST) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id B1D6818F7; Thu, 7 Oct 2010 11:40:34 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o979eVMA095799; Thu, 7 Oct 2010 11:40:31 +0200 (CEST) (envelope-from netchild@FreeBSD.org) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 07 Oct 2010 11:40:31 +0200 Message-ID: <20101007114031.80652w26vlw6cwis@webmail.leidinger.net> Date: Thu, 07 Oct 2010 11:40:31 +0200 From: Alexander Leidinger To: Doug Barton References: <201010060749.o967nSbZ086734@svn.freebsd.org> <4CACBCA4.3080006@FreeBSD.org> In-Reply-To: <4CACBCA4.3080006@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: B5DA184400C.A89BD X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.351, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: netchild@freebsd.org X-EBL-MailScanner-Watermark: 1287049244.02871@mEDiwlb2D8COilY8mgFeYA X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Paul B Mahol Subject: Re: svn commit: r213472 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 09:58:52 -0000 Quoting Doug Barton (from Wed, 06 Oct 2010 11:15:00 -0700): > On 10/6/2010 12:49 AM, Alexander Leidinger wrote: >> Author: netchild >> Date: Wed Oct 6 07:49:28 2010 >> New Revision: 213472 >> URL: http://svn.freebsd.org/changeset/base/213472 >> >> Log: >> Add some missing files to optionally delete. >> >> Submitted by: Paul B Mahol >> >> Modified: >> head/tools/build/mk/OptionalObsoleteFiles.inc >> >> Modified: head/tools/build/mk/OptionalObsoleteFiles.inc >> ============================================================================== >> --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 6 >> 07:34:41 2010 (r213471) >> +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 6 >> 07:49:28 2010 (r213472) >> @@ -141,6 +141,7 @@ OLD_FILES+=usr/share/man/man8/authpf.8.g >> .endif >> >> .if ${MK_BIND} == no >> +OLD_FILES+=etc/periodic/daily/470.status-named > > > Traditionally we haven't deleted these. In the case of named-related > files I would prefer that we did not because: > > 1. That check is off by default > 2. If the user is not running named it won't do any harm > 3. The default for installing named from the ports is to continue to > use the infrastructure in the base (such as this script, and > /etc/rc.d/named). > > I'm not sure what the right answer for all the periodic scripts is, > but for this one I would like it not to be included in the obsolete > files. Please confirm that this file is installed during installworld when MK_BIND is equal to "no" (as I read it, it is not installed). I agree that it makes sense to keep this file (and at least one which is covered by the sendmail knob), but the design of "delete-old" is to remove everything which is not installed anymore (= the file has to be deleted if MK_BIND is equal to "no"). If the script is installed during installworld (= I haven't read the Makefile correctly), the script is not allowed to be deleted (and the above piece of the patch is wrong = pointyhat to me). If the script is not installed during installworld, the above patch is 100% correct and the delete-old is working as designed. If you do not want to have it deleted by delete-old, do not exclude it during installworld (you have my vote for this) and remove its entry from OptionalObsoleteFiles.inc. Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 Postmen never die, they just lose their zip. From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 10:57:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 10D7E1065674; Thu, 7 Oct 2010 10:57:17 +0000 (UTC) Date: Thu, 7 Oct 2010 10:57:17 +0000 From: Alexander Best To: Doug Ambrisko Message-ID: <20101007105717.GA21488@freebsd.org> References: <201010061836.o96Iaosw013943@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: <201010061836.o96Iaosw013943@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213489 - in head/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 10:57:17 -0000 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline minor CR/LF issue in if_bcereg.h. ;) cheers. alex -- a13x --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="if_bcereg.h.diff" diff --git a/sys/dev/bce/if_bcereg.h b/sys/dev/bce/if_bcereg.h index cedb6b1..178c72d 100644 --- a/sys/dev/bce/if_bcereg.h +++ b/sys/dev/bce/if_bcereg.h @@ -1965,7 +1965,7 @@ struct l2_fhdr { #define BCE_MISC_ENABLE_CLR_BITS_UMP_ENABLE (1L<<27) #define BCE_MISC_ENABLE_CLR_BITS_RV2P_CMD_SCHEDULER_ENABLE (1L<<28) #define BCE_MISC_ENABLE_CLR_BITS_RSVD_FUTURE_ENABLE (0x7L<<29) - + #define BCE_MISC_ENABLE_CLR_DEFAULT 0x17ffffff #define BCE_MISC_CLOCK_CONTROL_BITS 0x00000818 --pf9I7BMVVzbSWLtt-- From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 12:20:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F948106566B; Thu, 7 Oct 2010 12:20:50 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DE8B8FC08; Thu, 7 Oct 2010 12:20: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 o97CKoAJ040660; Thu, 7 Oct 2010 12:20:50 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97CKo0U040658; Thu, 7 Oct 2010 12:20:50 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010071220.o97CKo0U040658@svn.freebsd.org> From: David Xu Date: Thu, 7 Oct 2010 12:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213511 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 12:20:50 -0000 Author: davidxu Date: Thu Oct 7 12:20:50 2010 New Revision: 213511 URL: http://svn.freebsd.org/changeset/base/213511 Log: MFC r213258: - kern_sched_rr_get_interval should return interval for thread 1 in target process. - eliminate a goto. Modified: stable/8/sys/kern/p1003_1b.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/p1003_1b.c ============================================================================== --- stable/8/sys/kern/p1003_1b.c Thu Oct 7 09:30:35 2010 (r213510) +++ stable/8/sys/kern/p1003_1b.c Thu Oct 7 12:20:50 2010 (r213511) @@ -219,10 +219,8 @@ sched_getscheduler(struct thread *td, st PROC_LOCK(targetp); } else { targetp = pfind(uap->pid); - if (targetp == NULL) { - e = ESRCH; - goto done2; - } + if (targetp == NULL) + return (ESRCH); targettd = FIRST_THREAD_IN_PROC(targetp); } @@ -233,7 +231,6 @@ sched_getscheduler(struct thread *td, st } PROC_UNLOCK(targetp); -done2: return (e); } @@ -293,13 +290,10 @@ kern_sched_rr_get_interval(struct thread targetp = td->td_proc; PROC_LOCK(targetp); } else { - targetp = td->td_proc; - PROC_LOCK(targetp); - targettd = thread_find(targetp, pid); - if (targettd == NULL) { - PROC_UNLOCK(targetp); + targetp = pfind(pid); + if (targetp == NULL) return (ESRCH); - } + targettd = FIRST_THREAD_IN_PROC(targetp); } e = p_cansee(td, targetp); From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 12:34:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 573301065670; Thu, 7 Oct 2010 12:34:55 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 463F48FC0C; Thu, 7 Oct 2010 12:34: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 o97CYtUI041085; Thu, 7 Oct 2010 12:34:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97CYt4G041082; Thu, 7 Oct 2010 12:34:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201010071234.o97CYt4G041082@svn.freebsd.org> From: Robert Watson Date: Thu, 7 Oct 2010 12:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213512 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 12:34:55 -0000 Author: rwatson Date: Thu Oct 7 12:34:54 2010 New Revision: 213512 URL: http://svn.freebsd.org/changeset/base/213512 Log: Add Jonathan Anderson as a src committer. Jon has been working on a number of things, not least Capsicum. I will be his mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Oct 7 12:20:50 2010 (r213511) +++ svnadmin/conf/access Thu Oct 7 12:34:54 2010 (r213512) @@ -119,6 +119,7 @@ jmallett jmg joerg freebsd-devel@uriah.heep.sax.de jon +jonathan julian kaiw kan Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Oct 7 12:20:50 2010 (r213511) +++ svnadmin/conf/mentors Thu Oct 7 12:34:54 2010 (r213512) @@ -21,6 +21,7 @@ eri mlaier Co-mentor: thompsa gabor delphij hselasky thompsa jinmei gnn +jonathan rwatson mm delphij nork imp pluknet avg Co-mentor: kib From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 12:57:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6460C1065693; Thu, 7 Oct 2010 12:57:16 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52BC78FC0C; Thu, 7 Oct 2010 12:57: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 o97CvG9N041740; Thu, 7 Oct 2010 12:57:16 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97CvGeb041738; Thu, 7 Oct 2010 12:57:16 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010071257.o97CvGeb041738@svn.freebsd.org> From: David Xu Date: Thu, 7 Oct 2010 12:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213513 - stable/7/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 12:57:16 -0000 Author: davidxu Date: Thu Oct 7 12:57:16 2010 New Revision: 213513 URL: http://svn.freebsd.org/changeset/base/213513 Log: MFC r211833: Decrease rdlock count only when thread unlocked a reader lock. Modified: stable/7/lib/libthr/thread/thr_rtld.c Directory Properties: stable/7/lib/libthr/ (props changed) Modified: stable/7/lib/libthr/thread/thr_rtld.c ============================================================================== --- stable/7/lib/libthr/thread/thr_rtld.c Thu Oct 7 12:34:54 2010 (r213512) +++ stable/7/lib/libthr/thread/thr_rtld.c Thu Oct 7 12:57:16 2010 (r213513) @@ -151,8 +151,8 @@ _thr_rtld_lock_release(void *lock) state = l->lock.rw_state; if (_thr_rwlock_unlock(&l->lock) == 0) { - curthread->rdlock_count--; if ((state & URWLOCK_WRITE_OWNER) == 0) { + curthread->rdlock_count--; THR_CRITICAL_LEAVE(curthread); } else { _thr_signal_unblock(curthread); From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 12:58:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 601A210656A3; Thu, 7 Oct 2010 12:58:10 +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 344168FC14; Thu, 7 Oct 2010 12:58: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 o97CwAj3041799; Thu, 7 Oct 2010 12:58:10 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97CwA3x041797; Thu, 7 Oct 2010 12:58:10 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201010071258.o97CwA3x041797@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 7 Oct 2010 12:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213514 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 12:58:10 -0000 Author: pluknet Date: Thu Oct 7 12:58:09 2010 New Revision: 213514 URL: http://svn.freebsd.org/changeset/base/213514 Log: Cosmetic change: Wrap lines for SiS and Promise entries to 80 columns. This doesn't change appearance in page rendered with troff or man.cgi. PR: docs/146195 Approved by: kib (mentor) MFC after: 1 week Modified: head/share/man/man4/ata.4 Modified: head/share/man/man4/ata.4 ============================================================================== --- head/share/man/man4/ata.4 Thu Oct 7 12:57:16 2010 (r213513) +++ head/share/man/man4/ata.4 Thu Oct 7 12:58:09 2010 (r213514) @@ -167,13 +167,19 @@ NC3000, NC5000. nForce, nForce2, nForce2 MCP, nForce3, nForce3 MCP, nForce3 Pro, nForce4, MCP51, MCP55, MCP61, MCP65, MCP67, MCP73, MCP77, MCP79, MCP89. .It Promise: -PDC20246, PDC20262, PDC20263, PDC20265, PDC20267, PDC20268, PDC20269, PDC20270, PDC20271, PDC20275, PDC20276, PDC20277, PDC20318, PDC20319, PDC20371, PDC20375, PDC20376, PDC20377, PDC20378, PDC20379, PDC20571, PDC20575, PDC20579, PDC20580, PDC20617, PDC20618, PDC20619, PDC20620, PDC20621, PDC20622, PDC40518, PDC40519, PDC40718, PDC40719. +PDC20246, PDC20262, PDC20263, PDC20265, PDC20267, PDC20268, PDC20269, PDC20270, +PDC20271, PDC20275, PDC20276, PDC20277, PDC20318, PDC20319, PDC20371, PDC20375, +PDC20376, PDC20377, PDC20378, PDC20379, PDC20571, PDC20575, PDC20579, PDC20580, +PDC20617, PDC20618, PDC20619, PDC20620, PDC20621, PDC20622, PDC40518, PDC40519, +PDC40718, PDC40719. .It ServerWorks: HT1000, ROSB4, CSB5, CSB6, K2, Frodo4, Frodo8. .It Silicon Image: SiI0680, SiI3112, SiI3114, SiI3124, SiI3132, SiI3512. .It SiS: -SIS180, SIS181, SIS182, SIS5513, SIS530, SIS540, SIS550, SIS620, SIS630, SIS630S, SIS633, SIS635, SIS730, SIS733, SIS735, SIS745, SIS961, SIS962, SIS963, SIS964, SIS965. +SIS180, SIS181, SIS182, SIS5513, SIS530, SIS540, SIS550, SIS620, SIS630, +SIS630S, SIS633, SIS635, SIS730, SIS733, SIS735, SIS745, SIS961, SIS962, +SIS963, SIS964, SIS965. .It VIA: VT6410, VT6420, VT6421, VT82C586, VT82C586B, VT82C596, VT82C596B, VT82C686, VT82C686A, VT82C686B, VT8231, VT8233, VT8233A, VT8233C, VT8235, VT8237, From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 13:13:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DFD0106564A; Thu, 7 Oct 2010 13:13:02 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5148FC0C; Thu, 7 Oct 2010 13:13: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 o97DD27X042126; Thu, 7 Oct 2010 13:13:02 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97DD2vD042123; Thu, 7 Oct 2010 13:13:02 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010071313.o97DD2vD042123@svn.freebsd.org> From: David Xu Date: Thu, 7 Oct 2010 13:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213515 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 13:13:02 -0000 Author: davidxu Date: Thu Oct 7 13:13:02 2010 New Revision: 213515 URL: http://svn.freebsd.org/changeset/base/213515 Log: MFC r213258: - kern_sched_rr_get_interval should return interval for thread 1 in target process. - eliminate a goto. Modified: stable/7/sys/kern/p1003_1b.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/p1003_1b.c ============================================================================== --- stable/7/sys/kern/p1003_1b.c Thu Oct 7 12:58:09 2010 (r213514) +++ stable/7/sys/kern/p1003_1b.c Thu Oct 7 13:13:02 2010 (r213515) @@ -219,10 +219,8 @@ sched_getscheduler(struct thread *td, st PROC_LOCK(targetp); } else { targetp = pfind(uap->pid); - if (targetp == NULL) { - e = ESRCH; - goto done2; - } + if (targetp == NULL) + return (ESRCH); targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */ } @@ -233,7 +231,6 @@ sched_getscheduler(struct thread *td, st } PROC_UNLOCK(targetp); -done2: return (e); } @@ -293,13 +290,10 @@ kern_sched_rr_get_interval(struct thread targetp = td->td_proc; PROC_LOCK(targetp); } else { - targetp = td->td_proc; - PROC_LOCK(targetp); - targettd = thread_find(targetp, pid); - if (targettd == NULL) { - PROC_UNLOCK(targetp); + targetp = pfind(pid); + if (targetp == NULL) return (ESRCH); - } + targettd = FIRST_THREAD_IN_PROC(targetp); } e = p_cansee(td, targetp); From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 16:32:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D198B106564A; Thu, 7 Oct 2010 16:32:35 +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 BC3468FC0A; Thu, 7 Oct 2010 16:32: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 o97GWZWP046486; Thu, 7 Oct 2010 16:32:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97GWZRU046480; Thu, 7 Oct 2010 16:32:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010071632.o97GWZRU046480@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Oct 2010 16:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213518 - in vendor/llvm/dist: . autoconf docs include/llvm/ADT lib/CodeGen lib/Target/ARM lib/Target/X86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 16:32:35 -0000 Author: dim Date: Thu Oct 7 16:32:35 2010 New Revision: 213518 URL: http://svn.freebsd.org/changeset/base/213518 Log: Vendor import of llvm 2.8 release: http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_28@115866 Approved by: rpaulo (mentor) Modified: vendor/llvm/dist/Makefile.rules vendor/llvm/dist/autoconf/configure.ac vendor/llvm/dist/configure vendor/llvm/dist/docs/ReleaseNotes.html vendor/llvm/dist/include/llvm/ADT/SmallVector.h vendor/llvm/dist/lib/CodeGen/MachineCSE.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp Modified: vendor/llvm/dist/Makefile.rules ============================================================================== --- vendor/llvm/dist/Makefile.rules Thu Oct 7 15:17:16 2010 (r213517) +++ vendor/llvm/dist/Makefile.rules Thu Oct 7 16:32:35 2010 (r213518) @@ -941,6 +941,11 @@ ifdef EXPORTED_SYMBOL_FILE # First, set up the native export file, which may differ from the source # export file. +# The option --version-script is not effective on GNU ld win32. +ifneq (,$(filter $(HOST_OS),Cygwin MingW)) + HAVE_LINK_VERSION_SCRIPT := 0 +endif + ifeq ($(HOST_OS),Darwin) # Darwin convention prefixes symbols with underscores. NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed Modified: vendor/llvm/dist/autoconf/configure.ac ============================================================================== --- vendor/llvm/dist/autoconf/configure.ac Thu Oct 7 15:17:16 2010 (r213517) +++ vendor/llvm/dist/autoconf/configure.ac Thu Oct 7 16:32:35 2010 (r213518) @@ -31,7 +31,7 @@ dnl=== dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([[llvm]],[[2.8rc]],[llvmbugs@cs.uiuc.edu]) +AC_INIT([[llvm]],[[2.8]],[llvmbugs@cs.uiuc.edu]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. Modified: vendor/llvm/dist/configure ============================================================================== --- vendor/llvm/dist/configure Thu Oct 7 15:17:16 2010 (r213517) +++ vendor/llvm/dist/configure Thu Oct 7 16:32:35 2010 (r213518) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for llvm 2.8rc. +# Generated by GNU Autoconf 2.60 for llvm 2.8. # # Report bugs to . # @@ -561,8 +561,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='llvm' PACKAGE_TARNAME='-llvm-' -PACKAGE_VERSION='2.8rc' -PACKAGE_STRING='llvm 2.8rc' +PACKAGE_VERSION='2.8' +PACKAGE_STRING='llvm 2.8' PACKAGE_BUGREPORT='llvmbugs@cs.uiuc.edu' ac_unique_file="lib/VMCore/Module.cpp" @@ -1318,7 +1318,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures llvm 2.8rc to adapt to many kinds of systems. +\`configure' configures llvm 2.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1384,7 +1384,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of llvm 2.8rc:";; + short | recursive ) echo "Configuration of llvm 2.8:";; esac cat <<\_ACEOF @@ -1394,7 +1394,7 @@ Optional Features: --enable-optimized Compile with optimizations enabled (default is NO) --enable-profiling Compile with profiling enabled (default is NO) --enable-assertions Compile with assertion checks enabled (default is - YES) + NO) --enable-expensive-checks Compile with expensive debug checks enabled (default is NO) @@ -1533,7 +1533,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -llvm configure 2.8rc +llvm configure 2.8 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1549,7 +1549,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by llvm $as_me 2.8rc, which was +It was created by llvm $as_me 2.8, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -21045,7 +21045,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by llvm $as_me 2.8rc, which was +This file was extended by llvm $as_me 2.8, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21098,7 +21098,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -llvm config.status 2.8rc +llvm config.status 2.8 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: vendor/llvm/dist/docs/ReleaseNotes.html ============================================================================== --- vendor/llvm/dist/docs/ReleaseNotes.html Thu Oct 7 15:17:16 2010 (r213517) +++ vendor/llvm/dist/docs/ReleaseNotes.html Thu Oct 7 16:32:35 2010 (r213518) @@ -3,6 +3,7 @@ + LLVM 2.8 Release Notes @@ -19,7 +20,6 @@
  • External Projects Using LLVM 2.8
  • What's New in LLVM 2.8?
  • Installation Instructions
  • -
  • Portability and Supported Platforms
  • Known Problems
  • Additional Information
  • @@ -28,11 +28,13 @@

    Written by the LLVM Team

    +
    @@ -66,23 +68,20 @@ current one. To see the release notes f Almost dead code. include/llvm/Analysis/LiveValues.h => Dan lib/Transforms/IPO/MergeFunctions.cpp => consider for 2.8. - llvm/Analysis/PointerTracking.h => Edwin wants this, consider for 2.8. GEPSplitterPass --> - - - + + +
    @@ -115,13 +114,32 @@ through expressive diagnostics, a high l standards, fast compilation, and low memory use. Like LLVM, Clang provides a modular, library-based architecture that makes it suitable for creating or integrating with other development tools. Clang is considered a -production-quality compiler for C and Objective-C on x86 (32- and 64-bit).

    +production-quality compiler for C, Objective-C, C++ and Objective-C++ on x86 +(32- and 64-bit), and for darwin-arm targets.

    In the LLVM 2.8 time-frame, the Clang team has made many improvements:

    -
      - -
    +
      +
    • Clang C++ is now feature-complete with respect to the ISO C++ 1998 and 2003 standards.
    • +
    • Added support for Objective-C++.
    • +
    • Clang now uses LLVM-MC to directly generate object code and to parse inline assembly (on Darwin).
    • +
    • Introduced many new warnings, including -Wmissing-field-initializers, -Wshadow, -Wno-protocol, -Wtautological-compare, -Wstrict-selector-match, -Wcast-align, -Wunused improvements, and greatly improved format-string checking.
    • +
    • Introduced the "libclang" library, a C interface to Clang intended to support IDE clients.
    • +
    • Added support for #pragma GCC visibility, #pragma align, and others.
    • +
    • Added support for SSE, ARM NEON, and Altivec.
    • +
    • Improved support for many Microsoft extensions.
    • +
    • Implemented support for blocks in C++.
    • +
    • Implemented precompiled headers for C++.
    • +
    • Improved abstract syntax trees to retain more accurate source information.
    • +
    • Added driver support for handling LLVM IR and bitcode files directly.
    • +
    • Major improvements to compiler correctness for exception handling.
    • +
    • Improved generated code quality in some areas: +
        +
      • Good code generation for X86-32 and X86-64 ABI handling.
      • +
      • Improved code generation for bit-fields, although important work remains.
      • +
      +
    • +
    @@ -138,27 +156,64 @@ production-quality compiler for C and Ob future!). The tool is very good at finding bugs that occur on specific paths through code, such as on error conditions.

    -

    In the LLVM 2.8 time-frame, +

    The LLVM 2.8 release fixes a number of bugs and slightly improves precision + over 2.7, but there are no major new features in the release.

    -The VMKit project is an implementation of -a JVM and a CLI Virtual Machine (Microsoft .NET is an -implementation of the CLI) using LLVM for static and just-in-time -compilation.

    +DragonEgg is a port of llvm-gcc to +gcc-4.5. Unlike llvm-gcc, dragonegg in theory does not require any gcc-4.5 +modifications whatsoever (currently one small patch is needed) thanks to the +new gcc plugin architecture. +DragonEgg is a gcc plugin that makes gcc-4.5 use the LLVM optimizers and code +generators instead of gcc's, just like with llvm-gcc. +

    -

    With the release of LLVM 2.8, ...

    +

    +DragonEgg is still a work in progress, but it is able to compile a lot of code, +for example all of gcc, LLVM and clang. Currently Ada, C, C++ and Fortran work +well, while all other languages either don't work at all or only work poorly. +For the moment only the x86-32 and x86-64 targets are supported, and only on +linux and darwin (darwin may need additional gcc patches). +

    + +

    +The 2.8 release has the following notable changes: +

      +
    • The plugin loads faster due to exporting fewer symbols.
    • +
    • Additional vector operations such as addps256 are now supported.
    • +
    • Ada global variables with no initial value are no longer zero initialized, +resulting in better optimization.
    • +
    • The '-fplugin-arg-dragonegg-enable-gcc-optzns' flag now runs all gcc +optimizers, rather than just a handful.
    • +
    • Fortran programs using common variables now link correctly.
    • +
    • GNU OMP constructs no longer crash the compiler.
    • +
    + + + +
    +

    +The VMKit project is an implementation of +a Java Virtual Machine (Java VM or JVM) that uses LLVM for static and +just-in-time compilation. As of LLVM 2.8, VMKit now supports copying garbage +collectors, and can be configured to use MMTk's copy mark-sweep garbage +collector. In LLVM 2.8, the VMKit .NET VM is no longer being maintained. +

    +
    @@ -178,67 +233,91 @@ libgcc routines).

    All of the code in the compiler-rt project is available under the standard LLVM -License, a "BSD-style" license. New in LLVM 2.8: - -Soft float support -

    +License, a "BSD-style" license. New in LLVM 2.8, compiler_rt now supports +soft floating point (for targets that don't have a real floating point unit), +and includes an extensive testsuite for the "blocks" language feature and the +blocks runtime included in compiler_rt.

    -DragonEgg is a port of llvm-gcc to -gcc-4.5. Unlike llvm-gcc, which makes many intrusive changes to the underlying -gcc-4.2 code, dragonegg in theory does not require any gcc-4.5 modifications -whatsoever (currently one small patch is needed). This is thanks to the new -gcc plugin architecture, which -makes it possible to modify the behaviour of gcc at runtime by loading a plugin, -which is nothing more than a dynamic library which conforms to the gcc plugin -interface. DragonEgg is a gcc plugin that causes the LLVM optimizers to be run -instead of the gcc optimizers, and the LLVM code generators instead of the gcc -code generators, just like llvm-gcc. To use it, you add -"-fplugin=path/dragonegg.so" to the gcc-4.5 command line, and gcc-4.5 magically -becomes llvm-gcc-4.5! -

    +LLDB is a brand new member of the LLVM +umbrella of projects. LLDB is a next generation, high-performance debugger. It +is built as a set of reusable components which highly leverage existing +libraries in the larger LLVM Project, such as the Clang expression parser, the +LLVM disassembler and the LLVM JIT.

    -DragonEgg is still a work in progress. Currently C works very well, while C++, -Ada and Fortran work fairly well. All other languages either don't work at all, -or only work poorly. For the moment only the x86-32 and x86-64 targets are -supported, and only on linux and darwin (darwin needs an additional gcc patch). +LLDB is in early development and not included as part of the LLVM 2.8 release, +but is mature enough to support basic debugging scenarios on Mac OS X in C, +Objective-C and C++. We'd really like help extending and expanding LLDB to +support new platforms, new languages, new architectures, and new features.

    +
    + + + + +

    -2.8 status here. +libc++ is another new member of the LLVM +family. It is an implementation of the C++ standard library, written from the +ground up to specifically target the forthcoming C++'0X standard and focus on +delivering great performance.

    + +

    +As of the LLVM 2.8 release, libc++ is virtually feature complete, but would +benefit from more testing and better integration with Clang++. It is also +looking forward to the C++ committee finalizing the C++'0x standard.

    +

    -The LLVM Machine Code (aka MC) sub-project of LLVM was created to solve a number -of problems in the realm of assembly, disassembly, object file format handling, -and a number of other related areas that CPU instruction-set level tools work -in. It is a sub-project of LLVM which provides it with a number of advantages -over other compilers that do not have tightly integrated assembly-level tools. -For a gentle introduction, please see the Intro to the -LLVM MC Project Blog Post. +KLEE is a symbolic execution framework for +programs in LLVM bitcode form. KLEE tries to symbolically evaluate "all" paths +through the application and records state transitions that lead to fault +states. This allows it to construct testcases that lead to faults and can even +be used to verify some algorithms.

    -

    2.8 status here

    -
    +

    Although KLEE does not have any major new features as of 2.8, we have made +various minor improvements, particular to ease development:

    +
      +
    • Added support for LLVM 2.8. KLEE currently maintains compatibility with + LLVM 2.6, 2.7, and 2.8.
    • +
    • Added a buildbot for 2.6, 2.7, and trunk. A 2.8 buildbot will be coming + soon following release.
    • +
    • Fixed many C++ code issues to allow building with Clang++. Mostly + complete, except for the version of MiniSAT which is inside the KLEE STP + version.
    • +
    • Improved support for building with separate source and build + directories.
    • +
    • Added support for "long double" on x86.
    • +
    • Initial work on KLEE support for using 'lit' test runner instead of + DejaGNU.
    • +
    • Added configure support for using an external version of + STP.
    • +
    + + @@ -254,231 +333,605 @@ LLVM MC Project Blog Post. projects that have already been updated to work with LLVM 2.8.

    + + + +
    +

    +TCE is a toolset for designing +application-specific processors (ASP) based on the Transport triggered +architecture (TTA). The toolset provides a complete co-design flow from C/C++ +programs down to synthesizable VHDL and parallel program binaries. Processor +customization points include the register files, function units, supported +operations, and the interconnection network.

    + +

    TCE uses llvm-gcc/Clang and LLVM for C/C++ language support, target +independent optimizations and also for parts of code generation. It generates +new LLVM-based code generators "on the fly" for the designed TTA processors and +loads them in to the compiler backend as runtime libraries to avoid per-target +recompilation of larger parts of the compiler chain.

    - - - + + +
    +

    +Horizon is a bytecode +language and compiler written on top of LLVM, intended for producing +single-address-space managed code operating systems that +run faster than the equivalent multiple-address-space C systems. +More in-depth blurb is available on the wiki.

    -

    This release includes a huge number of bug fixes, performance tweaks and -minor improvements. Some of the major improvements and new features are listed -in this section. +

    + + + + +
    +

    +Clam AntiVirus is an open source (GPL) +anti-virus toolkit for UNIX, designed especially for e-mail scanning on mail +gateways. Since version 0.96 it has bytecode +signatures that allow writing detections for complex malware. It +uses LLVM's JIT to speed up the execution of bytecode on +X86, X86-64, PPC32/64, falling back to its own interpreter otherwise. +The git version was updated to work with LLVM 2.8.

    +

    The +ClamAV bytecode compiler uses Clang and LLVM to compile a C-like +language, insert runtime checks, and generate ClamAV bytecode.

    +
    +

    +Pure +is an algebraic/functional +programming language based on term rewriting. Programs are collections +of equations which are used to evaluate expressions in a symbolic +fashion. Pure offers dynamic typing, eager and lazy evaluation, lexical +closures, a hygienic macro system (also based on term rewriting), +built-in list and matrix support (including list and matrix +comprehensions) and an easy-to-use C interface. The interpreter uses +LLVM as a backend to JIT-compile Pure programs to fast native code.

    -

    In addition to changes to the code, between LLVM 2.7 and 2.8, a number of -organization changes have happened: -

    +

    Pure versions 0.44 and later have been tested and are known to work with +LLVM 2.8 (and continue to work with older LLVM releases >= 2.5).

    -
      -
    +

    +GHC is an open source, +state-of-the-art programming suite for +Haskell, a standard lazy functional programming language. It includes +an optimizing static compiler generating good code for a variety of +platforms, together with an interactive system for convenient, quick +development.

    + +

    In addition to the existing C and native code generators, GHC 7.0 now +supports an LLVM +code generator. GHC supports LLVM 2.7 and later.

    -

    LLVM 2.8 includes several major new capabilities:

    +
    -
      -
    • .
    • -
    + + + +
    +

    +Clay is a new systems programming +language that is specifically designed for generic programming. It makes +generic programming very concise thanks to whole program type propagation. It +uses LLVM as its backend.

    -

    LLVM IR has several new features for better support of new targets and that -expose new optimization opportunities:

    +

    +llvm-py has been updated to work +with LLVM 2.8. llvm-py provides Python bindings for LLVM, allowing you to write a +compiler backend or a VM in Python.

    -
      +
    -
  • LLVM 2.8 changes the internal order of operands in InvokeInst - and CallInst. - To be portable across releases, resort to CallSite and the - high-level accessors, such as getCalledValue and setUnwindDest. -
  • -
  • - You can no longer pass use_iterators directly to cast<> (and similar), because - these routines tend to perform costly dereference operations more than once. You - have to dereference the iterators yourself and pass them in. -
  • -
  • - llvm.memcpy.*, llvm.memset.*, llvm.memmove.* (and possibly other?) intrinsics - take an extra parameter now (i1 isVolatile), totaling 5 parameters. - If you were creating these intrinsic calls and prototypes yourself (as opposed - to using Intrinsic::getDeclaration), you can use UpgradeIntrinsicFunction/UpgradeIntrinsicCall - to be portable accross releases. - Note that you cannot use Intrinsic::getDeclaration() in a backwards compatible - way (needs 2/3 types now, in 2.7 it needed just 1). -
  • -
  • - SetCurrentDebugLocation takes a DebugLoc now instead of a MDNode. - Change your code to use - SetCurrentDebugLocation(DebugLoc::getFromDILocation(...)). -
  • -
  • - VISIBILITY_HIDDEN is gone. -
  • -
  • - The RegisterPass and RegisterAnalysisGroup templates are - considered deprecated, but continue to function in LLVM 2.8. Clients are - strongly advised to use the upcoming INITIALIZE_PASS() and - INITIALIZE_AG_PASS() macros instead. -
  • - SMDiagnostic takes different parameters now. //FIXME: how to upgrade? -
  • -
  • - The constructor for the Triple class no longer tries to understand odd triple - specifications. Frontends should ensure that they only pass valid triples to - LLVM. The Triple::normalize utility method has been added to help front-ends - deal with funky triples. -
  • - Some APIs got renamed: -
      -
    • llvm_report_error -> report_fatal_error
    • -
    • llvm_install_error_handler -> install_fatal_error_handler
    • -
    • llvm::DwarfExceptionHandling -> llvm::JITExceptionHandling
    • -
    -
  • - + + + + +
    +

    +FAUST is a compiled language for real-time +audio signal processing. The name FAUST stands for Functional AUdio STream. Its +programming model combines two approaches: functional programming and block +diagram composition. In addition with the C, C++, JAVA output formats, the +Faust compiler can now generate LLVM bitcode, and works with LLVM 2.7 and +2.8.

    +

    Jade +(Just-in-time Adaptive Decoder Engine) is a generic video decoder engine using +LLVM for just-in-time compilation of video decoder configurations. Those +configurations are designed by MPEG Reconfigurable Video Coding (RVC) committee. +MPEG RVC standard is built on a stream-based dataflow representation of +decoders. It is composed of a standard library of coding tools written in +RVC-CAL language and a dataflow configuration — block diagram — +of a decoder.

    + +

    Jade project is hosted as part of the Open +RVC-CAL Compiler and requires it to translate the RVC-CAL standard library +of video coding tools into an LLVM assembly code.

    -

    In addition to a large array of minor performance tweaks and bug fixes, this -release includes a few major enhancements and additions to the optimizers:

    +
    -
      + + -
    • +
      +

      Neko LLVM JIT +replaces the standard Neko JIT with an LLVM-based implementation. While not +fully complete, it is already providing a 1.5x speedup on 64-bit systems. +Neko LLVM JIT requires LLVM 2.8 or later.

      -
    +
    + + +
    +

    +Crack aims to provide +the ease of development of a scripting language with the performance of a +compiled language. The language derives concepts from C++, Java and Python, +incorporating object-oriented programming, operator overloading and strong +typing. Crack 0.2 works with LLVM 2.7, and the forthcoming Crack 0.2.1 release +builds on LLVM 2.8.

    + +
    +

    +DTMC provides support for +Transactional Memory, which is an easy-to-use and efficient way to synchronize +accesses to shared memory. Transactions can contain normal C/C++ code (e.g., +__transaction { list.remove(x); x.refCount--; }) and will be executed +virtually atomically and isolated from other transactions.

    -
      -
    • +
    - + + + +
    +

    +Kai (Japanese 会 for +meeting/gathering) is an experimental interpreter that provides a highly +extensible runtime environment and explicit control over the compilation +process. Programs are defined using nested symbolic expressions, which are all +parsed into first-class values with minimal intrinsic semantics. Kai can +generate optimised code at run-time (using LLVM) in order to exploit the nature +of the underlying hardware and to integrate with external software libraries. +It is a unique exploration into world of dynamic code compilation, and the +interaction between high level and low level semantics.

    +

    +OSL is a shading +language designed for use in physically based renderers and in particular +production rendering. By using LLVM instead of the interpreter, it was able to +meet its performance goals (>= C-code) while retaining the benefits of +runtime specialization and a portable high-level language. +

    -

    We have put a significant amount of work into the code generator -infrastructure, which allows us to implement more aggressive algorithms and make -it run faster:

    +
    + + + + + + + +
    + +

    This release includes a huge number of bug fixes, performance tweaks and +minor improvements. Some of the major improvements and new features are listed +in this section. +

    -
      -
    • MachO writer works.
    • -
    -

    New features of the X86 target include: -

    -
      -
    • The X86 backend now supports holding X87 floating point stack values - in registers across basic blocks, dramatically improving performance of code - that uses long double, and when targetting CPUs that don't support SSE.
    • +

      LLVM 2.8 includes several major new capabilities:

      +
        +
      • As mentioned above, libc++ and LLDB are major new additions to the LLVM collective.
      • +
      • LLVM 2.8 now has pretty decent support for debugging optimized code. You + should be able to reliably get debug info for function arguments, assuming + that the value is actually available where you have stopped.
      • +
      • A new 'llvm-diff' tool is available that does a semantic diff of .ll + files.
      • +
      • The MC subproject has made major progress in this release. + Direct .o file writing support for darwin/x86[-64] is now reliable and + support for other targets and object file formats are in progress.
    -

    New features of the ARM target include: -

    +

    LLVM IR has several new features for better support of new targets and that +expose new optimization opportunities:

      +
    • The memcpy, memmove, and memset + intrinsics now take address space qualified pointers and a bit to indicate + whether the transfer is "volatile" or not. +
    • +
    • Per-instruction debug info metadata is much faster and uses less memory by + using the new DebugLoc class.
    • +
    • LLVM IR now has a more formalized concept of "trap values", which allow the optimizer + to optimize more aggressively in the presence of undefined behavior, while + still producing predictable results.
    • +
    • LLVM IR now supports two new linkage + types (linker_private_weak and linker_private_weak_def_auto) which map + onto some obscure MachO concepts.
    • +
    -
  • +
    + + + + +
    + +

    In addition to a large array of minor performance tweaks and bug fixes, this +release includes a few major enhancements and additions to the optimizers:

    +
      +
    • As mentioned above, the optimizer now has support for updating debug + information as it goes. A key aspect of this is the new llvm.dbg.value + intrinsic. This intrinsic represents debug info for variables that are + promoted to SSA values (typically by mem2reg or the -scalarrepl passes).
    • + +
    • The JumpThreading pass is now much more aggressive about implied value + relations, allowing it to thread conditions like "a == 4" when a is known to + be 13 in one of the predecessors of a block. It does this in conjunction + with the new LazyValueInfo analysis pass.
    • +
    • The new RegionInfo analysis pass identifies single-entry single-exit regions + in the CFG. You can play with it with the "opt -regions analyze" or + "opt -view-regions" commands.
    • +
    • The loop optimizer has significantly improved strength reduction and analysis + capabilities. Notably it is able to build on the trap value and signed + integer overflow information to optimize <= and >= loops.
    • +
    • The CallGraphSCCPassManager now has some basic support for iterating within + an SCC when a optimizer devirtualizes a function call. This allows inlining + through indirect call sites that are devirtualized by store-load forwarding + and other optimizations.
    • +
    • The new -loweratomic pass is available + to lower atomic instructions into their non-atomic form. This can be useful + to optimize generic code that expects to run in a single-threaded + environment.
    +
    +

    +The LLVM Machine Code (aka MC) subsystem was created to solve a number +of problems in the realm of assembly, disassembly, object file format handling, +and a number of other related areas that CPU instruction-set level tools work +in.

    + +

    The MC subproject has made great leaps in LLVM 2.8. For example, support for + directly writing .o files from LLC (and clang) now works reliably for + darwin/x86[-64] (including inline assembly support) and the integrated + assembler is turned on by default in Clang for these targets. This provides + improved compile times among other things.

    + +
      +
    • The entire compiler has converted over to using the MCStreamer assembler API + instead of writing out a .s file textually.
    • +
    • The "assembler parser" is far more mature than in 2.7, supporting a full + complement of directives, now supports assembler macros, etc.
    • +
    • The "assembler backend" has been completed, including support for relaxation + relocation processing and all the other things that an assembler does.
    • +
    • The MachO file format support is now fully functional and works.
    • +
    • The MC disassembler now fully supports ARM and Thumb. ARM assembler support + is still in early development though.
    • +
    • The X86 MC assembler now supports the X86 AES and AVX instruction set.
    • +
    • Work on ELF and COFF object files and ARM target support is well underway, + but isn't useful yet in LLVM 2.8. Please contact the llvmdev mailing list + if you're interested in this.
    • +
    -

    This release includes a number of new APIs that are used internally, which - may also be useful for external clients. +

    For more information, please see the Intro to the +LLVM MC Project Blog Post.

    +
    + + + + + +
    + +

    We have put a significant amount of work into the code generator +infrastructure, which allows us to implement more aggressive algorithms and make +it run faster:

    +
      -
    • +
    • The clang/gcc -momit-leaf-frame-pointer argument is now supported.
    • +
    • The clang/gcc -ffunction-sections and -fdata-sections arguments are now + supported on ELF targets (like GCC).
    • +
    • The MachineCSE pass is now tuned and on by default. It eliminates common + subexpressions that are exposed when lowering to machine instructions.
    • +
    • The "local" register allocator was replaced by a new "fast" register + allocator. This new allocator (which is often used at -O0) is substantially + faster and produces better code than the old local register allocator.
    • +
    • A new LLC "-regalloc=default" option is available, which automatically + chooses a register allocator based on the -O optimization level.
    • +
    • The common code generator code was modified to promote illegal argument and + return value vectors to wider ones when possible instead of scalarizing + them. For example, <3 x float> will now pass in one SSE register + instead of 3 on X86. This generates substantially better code since the + rest of the code generator was already expecting this.
    • +
    • The code generator uses a new "COPY" machine instruction. This speeds up + the code generator and eliminates the need for targets to implement the + isMoveInstr hook. Also, the copyRegToReg hook was renamed to copyPhysReg + and simplified.
    • +
    • The code generator now has a "LocalStackSlotPass", which optimizes stack + slot access for targets (like ARM) that have limited stack displacement + addressing.
    • +
    • A new "PeepholeOptimizer" is available, which eliminates sign and zero + extends, and optimizes away compare instructions when the condition result + is available from a previous instruction.
    • +
    • Atomic operations now get legalized into simpler atomic operations if not + natively supported, easing the implementation burden on targets.
    • +
    • We have added two new bottom-up pre-allocation register pressure aware schedulers: +
        +
      1. The hybrid scheduler schedules aggressively to minimize schedule length when registers are available and avoid overscheduling in high pressure situations.
      2. +
      3. The instruction-level-parallelism scheduler schedules for maximum ILP when registers are available and avoid overscheduling in high pressure situations.
      4. +
    • +
    • The tblgen type inference algorithm was rewritten to be more consistent and + diagnose more target bugs. If you have an out-of-tree backend, you may + find that it finds bugs in your target description. This support also + allows limited support for writing patterns for instructions that return + multiple results (e.g. a virtual register and a flag result). The + 'parallel' modifier in tblgen was removed, you should use the new support + for multiple results instead.
    • +
    • A new (experimental) "-rendermf" pass is available which renders a + MachineFunction into HTML, showing live ranges and other useful + details.
    • +
    • The new SubRegIndex tablegen class allows subregisters to be indexed + symbolically instead of numerically. If your target uses subregisters you + will need to adapt to use SubRegIndex when you upgrade to 2.8.
    • + + +
    • The -fast-isel instruction selection path (used at -O0 on X86) was rewritten + to work bottom-up on basic blocks instead of top down. This makes it + slightly faster (because the MachineDCE pass is not needed any longer) and + allows it to generate better code in some cases.
    • +
    +
    + + + +
    +

    New features and major changes in the X86 target include: +

    + +
      +
    • The X86 backend now supports holding X87 floating point stack values + in registers across basic blocks, dramatically improving performance of code + that uses long double, and when targeting CPUs that don't support SSE.
    • + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 16:34:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A063106566C; Thu, 7 Oct 2010 16:34:13 +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 1D9C58FC13; Thu, 7 Oct 2010 16:34: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 o97GYDW5046569; Thu, 7 Oct 2010 16:34:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97GYDg3046568; Thu, 7 Oct 2010 16:34:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010071634.o97GYDg3046568@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Oct 2010 16:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213519 - vendor/llvm/llvm-2.8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 16:34:13 -0000 Author: dim Date: Thu Oct 7 16:34:12 2010 New Revision: 213519 URL: http://svn.freebsd.org/changeset/base/213519 Log: Tag llvm 2.8 release. Approved by: rpaulo (mentor) Added: vendor/llvm/llvm-2.8/ - copied from r213518, vendor/llvm/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 16:35:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72EE0106564A; Thu, 7 Oct 2010 16:35:05 +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 60A398FC08; Thu, 7 Oct 2010 16:35:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o97GZ5Cv046631; Thu, 7 Oct 2010 16:35:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97GZ5F6046629; Thu, 7 Oct 2010 16:35:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010071635.o97GZ5F6046629@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Oct 2010 16:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213520 - vendor/clang/dist/lib/Basic X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 16:35:05 -0000 Author: dim Date: Thu Oct 7 16:35:05 2010 New Revision: 213520 URL: http://svn.freebsd.org/changeset/base/213520 Log: Vendor import of clang 2.8 release: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_28@115870 Approved by: rpaulo (mentor) Modified: vendor/clang/dist/lib/Basic/Version.cpp Modified: vendor/clang/dist/lib/Basic/Version.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Version.cpp Thu Oct 7 16:34:12 2010 (r213519) +++ vendor/clang/dist/lib/Basic/Version.cpp Thu Oct 7 16:35:05 2010 (r213520) @@ -21,7 +21,7 @@ using namespace std; namespace clang { llvm::StringRef getClangRepositoryPath() { - static const char URL[] = "$URL: http://llvm.org/svn/llvm-project/cfe/branches/release_28/lib/Basic/Version.cpp $"; + static const char URL[] = "$URL: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_28/lib/Basic/Version.cpp $"; const char *URLEnd = URL + strlen(URL); const char *End = strstr(URL, "/lib/Basic"); From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 16:35:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA6C81065673; Thu, 7 Oct 2010 16:35:50 +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 AE7358FC2A; Thu, 7 Oct 2010 16:35: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 o97GZo37046679; Thu, 7 Oct 2010 16:35:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97GZo6N046678; Thu, 7 Oct 2010 16:35:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010071635.o97GZo6N046678@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Oct 2010 16:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213521 - vendor/clang/clang-2.8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 16:35:51 -0000 Author: dim Date: Thu Oct 7 16:35:50 2010 New Revision: 213521 URL: http://svn.freebsd.org/changeset/base/213521 Log: Tag clang 2.8 release. Approved by: rpaulo (mentor) Added: vendor/clang/clang-2.8/ - copied from r213520, vendor/clang/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 17:14:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18D811065673; Thu, 7 Oct 2010 17:14: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 06E238FC19; Thu, 7 Oct 2010 17:14: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 o97HEo6q047542; Thu, 7 Oct 2010 17:14:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97HEoX9047540; Thu, 7 Oct 2010 17:14:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010071714.o97HEoX9047540@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Oct 2010 17:14: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: r213522 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 17:14:51 -0000 Author: yongari Date: Thu Oct 7 17:14:50 2010 New Revision: 213522 URL: http://svn.freebsd.org/changeset/base/213522 Log: Fix a long standing bug which regarded some revisions of controller as 5788. This caused BGE_MISC_LOCAL_CTL register is used to generate link state change interrupt for non-5788 controllers. The interrupt handler may or may not detect link state attention as status block wouldn't be updated when an interrupt was generated with BGE_MISC_LOCAL_CTL register. All controllers except 5700 and 5788 should use host coalescing mode register to trigger an interrupt. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Oct 7 16:35:50 2010 (r213521) +++ head/sys/dev/bge/if_bge.c Thu Oct 7 17:14:50 2010 (r213522) @@ -2656,14 +2656,12 @@ bge_attach(device_t dev) if (BGE_IS_5755_PLUS(sc) == 0) sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; - /* - * We could possibly check for BCOM_DEVICEID_BCM5788 in bge_probe() - * but I do not know the DEVICEID for the 5788M. - */ - misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID; - if (misccfg == BGE_MISCCFG_BOARD_ID_5788 || - misccfg == BGE_MISCCFG_BOARD_ID_5788M) - sc->bge_flags |= BGE_FLAG_5788; + if (sc->bge_asicrev == BGE_ASICREV_BCM5705) { + misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID; + if (misccfg == BGE_MISCCFG_BOARD_ID_5788 || + misccfg == BGE_MISCCFG_BOARD_ID_5788M) + sc->bge_flags |= BGE_FLAG_5788; + } /* * Some controllers seem to require a special firmware to use From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 17:26:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9FA81065675; Thu, 7 Oct 2010 17:26:22 +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 715CE8FC18; Thu, 7 Oct 2010 17:26: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 o97HQMpi047801; Thu, 7 Oct 2010 17:26:22 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97HQMYa047799; Thu, 7 Oct 2010 17:26:22 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010071726.o97HQMYa047799@svn.freebsd.org> From: Ed Maste Date: Thu, 7 Oct 2010 17:26: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: r213523 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 17:26:22 -0000 Author: emaste Date: Thu Oct 7 17:26:22 2010 New Revision: 213523 URL: http://svn.freebsd.org/changeset/base/213523 Log: Add a note on the removal of copyright strings from login(1) and sshd(8). Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Oct 7 17:14:50 2010 (r213522) +++ head/UPDATING Thu Oct 7 17:26:22 2010 (r213523) @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. uses /etc/manpath.config. Please consult man.conf(5) for how to migrate local entries to the new format. +20100928: + The copyright strings printed by login(1) and sshd(8) at the time of a + new connection have been removed to follow other operating systems and + upstream sshd. + 20100915: A workaround for a fixed ld bug has been removed in kernel code, so make sure that your system ld is built from sources after From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:00:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB491106564A; Thu, 7 Oct 2010 18:00:55 +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 988068FC0C; Thu, 7 Oct 2010 18:00: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 o97I0t6t048631; Thu, 7 Oct 2010 18:00:55 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97I0tiW048627; Thu, 7 Oct 2010 18:00:55 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010071800.o97I0tiW048627@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 7 Oct 2010 18:00: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: r213526 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:00:55 -0000 Author: jh Date: Thu Oct 7 18:00:55 2010 New Revision: 213526 URL: http://svn.freebsd.org/changeset/base/213526 Log: Check the device name validity on device registration. A new function prep_devname() sanitizes a device name by removing leading and redundant sequential slashes. The function returns an error for names which already exist or are considered invalid. A new flag MAKEDEV_CHECKNAME for make_dev_p(9) and make_dev_credf(9) indicates that the caller is prepared to handle an error related to the device name. An invalid name triggers a panic if the flag is not specified. Document the MAKEDEV_CHECKNAME flag in the make_dev(9) manual page. Idea from: kib Reviewed by: kib Modified: head/share/man/man9/make_dev.9 head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/share/man/man9/make_dev.9 ============================================================================== --- head/share/man/man9/make_dev.9 Thu Oct 7 17:49:19 2010 (r213525) +++ head/share/man/man9/make_dev.9 Thu Oct 7 18:00:55 2010 (r213526) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2010 +.Dd October 7, 2010 .Dt MAKE_DEV 9 .Os .Sh NAME @@ -131,12 +131,18 @@ argument alters the operation of .Fn make_dev_credf . The following values are currently accepted: .Pp -.Bd -literal -offset indent -compact -MAKEDEV_REF reference the created device -MAKEDEV_NOWAIT do not sleep, may return NULL -MAKEDEV_WAITOK allow the function to sleep to satisfy malloc -MAKEDEV_ETERNAL created device will be never destroyed -.Ed +.Bl -tag -width "MAKEDEV_CHECKNAME" -compact -offset indent +.It MAKEDEV_REF +reference the created device +.It MAKEDEV_NOWAIT +do not sleep, may return NULL +.It MAKEDEV_WAITOK +allow the function to sleep to satisfy malloc +.It MAKEDEV_ETERNAL +created device will be never destroyed +.It MAKEDEV_CHECKNAME +return NULL if the device name is invalid or already exists +.El .Pp The .Dv MAKEDEV_WAITOK @@ -166,6 +172,9 @@ For the convenience, use the flag for the code that can be compiled into kernel or loaded (and unloaded) as loadable module. .Pp +A panic will occur if the MAKEDEV_CHECKNAME flag is not specified +and the device name is invalid or already exists. +.Pp The .Fn make_dev_cred function is equivalent to the call Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Thu Oct 7 17:49:19 2010 (r213525) +++ head/sys/kern/kern_conf.c Thu Oct 7 18:00:55 2010 (r213526) @@ -682,26 +682,91 @@ prep_cdevsw(struct cdevsw *devsw, int fl } static int +prep_devname(struct cdev *dev, const char *fmt, va_list ap) +{ + int len; + char *from, *q, *s, *to; + + mtx_assert(&devmtx, MA_OWNED); + + len = vsnrprintf(dev->__si_namebuf, sizeof(dev->__si_namebuf), 32, + fmt, ap); + if (len > sizeof(dev->__si_namebuf) - 1) + return (ENAMETOOLONG); + + /* Strip leading slashes. */ + for (from = dev->__si_namebuf; *from == '/'; from++) + ; + + for (to = dev->__si_namebuf; *from != '\0'; from++, to++) { + /* Treat multiple sequential slashes as single. */ + while (from[0] == '/' && from[1] == '/') + from++; + /* Trailing slash is considered invalid. */ + if (from[0] == '/' && from[1] == '\0') + return (EINVAL); + *to = *from; + } + *to = '\0'; + + if (dev->__si_namebuf[0] == '\0') + return (EINVAL); + + /* Disallow "." and ".." components. */ + for (s = dev->__si_namebuf;;) { + for (q = s; *q != '/' && *q != '\0'; q++) + ; + if (q - s == 1 && s[0] == '.') + return (EINVAL); + if (q - s == 2 && s[0] == '.' && s[1] == '.') + return (EINVAL); + if (*q != '/') + break; + s = q + 1; + } + + if (devfs_dev_exists(dev->__si_namebuf) != 0) + return (EEXIST); + + return (0); +} + +static int make_dev_credv(int flags, struct cdev **dres, struct cdevsw *devsw, int unit, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, va_list ap) { - struct cdev *dev; - int i, res; + struct cdev *dev, *dev_new; + int res; KASSERT((flags & MAKEDEV_WAITOK) == 0 || (flags & MAKEDEV_NOWAIT) == 0, ("make_dev_credv: both WAITOK and NOWAIT specified")); - dev = devfs_alloc(flags); - if (dev == NULL) + dev_new = devfs_alloc(flags); + if (dev_new == NULL) return (ENOMEM); dev_lock(); res = prep_cdevsw(devsw, flags); if (res != 0) { dev_unlock(); - devfs_free(dev); + devfs_free(dev_new); return (res); } - dev = newdev(devsw, unit, dev); + dev = newdev(devsw, unit, dev_new); + if ((dev->si_flags & SI_NAMED) == 0) + res = prep_devname(dev, fmt, ap); + if (res != 0) { + if ((flags & MAKEDEV_CHECKNAME) == 0) { + panic( + "make_dev_credv: bad si_name (error=%d, si_name=%s)", + res, dev->si_name); + } + if (dev == dev_new) { + LIST_REMOVE(dev, si_list); + dev_unlock(); + devfs_free(dev); + } + return (res); + } if (flags & MAKEDEV_REF) dev_refl(dev); if (flags & MAKEDEV_ETERNAL) @@ -720,13 +785,6 @@ make_dev_credv(int flags, struct cdev ** KASSERT(!(dev->si_flags & SI_NAMED), ("make_dev() by driver %s on pre-existing device (min=%x, name=%s)", devsw->d_name, dev2unit(dev), devtoname(dev))); - - i = vsnrprintf(dev->__si_namebuf, sizeof dev->__si_namebuf, 32, fmt, ap); - if (i > (sizeof dev->__si_namebuf - 1)) { - printf("WARNING: Device name truncated! (%s)\n", - dev->__si_namebuf); - } - dev->si_flags |= SI_NAMED; if (cr != NULL) dev->si_cred = crhold(cr); @@ -756,7 +814,8 @@ make_dev(struct cdevsw *devsw, int unit, res = make_dev_credv(0, &dev, devsw, unit, NULL, uid, gid, mode, fmt, ap); va_end(ap); - KASSERT(res == 0 && dev != NULL, ("make_dev: failed make_dev_credv")); + KASSERT(res == 0 && dev != NULL, + ("make_dev: failed make_dev_credv (error=%d)", res)); return (dev); } @@ -773,7 +832,7 @@ make_dev_cred(struct cdevsw *devsw, int va_end(ap); KASSERT(res == 0 && dev != NULL, - ("make_dev_cred: failed make_dev_credv")); + ("make_dev_cred: failed make_dev_credv (error=%d)", res)); return (dev); } @@ -790,8 +849,9 @@ make_dev_credf(int flags, struct cdevsw fmt, ap); va_end(ap); - KASSERT((flags & MAKEDEV_NOWAIT) != 0 || res == 0, - ("make_dev_credf: failed make_dev_credv")); + KASSERT(((flags & MAKEDEV_NOWAIT) != 0 && res == ENOMEM) || + ((flags & MAKEDEV_CHECKNAME) != 0 && res != ENOMEM) || res == 0, + ("make_dev_credf: failed make_dev_credv (error=%d)", res)); return (res == 0 ? dev : NULL); } @@ -807,8 +867,9 @@ make_dev_p(int flags, struct cdev **cdev fmt, ap); va_end(ap); - KASSERT((flags & MAKEDEV_NOWAIT) != 0 || res == 0, - ("make_dev_p: failed make_dev_credv")); + KASSERT(((flags & MAKEDEV_NOWAIT) != 0 && res == ENOMEM) || + ((flags & MAKEDEV_CHECKNAME) != 0 && res != ENOMEM) || res == 0, + ("make_dev_p: failed make_dev_credv (error=%d)", res)); return (res); } @@ -836,21 +897,20 @@ make_dev_alias(struct cdev *pdev, const { struct cdev *dev; va_list ap; - int i; + int error; KASSERT(pdev != NULL, ("NULL pdev")); dev = devfs_alloc(MAKEDEV_WAITOK); dev_lock(); dev->si_flags |= SI_ALIAS; - dev->si_flags |= SI_NAMED; va_start(ap, fmt); - i = vsnrprintf(dev->__si_namebuf, sizeof dev->__si_namebuf, 32, fmt, ap); - if (i > (sizeof dev->__si_namebuf - 1)) { - printf("WARNING: Device name truncated! (%s)\n", - dev->__si_namebuf); - } + error = prep_devname(dev, fmt, ap); va_end(ap); - + if (error != 0) { + panic("make_dev_alias: bad si_name (error=%d, si_name=%s)", + error, dev->si_name); + } + dev->si_flags |= SI_NAMED; devfs_create(dev); dev_dependsl(pdev, dev); clean_unrhdrl(devfs_inos); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Thu Oct 7 17:49:19 2010 (r213525) +++ head/sys/sys/conf.h Thu Oct 7 18:00:55 2010 (r213526) @@ -263,11 +263,12 @@ struct cdev *make_dev(struct cdevsw *_de struct cdev *make_dev_cred(struct cdevsw *_devsw, int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _perms, const char *_fmt, ...) __printflike(7, 8); -#define MAKEDEV_REF 0x01 -#define MAKEDEV_WHTOUT 0x02 -#define MAKEDEV_NOWAIT 0x04 -#define MAKEDEV_WAITOK 0x08 -#define MAKEDEV_ETERNAL 0x10 +#define MAKEDEV_REF 0x01 +#define MAKEDEV_WHTOUT 0x02 +#define MAKEDEV_NOWAIT 0x04 +#define MAKEDEV_WAITOK 0x08 +#define MAKEDEV_ETERNAL 0x10 +#define MAKEDEV_CHECKNAME 0x20 struct cdev *make_dev_credf(int _flags, struct cdevsw *_devsw, int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:03:48 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34A7F1065694 for ; Thu, 7 Oct 2010 18:03:48 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id BCB318FC2B for ; Thu, 7 Oct 2010 18:03:47 +0000 (UTC) Received: (qmail 6461 invoked by uid 399); 7 Oct 2010 18:03:44 -0000 Received: from localhost (HELO ?192.168.0.145?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 7 Oct 2010 18:03:44 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4CAE0B88.30508@FreeBSD.org> Date: Thu, 07 Oct 2010 11:03:52 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Alexander Leidinger References: <201010060749.o967nSbZ086734@svn.freebsd.org> <4CACBCA4.3080006@FreeBSD.org> <20101007114031.80652w26vlw6cwis@webmail.leidinger.net> In-Reply-To: <20101007114031.80652w26vlw6cwis@webmail.leidinger.net> X-Enigmail-Version: 1.2a1pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Paul B Mahol Subject: Re: svn commit: r213472 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:03:48 -0000 On 10/7/2010 2:40 AM, Alexander Leidinger wrote: > If you do not want to have it deleted by delete-old, do not exclude it > during installworld (you have my vote for this) and remove its entry > from OptionalObsoleteFiles.inc. That sounds fine with me. I will get to that ASAP. Don't hesitate to beat me to it. :) Thanks, Doug -- Breadth of IT experience, and | Nothin' ever doesn't change, depth of knowledge in the DNS. | but nothin' changes much. Yours for the right price. :) | -- OK Go http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:11:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAA2A106564A; Thu, 7 Oct 2010 18:11:33 +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 9931D8FC16; Thu, 7 Oct 2010 18:11: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 o97IBXGt048987; Thu, 7 Oct 2010 18:11:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97IBXOO048985; Thu, 7 Oct 2010 18:11:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010071811.o97IBXOO048985@svn.freebsd.org> From: Andriy Gapon Date: Thu, 7 Oct 2010 18:11: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: r213527 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:11:33 -0000 Author: avg Date: Thu Oct 7 18:11:33 2010 New Revision: 213527 URL: http://svn.freebsd.org/changeset/base/213527 Log: vm.kmem_map_size: a sysctl to query current kmem_map->size Based on a patch from Sandvine Incorporated via emaste. Reviewed by: emaste MFC after: 1 week Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Thu Oct 7 18:00:55 2010 (r213526) +++ head/sys/kern/kern_malloc.c Thu Oct 7 18:11:33 2010 (r213527) @@ -202,6 +202,11 @@ static u_int vm_kmem_size_scale; SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0, "Scale factor for kernel memory size"); +static int sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vm, OID_AUTO, kmem_map_size, + CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kmem_map_size, "LU", "Current kmem_map allocation size"); + /* * The malloc_mtx protects the kmemstatistics linked list. */ @@ -240,6 +245,15 @@ SYSCTL_INT(_debug_malloc, OID_AUTO, fail &malloc_failure_count, 0, "Number of imposed M_NOWAIT malloc failures"); #endif +static int +sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS) +{ + u_long size; + + size = kmem_map->size; + return (sysctl_handle_long(oidp, &size, 0, req)); +} + /* * malloc(9) uma zone separation -- sub-page buffer overruns in one * malloc type will affect only a subset of other malloc types. From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:16:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58D65106564A; Thu, 7 Oct 2010 18:16:14 +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 474FF8FC16; Thu, 7 Oct 2010 18:16: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 o97IGE1F049416; Thu, 7 Oct 2010 18:16:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97IGE3g049414; Thu, 7 Oct 2010 18:16:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010071816.o97IGE3g049414@svn.freebsd.org> From: Andriy Gapon Date: Thu, 7 Oct 2010 18:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213528 - head/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:16:14 -0000 Author: avg Date: Thu Oct 7 18:16:14 2010 New Revision: 213528 URL: http://svn.freebsd.org/changeset/base/213528 Log: opensolaris_kmem kmem_size(): report lesser of vm_kmem_size and available physical memory This is needed to correctly autotune ZFS ARC size when vm_kmem_size is set to value larger than available physical memory. MFC after: 2 weeks Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Thu Oct 7 18:11:33 2010 (r213527) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Thu Oct 7 18:16:14 2010 (r213528) @@ -112,18 +112,30 @@ zfs_kmem_free(void *buf, size_t size __u free(buf, M_SOLARIS); } +static uint64_t kmem_size_val; + +static void +kmem_size_init(void *unused __unused) +{ + + kmem_size_val = (uint64_t)cnt.v_page_count * PAGE_SIZE; + if (kmem_size_val > vm_kmem_size) + kmem_size_val = vm_kmem_size; +} +SYSINIT(kmem_size_init, SI_SUB_KMEM, SI_ORDER_ANY, kmem_size_init, NULL); + uint64_t kmem_size(void) { - return ((uint64_t)vm_kmem_size); + return (kmem_size_val); } uint64_t kmem_used(void) { - return ((uint64_t)kmem_map->size); + return (kmem_map->size); } static int From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:16:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49325106566B; Thu, 7 Oct 2010 18:16:23 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37BC28FC1A; Thu, 7 Oct 2010 18:16: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 o97IGNw9049463; Thu, 7 Oct 2010 18:16:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97IGNvl049461; Thu, 7 Oct 2010 18:16:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010071816.o97IGNvl049461@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Oct 2010 18:16: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: r213529 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:16:23 -0000 Author: pjd Date: Thu Oct 7 18:16:22 2010 New Revision: 213529 URL: http://svn.freebsd.org/changeset/base/213529 Log: Don't close local component on exit as we can hang waiting on g_waitidle. I'm unable to reproduce the race described in comment anymore and also the comment is incorrect - localfd represents local component from configuration file, eg. /dev/da0 and not HAST provider. Reported by: Mikolaj Golub MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Oct 7 18:16:14 2010 (r213528) +++ head/sbin/hastd/primary.c Thu Oct 7 18:16:22 2010 (r213529) @@ -234,12 +234,6 @@ cleanup(struct hast_resource *res) /* Remember errno. */ rerrno = errno; - /* - * Close descriptor to /dev/hast/ - * to work-around race in the kernel. - */ - close(res->hr_localfd); - /* Destroy ggate provider if we created one. */ if (res->hr_ggateunit >= 0) { struct g_gate_ctl_destroy ggiod; From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:19:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFCCC106566B; Thu, 7 Oct 2010 18:19:02 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE7E88FC0C; Thu, 7 Oct 2010 18:19: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 o97IJ2tt049725; Thu, 7 Oct 2010 18:19:02 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97IJ2OX049723; Thu, 7 Oct 2010 18:19:02 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010071819.o97IJ2OX049723@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Oct 2010 18:19: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: r213530 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:19:03 -0000 Author: pjd Date: Thu Oct 7 18:19:02 2010 New Revision: 213530 URL: http://svn.freebsd.org/changeset/base/213530 Log: Start the guard thread first, so we can handle signals from the very begining. Reported by: Mikolaj Golub MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Oct 7 18:16:22 2010 (r213529) +++ head/sbin/hastd/primary.c Thu Oct 7 18:19:02 2010 (r213530) @@ -791,6 +791,12 @@ hastd_primary(struct hast_resource *res) init_ggate(res); init_environment(res); /* + * Create the guard thread first, so we can handle signals from the + * very begining. + */ + error = pthread_create(&td, NULL, guard_thread, res); + assert(error == 0); + /* * Create the control thread before sending any event to the parent, * as we can deadlock when parent sends control request to worker, * but worker has no control thread started yet, so parent waits. @@ -812,9 +818,7 @@ hastd_primary(struct hast_resource *res) assert(error == 0); error = pthread_create(&td, NULL, ggate_send_thread, res); assert(error == 0); - error = pthread_create(&td, NULL, sync_thread, res); - assert(error == 0); - (void)guard_thread(res); + (void)sync_thread(res); } static void From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:20:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DDE41065670; Thu, 7 Oct 2010 18:20:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BD198FC1A; Thu, 7 Oct 2010 18:20: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 o97IKGTa049865; Thu, 7 Oct 2010 18:20:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97IKGfq049863; Thu, 7 Oct 2010 18:20:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010071820.o97IKGfq049863@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Oct 2010 18:20: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: r213531 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:20:16 -0000 Author: pjd Date: Thu Oct 7 18:20:16 2010 New Revision: 213531 URL: http://svn.freebsd.org/changeset/base/213531 Log: Log error message when we fail to destroy ggate provider. MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Oct 7 18:19:02 2010 (r213530) +++ head/sbin/hastd/primary.c Thu Oct 7 18:20:16 2010 (r213531) @@ -242,7 +242,8 @@ cleanup(struct hast_resource *res) ggiod.gctl_unit = res->hr_ggateunit; ggiod.gctl_force = 1; if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) < 0) { - pjdlog_warning("Unable to destroy hast/%s device", + pjdlog_errno(LOG_WARNING, + "Unable to destroy hast/%s device", res->hr_provname); } res->hr_ggateunit = -1; From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:20:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 171E310656A3; Thu, 7 Oct 2010 18:20:52 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05AD28FC22; Thu, 7 Oct 2010 18:20: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 o97IKpPm049946; Thu, 7 Oct 2010 18:20:51 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97IKpwi049944; Thu, 7 Oct 2010 18:20:51 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201010071820.o97IKpwi049944@svn.freebsd.org> From: Jonathan Anderson Date: Thu, 7 Oct 2010 18:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213532 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:20:52 -0000 Author: jonathan Date: Thu Oct 7 18:20:51 2010 New Revision: 213532 URL: http://svn.freebsd.org/changeset/base/213532 Log: Add myself (jonathan@) to committers-src.dot Reviewed by: rwatson Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Oct 7 18:20:16 2010 (r213531) +++ head/share/misc/committers-src.dot Thu Oct 7 18:20:51 2010 (r213532) @@ -128,6 +128,7 @@ jls [label="Jordan Sissel\njls@FreeBSD.o joe [label="Josef Karthauser\njoe@FreeBSD.org\n1999/10/22"] joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1993/11/14"] jon [label="Jonathan Chen\njon@FreeBSD.org\n2000/10/17"] +jonathan [label="Jonathan Anderson\njonathan@FreeBSD.org\n2010/10/07"] julian [label="Julian Elischer\njulian@FreeBSD.org\n1993/??/??"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"] @@ -460,6 +461,7 @@ rwatson -> cperciva rwatson -> emaste rwatson -> gnn rwatson -> jh +rwatson -> jonathan rwatson -> kensmith rwatson -> kmacy rwatson -> linimon From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 18:23:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01A1C106566B; Thu, 7 Oct 2010 18:23:29 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9ED78FC08; Thu, 7 Oct 2010 18:23: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 o97INSPq050210; Thu, 7 Oct 2010 18:23:28 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97INSLO050208; Thu, 7 Oct 2010 18:23:28 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010071823.o97INSLO050208@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 7 Oct 2010 18: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: r213533 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 18:23:29 -0000 Author: pjd Date: Thu Oct 7 18:23:28 2010 New Revision: 213533 URL: http://svn.freebsd.org/changeset/base/213533 Log: Clear ggate structures before using them. We don't initialize all the field and there can be some garbage from the stack. MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Oct 7 18:20:51 2010 (r213532) +++ head/sbin/hastd/primary.c Thu Oct 7 18:23:28 2010 (r213533) @@ -238,6 +238,7 @@ cleanup(struct hast_resource *res) if (res->hr_ggateunit >= 0) { struct g_gate_ctl_destroy ggiod; + bzero(&ggiod, sizeof(ggiod)); ggiod.gctl_version = G_GATE_VERSION; ggiod.gctl_unit = res->hr_ggateunit; ggiod.gctl_force = 1; @@ -700,6 +701,7 @@ init_ggate(struct hast_resource *res) * Create provider before trying to connect, as connection failure * is not critical, but may take some time. */ + bzero(&ggiocreate, sizeof(ggiocreate)); ggiocreate.gctl_version = G_GATE_VERSION; ggiocreate.gctl_mediasize = res->hr_datasize; ggiocreate.gctl_sectorsize = res->hr_local_sectorsize; @@ -709,7 +711,6 @@ init_ggate(struct hast_resource *res) ggiocreate.gctl_unit = G_GATE_NAME_GIVEN; snprintf(ggiocreate.gctl_name, sizeof(ggiocreate.gctl_name), "hast/%s", res->hr_provname); - bzero(ggiocreate.gctl_info, sizeof(ggiocreate.gctl_info)); if (ioctl(res->hr_ggatefd, G_GATE_CMD_CREATE, &ggiocreate) == 0) { pjdlog_info("Device hast/%s created.", res->hr_provname); res->hr_ggateunit = ggiocreate.gctl_unit; @@ -727,6 +728,7 @@ init_ggate(struct hast_resource *res) * provider died and didn't clean up. In that case we will start from * where he left of. */ + bzero(&ggiocancel, sizeof(ggiocancel)); ggiocancel.gctl_version = G_GATE_VERSION; ggiocancel.gctl_unit = G_GATE_NAME_GIVEN; snprintf(ggiocancel.gctl_name, sizeof(ggiocancel.gctl_name), "hast/%s", @@ -928,6 +930,7 @@ ggate_recv_thread(void *arg) QUEUE_TAKE2(hio, free); pjdlog_debug(2, "ggate_recv: (%p) Got free request.", hio); ggio = &hio->hio_ggio; + bzero(ggio, sizeof(*ggio)); ggio->gctl_unit = res->hr_ggateunit; ggio->gctl_length = MAXPHYS; ggio->gctl_error = 0; From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 20:31:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3CAF106564A; Thu, 7 Oct 2010 20:31:07 +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 CDC458FC08; Thu, 7 Oct 2010 20:31: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 o97KV7qL060833; Thu, 7 Oct 2010 20:31:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97KV7Mg060823; Thu, 7 Oct 2010 20:31:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010072031.o97KV7Mg060823@svn.freebsd.org> From: Dimitry Andric Date: Thu, 7 Oct 2010 20:31: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: r213534 - in head: contrib/llvm contrib/llvm/autoconf contrib/llvm/include/llvm/ADT contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/ARM contrib/llvm/lib/Target/X86 contrib/llvm/tools/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 20:31:08 -0000 Author: dim Date: Thu Oct 7 20:31:07 2010 New Revision: 213534 URL: http://svn.freebsd.org/changeset/base/213534 Log: Upgrade Clang and LLVM to the 2.8 release. See here for release notes: http://llvm.org/releases/2.8/docs/ReleaseNotes.html Approved by: rpaulo (mentor) Modified: head/contrib/llvm/Makefile.rules head/contrib/llvm/autoconf/configure.ac head/contrib/llvm/configure head/contrib/llvm/include/llvm/ADT/SmallVector.h head/contrib/llvm/lib/CodeGen/MachineCSE.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/lib/clang/include/clang/Basic/Version.inc Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/contrib/llvm/Makefile.rules ============================================================================== --- head/contrib/llvm/Makefile.rules Thu Oct 7 18:23:28 2010 (r213533) +++ head/contrib/llvm/Makefile.rules Thu Oct 7 20:31:07 2010 (r213534) @@ -941,6 +941,11 @@ ifdef EXPORTED_SYMBOL_FILE # First, set up the native export file, which may differ from the source # export file. +# The option --version-script is not effective on GNU ld win32. +ifneq (,$(filter $(HOST_OS),Cygwin MingW)) + HAVE_LINK_VERSION_SCRIPT := 0 +endif + ifeq ($(HOST_OS),Darwin) # Darwin convention prefixes symbols with underscores. NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed Modified: head/contrib/llvm/autoconf/configure.ac ============================================================================== --- head/contrib/llvm/autoconf/configure.ac Thu Oct 7 18:23:28 2010 (r213533) +++ head/contrib/llvm/autoconf/configure.ac Thu Oct 7 20:31:07 2010 (r213534) @@ -31,7 +31,7 @@ dnl=== dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([[llvm]],[[2.8rc]],[llvmbugs@cs.uiuc.edu]) +AC_INIT([[llvm]],[[2.8]],[llvmbugs@cs.uiuc.edu]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. Modified: head/contrib/llvm/configure ============================================================================== --- head/contrib/llvm/configure Thu Oct 7 18:23:28 2010 (r213533) +++ head/contrib/llvm/configure Thu Oct 7 20:31:07 2010 (r213534) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for llvm 2.8rc. +# Generated by GNU Autoconf 2.60 for llvm 2.8. # # Report bugs to . # @@ -561,8 +561,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='llvm' PACKAGE_TARNAME='-llvm-' -PACKAGE_VERSION='2.8rc' -PACKAGE_STRING='llvm 2.8rc' +PACKAGE_VERSION='2.8' +PACKAGE_STRING='llvm 2.8' PACKAGE_BUGREPORT='llvmbugs@cs.uiuc.edu' ac_unique_file="lib/VMCore/Module.cpp" @@ -1318,7 +1318,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures llvm 2.8rc to adapt to many kinds of systems. +\`configure' configures llvm 2.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1384,7 +1384,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of llvm 2.8rc:";; + short | recursive ) echo "Configuration of llvm 2.8:";; esac cat <<\_ACEOF @@ -1394,7 +1394,7 @@ Optional Features: --enable-optimized Compile with optimizations enabled (default is NO) --enable-profiling Compile with profiling enabled (default is NO) --enable-assertions Compile with assertion checks enabled (default is - YES) + NO) --enable-expensive-checks Compile with expensive debug checks enabled (default is NO) @@ -1533,7 +1533,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -llvm configure 2.8rc +llvm configure 2.8 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1549,7 +1549,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by llvm $as_me 2.8rc, which was +It was created by llvm $as_me 2.8, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -21045,7 +21045,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by llvm $as_me 2.8rc, which was +This file was extended by llvm $as_me 2.8, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21098,7 +21098,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -llvm config.status 2.8rc +llvm config.status 2.8 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: head/contrib/llvm/include/llvm/ADT/SmallVector.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/SmallVector.h Thu Oct 7 18:23:28 2010 (r213533) +++ head/contrib/llvm/include/llvm/ADT/SmallVector.h Thu Oct 7 20:31:07 2010 (r213534) @@ -61,7 +61,7 @@ protected: // number of union instances for the space, which guarantee maximal alignment. struct U { #ifdef __GNUC__ - char X __attribute__((aligned(8))); + char X __attribute__((aligned)); #else union { double D; Modified: head/contrib/llvm/lib/CodeGen/MachineCSE.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/MachineCSE.cpp Thu Oct 7 18:23:28 2010 (r213533) +++ head/contrib/llvm/lib/CodeGen/MachineCSE.cpp Thu Oct 7 20:31:07 2010 (r213534) @@ -54,6 +54,11 @@ namespace { AU.addPreserved(); } + virtual void releaseMemory() { + ScopeMap.clear(); + Exps.clear(); + } + private: const unsigned LookAheadLimit; typedef ScopedHashTableScopehasOneUse(Reg)) + if (!MRI->hasOneNonDBGUse(Reg)) // Only coalesce single use copies. This ensure the copy will be // deleted. continue; @@ -469,6 +474,8 @@ bool MachineCSE::PerformCSE(MachineDomTr DenseMap ParentMap; DenseMap OpenChildren; + CurrVN = 0; + // Perform a DFS walk to determine the order of visit. WorkList.push_back(Node); do { Modified: head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Oct 7 18:23:28 2010 (r213533) +++ head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Oct 7 20:31:07 2010 (r213534) @@ -1389,7 +1389,8 @@ ConvertToSetZeroFlag(MachineInstr *MI, M // Check that CPSR isn't set between the comparison instruction and the one we // want to change. - MachineBasicBlock::const_iterator I = CmpInstr, E = MI; + MachineBasicBlock::const_iterator I = CmpInstr, E = MI, + B = MI->getParent()->begin(); --I; for (; I != E; --I) { const MachineInstr &Instr = *I; @@ -1403,6 +1404,10 @@ ConvertToSetZeroFlag(MachineInstr *MI, M if (MO.getReg() == ARM::CPSR) return false; } + + if (I == B) + // The 'and' is below the comparison instruction. + return false; } // Set the "zero" bit in CPSR. Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Oct 7 18:23:28 2010 (r213533) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Oct 7 20:31:07 2010 (r213534) @@ -5414,11 +5414,11 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(S return getMOVL(DAG, dl, VT, V2, V1); } - if (X86::isUNPCKLMask(SVOp)) + if (X86::isUNPCKL_v_undef_Mask(SVOp) || X86::isUNPCKLMask(SVOp)) return (isMMX) ? Op : getTargetShuffleNode(getUNPCKLOpcode(VT), dl, VT, V1, V2, DAG); - if (X86::isUNPCKHMask(SVOp)) + if (X86::isUNPCKH_v_undef_Mask(SVOp) || X86::isUNPCKHMask(SVOp)) return (isMMX) ? Op : getTargetShuffleNode(getUNPCKHOpcode(VT), dl, VT, V1, V2, DAG); @@ -5443,11 +5443,11 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(S SDValue NewOp = CommuteVectorShuffle(SVOp, DAG); ShuffleVectorSDNode *NewSVOp = cast(NewOp); - if (X86::isUNPCKLMask(NewSVOp)) + if (X86::isUNPCKL_v_undef_Mask(NewSVOp) || X86::isUNPCKLMask(NewSVOp)) return (isMMX) ? NewOp : getTargetShuffleNode(getUNPCKLOpcode(VT), dl, VT, V2, V1, DAG); - if (X86::isUNPCKHMask(NewSVOp)) + if (X86::isUNPCKH_v_undef_Mask(NewSVOp) || X86::isUNPCKHMask(NewSVOp)) return (isMMX) ? NewOp : getTargetShuffleNode(getUNPCKHOpcode(VT), dl, VT, V2, V1, DAG); } @@ -5494,13 +5494,6 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(S TargetMask, DAG); } - if (X86::isUNPCKL_v_undef_Mask(SVOp)) - if (VT != MVT::v2i64 && VT != MVT::v2f64) - return getTargetShuffleNode(getUNPCKLOpcode(VT), dl, VT, V1, V1, DAG); - if (X86::isUNPCKH_v_undef_Mask(SVOp)) - if (VT != MVT::v2i64 && VT != MVT::v2f64) - return getTargetShuffleNode(getUNPCKHOpcode(VT), dl, VT, V1, V1, DAG); - // Handle v8i16 specifically since SSE can do byte extraction and insertion. if (VT == MVT::v8i16) { SDValue NewOp = LowerVECTOR_SHUFFLEv8i16(Op, DAG); Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Thu Oct 7 18:23:28 2010 (r213533) +++ head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Thu Oct 7 20:31:07 2010 (r213534) @@ -21,7 +21,7 @@ using namespace std; namespace clang { llvm::StringRef getClangRepositoryPath() { - static const char URL[] = "$URL: http://llvm.org/svn/llvm-project/cfe/branches/release_28/lib/Basic/Version.cpp $"; + static const char URL[] = "$URL: http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_28/lib/Basic/Version.cpp $"; const char *URLEnd = URL + strlen(URL); const char *End = strstr(URL, "/lib/Basic"); Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Thu Oct 7 18:23:28 2010 (r213533) +++ head/lib/clang/include/clang/Basic/Version.inc Thu Oct 7 20:31:07 2010 (r213534) @@ -5,6 +5,6 @@ #define CLANG_VERSION_MINOR 8 #define CLANG_VENDOR "FreeBSD " -#define CLANG_VENDOR_SUFFIX " 20100917" +#define CLANG_VENDOR_SUFFIX " 20101007" -#define SVN_REVISION "114020" +#define SVN_REVISION "115870" From owner-svn-src-all@FreeBSD.ORG Thu Oct 7 21:56:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8958D1065674; Thu, 7 Oct 2010 21:56:10 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 759B78FC1A; Thu, 7 Oct 2010 21:56: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 o97LuAjQ068050; Thu, 7 Oct 2010 21:56:10 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o97LuAjk068045; Thu, 7 Oct 2010 21:56:10 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201010072156.o97LuAjk068045@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 7 Oct 2010 21:56: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: r213535 - in head: share/man/man4 sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 21:56:10 -0000 Author: ken Date: Thu Oct 7 21:56:10 2010 New Revision: 213535 URL: http://svn.freebsd.org/changeset/base/213535 Log: Turn on serialization of task management commands going down to the controller, but make it optional. After a problem report from Andrew Boyer, it looks like the LSI chip may have issues (the watchdog timer fired) if too many aborts are sent down to the chip at the same time. We know that task management commands are serialized, and although the manual doesn't say it, it may be a good idea to just send one at a time. But, since I'm not certain that this is necessary, add a tunable and sysctl variable (hw.mps.%d.allow_multiple_tm_cmds) to control the driver's behavior. mps.c: Add support for the sysctl and tunable, and add a comment about the possible return values to mps_map_command(). mps_sas.c: Run all task management commands through two new routines, mpssas_issue_tm_request() and mpssas_complete_tm_request(). This allows us to optionally serialize task management commands. Also, change things so that the response to a task management command always comes back through the callback. (Before it could come via the callback or the return value.) mpsvar.h: Add softc variables for the list of active task management commands, the number of active commands, and whether we should allow multiple active task management commands. Add an active command flag. mps.4: Describe the new sysctl/loader tunable variable. Sponsored by: Spectra Logic Corporation Modified: head/share/man/man4/mps.4 head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Thu Oct 7 20:31:07 2010 (r213534) +++ head/share/man/man4/mps.4 Thu Oct 7 21:56:10 2010 (r213535) @@ -31,7 +31,7 @@ .\" .\" Author: Ken Merry .\" -.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#1 $ +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#4 $ .\" $FreeBSD$ .\" .Dd September 13, 2010 @@ -97,6 +97,20 @@ driver instances, set the following tuna .Bd -literal -offset indent hw.mps.disable_msix=1 .Ed +.Pp +To allow the driver to send multiple task management commands (like abort, +LUN reset, etc.), set the following variable: +.Bd -literal -offset indent +hw.mps.X.allow_multiple_tm_cmds=1 +.Ed +.Pp +via +.Xr loader.conf 5 +or +.Xr sysctl 8 , +where X is the adapter number. +By default the driver only sends one task management command at a time, to +avoid causing a potential controller lock-up. .Sh DEBUGGING To enable debugging prints from the .Nm Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Thu Oct 7 20:31:07 2010 (r213534) +++ head/sys/dev/mps/mps.c Thu Oct 7 21:56:10 2010 (r213535) @@ -805,6 +805,9 @@ mps_attach(struct mps_softc *sc) snprintf(tmpstr, sizeof(tmpstr), "hw.mps.%d.debug_level", device_get_unit(sc->mps_dev)); TUNABLE_INT_FETCH(tmpstr, &sc->mps_debug); + snprintf(tmpstr, sizeof(tmpstr), "hw.mps.%d.allow_multiple_tm_cmds", + device_get_unit(sc->mps_dev)); + TUNABLE_INT_FETCH(tmpstr, &sc->allow_multiple_tm_cmds); mps_dprint(sc, MPS_TRACE, "%s\n", __func__); @@ -831,6 +834,11 @@ mps_attach(struct mps_softc *sc) OID_AUTO, "debug_level", CTLFLAG_RW, &sc->mps_debug, 0, "mps debug level"); + SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), + OID_AUTO, "allow_multiple_tm_cmds", CTLFLAG_RW, + &sc->allow_multiple_tm_cmds, 0, + "allow multiple simultaneous task management cmds"); + if ((error = mps_transition_ready(sc)) != 0) return (error); @@ -873,6 +881,7 @@ mps_attach(struct mps_softc *sc) sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; TAILQ_INIT(&sc->req_list); TAILQ_INIT(&sc->chain_list); + TAILQ_INIT(&sc->tm_list); if (((error = mps_alloc_queues(sc)) != 0) || ((error = mps_alloc_replies(sc)) != 0) || @@ -1470,6 +1479,10 @@ mps_data_cb(void *arg, bus_dma_segment_t return; } +/* + * Note that the only error path here is from bus_dmamap_load(), which can + * return EINPROGRESS if it is waiting for resources. + */ int mps_map_command(struct mps_softc *sc, struct mps_command *cm) { Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Thu Oct 7 20:31:07 2010 (r213534) +++ head/sys/dev/mps/mps_sas.c Thu Oct 7 21:56:10 2010 (r213535) @@ -135,9 +135,16 @@ static void mpssas_probe_device_complete static void mpssas_scsiio_timeout(void *data); static void mpssas_abort_complete(struct mps_softc *sc, struct mps_command *cm); static void mpssas_recovery(struct mps_softc *, struct mps_command *); +static int mpssas_map_tm_request(struct mps_softc *sc, struct mps_command *cm); +static void mpssas_issue_tm_request(struct mps_softc *sc, + struct mps_command *cm); +static void mpssas_tm_complete(struct mps_softc *sc, struct mps_command *cm, + int error); +static int mpssas_complete_tm_request(struct mps_softc *sc, + struct mps_command *cm, int free_cm); static void mpssas_action_scsiio(struct mpssas_softc *, union ccb *); static void mpssas_scsiio_complete(struct mps_softc *, struct mps_command *); -static int mpssas_resetdev(struct mpssas_softc *, struct mps_command *); +static void mpssas_resetdev(struct mpssas_softc *, struct mps_command *); static void mpssas_action_resetdev(struct mpssas_softc *, union ccb *); static void mpssas_resetdev_complete(struct mps_softc *, struct mps_command *); static void mpssas_freeze_device(struct mpssas_softc *, struct mpssas_target *); @@ -438,8 +445,7 @@ mpssas_prepare_remove(struct mpssas_soft cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_complete = mpssas_remove_device; cm->cm_targ = targ; - xpt_freeze_simq(sc->sassc->sim, 1); - mps_map_command(sc, cm); + mpssas_issue_tm_request(sc, cm); } static void @@ -454,7 +460,9 @@ mpssas_remove_device(struct mps_softc *s reply = (MPI2_SCSI_TASK_MANAGE_REPLY *)cm->cm_reply; handle = cm->cm_targ->handle; - xpt_release_simq(sc->sassc->sim, 1); + + mpssas_complete_tm_request(sc, cm, /*free_cm*/ 0); + if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { mps_printf(sc, "Failure 0x%x reseting device 0x%04x\n", reply->IOCStatus, handle); @@ -1020,12 +1028,7 @@ mpssas_abort_complete(struct mps_softc * mps_printf(sc, "%s: abort request on handle %#04x SMID %d " "complete\n", __func__, req->DevHandle, req->TaskMID); - /* - * Release the SIM queue, we froze it when we sent the abort. - */ - xpt_release_simq(sc->sassc->sim, 1); - - mps_free_command(sc, cm); + mpssas_complete_tm_request(sc, cm, /*free_cm*/ 1); } static void @@ -1033,7 +1036,6 @@ mpssas_recovery(struct mps_softc *sc, st { struct mps_command *cm; MPI2_SCSI_TASK_MANAGE_REQUEST *req, *orig_req; - int error; cm = mps_alloc_command(sc); if (cm == NULL) { @@ -1055,34 +1057,204 @@ mpssas_recovery(struct mps_softc *sc, st cm->cm_data = NULL; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; + mpssas_issue_tm_request(sc, cm); + +} + +/* + * Can return 0 or EINPROGRESS on success. Any other value means failure. + */ +static int +mpssas_map_tm_request(struct mps_softc *sc, struct mps_command *cm) +{ + int error; + + error = 0; + + cm->cm_flags |= MPS_CM_FLAGS_ACTIVE; + error = mps_map_command(sc, cm); + if ((error == 0) + || (error == EINPROGRESS)) + sc->tm_cmds_active++; + + return (error); +} + +static void +mpssas_issue_tm_request(struct mps_softc *sc, struct mps_command *cm) +{ + int freeze_queue, send_command, error; + + freeze_queue = 0; + send_command = 0; + error = 0; + + mtx_assert(&sc->mps_mtx, MA_OWNED); + /* - * Freeze the SIM queue while we issue the abort. According to the - * Fusion-MPT 2.0 spec, task management requests are serialized, - * and so the host should not send any I/O requests while task - * management requests are pending. + * If there are no other pending task management commands, go + * ahead and send this one. There is a small amount of anecdotal + * evidence that sending lots of task management commands at once + * may cause the controller to lock up. Or, if the user has + * configured the driver (via the allow_multiple_tm_cmds variable) to + * not serialize task management commands, go ahead and send the + * command if even other task management commands are pending. */ - xpt_freeze_simq(sc->sassc->sim, 1); + if (TAILQ_FIRST(&sc->tm_list) == NULL) { + send_command = 1; + freeze_queue = 1; + } else if (sc->allow_multiple_tm_cmds != 0) + send_command = 1; - error = mps_map_command(sc, cm); + TAILQ_INSERT_TAIL(&sc->tm_list, cm, cm_link); + if (send_command != 0) { + /* + * Freeze the SIM queue while we issue the task management + * command. According to the Fusion-MPT 2.0 spec, task + * management requests are serialized, and so the host + * should not send any I/O requests while task management + * requests are pending. + */ + if (freeze_queue != 0) + xpt_freeze_simq(sc->sassc->sim, 1); - if (error != 0) { - mps_printf(sc, "%s: error mapping abort request!\n", __func__); - xpt_release_simq(sc->sassc->sim, 1); - } -#if 0 - error = mpssas_reset(sc, targ, &resetcm); - if ((error != 0) && (error != EBUSY)) { - mps_printf(sc, "Error resetting device!\n"); - mps_unlock(sc); - return; + error = mpssas_map_tm_request(sc, cm); + + /* + * At present, there is no error path back from + * mpssas_map_tm_request() (which calls mps_map_command()) + * when cm->cm_data == NULL. But since there is a return + * value, we check it just in case the implementation + * changes later. + */ + if ((error != 0) + && (error != EINPROGRESS)) + mpssas_tm_complete(sc, cm, + MPI2_SCSITASKMGMT_RSP_TM_FAILED); } +} - targ->flags |= MPSSAS_TARGET_INRESET; +static void +mpssas_tm_complete(struct mps_softc *sc, struct mps_command *cm, int error) +{ + MPI2_SCSI_TASK_MANAGE_REPLY *resp; - cm->cm_complete = mpssas_resettimeout_complete; - cm->cm_complete_data = cm; - mps_map_command(sassc->sc, cm); -#endif + resp = (MPI2_SCSI_TASK_MANAGE_REPLY *)cm->cm_reply; + + resp->ResponseCode = error; + + /* + * Call the callback for this command, it will be + * removed from the list and freed via the callback. + */ + cm->cm_complete(sc, cm); +} + +/* + * Complete a task management request. The basic completion operation will + * always succeed. Returns status for sending any further task management + * commands that were queued. + */ +static int +mpssas_complete_tm_request(struct mps_softc *sc, struct mps_command *cm, + int free_cm) +{ + int error; + + error = 0; + + mtx_assert(&sc->mps_mtx, MA_OWNED); + + TAILQ_REMOVE(&sc->tm_list, cm, cm_link); + cm->cm_flags &= ~MPS_CM_FLAGS_ACTIVE; + sc->tm_cmds_active--; + + if (free_cm != 0) + mps_free_command(sc, cm); + + if (TAILQ_FIRST(&sc->tm_list) == NULL) { + /* + * Release the SIM queue, we froze it when we sent the first + * task management request. + */ + xpt_release_simq(sc->sassc->sim, 1); + } else if ((sc->tm_cmds_active == 0) + || (sc->allow_multiple_tm_cmds != 0)) { + int error; + struct mps_command *cm2; + +restart_traversal: + + /* + * We don't bother using TAILQ_FOREACH_SAFE here, but + * rather use the standard version and just restart the + * list traversal if we run into the error case. + * TAILQ_FOREACH_SAFE allows safe removal of the current + * list element, but if you have a queue of task management + * commands, all of which have mapping errors, you'll end + * up with recursive calls to this routine and so you could + * wind up removing more than just the current list element. + */ + TAILQ_FOREACH(cm2, &sc->tm_list, cm_link) { + MPI2_SCSI_TASK_MANAGE_REQUEST *req; + + /* This command is active, no need to send it again */ + if (cm2->cm_flags & MPS_CM_FLAGS_ACTIVE) + continue; + + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm2->cm_req; + + mps_printf(sc, "%s: sending deferred task management " + "request for handle %#04x SMID %d\n", __func__, + req->DevHandle, req->TaskMID); + + error = mpssas_map_tm_request(sc, cm2); + + /* + * Check for errors. If we had an error, complete + * this command with an error, and keep going through + * the list until we are able to send at least one + * command or all of them are completed with errors. + * + * We don't want to wind up in a situation where + * we're stalled out with no way for queued task + * management commands to complete. + * + * Note that there is not currently an error path + * back from mpssas_map_tm_request() (which calls + * mps_map_command()) when cm->cm_data == NULL. + * But we still want to check for errors here in + * case the implementation changes, or in case + * there is some reason for a data payload here. + */ + if ((error != 0) + && (error != EINPROGRESS)) { + mpssas_tm_complete(sc, cm, + MPI2_SCSITASKMGMT_RSP_TM_FAILED); + + /* + * If we don't currently have any commands + * active, go back to the beginning and see + * if there are any more that can be started. + * Otherwise, we're done here. + */ + if (sc->tm_cmds_active == 0) + goto restart_traversal; + else + break; + } + + /* + * If the user only wants one task management command + * active at a time, we're done, since we've + * already successfully sent a command at this point. + */ + if (sc->allow_multiple_tm_cmds == 0) + break; + } + } + + return (error); } static void @@ -1359,7 +1531,6 @@ mpssas_action_resetdev(struct mpssas_sof struct mps_softc *sc; struct mps_command *cm; struct mpssas_target *targ; - int error; sc = sassc->sc; targ = &sassc->targets[ccb->ccb_h.target_id]; @@ -1372,7 +1543,7 @@ mpssas_action_resetdev(struct mpssas_sof cm = mps_alloc_command(sc); if (cm == NULL) { - mps_printf(sc, "mpssas_action_resetdev: cannot alloc command\n"); + mps_printf(sc, "%s: cannot alloc command\n", __func__); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); return; @@ -1382,20 +1553,14 @@ mpssas_action_resetdev(struct mpssas_sof cm->cm_complete = mpssas_resetdev_complete; cm->cm_complete_data = ccb; - error = mpssas_resetdev(sassc, cm); - if (error) { - ccb->ccb_h.status = CAM_RESRC_UNAVAIL; - xpt_done(ccb); - return; - } + mpssas_resetdev(sassc, cm); } -static int +static void mpssas_resetdev(struct mpssas_softc *sassc, struct mps_command *cm) { MPI2_SCSI_TASK_MANAGE_REQUEST *req; struct mps_softc *sc; - int error; mps_dprint(sassc->sc, MPS_TRACE, "%s\n", __func__); @@ -1412,14 +1577,7 @@ mpssas_resetdev(struct mpssas_softc *sas cm->cm_data = NULL; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; - xpt_freeze_simq(sassc->sim, 1); - - error = mps_map_command(sassc->sc, cm); - - if (error != 0) - xpt_release_simq(sassc->sim, 1); - - return (error); + mpssas_issue_tm_request(sc, cm); } static void @@ -1441,9 +1599,7 @@ mpssas_resetdev_complete(struct mps_soft else ccb->ccb_h.status = CAM_REQ_CMP_ERR; - mps_free_command(sc, cm); - - xpt_release_simq(sc->sassc->sim, 1); + mpssas_complete_tm_request(sc, cm, /*free_cm*/ 1); xpt_done(ccb); } Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Thu Oct 7 20:31:07 2010 (r213534) +++ head/sys/dev/mps/mpsvar.h Thu Oct 7 21:56:10 2010 (r213535) @@ -81,6 +81,7 @@ struct mps_command { #define MPS_CM_FLAGS_DATAOUT (1 << 3) #define MPS_CM_FLAGS_DATAIN (1 << 4) #define MPS_CM_FLAGS_WAKEUP (1 << 5) +#define MPS_CM_FLAGS_ACTIVE (1 << 6) u_int cm_state; #define MPS_CM_STATE_FREE 0 #define MPS_CM_STATE_BUSY 1 @@ -109,6 +110,8 @@ struct mps_softc { #define MPS_FLAGS_BUSY (1 << 2) #define MPS_FLAGS_SHUTDOWN (1 << 3) u_int mps_debug; + u_int allow_multiple_tm_cmds; + int tm_cmds_active; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; struct mps_command *commands; @@ -119,6 +122,7 @@ struct mps_softc { TAILQ_HEAD(, mps_command) req_list; TAILQ_HEAD(, mps_chain) chain_list; + TAILQ_HEAD(, mps_command) tm_list; int replypostindex; int replyfreeindex; int replycurindex; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 00:44:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEB210656B6; Fri, 8 Oct 2010 00:44:53 +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 8E75B8FC1E; Fri, 8 Oct 2010 00:44:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o980iraD072761; Fri, 8 Oct 2010 00:44:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o980irC5072756; Fri, 8 Oct 2010 00:44:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010080044.o980irC5072756@svn.freebsd.org> From: Ed Maste Date: Fri, 8 Oct 2010 00:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213536 - in head: bin/ps sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 00:44:53 -0000 Author: emaste Date: Fri Oct 8 00:44:53 2010 New Revision: 213536 URL: http://svn.freebsd.org/changeset/base/213536 Log: Make a thread's address available via the kern proc sysctl, just like the process address. Add "tdaddr" keyword to ps(1) to display this thread address. Distilled from Sandvine's patch set by Mark Johnston. Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 head/sys/kern/kern_proc.c head/sys/sys/user.h Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Thu Oct 7 21:56:10 2010 (r213535) +++ head/bin/ps/keyword.c Fri Oct 8 00:44:53 2010 (r213536) @@ -187,6 +187,8 @@ static VAR var[] = { UINT, UIDFMT, 0}, {"svuid", "SVUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid), UINT, UIDFMT, 0}, + {"tdaddr", "TDADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, + KOFF(ki_tdaddr), KPTR, "lx", 0}, {"tdev", "TDEV", NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0}, {"tdnam", "TDNAM", NULL, LJUST, tdnam, NULL, COMMLEN, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, USER, cputime, NULL, 9, 0, CHAR, NULL, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Thu Oct 7 21:56:10 2010 (r213535) +++ head/bin/ps/ps.1 Fri Oct 8 00:44:53 2010 (r213536) @@ -591,6 +591,8 @@ symbolic process state (alias saved gid from a setgid executable .It Cm svuid saved UID from a setuid executable +.It Cm tdaddr +thread address .It Cm tdev control terminal device number .It Cm time Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Oct 7 21:56:10 2010 (r213535) +++ head/sys/kern/kern_proc.c Fri Oct 8 00:44:53 2010 (r213536) @@ -842,6 +842,7 @@ fill_kinfo_thread(struct thread *td, str struct proc *p; p = td->td_proc; + kp->ki_tdaddr = td; PROC_LOCK_ASSERT(p, MA_OWNED); thread_lock(td); Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Thu Oct 7 21:56:10 2010 (r213535) +++ head/sys/sys/user.h Fri Oct 8 00:44:53 2010 (r213536) @@ -85,7 +85,7 @@ */ #define KI_NSPARE_INT 9 #define KI_NSPARE_LONG 12 -#define KI_NSPARE_PTR 7 +#define KI_NSPARE_PTR 6 #ifndef _KERNEL #ifndef KINFO_PROC_SIZE @@ -188,6 +188,7 @@ struct kinfo_proc { struct pcb *ki_pcb; /* kernel virtual addr of pcb */ void *ki_kstack; /* kernel virtual addr of stack */ void *ki_udata; /* User convenience pointer */ + struct thread *ki_tdaddr; /* address of thread */ /* * When adding new variables, take space for pointers from the * front of ki_spareptrs, and longs from the end of ki_sparelongs. From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 01:03:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 476FA1065672; Fri, 8 Oct 2010 01:03:31 +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 3507A8FC08; Fri, 8 Oct 2010 01:03:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9813VrC073286; Fri, 8 Oct 2010 01:03:31 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9813VbC073284; Fri, 8 Oct 2010 01:03:31 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010080103.o9813VbC073284@svn.freebsd.org> From: Ed Maste Date: Fri, 8 Oct 2010 01:03: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: r213537 - head/sys/dev/usb/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 01:03:31 -0000 Author: emaste Date: Fri Oct 8 01:03:30 2010 New Revision: 213537 URL: http://svn.freebsd.org/changeset/base/213537 Log: In r207768 I silenced a console warning from rum(4). There was legitimate opposition to the change, since really we need to implement missing functionality in drivers or the 802.3 layer. For now, restore a reminder message for a missing rum_update_mcast, but print it only once. Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Fri Oct 8 00:44:53 2010 (r213536) +++ head/sys/dev/usb/wlan/if_rum.c Fri Oct 8 01:03:30 2010 (r213537) @@ -1819,8 +1819,12 @@ rum_update_promisc(struct ifnet *ifp) static void rum_update_mcast(struct ifnet *ifp) { + static int warning_printed; - /* XXX do nothing? */ + if (warning_printed == 0) { + if_printf(ifp, "need to implement %s\n", __func__); + warning_printed = 1; + } } static const char * From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 01:47:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64F051065674; Fri, 8 Oct 2010 01:47:14 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52C238FC12; Fri, 8 Oct 2010 01:47: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 o981lEee074245; Fri, 8 Oct 2010 01:47:14 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o981lEZ6074243; Fri, 8 Oct 2010 01:47:14 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010080147.o981lEZ6074243@svn.freebsd.org> From: David Xu Date: Fri, 8 Oct 2010 01:47: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: r213539 - head/lib/libthr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 01:47:14 -0000 Author: davidxu Date: Fri Oct 8 01:47:14 2010 New Revision: 213539 URL: http://svn.freebsd.org/changeset/base/213539 Log: unwind.h was imported, gcc directory is no longer needed. Modified: head/lib/libthr/Makefile Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Fri Oct 8 01:17:22 2010 (r213538) +++ head/lib/libthr/Makefile Fri Oct 8 01:47:14 2010 (r213539) @@ -27,7 +27,6 @@ CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline .ifndef NO_THREAD_UNWIND_STACK -CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions CFLAGS+=-D_PTHREAD_FORCED_UNWIND .endif From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 01:53:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFACD106566C; Fri, 8 Oct 2010 01:53:33 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B39488FC1D; Fri, 8 Oct 2010 01:53: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 o981rXBd074483; Fri, 8 Oct 2010 01:53:33 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o981rXZs074481; Fri, 8 Oct 2010 01:53:33 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010080153.o981rXZs074481@svn.freebsd.org> From: David Xu Date: Fri, 8 Oct 2010 01:53: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: r213541 - head/lib/libthr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 01:53:34 -0000 Author: davidxu Date: Fri Oct 8 01:53:33 2010 New Revision: 213541 URL: http://svn.freebsd.org/changeset/base/213541 Log: Oops, don't remove -fexceptions flag. Modified: head/lib/libthr/Makefile Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Fri Oct 8 01:52:01 2010 (r213540) +++ head/lib/libthr/Makefile Fri Oct 8 01:53:33 2010 (r213541) @@ -27,6 +27,7 @@ CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline .ifndef NO_THREAD_UNWIND_STACK +CFLAGS+=-fexceptions CFLAGS+=-D_PTHREAD_FORCED_UNWIND .endif From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 01:58:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58C57106564A; Fri, 8 Oct 2010 01:58:41 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh8.mail.rice.edu (mh8.mail.rice.edu [128.42.201.24]) by mx1.freebsd.org (Postfix) with ESMTP id 2801A8FC08; Fri, 8 Oct 2010 01:58:40 +0000 (UTC) Received: from mh8.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh8.mail.rice.edu (Postfix) with ESMTP id C25DB28F820; Thu, 7 Oct 2010 20:58:39 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh8.mail.rice.edu, auth channel Received: from mh8.mail.rice.edu ([127.0.0.1]) by mh8.mail.rice.edu (mh8.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 2QX4VxIypR+N; Thu, 7 Oct 2010 20:58:39 -0500 (CDT) 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 mh8.mail.rice.edu (Postfix) with ESMTPSA id 32E8C28F805; Thu, 7 Oct 2010 20:58:39 -0500 (CDT) Message-ID: <4CAE7ACE.1020005@rice.edu> Date: Thu, 07 Oct 2010 20:58:38 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Andriy Gapon References: <201010071811.o97IBXOO048985@svn.freebsd.org> In-Reply-To: <201010071811.o97IBXOO048985@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: r213527 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 01:58:41 -0000 Andriy Gapon wrote: > Author: avg > Date: Thu Oct 7 18:11:33 2010 > New Revision: 213527 > URL: http://svn.freebsd.org/changeset/base/213527 > > Log: > vm.kmem_map_size: a sysctl to query current kmem_map->size > > Based on a patch from Sandvine Incorporated via emaste. > > You might, in fact, find kmem_map->root->max_free to be more useful. root->max_free is the size of the largest, contiguous range of unused virtual addresses in the map. Alan From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 06:58:10 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37461065693; Fri, 8 Oct 2010 06:58:09 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id ED2378FC08; Fri, 8 Oct 2010 06:58:07 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 8FFCE9CB0CC; Fri, 8 Oct 2010 08:58:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2qepLU7p2SOB; Fri, 8 Oct 2010 08:58:04 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 89A259CB0E8; Fri, 8 Oct 2010 08:58:04 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id o986w4rS013630; Fri, 8 Oct 2010 08:58:04 +0200 (CEST) (envelope-from rdivacky) Date: Fri, 8 Oct 2010 08:58:04 +0200 From: Roman Divacky To: Dimitry Andric Message-ID: <20101008065804.GA13461@freebsd.org> References: <201010072031.o97KV7Mg060823@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010072031.o97KV7Mg060823@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213534 - in head: contrib/llvm contrib/llvm/autoconf contrib/llvm/include/llvm/ADT contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/ARM contrib/llvm/lib/Target/X86 contrib/llvm/tools/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 06:58:10 -0000 On Thu, Oct 07, 2010 at 08:31:07PM +0000, Dimitry Andric wrote: > Author: dim > Date: Thu Oct 7 20:31:07 2010 > New Revision: 213534 > URL: http://svn.freebsd.org/changeset/base/213534 > > Log: > Upgrade Clang and LLVM to the 2.8 release. See here for release notes: > http://llvm.org/releases/2.8/docs/ReleaseNotes.html now for the next update in 1-2 months which will bring us the llvm integrated assembler! From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:17:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81F05106564A; Fri, 8 Oct 2010 07:17:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 711388FC1A; Fri, 8 Oct 2010 07:17: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 o987HMLt082048; Fri, 8 Oct 2010 07:17:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987HMWq082046; Fri, 8 Oct 2010 07:17:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010080717.o987HMWq082046@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Oct 2010 07:17: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: r213543 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:17:22 -0000 Author: kib Date: Fri Oct 8 07:17:22 2010 New Revision: 213543 URL: http://svn.freebsd.org/changeset/base/213543 Log: Add a comment describing the reason for calling cache_purge(fvp). Requested by: danfe MFC after: 6 days Modified: head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Fri Oct 8 01:54:27 2010 (r213542) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Fri Oct 8 07:17:22 2010 (r213543) @@ -1258,6 +1258,13 @@ abortit: } } + /* + * The msdosfs lookup is case insensitive. Several aliases may + * be inserted for a single directory entry. As a consequnce, + * name cache purge done by lookup for fvp when DELETE op for + * namei is specified, might be not enough to expunge all + * namecache entries that were installed for this direntry. + */ cache_purge(fvp); VOP_UNLOCK(fvp, 0); bad: From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:18:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E9B1106566B; Fri, 8 Oct 2010 07:18:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DEE88FC14; Fri, 8 Oct 2010 07:18: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 o987Ii6h082123; Fri, 8 Oct 2010 07:18:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987IiJB082121; Fri, 8 Oct 2010 07:18:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010080718.o987IiJB082121@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Oct 2010 07:18: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: r213544 - head/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:18:44 -0000 Author: kib Date: Fri Oct 8 07:18:44 2010 New Revision: 213544 URL: http://svn.freebsd.org/changeset/base/213544 Log: Fix typo. Submitted by: arundel MFC after: 3 days Modified: head/sys/amd64/linux32/syscalls.master Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Fri Oct 8 07:17:22 2010 (r213543) +++ head/sys/amd64/linux32/syscalls.master Fri Oct 8 07:18:44 2010 (r213544) @@ -416,7 +416,7 @@ 245 AUE_NULL UNIMPL linux_io_setup 246 AUE_NULL UNIMPL linux_io_destroy 247 AUE_NULL UNIMPL linux_io_getevents -248 AUE_NULL UNIMPL inux_io_submit +248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel 250 AUE_NULL STD { int linux_fadvise64(void); } 251 AUE_NULL UNIMPL From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:19:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3983C1065672; Fri, 8 Oct 2010 07:19:06 +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 0E6ED8FC1B; Fri, 8 Oct 2010 07:19: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 o987J58F082183; Fri, 8 Oct 2010 07:19:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987J5q7082179; Fri, 8 Oct 2010 07:19:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010080719.o987J5q7082179@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Oct 2010 07:19: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: r213545 - head/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:19:06 -0000 Author: kib Date: Fri Oct 8 07:19:05 2010 New Revision: 213545 URL: http://svn.freebsd.org/changeset/base/213545 Log: Regen. Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_sysent.c Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Fri Oct 8 07:18:44 2010 (r213544) +++ head/sys/amd64/linux32/linux32_proto.h Fri Oct 8 07:19:05 2010 (r213545) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 210431 2010-07-23 21:30:33Z kib + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 213544 2010-10-08 07:18:44Z kib */ #ifndef _LINUX_SYSPROTO_H_ Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Fri Oct 8 07:18:44 2010 (r213544) +++ head/sys/amd64/linux32/linux32_syscall.h Fri Oct 8 07:19:05 2010 (r213545) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 210431 2010-07-23 21:30:33Z kib + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 213544 2010-10-08 07:18:44Z kib */ #define LINUX_SYS_exit 1 Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Fri Oct 8 07:18:44 2010 (r213544) +++ head/sys/amd64/linux32/linux32_sysent.c Fri Oct 8 07:19:05 2010 (r213545) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 210431 2010-07-23 21:30:33Z kib + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 213544 2010-10-08 07:18:44Z kib */ #include "opt_compat.h" @@ -267,7 +267,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 245 = linux_io_setup */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 246 = linux_io_destroy */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 247 = linux_io_getevents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = inux_io_submit */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = linux_io_cancel */ { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 251 = */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:26:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FAD0106566C; Fri, 8 Oct 2010 07:26:56 +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 5DAD28FC1E; Fri, 8 Oct 2010 07: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 o987QuIW082411; Fri, 8 Oct 2010 07:26:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987Quqg082409; Fri, 8 Oct 2010 07:26:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080726.o987Quqg082409@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213546 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:26:56 -0000 Author: avg Date: Fri Oct 8 07:26:56 2010 New Revision: 213546 URL: http://svn.freebsd.org/changeset/base/213546 Log: MFC r212950: zfs_vnops: use zfs_map_page/zfs_unmap_page helper functions in another place Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 8 07:19:05 2010 (r213545) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 8 07:26:56 2010 (r213546) @@ -512,14 +512,11 @@ again: dirbytes = 0; } if (error == 0) { - sched_pin(); - sf = sf_buf_alloc(m, SFB_CPUPRIVATE); - va = (caddr_t)sf_buf_kva(sf); + va = zfs_map_page(m, &sf); error = dmu_read(os, zp->z_id, start + off, bytes, (void *)(va + off), DMU_READ_PREFETCH); - sf_buf_free(sf); - sched_unpin(); + zfs_unmap_page(sf); } VM_OBJECT_LOCK(obj); if (error == 0) From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:29:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 060AD1065679; Fri, 8 Oct 2010 07:29:27 +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 E82D28FC17; Fri, 8 Oct 2010 07:29: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 o987TQd8082506; Fri, 8 Oct 2010 07:29:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987TQAt082504; Fri, 8 Oct 2010 07:29:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080729.o987TQAt082504@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213547 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:29:27 -0000 Author: avg Date: Fri Oct 8 07:29:26 2010 New Revision: 213547 URL: http://svn.freebsd.org/changeset/base/213547 Log: MFC r212951: zfs_map_page/zfs_unmap_page: do not use sched_pin() and SFB_CPUPRIVATE Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 8 07:26:56 2010 (r213546) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 8 07:29:26 2010 (r213547) @@ -360,8 +360,7 @@ static caddr_t zfs_map_page(vm_page_t pp, struct sf_buf **sfp) { - sched_pin(); - *sfp = sf_buf_alloc(pp, SFB_CPUPRIVATE); + *sfp = sf_buf_alloc(pp, 0); return ((caddr_t)sf_buf_kva(*sfp)); } @@ -370,7 +369,6 @@ zfs_unmap_page(struct sf_buf *sf) { sf_buf_free(sf); - sched_unpin(); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:31:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5342B1065670; Fri, 8 Oct 2010 07:31:33 +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 264BA8FC12; Fri, 8 Oct 2010 07:31: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 o987VXQC082615; Fri, 8 Oct 2010 07:31:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987VXkH082612; Fri, 8 Oct 2010 07:31:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080731.o987VXkH082612@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213548 - in stable/8/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:31:33 -0000 Author: avg Date: Fri Oct 8 07:31:32 2010 New Revision: 213548 URL: http://svn.freebsd.org/changeset/base/213548 Log: MFC r212657: zfs vn_has_cached_data: take into account v_object->cache != NULL Modified: stable/8/sys/cddl/compat/opensolaris/sys/vnode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/vnode.h Fri Oct 8 07:29:26 2010 (r213547) +++ stable/8/sys/cddl/compat/opensolaris/sys/vnode.h Fri Oct 8 07:31:32 2010 (r213548) @@ -69,7 +69,9 @@ vn_is_readonly(vnode_t *vp) #define vn_vfsunlock(vp) do { } while (0) #define vn_ismntpt(vp) ((vp)->v_type == VDIR && (vp)->v_mountedhere != NULL) #define vn_mountedvfs(vp) ((vp)->v_mountedhere) -#define vn_has_cached_data(vp) ((vp)->v_object != NULL && (vp)->v_object->resident_page_count > 0) +#define vn_has_cached_data(vp) \ + ((vp)->v_object != NULL && ((vp)->v_object->resident_page_count > 0 \ + || (vp)->v_object->cache != NULL)) #define vn_exists(vp) do { } while (0) #define vn_invalid(vp) do { } while (0) #define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 8 07:29:26 2010 (r213547) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 8 07:31:32 2010 (r213548) @@ -931,17 +931,7 @@ again: uioskip(uio, tx_bytes); } - /* - * XXXPJD: There are some cases (triggered by fsx) where - * vn_has_cached_data(vp) returns false when it should - * return true. This should be investigated. - */ -#if 0 - if (tx_bytes && vn_has_cached_data(vp)) -#else - if (tx_bytes && vp->v_object != NULL) -#endif - { + if (tx_bytes && vn_has_cached_data(vp)) { update_pages(vp, woff, tx_bytes, zfsvfs->z_os, zp->z_id, uio->uio_segflg, tx); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:33:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2F261065675; Fri, 8 Oct 2010 07:33:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C12948FC14; Fri, 8 Oct 2010 07:33: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 o987XMHL082716; Fri, 8 Oct 2010 07:33:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987XMLv082714; Fri, 8 Oct 2010 07:33:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080733.o987XMLv082714@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213549 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:33:22 -0000 Author: avg Date: Fri Oct 8 07:33:22 2010 New Revision: 213549 URL: http://svn.freebsd.org/changeset/base/213549 Log: MFC r212780: zfs arc_reclaim_needed: more reasonable threshold for available pages Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 8 07:31:32 2010 (r213548) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 8 07:33:22 2010 (r213549) @@ -2161,10 +2161,10 @@ arc_reclaim_needed(void) return (0); /* - * If pages are needed or we're within 2048 pages - * of needing to page need to reclaim + * Cooperate with pagedaemon when it's time for it to scan + * and reclaim some pages. */ - if (vm_pages_needed || (vm_paging_target() > -2048)) + if (vm_paging_need()) return (1); #if 0 From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:34:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F709106566B; Fri, 8 Oct 2010 07:34:33 +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 F1E698FC1B; Fri, 8 Oct 2010 07:34: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 o987YWS7082785; Fri, 8 Oct 2010 07:34:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987YWdr082783; Fri, 8 Oct 2010 07:34:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080734.o987YWdr082783@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213550 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:34:33 -0000 Author: avg Date: Fri Oct 8 07:34:32 2010 New Revision: 213550 URL: http://svn.freebsd.org/changeset/base/213550 Log: MFC r212783: zfs arc_reclaim_needed: fix typo in mismerge in r212780 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 8 07:33:22 2010 (r213549) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 8 07:34:32 2010 (r213550) @@ -2164,7 +2164,7 @@ arc_reclaim_needed(void) * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. */ - if (vm_paging_need()) + if (vm_paging_needed()) return (1); #if 0 From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:36:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77061106566C; Fri, 8 Oct 2010 07:36:31 +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 650E98FC12; Fri, 8 Oct 2010 07:36: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 o987aVIv082880; Fri, 8 Oct 2010 07:36:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987aVKk082878; Fri, 8 Oct 2010 07:36:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080736.o987aVKk082878@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213551 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:36:31 -0000 Author: avg Date: Fri Oct 8 07:36:30 2010 New Revision: 213551 URL: http://svn.freebsd.org/changeset/base/213551 Log: MFC r212781: zfs arc_reclaim_needed: remove redundant checks for arc_c_max and arc_c_max Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 8 07:34:32 2010 (r213550) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Oct 8 07:36:30 2010 (r213551) @@ -2155,10 +2155,6 @@ arc_reclaim_needed(void) #ifdef _KERNEL if (needfree) return (1); - if (arc_size > arc_c_max) - return (1); - if (arc_size <= arc_c_min) - return (0); /* * Cooperate with pagedaemon when it's time for it to scan From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:38:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44D7F1065674; Fri, 8 Oct 2010 07:38:45 +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 336CD8FC1B; Fri, 8 Oct 2010 07:38:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o987cj95082968; Fri, 8 Oct 2010 07:38:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987cjfd082966; Fri, 8 Oct 2010 07:38:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080738.o987cjfd082966@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213552 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:38:45 -0000 Author: avg Date: Fri Oct 8 07:38:44 2010 New Revision: 213552 URL: http://svn.freebsd.org/changeset/base/213552 Log: MFC r212964: kdb_backtrace: stack(9)-based code to print backtrace without any backend Modified: stable/8/sys/kern/subr_kdb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Fri Oct 8 07:36:30 2010 (r213551) +++ stable/8/sys/kern/subr_kdb.c Fri Oct 8 07:38:44 2010 (r213552) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" +#include "opt_stack.h" #include #include @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -300,6 +302,15 @@ kdb_backtrace(void) printf("KDB: stack backtrace:\n"); kdb_dbbe->dbbe_trace(); } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace:\n"); + stack_save(&st); + stack_print(&st); + } +#endif } /* From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:49:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81000106566B; Fri, 8 Oct 2010 07:49:06 +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 647288FC08; Fri, 8 Oct 2010 07:49:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o987n6j5083247; Fri, 8 Oct 2010 07:49:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987n6iC083243; Fri, 8 Oct 2010 07:49:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080749.o987n6iC083243@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213553 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:49:06 -0000 Author: avg Date: Fri Oct 8 07:49:05 2010 New Revision: 213553 URL: http://svn.freebsd.org/changeset/base/213553 Log: MFC r212994: kdb_backtrace: use stack_print_ddb instead of stack_print Modified: stable/8/sys/kern/kern_linker.c stable/8/sys/kern/subr_kdb.c stable/8/sys/kern/subr_stack.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_linker.c ============================================================================== --- stable/8/sys/kern/kern_linker.c Fri Oct 8 07:38:44 2010 (r213552) +++ stable/8/sys/kern/kern_linker.c Fri Oct 8 07:49:05 2010 (r213553) @@ -919,7 +919,6 @@ linker_debug_search_symbol_name(caddr_t return (0); } -#ifdef DDB /* * DDB Helpers. DDB has to look across multiple files with their own symbol * tables and string tables. @@ -928,12 +927,14 @@ linker_debug_search_symbol_name(caddr_t * DDB to hang because somebody's got the lock held. We'll take the chance * that the files list is inconsistant instead. */ +#ifdef DDB int linker_ddb_lookup(const char *symstr, c_linker_sym_t *sym) { return (linker_debug_lookup(symstr, sym)); } +#endif int linker_ddb_search_symbol(caddr_t value, c_linker_sym_t *sym, long *diffp) @@ -956,7 +957,6 @@ linker_ddb_search_symbol_name(caddr_t va return (linker_debug_search_symbol_name(value, buf, buflen, offset)); } -#endif /* * stack(9) helper for non-debugging environemnts. Unlike DDB helpers, we do Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Fri Oct 8 07:38:44 2010 (r213552) +++ stable/8/sys/kern/subr_kdb.c Fri Oct 8 07:49:05 2010 (r213553) @@ -308,7 +308,7 @@ kdb_backtrace(void) printf("KDB: stack backtrace:\n"); stack_save(&st); - stack_print(&st); + stack_print_ddb(&st); } #endif } Modified: stable/8/sys/kern/subr_stack.c ============================================================================== --- stable/8/sys/kern/subr_stack.c Fri Oct 8 07:38:44 2010 (r213552) +++ stable/8/sys/kern/subr_stack.c Fri Oct 8 07:49:05 2010 (r213553) @@ -44,9 +44,7 @@ static MALLOC_DEFINE(M_STACK, "stack", " static int stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen, long *offset); -#ifdef DDB static int stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset); -#endif struct stack * stack_create(void) @@ -125,7 +123,6 @@ stack_print_short(struct stack *st) printf("\n"); } -#ifdef DDB void stack_print_ddb(struct stack *st) { @@ -141,6 +138,7 @@ stack_print_ddb(struct stack *st) } } +#ifdef DDB void stack_print_short_ddb(struct stack *st) { @@ -255,7 +253,6 @@ stack_symbol(vm_offset_t pc, char *nameb return (0); } -#ifdef DDB static int stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset) { @@ -275,4 +272,3 @@ stack_symbol_ddb(vm_offset_t pc, const c *name = "??"; return (ENOENT); } -#endif From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:52:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08921106566C; Fri, 8 Oct 2010 07:52:01 +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 EB0EE8FC12; Fri, 8 Oct 2010 07:52: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 o987q0lp083365; Fri, 8 Oct 2010 07:52:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987q0jx083363; Fri, 8 Oct 2010 07:52:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080752.o987q0jx083363@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213554 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:52:01 -0000 Author: avg Date: Fri Oct 8 07:52:00 2010 New Revision: 213554 URL: http://svn.freebsd.org/changeset/base/213554 Log: MFC r213303: kmem_size* sysctls: hint that these are also tunables Modified: stable/8/sys/kern/kern_malloc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_malloc.c ============================================================================== --- stable/8/sys/kern/kern_malloc.c Fri Oct 8 07:49:05 2010 (r213553) +++ stable/8/sys/kern/kern_malloc.c Fri Oct 8 07:52:00 2010 (r213554) @@ -182,19 +182,19 @@ struct { static uma_zone_t mt_zone; u_long vm_kmem_size; -SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RD, &vm_kmem_size, 0, +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, "Size of kernel memory"); static u_long vm_kmem_size_min; -SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RD, &vm_kmem_size_min, 0, +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RDTUN, &vm_kmem_size_min, 0, "Minimum size of kernel memory"); static u_long vm_kmem_size_max; -SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RD, &vm_kmem_size_max, 0, +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RDTUN, &vm_kmem_size_max, 0, "Maximum size of kernel memory"); static u_int vm_kmem_size_scale; -SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RD, &vm_kmem_size_scale, 0, +SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0, "Scale factor for kernel memory size"); /* From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:54:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82FE2106564A; Fri, 8 Oct 2010 07:54:55 +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 70AD48FC13; Fri, 8 Oct 2010 07:54: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 o987stG1083472; Fri, 8 Oct 2010 07:54:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987stDM083470; Fri, 8 Oct 2010 07:54:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080754.o987stDM083470@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213555 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:54:55 -0000 Author: avg Date: Fri Oct 8 07:54:55 2010 New Revision: 213555 URL: http://svn.freebsd.org/changeset/base/213555 Log: MFC r213303: kmem_size* sysctls: hint that these are also tunables Modified: stable/7/sys/kern/kern_malloc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_malloc.c ============================================================================== --- stable/7/sys/kern/kern_malloc.c Fri Oct 8 07:52:00 2010 (r213554) +++ stable/7/sys/kern/kern_malloc.c Fri Oct 8 07:54:55 2010 (r213555) @@ -182,19 +182,19 @@ struct { static uma_zone_t mt_zone; u_long vm_kmem_size; -SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RD, &vm_kmem_size, 0, +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, "Size of kernel memory"); static u_long vm_kmem_size_min; -SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RD, &vm_kmem_size_min, 0, +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RDTUN, &vm_kmem_size_min, 0, "Minimum size of kernel memory"); static u_long vm_kmem_size_max; -SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RD, &vm_kmem_size_max, 0, +SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RDTUN, &vm_kmem_size_max, 0, "Maximum size of kernel memory"); static u_int vm_kmem_size_scale; -SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RD, &vm_kmem_size_scale, 0, +SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0, "Scale factor for kernel memory size"); /* From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:57:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1143D1065670; Fri, 8 Oct 2010 07:57:20 +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 F3E388FC19; Fri, 8 Oct 2010 07:57: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 o987vJ21083586; Fri, 8 Oct 2010 07:57:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987vJBt083584; Fri, 8 Oct 2010 07:57:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080757.o987vJBt083584@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213556 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:57:20 -0000 Author: avg Date: Fri Oct 8 07:57:19 2010 New Revision: 213556 URL: http://svn.freebsd.org/changeset/base/213556 Log: MFC r213304: debug.kdb.stop_cpus sysctl: hint that this is also a tunable Modified: stable/8/sys/kern/subr_kdb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Fri Oct 8 07:54:55 2010 (r213555) +++ stable/8/sys/kern/subr_kdb.c Fri Oct 8 07:57:19 2010 (r213556) @@ -95,7 +95,7 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_c */ #ifdef SMP static int kdb_stop_cpus = 1; -SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLFLAG_RW | CTLFLAG_TUN, &kdb_stop_cpus, 0, "stop other CPUs when entering the debugger"); TUNABLE_INT("debug.kdb.stop_cpus", &kdb_stop_cpus); #endif From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 07:58:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15BB71065694; Fri, 8 Oct 2010 07:58:58 +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 043738FC2D; Fri, 8 Oct 2010 07:58: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 o987wvn7083667; Fri, 8 Oct 2010 07:58:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o987wvaL083665; Fri, 8 Oct 2010 07:58:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080758.o987wvaL083665@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 07:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213557 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 07:58:58 -0000 Author: avg Date: Fri Oct 8 07:58:57 2010 New Revision: 213557 URL: http://svn.freebsd.org/changeset/base/213557 Log: MFC r213304: debug.kdb.stop_cpus sysctl: hint that this is also a tunable Modified: stable/7/sys/kern/subr_kdb.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/subr_kdb.c ============================================================================== --- stable/7/sys/kern/subr_kdb.c Fri Oct 8 07:57:19 2010 (r213556) +++ stable/7/sys/kern/subr_kdb.c Fri Oct 8 07:58:57 2010 (r213557) @@ -92,7 +92,7 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_c */ #ifdef SMP static int kdb_stop_cpus = 1; -SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLFLAG_RW | CTLFLAG_TUN, &kdb_stop_cpus, 0, "stop other CPUs when entering the debugger"); TUNABLE_INT("debug.kdb.stop_cpus", &kdb_stop_cpus); #endif From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 08:01:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A13F106564A; Fri, 8 Oct 2010 08:01:37 +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 2DC508FC1B; Fri, 8 Oct 2010 08:01: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 o9881b02083806; Fri, 8 Oct 2010 08:01:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9881bN8083802; Fri, 8 Oct 2010 08:01:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080801.o9881bN8083802@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 08:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213558 - in stable/8/sys: gdb kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 08:01:37 -0000 Author: avg Date: Fri Oct 8 08:01:36 2010 New Revision: 213558 URL: http://svn.freebsd.org/changeset/base/213558 Log: MFC r213305: there must be only one SYSINIT with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order Modified: stable/8/sys/gdb/gdb_cons.c stable/8/sys/kern/kern_ntptime.c stable/8/sys/sys/sched.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/gdb/gdb_cons.c ============================================================================== --- stable/8/sys/gdb/gdb_cons.c Fri Oct 8 07:58:57 2010 (r213557) +++ stable/8/sys/gdb/gdb_cons.c Fri Oct 8 08:01:36 2010 (r213558) @@ -126,7 +126,7 @@ oktousecallout(void *data __unused) { calloutok = 1; } -SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, oktousecallout, NULL); +SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL); static void gdb_cnputc(struct consdev *cp, int c) Modified: stable/8/sys/kern/kern_ntptime.c ============================================================================== --- stable/8/sys/kern/kern_ntptime.c Fri Oct 8 07:58:57 2010 (r213557) +++ stable/8/sys/kern/kern_ntptime.c Fri Oct 8 08:01:36 2010 (r213558) @@ -1035,5 +1035,5 @@ start_periodic_resettodr(void *arg __unu periodic_resettodr, NULL); } -SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY - 1, +SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, start_periodic_resettodr, NULL); Modified: stable/8/sys/sys/sched.h ============================================================================== --- stable/8/sys/sys/sched.h Fri Oct 8 07:58:57 2010 (r213557) +++ stable/8/sys/sys/sched.h Fri Oct 8 08:01:36 2010 (r213558) @@ -173,7 +173,7 @@ static void name ## _add_proc(void *dumm #name, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, \ ptr, 0, sysctl_dpcpu_long, "LU", descr); \ } \ -SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, name ## _add_proc, NULL); +SYSINIT(name, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, name ## _add_proc, NULL); #define SCHED_STAT_DEFINE(name, descr) \ DPCPU_DEFINE(unsigned long, name); \ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 08:09:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16881106564A; Fri, 8 Oct 2010 08:09:46 +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 04C0A8FC12; Fri, 8 Oct 2010 08:09: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 o9889jvu084019; Fri, 8 Oct 2010 08:09:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9889jMH084016; Fri, 8 Oct 2010 08:09:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080809.o9889jMH084016@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 08:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213559 - in stable/7/sys: gdb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 08:09:46 -0000 Author: avg Date: Fri Oct 8 08:09:45 2010 New Revision: 213559 URL: http://svn.freebsd.org/changeset/base/213559 Log: MFC r213305: there must be only one SYSINIT with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order Modified: stable/7/sys/gdb/gdb_cons.c stable/7/sys/kern/kern_ntptime.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/gdb/gdb_cons.c ============================================================================== --- stable/7/sys/gdb/gdb_cons.c Fri Oct 8 08:01:36 2010 (r213558) +++ stable/7/sys/gdb/gdb_cons.c Fri Oct 8 08:09:45 2010 (r213559) @@ -126,7 +126,7 @@ oktousecallout(void *data __unused) { calloutok = 1; } -SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, oktousecallout, NULL); +SYSINIT(gdbhack, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, oktousecallout, NULL); static void gdb_cnputc(struct consdev *cp, int c) Modified: stable/7/sys/kern/kern_ntptime.c ============================================================================== --- stable/7/sys/kern/kern_ntptime.c Fri Oct 8 08:01:36 2010 (r213558) +++ stable/7/sys/kern/kern_ntptime.c Fri Oct 8 08:09:45 2010 (r213559) @@ -1037,5 +1037,5 @@ start_periodic_resettodr(void *arg __unu periodic_resettodr, NULL); } -SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY - 1, +SYSINIT(periodic_resettodr, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, start_periodic_resettodr, NULL); From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 08:13:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8C27106564A; Fri, 8 Oct 2010 08:13:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 970038FC15; Fri, 8 Oct 2010 08:13: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 o988DM4Z084158; Fri, 8 Oct 2010 08:13:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o988DMew084156; Fri, 8 Oct 2010 08:13:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080813.o988DMew084156@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 08:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213560 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 08:13:22 -0000 Author: avg Date: Fri Oct 8 08:13:22 2010 New Revision: 213560 URL: http://svn.freebsd.org/changeset/base/213560 Log: MFC r213322: sysctls in kern_shutdown: add twin tunables Modified: stable/8/sys/kern/kern_shutdown.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_shutdown.c ============================================================================== --- stable/8/sys/kern/kern_shutdown.c Fri Oct 8 08:09:45 2010 (r213559) +++ stable/8/sys/kern/kern_shutdown.c Fri Oct 8 08:13:22 2010 (r213560) @@ -98,21 +98,24 @@ int debugger_on_panic = 0; #else int debugger_on_panic = 1; #endif -SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW | CTLFLAG_TUN, &debugger_on_panic, 0, "Run debugger on kernel panic"); +TUNABLE_INT("debug.debugger_on_panic", &debugger_on_panic); #ifdef KDB_TRACE -int trace_on_panic = 1; +static int trace_on_panic = 1; #else -int trace_on_panic = 0; +static int trace_on_panic = 0; #endif -SYSCTL_INT(_debug, OID_AUTO, trace_on_panic, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, trace_on_panic, CTLFLAG_RW | CTLFLAG_TUN, &trace_on_panic, 0, "Print stack trace on kernel panic"); +TUNABLE_INT("debug.trace_on_panic", &trace_on_panic); #endif /* KDB */ -int sync_on_panic = 0; -SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RW, +static int sync_on_panic = 0; +SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RW | CTLFLAG_TUN, &sync_on_panic, 0, "Do a sync before rebooting from a panic"); +TUNABLE_INT("kern.sync_on_panic", &sync_on_panic); SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment"); From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 08:14:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DA1D1065672; Fri, 8 Oct 2010 08:14:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF9C8FC19; Fri, 8 Oct 2010 08:14: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 o988EhPo084231; Fri, 8 Oct 2010 08:14:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o988EhYA084229; Fri, 8 Oct 2010 08:14:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010080814.o988EhYA084229@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Oct 2010 08:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213561 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 08:14:43 -0000 Author: avg Date: Fri Oct 8 08:14:43 2010 New Revision: 213561 URL: http://svn.freebsd.org/changeset/base/213561 Log: MFC r213322: sysctls in kern_shutdown: add twin tunables Modified: stable/7/sys/kern/kern_shutdown.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_shutdown.c ============================================================================== --- stable/7/sys/kern/kern_shutdown.c Fri Oct 8 08:13:22 2010 (r213560) +++ stable/7/sys/kern/kern_shutdown.c Fri Oct 8 08:14:43 2010 (r213561) @@ -97,21 +97,24 @@ int debugger_on_panic = 0; #else int debugger_on_panic = 1; #endif -SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW | CTLFLAG_TUN, &debugger_on_panic, 0, "Run debugger on kernel panic"); +TUNABLE_INT("debug.debugger_on_panic", &debugger_on_panic); #ifdef KDB_TRACE -int trace_on_panic = 1; +static int trace_on_panic = 1; #else -int trace_on_panic = 0; +static int trace_on_panic = 0; #endif -SYSCTL_INT(_debug, OID_AUTO, trace_on_panic, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, trace_on_panic, CTLFLAG_RW | CTLFLAG_TUN, &trace_on_panic, 0, "Print stack trace on kernel panic"); +TUNABLE_INT("debug.trace_on_panic", &trace_on_panic); #endif /* KDB */ -int sync_on_panic = 0; -SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RW, +static int sync_on_panic = 0; +SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RW | CTLFLAG_TUN, &sync_on_panic, 0, "Do a sync before rebooting from a panic"); +TUNABLE_INT("kern.sync_on_panic", &sync_on_panic); SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment"); From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 09:17:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 2EC031065670; Fri, 8 Oct 2010 09:17:46 +0000 (UTC) Date: Fri, 8 Oct 2010 09:17:46 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Message-ID: <20101008091746.GB21612@FreeBSD.org> References: <201010080717.o987HMWq082046@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201010080717.o987HMWq082046@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: r213543 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 09:17:46 -0000 On Fri, Oct 08, 2010 at 07:17:22AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Oct 8 07:17:22 2010 > New Revision: 213543 > URL: http://svn.freebsd.org/changeset/base/213543 > > Log: > Add a comment describing the reason for calling cache_purge(fvp). > > Requested by: danfe Thanks, but that was just a kind suggestion. :-) ./danfe From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 09:32:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88CCB106564A; Fri, 8 Oct 2010 09:32:38 +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 49FFC8FC1C; Fri, 8 Oct 2010 09:32: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 o989WcNm086148; Fri, 8 Oct 2010 09:32:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o989Wcfg086145; Fri, 8 Oct 2010 09:32:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010080932.o989Wcfg086145@svn.freebsd.org> From: Ed Schouten Date: Fri, 8 Oct 2010 09:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213562 - vendor/ee/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 09:32:38 -0000 Author: ed Date: Fri Oct 8 09:32:37 2010 New Revision: 213562 URL: http://svn.freebsd.org/changeset/base/213562 Log: Import ee 1.5.1. Modified: vendor/ee/dist/ee.c vendor/ee/dist/ee_version.h Modified: vendor/ee/dist/ee.c ============================================================================== --- vendor/ee/dist/ee.c Fri Oct 8 08:14:43 2010 (r213561) +++ vendor/ee/dist/ee.c Fri Oct 8 09:32:37 2010 (r213562) @@ -50,7 +50,7 @@ | proprietary information which is protected by | copyright. All rights are reserved. | - | $Header: /home/hugh/sources/old_ae/RCS/ee.c,v 1.102 2009/02/17 03:22:50 hugh Exp hugh $ + | $Header: /home/hugh/sources/old_ae/RCS/ee.c,v 1.103 2010/05/20 03:40:29 hugh Exp hugh $ | */ @@ -59,7 +59,7 @@ char *ee_copyright_message = #include "ee_version.h" -char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.102 $"; +char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.103 $"; #ifdef NCURSE #include "new_curse.h" @@ -308,7 +308,7 @@ void undel_word P_((void)); void del_line P_((void)); void undel_line P_((void)); void adv_word P_((void)); -void move_rel P_((char *direction, int lines)); +void move_rel P_((char direction, int lines)); void eol P_((void)); void bol P_((void)); void adv_line P_((void)); @@ -552,7 +552,7 @@ char *argv[]; { int counter; - for (counter = 1; counter < 24; counter++) + for (counter = 1; counter < SIGUNUSED; counter++) signal(counter, SIG_IGN); signal(SIGCHLD, SIG_DFL); @@ -825,7 +825,6 @@ int disp; } else if (curr_line->prev_line != NULL) { - absolute_lin--; text_changes = TRUE; left(disp); /* go to previous line */ temp_buff = curr_line->next_line; @@ -1221,11 +1220,11 @@ control() /* use control for commands else if (in == 13) /* control m */ insert_line(TRUE); else if (in == 14) /* control n */ - move_rel("d", max(5, (last_line - 5))); + move_rel('d', max(5, (last_line - 5))); else if (in == 15) /* control o */ eol(); else if (in == 16) /* control p */ - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == 17) /* control q */ ; else if (in == 18) /* control r */ @@ -1276,7 +1275,7 @@ emacs_control() else if (in == 6) /* control f */ right(TRUE); else if (in == 7) /* control g */ - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == 8) /* control h */ delete(TRUE); else if (in == 9) /* control i */ @@ -1315,7 +1314,7 @@ emacs_control() else if (in == 21) /* control u */ bottom(); else if (in == 22) /* control v */ - move_rel("d", max(5, (last_line - 5))); + move_rel('d', max(5, (last_line - 5))); else if (in == 23) /* control w */ del_word(); else if (in == 24) /* control x */ @@ -1550,9 +1549,9 @@ function_key() /* process function ke else if (in == KEY_DOWN) down(); else if (in == KEY_NPAGE) - move_rel("d", max( 5, (last_line - 5))); + move_rel('d', max( 5, (last_line - 5))); else if (in == KEY_PPAGE) - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == KEY_DL) del_line(); else if (in == KEY_DC) @@ -1990,7 +1989,7 @@ char *cmd_str; int number; int i; char *ptr; - char *direction = NULL; + char direction = '\0'; struct text *t_line; ptr = cmd_str; @@ -2007,12 +2006,12 @@ char *cmd_str; { i++; t_line = t_line->prev_line; - direction = "u"; + direction = 'u'; } while ((t_line->line_number < number) && (t_line->next_line != NULL)) { i++; - direction = "d"; + direction = 'd'; t_line = t_line->next_line; } if ((i < 30) && (i > 0)) @@ -2021,7 +2020,7 @@ char *cmd_str; } else { - if (!strcmp(direction, "d")) + if (direction != 'd') { absolute_lin += i; } @@ -2218,7 +2217,7 @@ check_fp() /* open or close files accor if (start_at_line != NULL) { line_num = atoi(start_at_line) - 1; - move_rel("d", line_num); + move_rel('d', line_num); line_num = 0; start_at_line = NULL; } @@ -2661,7 +2660,7 @@ int display_message; { if (lines_moved < 30) { - move_rel("d", lines_moved); + move_rel('d', lines_moved); while (position < iter) right(TRUE); } @@ -2941,13 +2940,13 @@ while ((position < curr_line->line_lengt void move_rel(direction, lines) /* move relative to current line */ -char *direction; +char direction; int lines; { int i; char *tmp; - if (*direction == 'u') + if (direction == 'u') { scr_pos = 0; while (position > 1) Modified: vendor/ee/dist/ee_version.h ============================================================================== --- vendor/ee/dist/ee_version.h Fri Oct 8 08:14:43 2010 (r213561) +++ vendor/ee/dist/ee_version.h Fri Oct 8 09:32:37 2010 (r213562) @@ -2,5 +2,5 @@ | provide a version number for ee */ -#define EE_VERSION "1.5.0" -#define DATE_STRING "$Date: 2009/02/17 03:32:30 $" +#define EE_VERSION "1.5.1" +#define DATE_STRING "$Date: 2010/05/20 03:43:33 $" From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 09:33:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A7491065674; Fri, 8 Oct 2010 09:33:22 +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 1EF048FC1B; Fri, 8 Oct 2010 09:33: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 o989XMuv086219; Fri, 8 Oct 2010 09:33:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o989XMut086218; Fri, 8 Oct 2010 09:33:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010080933.o989XMut086218@svn.freebsd.org> From: Ed Schouten Date: Fri, 8 Oct 2010 09:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213563 - vendor/ee/ee-1.5.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 09:33:22 -0000 Author: ed Date: Fri Oct 8 09:33:21 2010 New Revision: 213563 URL: http://svn.freebsd.org/changeset/base/213563 Log: Tag ee 1.5.1. Added: vendor/ee/ee-1.5.1/ - copied from r213562, vendor/ee/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 09:33:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DFC51065679; Fri, 8 Oct 2010 09:33:53 +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 D6A3D8FC1D; Fri, 8 Oct 2010 09:33: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 o989Xqv8086270; Fri, 8 Oct 2010 09:33:52 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o989XqQW086269; Fri, 8 Oct 2010 09:33:52 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010080933.o989XqQW086269@svn.freebsd.org> From: Ed Schouten Date: Fri, 8 Oct 2010 09:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213564 - in vendor/ee: 1.5.1 ee-1.5.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 09:33:53 -0000 Author: ed Date: Fri Oct 8 09:33:52 2010 New Revision: 213564 URL: http://svn.freebsd.org/changeset/base/213564 Log: Make tag name consistent. Added: vendor/ee/1.5.1/ - copied from r213563, vendor/ee/ee-1.5.1/ Deleted: vendor/ee/ee-1.5.1/ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 09:34:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A18A81065672; Fri, 8 Oct 2010 09:34:59 +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 89E308FC14; Fri, 8 Oct 2010 09:34: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 o989Yxjr086330; Fri, 8 Oct 2010 09:34:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o989YxxU086327; Fri, 8 Oct 2010 09:34:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010080934.o989YxxU086327@svn.freebsd.org> From: Ed Schouten Date: Fri, 8 Oct 2010 09:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213565 - vendor/ee/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 09:34:59 -0000 Author: ed Date: Fri Oct 8 09:34:59 2010 New Revision: 213565 URL: http://svn.freebsd.org/changeset/base/213565 Log: Import ee 1.5.2. Modified: vendor/ee/dist/ee.c vendor/ee/dist/ee_version.h Modified: vendor/ee/dist/ee.c ============================================================================== --- vendor/ee/dist/ee.c Fri Oct 8 09:33:52 2010 (r213564) +++ vendor/ee/dist/ee.c Fri Oct 8 09:34:59 2010 (r213565) @@ -50,7 +50,7 @@ | proprietary information which is protected by | copyright. All rights are reserved. | - | $Header: /home/hugh/sources/old_ae/RCS/ee.c,v 1.103 2010/05/20 03:40:29 hugh Exp hugh $ + | $Header: /home/hugh/sources/old_ae/RCS/ee.c,v 1.104 2010/06/04 01:55:31 hugh Exp hugh $ | */ @@ -59,7 +59,7 @@ char *ee_copyright_message = #include "ee_version.h" -char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.103 $"; +char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.104 $"; #ifdef NCURSE #include "new_curse.h" @@ -817,7 +817,7 @@ int disp; tp++; temp2++; } - if (scr_horz < horiz_offset) + if ((scr_horz < horiz_offset) && (horiz_offset > 0)) { horiz_offset -= 8; midscreen(scr_vert, point); @@ -2730,8 +2730,8 @@ del_char() /* delete current character } else { - right(FALSE); - delete(FALSE); + right(TRUE); + delete(TRUE); } } Modified: vendor/ee/dist/ee_version.h ============================================================================== --- vendor/ee/dist/ee_version.h Fri Oct 8 09:33:52 2010 (r213564) +++ vendor/ee/dist/ee_version.h Fri Oct 8 09:34:59 2010 (r213565) @@ -2,5 +2,5 @@ | provide a version number for ee */ -#define EE_VERSION "1.5.1" -#define DATE_STRING "$Date: 2010/05/20 03:43:33 $" +#define EE_VERSION "1.5.2" +#define DATE_STRING "$Date: 2010/06/04 02:35:35 $" From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 09:35:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7446F106566C; Fri, 8 Oct 2010 09:35:23 +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 48C568FC12; Fri, 8 Oct 2010 09: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 o989ZNa1086386; Fri, 8 Oct 2010 09:35:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o989ZNJ1086385; Fri, 8 Oct 2010 09:35:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010080935.o989ZNJ1086385@svn.freebsd.org> From: Ed Schouten Date: Fri, 8 Oct 2010 09:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213566 - vendor/ee/1.5.2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 09:35:23 -0000 Author: ed Date: Fri Oct 8 09:35:23 2010 New Revision: 213566 URL: http://svn.freebsd.org/changeset/base/213566 Log: Tag ee 1.5.2. Added: vendor/ee/1.5.2/ - copied from r213565, vendor/ee/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 09:43:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6970106566B; Fri, 8 Oct 2010 09:43:06 +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 D4DB98FC13; Fri, 8 Oct 2010 09:43: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 o989h6Ls086578; Fri, 8 Oct 2010 09:43:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o989h6Rp086575; Fri, 8 Oct 2010 09:43:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010080943.o989h6Rp086575@svn.freebsd.org> From: Ed Schouten Date: Fri, 8 Oct 2010 09:43: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: r213567 - head/contrib/ee X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 09:43:07 -0000 Author: ed Date: Fri Oct 8 09:43:06 2010 New Revision: 213567 URL: http://svn.freebsd.org/changeset/base/213567 Log: Import ee 1.5.2 into HEAD. PR: bin/145921 MFC after: 2 weeks Modified: head/contrib/ee/ee.c head/contrib/ee/ee_version.h Directory Properties: head/contrib/ee/ (props changed) Modified: head/contrib/ee/ee.c ============================================================================== --- head/contrib/ee/ee.c Fri Oct 8 09:35:23 2010 (r213566) +++ head/contrib/ee/ee.c Fri Oct 8 09:43:06 2010 (r213567) @@ -50,7 +50,7 @@ | proprietary information which is protected by | copyright. All rights are reserved. | - | $Header: /home/hugh/sources/old_ae/RCS/ee.c,v 1.102 2009/02/17 03:22:50 hugh Exp hugh $ + | $Header: /home/hugh/sources/old_ae/RCS/ee.c,v 1.104 2010/06/04 01:55:31 hugh Exp hugh $ | */ @@ -62,7 +62,7 @@ char *ee_copyright_message = #include "ee_version.h" -char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.102 $"; +char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.104 $"; #ifdef NCURSE #include "new_curse.h" @@ -307,7 +307,7 @@ void undel_word P_((void)); void del_line P_((void)); void undel_line P_((void)); void adv_word P_((void)); -void move_rel P_((char *direction, int lines)); +void move_rel P_((char direction, int lines)); void eol P_((void)); void bol P_((void)); void adv_line P_((void)); @@ -816,7 +816,7 @@ int disp; tp++; temp2++; } - if (scr_horz < horiz_offset) + if ((scr_horz < horiz_offset) && (horiz_offset > 0)) { horiz_offset -= 8; midscreen(scr_vert, point); @@ -824,7 +824,6 @@ int disp; } else if (curr_line->prev_line != NULL) { - absolute_lin--; text_changes = TRUE; left(disp); /* go to previous line */ temp_buff = curr_line->next_line; @@ -1220,11 +1219,11 @@ control() /* use control for commands else if (in == 13) /* control m */ insert_line(TRUE); else if (in == 14) /* control n */ - move_rel("d", max(5, (last_line - 5))); + move_rel('d', max(5, (last_line - 5))); else if (in == 15) /* control o */ eol(); else if (in == 16) /* control p */ - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == 17) /* control q */ ; else if (in == 18) /* control r */ @@ -1275,7 +1274,7 @@ emacs_control() else if (in == 6) /* control f */ right(TRUE); else if (in == 7) /* control g */ - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == 8) /* control h */ delete(TRUE); else if (in == 9) /* control i */ @@ -1314,7 +1313,7 @@ emacs_control() else if (in == 21) /* control u */ bottom(); else if (in == 22) /* control v */ - move_rel("d", max(5, (last_line - 5))); + move_rel('d', max(5, (last_line - 5))); else if (in == 23) /* control w */ del_word(); else if (in == 24) /* control x */ @@ -1549,9 +1548,9 @@ function_key() /* process function ke else if (in == KEY_DOWN) down(); else if (in == KEY_NPAGE) - move_rel("d", max( 5, (last_line - 5))); + move_rel('d', max( 5, (last_line - 5))); else if (in == KEY_PPAGE) - move_rel("u", max(5, (last_line - 5))); + move_rel('u', max(5, (last_line - 5))); else if (in == KEY_DL) del_line(); else if (in == KEY_DC) @@ -1989,7 +1988,7 @@ char *cmd_str; int number; int i; char *ptr; - char *direction = "d"; + char direction = '\0'; struct text *t_line; ptr = cmd_str; @@ -2006,12 +2005,12 @@ char *cmd_str; { i++; t_line = t_line->prev_line; - direction = "u"; + direction = 'u'; } while ((t_line->line_number < number) && (t_line->next_line != NULL)) { i++; - direction = "d"; + direction = 'd'; t_line = t_line->next_line; } if ((i < 30) && (i > 0)) @@ -2020,7 +2019,7 @@ char *cmd_str; } else { - if (!strcmp(direction, "d")) + if (direction != 'd') { absolute_lin += i; } @@ -2217,7 +2216,7 @@ check_fp() /* open or close files accor if (start_at_line != NULL) { line_num = atoi(start_at_line) - 1; - move_rel("d", line_num); + move_rel('d', line_num); line_num = 0; start_at_line = NULL; } @@ -2660,7 +2659,7 @@ int display_message; { if (lines_moved < 30) { - move_rel("d", lines_moved); + move_rel('d', lines_moved); while (position < iter) right(TRUE); } @@ -2730,8 +2729,8 @@ del_char() /* delete current character } else { - right(FALSE); - delete(FALSE); + right(TRUE); + delete(TRUE); } } @@ -2940,13 +2939,13 @@ while ((position < curr_line->line_lengt void move_rel(direction, lines) /* move relative to current line */ -char *direction; +char direction; int lines; { int i; char *tmp; - if (*direction == 'u') + if (direction == 'u') { scr_pos = 0; while (position > 1) Modified: head/contrib/ee/ee_version.h ============================================================================== --- head/contrib/ee/ee_version.h Fri Oct 8 09:35:23 2010 (r213566) +++ head/contrib/ee/ee_version.h Fri Oct 8 09:43:06 2010 (r213567) @@ -2,5 +2,5 @@ | provide a version number for ee */ -#define EE_VERSION "1.5.0" -#define DATE_STRING "$Date: 2009/02/17 03:32:30 $" +#define EE_VERSION "1.5.2" +#define DATE_STRING "$Date: 2010/06/04 02:35:35 $" From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 10:27:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41B3C106564A; Fri, 8 Oct 2010 10:27:53 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3059E8FC1B; Fri, 8 Oct 2010 10:27:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98ARrQY087675; Fri, 8 Oct 2010 10:27:53 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98ARrUQ087673; Fri, 8 Oct 2010 10:27:53 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201010081027.o98ARrUQ087673@svn.freebsd.org> From: Peter Holm Date: Fri, 8 Oct 2010 10:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213568 - head/sys/boot/i386/gptboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 10:27:53 -0000 Author: pho Date: Fri Oct 8 10:27:52 2010 New Revision: 213568 URL: http://svn.freebsd.org/changeset/base/213568 Log: Ensure that a make from sys/boot does not pick up include files from /usr/include. Discussed with: kib Modified: head/sys/boot/i386/gptboot/Makefile Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Fri Oct 8 09:43:06 2010 (r213567) +++ head/sys/boot/i386/gptboot/Makefile Fri Oct 8 10:27:52 2010 (r213568) @@ -36,6 +36,7 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -I${.CURDIR}/../common \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ + -I${.CURDIR}/../../.. \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 10:32:40 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12B17106564A; Fri, 8 Oct 2010 10:32:40 +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 9C0ED8FC12; Fri, 8 Oct 2010 10:32:39 +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 o98AWcN2004108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Oct 2010 12:32:38 +0200 (CEST) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1286533958; bh=+xh7a4e6ZVBesbiiLhwjrVqcrAZKc5S78UR682JrPRA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=q+04UDjDzabUDQVwJM/oGfR6j1prBROBfLWiXMb3DcB2FGkpAmruvHVar0ML49Js8 HnHUBXTMHxm4WQjIIrNIue/3DuXcM2YrUXtMQ6Lx+4l6oEAzYmTkfCwMidGBcWabjr Bk3a3L9OA4Xff1wBtROffnjqJ17lSHauMraN+FU8= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o98AWcjD004107; Fri, 8 Oct 2010 12:32:38 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Fri, 8 Oct 2010 12:32:38 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Ivan Voras Message-ID: <20101008103238.GV65440@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Ivan Voras , Alexander Best , Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> <20101004104257.GH7322@garage.freebsd.pl> <20101004114248.GA16641@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="7gGkHNMELEOhSGF6" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Alexander Best , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 10:32:40 -0000 --7gGkHNMELEOhSGF6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, 04.10.2010 at 14:04:53 +0200, Ivan Voras wrote: > On 4 October 2010 13:42, Alexander Best wrote: > > > good point. ZFS should really be added to the list and LFS should go away. are > > there any other relevant filesystems without a fixed-block size that need to be > > mentioned? what about afs? or tmpfs? > > (it's not that the block sizes aren't fixed, it's that the assignment > of blocks to the file is not fixed). Review of attached patch, anyone? I didn't come up with a clever way to describe non-COW file systems :/ --7gGkHNMELEOhSGF6 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="rm.diff" Content-Transfer-Encoding: 8bit commit 1756b0548e6b18a88e58fad0d078a507c2d87422 Author: Ulrich Spörlein Date: Fri Oct 8 12:29:06 2010 +0200 rm(1): clarify that -P works only when the block allocation is static Suggested by: pjd, ivoras diff --git a/bin/rm/rm.1 b/bin/rm/rm.1 index f580d33..dfba07b 100644 --- a/bin/rm/rm.1 +++ b/bin/rm/rm.1 @@ -32,7 +32,7 @@ .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" $FreeBSD$ .\" -.Dd October 3, 2010 +.Dd October 8, 2010 .Dt RM 1 .Os .Sh NAME @@ -229,8 +229,8 @@ command appeared in .Sh BUGS The .Fl P -option assumes that the underlying file system is a fixed-block file -system. -UFS is a fixed-block file system, LFS is not. +option assumes that the underlying file system does not allocate new blocks +when writing to existing blocks. +This is true for UFS but not for ZFS, which is using Copy-On-Write. In addition, only regular files are overwritten, other types of files are not. diff --git a/bin/rm/rm.c b/bin/rm/rm.c index d9bd296..653833a 100644 --- a/bin/rm/rm.c +++ b/bin/rm/rm.c @@ -402,8 +402,8 @@ rm_file(char **argv) * This is a cheap way to *really* delete files. Note that only regular * files are deleted, directories (and therefore names) will remain. * Also, this assumes a fixed-block file system (like FFS, or a V7 or a - * System V file system). In a logging file system, you'll have to have - * kernel support. + * System V file system). In a logging or COW file system, you'll have to + * have kernel support. */ int rm_overwrite(char *file, struct stat *sbp) --7gGkHNMELEOhSGF6-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 10:49:58 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 57EA41065672; Fri, 8 Oct 2010 10:49:58 +0000 (UTC) Date: Fri, 8 Oct 2010 10:49:58 +0000 From: Alexander Best To: Ulrich =?iso-8859-15?Q?Sp=F6rlein?= , Ivan Voras , Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Message-ID: <20101008104958.GA41296@freebsd.org> References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> <20101004104257.GH7322@garage.freebsd.pl> <20101004114248.GA16641@freebsd.org> <20101008103238.GV65440@acme.spoerlein.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20101008103238.GV65440@acme.spoerlein.net> Cc: Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 10:49:58 -0000 On Fri Oct 8 10, Ulrich Spörlein wrote: > On Mon, 04.10.2010 at 14:04:53 +0200, Ivan Voras wrote: > > On 4 October 2010 13:42, Alexander Best wrote: > > > > > good point. ZFS should really be added to the list and LFS should go away. are > > > there any other relevant filesystems without a fixed-block size that need to be > > > mentioned? what about afs? or tmpfs? > > > > (it's not that the block sizes aren't fixed, it's that the assignment > > of blocks to the file is not fixed). > > Review of attached patch, anyone? I didn't come up with a clever way to > describe non-COW file systems :/ i like it. personally i'd prefer "which is using a Copy-On-Write strategie." instead of "which is using Copy-On-Write." but that's just personal taste. ;) cheers. alex -- a13x From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 11:34:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id E97981065672; Fri, 8 Oct 2010 11:34:49 +0000 (UTC) Date: Fri, 8 Oct 2010 11:34:49 +0000 From: Alexander Best To: Konstantin Belousov Message-ID: <20101008113449.GA47734@freebsd.org> References: <201010080718.o987IiJB082121@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010080718.o987IiJB082121@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213544 - head/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 11:34:50 -0000 On Fri Oct 8 10, Konstantin Belousov wrote: > Author: kib > Date: Fri Oct 8 07:18:44 2010 > New Revision: 213544 > URL: http://svn.freebsd.org/changeset/base/213544 > > Log: > Fix typo. > > Submitted by: arundel > MFC after: 3 days > > Modified: > head/sys/amd64/linux32/syscalls.master > > Modified: head/sys/amd64/linux32/syscalls.master > ============================================================================== > --- head/sys/amd64/linux32/syscalls.master Fri Oct 8 07:17:22 2010 (r213543) > +++ head/sys/amd64/linux32/syscalls.master Fri Oct 8 07:18:44 2010 (r213544) > @@ -416,7 +416,7 @@ > 245 AUE_NULL UNIMPL linux_io_setup > 246 AUE_NULL UNIMPL linux_io_destroy > 247 AUE_NULL UNIMPL linux_io_getevents > -248 AUE_NULL UNIMPL inux_io_submit > +248 AUE_NULL UNIMPL linux_io_submit > 249 AUE_NULL UNIMPL linux_io_cancel > 250 AUE_NULL STD { int linux_fadvise64(void); } > 251 AUE_NULL UNIMPL thanks a lot. :) -- a13x From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 12:39:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D5AB1065670; Fri, 8 Oct 2010 12:39:50 +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 0B9608FC12; Fri, 8 Oct 2010 12: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 o98CdneT093508; Fri, 8 Oct 2010 12:39:49 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Cdn8C093505; Fri, 8 Oct 2010 12:39:49 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201010081239.o98Cdn8C093505@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 8 Oct 2010 12: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: r213572 - in head: lib/libjail usr.sbin/pc-sysinstall/pc-sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 12:39:50 -0000 Author: uqs Date: Fri Oct 8 12:39:49 2010 New Revision: 213572 URL: http://svn.freebsd.org/changeset/base/213572 Log: mdoc: fix manlint warnings by unbreaking mdoc syntax Modified: head/lib/libjail/jail.3 head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 Modified: head/lib/libjail/jail.3 ============================================================================== --- head/lib/libjail/jail.3 Fri Oct 8 12:39:05 2010 (r213571) +++ head/lib/libjail/jail.3 Fri Oct 8 12:39:49 2010 (r213572) @@ -248,7 +248,7 @@ jailparam_init(¶ms[1], "host.hostnam jailparam_get(params, 2, 0); hostname = jailparam_export(¶ms[1]); jailparam_free(params, 2); -... +\&... free(hostname); .Ed .Sh ERRORS Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 ============================================================================== --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 Fri Oct 8 12:39:05 2010 (r213571) +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 Fri Oct 8 12:39:49 2010 (r213572) @@ -62,7 +62,7 @@ Display the help data for the specified .It disk-list Provide a listing of the storage devices detected on this system. .It disk-part Ar disk -Queries the specified storage device and returns information about its +Queries the specified storage device and returns information about its partitions. .It disk-info Ar disk Returns information about a storage device's size, cylinders, heads, and @@ -106,6 +106,7 @@ used by automated install scripts. .It setup-ssh-keys Ar user Ar host Ar port Setup SSH without a password for the target host, user, and port. Used to prompt the user to log into a server before doing a rsync + ssh restore. +.El .Sh HISTORY This version of .Nm From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 12:40:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDC751065679; Fri, 8 Oct 2010 12:40:17 +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 B84128FC12; Fri, 8 Oct 2010 12:40: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 o98CeHPL093640; Fri, 8 Oct 2010 12:40:17 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98CeG2A093563; Fri, 8 Oct 2010 12:40:16 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201010081240.o98CeG2A093563@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 8 Oct 2010 12:40: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: r213573 - in head: bin/chflags bin/stty games/caesar lib/libarchive lib/libc/gen lib/libc/locale lib/libc/net lib/libc/posix1e lib/libc/regex lib/libc/stdlib lib/libc/sys lib/libc/uuid ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 12:40:17 -0000 Author: uqs Date: Fri Oct 8 12:40:16 2010 New Revision: 213573 URL: http://svn.freebsd.org/changeset/base/213573 Log: mdoc: drop redundant .Pp and .LP calls They have no effect when coming in pairs, or before .Bl/.Bd Modified: head/bin/chflags/chflags.1 head/bin/stty/stty.1 head/games/caesar/caesar.6 head/lib/libarchive/libarchive-formats.5 head/lib/libc/gen/confstr.3 head/lib/libc/gen/getcap.3 head/lib/libc/gen/stringlist.3 head/lib/libc/gen/sysctl.3 head/lib/libc/locale/localeconv.3 head/lib/libc/locale/setlocale.3 head/lib/libc/net/getnetent.3 head/lib/libc/net/getprotoent.3 head/lib/libc/net/nsdispatch.3 head/lib/libc/posix1e/acl_add_flag_np.3 head/lib/libc/posix1e/acl_add_perm.3 head/lib/libc/posix1e/acl_get.3 head/lib/libc/posix1e/acl_set.3 head/lib/libc/posix1e/acl_set_entry_type_np.3 head/lib/libc/posix1e/acl_set_tag_type.3 head/lib/libc/regex/re_format.7 head/lib/libc/stdlib/malloc.3 head/lib/libc/stdlib/strtod.3 head/lib/libc/sys/aio_read.2 head/lib/libc/sys/aio_write.2 head/lib/libc/sys/clock_gettime.2 head/lib/libc/sys/gettimeofday.2 head/lib/libc/sys/kldstat.2 head/lib/libc/sys/kldsym.2 head/lib/libc/sys/kqueue.2 head/lib/libc/sys/modstat.2 head/lib/libc/sys/recv.2 head/lib/libc/sys/sched_setscheduler.2 head/lib/libc/uuid/uuid.3 head/lib/libcam/cam_cdbparse.3 head/lib/libdisk/libdisk.3 head/lib/libelf/elf_begin.3 head/lib/libgssapi/gssapi.3 head/lib/libpmc/pmc.p4.3 head/lib/libradius/radius.conf.5 head/lib/libstand/libstand.3 head/lib/libtacplus/libtacplus.3 head/lib/libutil/realhostname.3 head/lib/libutil/realhostname_sa.3 head/libexec/ftpd/ftpd.8 head/libexec/getty/gettytab.5 head/libexec/rtld-elf/rtld.1 head/sbin/camcontrol/camcontrol.8 head/sbin/ccdconfig/ccdconfig.8 head/sbin/devd/devd.conf.5 head/sbin/geom/class/journal/gjournal.8 head/sbin/geom/class/raid3/graid3.8 head/sbin/ipfw/ipfw.8 head/sbin/mknod/mknod.8 head/share/man/man3/fpgetround.3 head/share/man/man4/acpi_hp.4 head/share/man/man4/aue.4 head/share/man/man4/bpf.4 head/share/man/man4/bt.4 head/share/man/man4/bwi.4 head/share/man/man4/bwn.4 head/share/man/man4/cd.4 head/share/man/man4/ch.4 head/share/man/man4/cpuctl.4 head/share/man/man4/dc.4 head/share/man/man4/ddb.4 head/share/man/man4/de.4 head/share/man/man4/digi.4 head/share/man/man4/igmp.4 head/share/man/man4/inet.4 head/share/man/man4/ipw.4 head/share/man/man4/iscsi_initiator.4 head/share/man/man4/isp.4 head/share/man/man4/iwi.4 head/share/man/man4/iwn.4 head/share/man/man4/joy.4 head/share/man/man4/keyboard.4 head/share/man/man4/led.4 head/share/man/man4/lpbb.4 head/share/man/man4/mac_biba.4 head/share/man/man4/mac_lomac.4 head/share/man/man4/mac_portacl.4 head/share/man/man4/malo.4 head/share/man/man4/meteor.4 head/share/man/man4/mk48txx.4 head/share/man/man4/mld.4 head/share/man/man4/mtio.4 head/share/man/man4/mwl.4 head/share/man/man4/netintro.4 head/share/man/man4/ng_UI.4 head/share/man/man4/ng_async.4 head/share/man/man4/ng_cisco.4 head/share/man/man4/ng_frame_relay.4 head/share/man/man4/ng_gif.4 head/share/man/man4/ng_iface.4 head/share/man/man4/ng_l2cap.4 head/share/man/man4/ng_lmi.4 head/share/man/man4/ng_pppoe.4 head/share/man/man4/ng_rfc1490.4 head/share/man/man4/ng_tee.4 head/share/man/man4/ng_tty.4 head/share/man/man4/ng_vjc.4 head/share/man/man4/pcn.4 head/share/man/man4/psm.4 head/share/man/man4/pt.4 head/share/man/man4/pts.4 head/share/man/man4/pty.4 head/share/man/man4/ral.4 head/share/man/man4/random.4 head/share/man/man4/rl.4 head/share/man/man4/rum.4 head/share/man/man4/run.4 head/share/man/man4/screen.4 head/share/man/man4/send.4 head/share/man/man4/ses.4 head/share/man/man4/sf.4 head/share/man/man4/sis.4 head/share/man/man4/sk.4 head/share/man/man4/smb.4 head/share/man/man4/snd_hda.4 head/share/man/man4/ste.4 head/share/man/man4/sym.4 head/share/man/man4/syscons.4 head/share/man/man4/ti.4 head/share/man/man4/tl.4 head/share/man/man4/tx.4 head/share/man/man4/uath.4 head/share/man/man4/upgt.4 head/share/man/man4/ural.4 head/share/man/man4/urtw.4 head/share/man/man4/vr.4 head/share/man/man4/wb.4 head/share/man/man4/wi.4 head/share/man/man4/wpi.4 head/share/man/man4/xl.4 head/share/man/man5/elf.5 head/share/man/man5/link.5 head/share/man/man5/make.conf.5 head/share/man/man5/passwd.5 head/share/man/man5/quota.user.5 head/share/man/man5/resolver.5 head/share/man/man7/firewall.7 head/share/man/man7/sdoc.7 head/share/man/man8/picobsd.8 head/share/man/man8/rc.8 head/share/man/man8/rc.sendmail.8 head/share/man/man9/DB_COMMAND.9 head/share/man/man9/MD5.9 head/share/man/man9/VOP_READDIR.9 head/share/man/man9/fail.9 head/share/man/man9/ieee80211_ddb.9 head/share/man/man9/ieee80211_radiotap.9 head/share/man/man9/mbuf.9 head/share/man/man9/style.9 head/share/man/man9/timeout.9 head/share/man/man9/uio.9 head/share/termcap/termcap.5 head/sys/boot/common/loader.8 head/usr.bin/chat/chat.8 head/usr.bin/cksum/cksum.1 head/usr.bin/colldef/colldef.1 head/usr.bin/csup/cpasswd.1 head/usr.bin/gencat/gencat.1 head/usr.bin/getopt/getopt.1 head/usr.bin/nl/nl.1 head/usr.bin/vmstat/vmstat.8 head/usr.sbin/burncd/burncd.8 head/usr.sbin/ckdist/ckdist.1 head/usr.sbin/crunch/crunchgen/crunchgen.1 head/usr.sbin/dconschat/dconschat.8 head/usr.sbin/flowctl/flowctl.8 head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/i2c/i2c.8 head/usr.sbin/jail/jail.8 head/usr.sbin/lpr/lpq/lpq.1 head/usr.sbin/lpr/lprm/lprm.1 head/usr.sbin/mergemaster/mergemaster.8 head/usr.sbin/mixer/mixer.8 head/usr.sbin/mlxcontrol/mlxcontrol.8 head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 head/usr.sbin/portsnap/portsnap/portsnap.8 head/usr.sbin/pw/pw.8 head/usr.sbin/sysinstall/sysinstall.8 head/usr.sbin/vidcontrol/vidcontrol.1 Modified: head/bin/chflags/chflags.1 ============================================================================== --- head/bin/chflags/chflags.1 Fri Oct 8 12:39:49 2010 (r213572) +++ head/bin/chflags/chflags.1 Fri Oct 8 12:40:16 2010 (r213573) @@ -98,7 +98,6 @@ will also be printed, in octal notation. The flags are specified as an octal number or a comma separated list of keywords. The following keywords are currently defined: -.Pp .Bl -tag -offset indent -width ".Cm opaque" .It Cm arch , archived set the archived flag (super-user only) Modified: head/bin/stty/stty.1 ============================================================================== --- head/bin/stty/stty.1 Fri Oct 8 12:39:49 2010 (r213572) +++ head/bin/stty/stty.1 Fri Oct 8 12:40:16 2010 (r213573) @@ -419,7 +419,6 @@ Non-Canonical mode input processing (-icanon). .El .Ss Combination Modes: -.Pp .Bl -tag -width Fl .It Ar saved settings Set the current terminal Modified: head/games/caesar/caesar.6 ============================================================================== --- head/games/caesar/caesar.6 Fri Oct 8 12:39:49 2010 (r213572) +++ head/games/caesar/caesar.6 Fri Oct 8 12:40:16 2010 (r213573) @@ -58,13 +58,11 @@ If invoked as a rotation value of 13 will be used. .Pp The frequency (from most common to least) of English letters is as follows: -.Pp .Bd -ragged -offset indent ETAONRISHDLFCMUGPYWBVKXJQZ .Ed .Pp Their frequencies as a percentage are as follows: -.Pp .Bd -ragged -offset indent E(13), T(10.5), A(8.1), O(7.9), N(7.1), R(6.8), I(6.3), S(6.1), H(5.2), D(3.8), L(3.4), F(2.9), C(2.7), M(2.5), U(2.4), G(2), Modified: head/lib/libarchive/libarchive-formats.5 ============================================================================== --- head/lib/libarchive/libarchive-formats.5 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libarchive/libarchive-formats.5 Fri Oct 8 12:40:16 2010 (r213573) @@ -65,7 +65,6 @@ Later variants have extended this by eit areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries. -.Pp .Bl -tag -width indent .It Cm gnutar The Modified: head/lib/libc/gen/confstr.3 ============================================================================== --- head/lib/libc/gen/confstr.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/gen/confstr.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -77,7 +77,6 @@ has a value, up to The copied value is always null terminated. .Pp The available values are as follows: -.Pp .Bl -tag -width 6n .It Li _CS_PATH Return a value for the Modified: head/lib/libc/gen/getcap.3 ============================================================================== --- head/lib/libc/gen/getcap.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/gen/getcap.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -415,7 +415,6 @@ type `^') and any other value bindings a The capability abc also has two values bound but only a value of type `$' is prevented from being defined in the capability record more. -.Pp .Bd -unfilled -offset indent file1: new\||\|new_record\||\|a modification of "old":\e Modified: head/lib/libc/gen/stringlist.3 ============================================================================== --- head/lib/libc/gen/stringlist.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/gen/stringlist.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -66,7 +66,6 @@ typedef struct _stringlist { size_t sl_cur; } StringList; .Ed -.Pp .Bl -tag -width "sl_str" -offset indent .It Va sl_str a pointer to the base of the array containing the list. Modified: head/lib/libc/gen/sysctl.3 ============================================================================== --- head/lib/libc/gen/sysctl.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/gen/sysctl.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -183,7 +183,6 @@ The top level names are defined with a C and are as follows. The next and subsequent levels down are found in the include files listed here, and described in separate sections below. -.Pp .Bl -column CTLXMACHDEPXXX "Next level namesXXXXXX" -offset indent .It Sy "Name Next level names Description" .It "CTL_DEBUG sys/sysctl.h Debugging" Modified: head/lib/libc/locale/localeconv.3 ============================================================================== --- head/lib/libc/locale/localeconv.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/locale/localeconv.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -80,7 +80,6 @@ struct lconv { .Ed .Pp The individual fields have the following meanings: -.Pp .Bl -tag -width mon_decimal_point .It Va decimal_point The decimal point character, except for currency values, Modified: head/lib/libc/locale/setlocale.3 ============================================================================== --- head/lib/libc/locale/setlocale.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/locale/setlocale.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -57,7 +57,6 @@ The .Fn setlocale function recognizes several categories of routines. These are the categories and the sets of routines they select: -.Pp .Bl -tag -width LC_MONETARY .It Dv LC_ALL Set the entire locale generically. Modified: head/lib/libc/net/getnetent.3 ============================================================================== --- head/lib/libc/net/getnetent.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/net/getnetent.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -72,7 +72,6 @@ system. The order of the lookups is controlled by the `networks' entry in .Xr nsswitch.conf 5 . -.Pp .Bd -literal -offset indent struct netent { char *n_name; /* official name of net */ Modified: head/lib/libc/net/getprotoent.3 ============================================================================== --- head/lib/libc/net/getprotoent.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/net/getprotoent.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -64,7 +64,6 @@ following structure containing the broken-out fields of a line in the network protocol data base, .Pa /etc/protocols . -.Pp .Bd -literal -offset indent struct protoent { char *p_name; /* official name of protocol */ Modified: head/lib/libc/net/nsdispatch.3 ============================================================================== --- head/lib/libc/net/nsdispatch.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/net/nsdispatch.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -85,7 +85,6 @@ typedef struct _ns_dtab { void *mdata; } ns_dtab; .Ed -.Pp .Bd -ragged -offset indent The .Fa dtab @@ -133,7 +132,6 @@ typedef struct _ns_src { u_int32_t flags; } ns_src; .Ed -.Pp .Bd -ragged -offset indent The .Fa defaults Modified: head/lib/libc/posix1e/acl_add_flag_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_add_flag_np.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/posix1e/acl_add_flag_np.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -51,7 +51,6 @@ Note: it is not considered an error to a that already exist in the flagset. .Pp Valid values are: -.Pp .Bl -column -offset 3n "ACL_ENTRY_NO_PROPAGATE_INHERIT" .It ACL_ENTRY_FILE_INHERIT Will be inherited by files. .It ACL_ENTRY_DIRECTORY_INHERIT Will be inherited by directories. Modified: head/lib/libc/posix1e/acl_add_perm.3 ============================================================================== --- head/lib/libc/posix1e/acl_add_perm.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/posix1e/acl_add_perm.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -51,7 +51,6 @@ Note: it is not considered an error to a that already exist in the permission set. .Pp For POSIX.1e ACLs, valid values are: -.Pp .Bl -column -offset 3n "ACL_WRITE_NAMED_ATTRS" .It ACL_EXECUTE Execute permission .It ACL_WRITE Write permission @@ -59,7 +58,6 @@ For POSIX.1e ACLs, valid values are: .El .Pp For NFSv4 ACLs, valid values are: -.Pp .Bl -column -offset 3n "ACL_WRITE_NAMED_ATTRS" .It ACL_READ_DATA Read permission .It ACL_LIST_DIRECTORY Same as ACL_READ_DATA Modified: head/lib/libc/posix1e/acl_get.3 ============================================================================== --- head/lib/libc/posix1e/acl_get.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/posix1e/acl_get.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -95,7 +95,6 @@ decisions. Valid values for the .Va type argument are: -.Pp .Bl -column -offset 3n "ACL_TYPE_DEFAULT" .It ACL_TYPE_ACCESS POSIX.1e access ACL .It ACL_TYPE_DEFAULT POSIX.1e default ACL Modified: head/lib/libc/posix1e/acl_set.3 ============================================================================== --- head/lib/libc/posix1e/acl_set.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/posix1e/acl_set.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -79,7 +79,6 @@ path is a symlink. Valid values for the .Va type argument are: -.Pp .Bl -column -offset 3n "ACL_TYPE_DEFAULT" .It ACL_TYPE_ACCESS POSIX.1e access ACL .It ACL_TYPE_DEFAULT POSIX.1e default ACL Modified: head/lib/libc/posix1e/acl_set_entry_type_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_set_entry_type_np.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/posix1e/acl_set_entry_type_np.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -48,7 +48,6 @@ to the value referred to by .Fa entry_type . .Pp Valid values are: -.Pp .Bl -column -offset 3n "ACL_ENTRY_TYPE_ALLOW" .It ACL_ENTRY_TYPE_ALLOW "allow" type entry .It ACL_ENTRY_TYPE_DENY "deny" type entry Modified: head/lib/libc/posix1e/acl_set_tag_type.3 ============================================================================== --- head/lib/libc/posix1e/acl_set_tag_type.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/posix1e/acl_set_tag_type.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -48,7 +48,6 @@ to the value of .Fa tag_type . .Pp Valid values are: -.Pp .Bl -column -offset 3n "ACL_OTHER_OBJ" .It ACL_USER_OBJ Permissions apply to file owner .It ACL_USER Permissions apply to additional user specified by qualifier Modified: head/lib/libc/regex/re_format.7 ============================================================================== --- head/lib/libc/regex/re_format.7 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/regex/re_format.7 Fri Oct 8 12:40:16 2010 (r213573) @@ -275,7 +275,6 @@ and stands for the list of all characters belonging to that class. Standard character class names are: -.Pp .Bl -column "alnum" "digit" "xdigit" -offset indent .It Em "alnum digit punct" .It Em "alpha graph space" Modified: head/lib/libc/stdlib/malloc.3 ============================================================================== --- head/lib/libc/stdlib/malloc.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/stdlib/malloc.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -550,7 +550,6 @@ allocation functions. .El .Sh EXAMPLES To dump core whenever a problem occurs: -.Pp .Bd -literal -offset indent ln -s 'A' /etc/malloc.conf .Ed Modified: head/lib/libc/stdlib/strtod.3 ============================================================================== --- head/lib/libc/stdlib/strtod.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/stdlib/strtod.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -173,7 +173,6 @@ conforms to .Sh AUTHORS The author of this software is .An David M. Gay . -.Pp .Bd -literal Copyright (c) 1998 by Lucent Technologies All Rights Reserved Modified: head/lib/libc/sys/aio_read.2 ============================================================================== --- head/lib/libc/sys/aio_read.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/aio_read.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -136,7 +136,6 @@ system call must be called, and will ret must be called to determine the actual value that would have been returned in .Va errno . -.Pp .Bl -tag -width Er .It Bq Er EBADF The Modified: head/lib/libc/sys/aio_write.2 ============================================================================== --- head/lib/libc/sys/aio_write.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/aio_write.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -140,7 +140,6 @@ system call must be called, and will ret must be called to determine the actual value that would have been returned in .Va errno . -.Pp .Bl -tag -width Er .It Bq Er EBADF The Modified: head/lib/libc/sys/clock_gettime.2 ============================================================================== --- head/lib/libc/sys/clock_gettime.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/clock_gettime.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -102,7 +102,6 @@ The structure pointed to by is defined in .In sys/timespec.h as: -.Pp .Bd -literal struct timespec { time_t tv_sec; /* seconds */ Modified: head/lib/libc/sys/gettimeofday.2 ============================================================================== --- head/lib/libc/sys/gettimeofday.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/gettimeofday.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -75,7 +75,6 @@ and are defined in .In sys/time.h as: -.Pp .Bd -literal struct timeval { time_t tv_sec; /* seconds */ Modified: head/lib/libc/sys/kldstat.2 ============================================================================== --- head/lib/libc/sys/kldstat.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/kldstat.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -56,7 +56,6 @@ struct kld_file_stat { char pathname[MAXPATHLEN]; }; .Ed -.Pp .Bl -tag -width XXXaddress .It version This field is set to the size of the structure mentioned above by the code Modified: head/lib/libc/sys/kldsym.2 ============================================================================== --- head/lib/libc/sys/kldsym.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/kldsym.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -55,7 +55,6 @@ implemented is The .Fa data argument is of the following structure: -.Pp .Bd -literal -offset indent struct kld_sym_lookup { int version; /* sizeof(struct kld_sym_lookup) */ Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/kqueue.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -251,7 +251,6 @@ Takes a descriptor as the identifier, an there is data available to read. The behavior of the filter is slightly different depending on the descriptor type. -.Pp .Bl -tag -width 2n .It Sockets Sockets which have previously been passed to Modified: head/lib/libc/sys/modstat.2 ============================================================================== --- head/lib/libc/sys/modstat.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/modstat.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -60,7 +60,6 @@ typedef union modspecific { u_long ulongval; } modspecific_t; .Ed -.Pp .Bl -tag -width XXXaddress .It version This field is set to the size of the structure mentioned above by the code Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/recv.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -165,7 +165,6 @@ system call uses a structure to minimize the number of directly supplied arguments. This structure has the following form, as defined in .In sys/socket.h : -.Pp .Bd -literal struct msghdr { void *msg_name; /* optional address */ @@ -242,7 +241,6 @@ should be a structure of type which is defined in .In sys/socket.h as follows: -.Pp .Bd -literal struct cmsgcred { pid_t cmcred_pid; /* PID of sending process */ Modified: head/lib/libc/sys/sched_setscheduler.2 ============================================================================== --- head/lib/libc/sys/sched_setscheduler.2 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/sys/sched_setscheduler.2 Fri Oct 8 12:40:16 2010 (r213573) @@ -95,7 +95,6 @@ The .Vt sched_param structure is defined in .Fa : -.Pp .Bd -literal -offset indent struct sched_param { int sched_priority; /* scheduling priority */ Modified: head/lib/libc/uuid/uuid.3 ============================================================================== --- head/lib/libc/uuid/uuid.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libc/uuid/uuid.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -108,7 +108,6 @@ the .Fa status argument. Possible values are: -.Pp .Bl -tag -width ".Dv uuid_s_invalid_string_uuid" .It Dv uuid_s_ok The function completed successfully. Modified: head/lib/libcam/cam_cdbparse.3 ============================================================================== --- head/lib/libcam/cam_cdbparse.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libcam/cam_cdbparse.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -258,7 +258,6 @@ typedef enum { Multiple flags should be ORed together. Any of the CCB flags may be used, although it is worth noting several important ones here: -.Pp .Bl -tag -width CAM_PASS_ERR_RECOVER .It Dv CAM_DIR_IN This indicates that the operation in question is a read operation. Modified: head/lib/libdisk/libdisk.3 ============================================================================== --- head/lib/libdisk/libdisk.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libdisk/libdisk.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -153,7 +153,6 @@ struct disk { The only flag value by now is .Ql DISK_ON_TRACK , meaning that this disk is handled by the On-Track Disk Manager. -.Pp .Bd -literal -offset indent struct chunk { struct chunk *next; Modified: head/lib/libelf/elf_begin.3 ============================================================================== --- head/lib/libelf/elf_begin.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libelf/elf_begin.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -222,7 +222,6 @@ elf_end(e); Function .Fn elf_begin can fail with the following errors: -.Pp .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARCHIVE The archive denoted by argument Modified: head/lib/libgssapi/gssapi.3 ============================================================================== --- head/lib/libgssapi/gssapi.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libgssapi/gssapi.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -51,7 +51,6 @@ and to apply security services such as c on a per-message basis. .Pp There are four stages to using the GSS-API: -.Pp .Bl -tag -width "a)" .It a) The application acquires a set of credentials with which it may prove Modified: head/lib/libpmc/pmc.p4.3 ============================================================================== --- head/lib/libpmc/pmc.p4.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libpmc/pmc.p4.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -174,7 +174,6 @@ Only TS events are allowed for use with Pentium-4/HTT CPUs. .Pp The event specifiers supported by Intel P4 PMCs are: -.Pp .Bl -tag -width indent .It Li p4-128bit-mmx-uop Op Li ,mask= Ns Ar flags .Pq "TI event" Modified: head/lib/libradius/radius.conf.5 ============================================================================== --- head/lib/libradius/radius.conf.5 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libradius/radius.conf.5 Fri Oct 8 12:40:16 2010 (r213573) @@ -75,7 +75,6 @@ and the backslash can be represented by .Ql \e\e . No other escape sequences are supported. .Pp -.Pp The first field gives the service type, either .Ql auth for RADIUS authentication or Modified: head/lib/libstand/libstand.3 ============================================================================== --- head/lib/libstand/libstand.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libstand/libstand.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -270,7 +270,6 @@ The .Li b conversion is provided to decode error registers. Its usage is: -.Pp .Bd -ragged -offset indent printf( .Qq reg=%b\en , @@ -285,7 +284,6 @@ Each is a sequence of characters, which gives the bit number to be inspected (origin 1) and the next characters (up to a character less than 32) give the text to be displayed if the bit is set. Thus -.Pp .Bd -ragged -offset indent printf( .Qq reg=%b\en , @@ -295,7 +293,6 @@ printf( .Ed .Pp would give the output -.Pp .Bd -ragged -offset indent reg=3 .Ed @@ -303,7 +300,6 @@ reg=3 The .Li D conversion provides a hexdump facility, e.g. -.Pp .Bd -ragged -offset indent printf( .Qq %6D , Modified: head/lib/libtacplus/libtacplus.3 ============================================================================== --- head/lib/libtacplus/libtacplus.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libtacplus/libtacplus.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -148,7 +148,6 @@ The parameter is a bit mask of flags to specify various characteristics of the server. It may contain: -.Pp .Bl -tag -width Fl .It Dv TAC_SRVR_SINGLE_CONNECT Causes the library to attempt to negotiate single connection mode Modified: head/lib/libutil/realhostname.3 ============================================================================== --- head/lib/libutil/realhostname.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libutil/realhostname.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -76,7 +76,6 @@ The .Fn realhostname function will return one of the following constants which are defined in .In libutil.h : -.Pp .Bl -tag -width XXX -offset XXX .It Li HOSTNAME_FOUND A valid host name was found. Modified: head/lib/libutil/realhostname_sa.3 ============================================================================== --- head/lib/libutil/realhostname_sa.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/lib/libutil/realhostname_sa.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -105,7 +105,6 @@ The .Fn realhostname_sa function will return one of the following constants which are defined in .In libutil.h : -.Pp .Bl -tag -width XXX -offset XXX .It Li HOSTNAME_FOUND A valid host name was found. Modified: head/libexec/ftpd/ftpd.8 ============================================================================== --- head/libexec/ftpd/ftpd.8 Fri Oct 8 12:39:49 2010 (r213572) +++ head/libexec/ftpd/ftpd.8 Fri Oct 8 12:40:16 2010 (r213573) @@ -304,7 +304,6 @@ The following non-standard or specific commands are supported by the SITE request. -.Pp .Bl -column Request -offset indent .It Sy Request Ta Sy Description .It UMASK Ta change umask, e.g. ``SITE UMASK 002'' @@ -347,7 +346,6 @@ This allows users to utilize the metacha The .Nm utility authenticates users according to six rules. -.Pp .Bl -enum -offset indent .It The login name must be in the password data base Modified: head/libexec/getty/gettytab.5 ============================================================================== --- head/libexec/getty/gettytab.5 Fri Oct 8 12:39:49 2010 (r213572) +++ head/libexec/getty/gettytab.5 Fri Oct 8 12:40:16 2010 (r213573) @@ -290,7 +290,6 @@ may include any of the following charact information about the environment in which .Xr getty 8 is running. -.Pp .Bl -tag -offset indent -width \&%xxxxxxxxxxxxxx .It \&%d The current date and time formatted according to the Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Fri Oct 8 12:39:49 2010 (r213572) +++ head/libexec/rtld-elf/rtld.1 Fri Oct 8 12:40:16 2010 (r213573) @@ -105,7 +105,6 @@ all the environment variables listed bel .Ev LD_32_ , for example: .Ev LD_32_TRACE_LOADED_OBJECTS . -.Pp .Bl -tag -width ".Ev LD_LIBMAP_DISABLE" .It Ev LD_DUMP_REL_POST If set, Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Fri Oct 8 12:39:49 2010 (r213572) +++ head/sbin/camcontrol/camcontrol.8 Fri Oct 8 12:40:16 2010 (r213573) @@ -800,7 +800,6 @@ The and .Fl y arguments can be useful for scripts. -.Pp .Bl -tag -width 6n .It Fl q Be quiet, do not print any status messages. @@ -893,7 +892,6 @@ utility will report whether the disk is information if the command fails since the .Fl v switch was not specified. -.Pp .Bd -literal -offset indent camcontrol tur da1 -E -C 4 -t 50 -v .Ed @@ -920,7 +918,6 @@ Display the buffer size of cd1, and display the first 10 bytes from the cache on cd1. Display SCSI sense information if the command fails. -.Pp .Bd -literal -offset indent camcontrol cmd -n cd -u 1 -v -c "3B 00 00 00 00 00 00 00 0e 00" \e -o 14 "00 00 00 00 1 2 3 4 5 6 v v v v" 7 8 9 8 @@ -933,7 +930,6 @@ Print out sense information if the command fails. Be very careful with this command, improper use may cause data corruption. -.Pp .Bd -literal -offset indent camcontrol modepage da3 -m 1 -e -P 3 .Ed @@ -960,13 +956,11 @@ changed. .Dl camcontrol tags da5 -N 24 .Pp Set the number of concurrent transactions for da5 to 24. -.Pp .Bd -literal -offset indent camcontrol negotiate -n da -u 4 -T disable .Ed .Pp Disable tagged queueing for da4. -.Pp .Bd -literal -offset indent camcontrol negotiate -n da -u 3 -R 20.000 -O 15 -a .Ed Modified: head/sbin/ccdconfig/ccdconfig.8 ============================================================================== --- head/sbin/ccdconfig/ccdconfig.8 Fri Oct 8 12:39:49 2010 (r213572) +++ head/sbin/ccdconfig/ccdconfig.8 Fri Oct 8 12:40:16 2010 (r213573) @@ -161,7 +161,6 @@ The last example is a simple mirror. The 2nd slice of /dev/da8 is mirrored with the 3rd slice of /dev/da9 and assigned to ccd0. -.Pp .Bd -literal # ccdconfig ccd0 64 none /dev/da0s1 /dev/da1s1 /dev/da2s1 /dev/da3s1 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da4 /dev/da5 /dev/da6 /dev/da7 @@ -203,7 +202,6 @@ partition such that it does not overlap For example, if you have A ccd disk with 10000 sectors you might create a 'd' partition with offset 16 and size 9984. -.Pp .Bd -literal # disklabel ccd0 > /tmp/disklabel.ccd0 # disklabel -Rr ccd0 /tmp/disklabel.ccd0 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Fri Oct 8 12:39:49 2010 (r213572) +++ head/sbin/devd/devd.conf.5 Fri Oct 8 12:40:16 2010 (r213573) @@ -94,7 +94,6 @@ In this way generic statements can be ov notifications that require special attention. .Pp The general syntax of a statement is: -.Pp .Bd -literal -offset indent statement priority { substatement "value"; Modified: head/sbin/geom/class/journal/gjournal.8 ============================================================================== --- head/sbin/geom/class/journal/gjournal.8 Fri Oct 8 12:39:49 2010 (r213572) +++ head/sbin/geom/class/journal/gjournal.8 Fri Oct 8 12:40:16 2010 (r213573) @@ -240,7 +240,6 @@ change the value. .It "record_entries integer yes" .It "optimize integer yes" .El -.Pp .Bl -tag -width 6n .It Li debug Setting a non-zero value enables debugging at various levels. @@ -284,7 +283,6 @@ privilege may change the value. .It "misses integer yes" .It "alloc_failures integer yes" .El -.Pp .Bl -tag -width 6n .It Li used The number of bytes currently allocated to the cache. @@ -317,7 +315,6 @@ privilege may change the value. .It "journal_full integer yes" .It "low_mem integer yes" .El -.Pp .Bl -tag -width 6n .It Li skipped_bytes The number of bytes skipped. Modified: head/sbin/geom/class/raid3/graid3.8 ============================================================================== --- head/sbin/geom/class/raid3/graid3.8 Fri Oct 8 12:39:49 2010 (r213572) +++ head/sbin/geom/class/raid3/graid3.8 Fri Oct 8 12:40:16 2010 (r213573) @@ -221,7 +221,6 @@ graid3 stop data graid3 unload .Ed .Pp -.Pp Create a RAID3 array, but do not use the automatic synchronization feature. Rebuild parity component: .Bd -literal -offset indent Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Oct 8 12:39:49 2010 (r213572) +++ head/sbin/ipfw/ipfw.8 Fri Oct 8 12:40:16 2010 (r213573) @@ -184,7 +184,6 @@ See Section for more information on .Em sets . .Pp -.Pp Rules can be added with the .Cm add command; deleted individually or in groups with the @@ -1091,7 +1090,6 @@ will match the following IP addresses: .It Ar addr6-list : ip6-addr Ns Op Ns , Ns Ar addr6-list .It Ar ip6-addr : A host or subnet specified one of the following ways: -.Pp .Bl -tag -width indent .It Ar numeric-ip | hostname Matches a single IPv6 address as allowed by Modified: head/sbin/mknod/mknod.8 ============================================================================== --- head/sbin/mknod/mknod.8 Fri Oct 8 12:39:49 2010 (r213572) +++ head/sbin/mknod/mknod.8 Fri Oct 8 12:40:16 2010 (r213573) @@ -55,7 +55,6 @@ The .Nm utility creates device special files. To make nodes manually, the arguments are: -.Pp .Bl -tag -width indent .It Ar name Device name, for example Modified: head/share/man/man3/fpgetround.3 ============================================================================== --- head/share/man/man3/fpgetround.3 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man3/fpgetround.3 Fri Oct 8 12:40:16 2010 (r213573) @@ -47,7 +47,6 @@ .Nd IEEE floating point interface .Sh SYNOPSIS .In ieeefp.h -.Pp .Bd -literal typedef enum { FP_RN, /* round to nearest */ @@ -60,7 +59,6 @@ typedef enum { .Fn fpgetround void .Ft fp_rnd_t .Fn fpsetround "fp_rnd_t direction" -.Pp .Bd -literal typedef enum { FP_PS, /* 24 bit (single-precision) */ @@ -73,7 +71,6 @@ typedef enum { .Fn fpgetprec void .Ft fp_prec_t .Fn fpsetprec "fp_prec_t precision" -.Pp .Bd -literal #define fp_except_t int #define FP_X_INV 0x01 /* invalid operation */ Modified: head/share/man/man4/acpi_hp.4 ============================================================================== --- head/share/man/man4/acpi_hp.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/acpi_hp.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -266,7 +266,6 @@ driver was written by .Pp It has been inspired by hp-wmi driver, which implements a subset of these features (hotkeys) on Linux. -.Pp .Bl -tag -width indent .It HP CMI whitepaper: http://h20331.www2.hp.com/Hpsub/downloads/cmi_whitepaper.pdf Modified: head/share/man/man4/aue.4 ============================================================================== --- head/share/man/man4/aue.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/aue.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -80,7 +80,6 @@ received and transmitted over separate U The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options. @@ -117,7 +116,6 @@ mode. The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxxxxxxx .It full-duplex Force full duplex operation. Modified: head/share/man/man4/bpf.4 ============================================================================== --- head/share/man/man4/bpf.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/bpf.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -804,7 +804,6 @@ are the corresponding fields in the instruction definition. .Dq len refers to the length of the packet. -.Pp .Bl -tag -width BPF_STXx .It Dv BPF_LD These instructions copy a value into the accumulator. @@ -833,7 +832,6 @@ or byte The semantics of all the recognized .Dv BPF_LD instructions follow. -.Pp .Bd -literal BPF_LD+BPF_W+BPF_ABS A <- P[k:4] BPF_LD+BPF_H+BPF_ABS A <- P[k:2] @@ -852,7 +850,6 @@ the addressing modes are more restrictiv but they include .Dv BPF_MSH , a hack for efficiently loading the IP header length. -.Pp .Bd -literal BPF_LDX+BPF_W+BPF_IMM X <- k BPF_LDX+BPF_W+BPF_MEM X <- M[k] @@ -863,13 +860,11 @@ BPF_LDX+BPF_B+BPF_MSH X <- 4*(P[k:1]&0xf This instruction stores the accumulator into the scratch memory. We do not need an addressing mode since there is only one possibility for the destination. -.Pp .Bd -literal BPF_ST M[k] <- A .Ed .It Dv BPF_STX This instruction stores the index register in the scratch memory store. -.Pp .Bd -literal BPF_STX M[k] <- X .Ed @@ -880,7 +875,6 @@ For binary operations, a source mode is .Dv ( BPF_K or .Dv BPF_X ) . -.Pp .Bd -literal BPF_ALU+BPF_ADD+BPF_K A <- A + k BPF_ALU+BPF_SUB+BPF_K A <- A - k @@ -916,7 +910,6 @@ opcode uses the 32 bit .Li k field as the offset, allowing arbitrarily distant destinations. All conditionals use unsigned comparison conventions. -.Pp .Bd -literal BPF_JMP+BPF_JA pc += k BPF_JMP+BPF_JGT+BPF_K pc += (A > k) ? jt : jf @@ -936,7 +929,6 @@ The return value is either a constant .Pq Dv BPF_K or the accumulator .Pq Dv BPF_A . -.Pp .Bd -literal BPF_RET+BPF_A accept A bytes BPF_RET+BPF_K accept k bytes @@ -947,7 +939,6 @@ fit into the above classes, and for any be added. Currently, these are the register transfer instructions that copy the index register to the accumulator or vice versa. -.Pp .Bd -literal BPF_MISC+BPF_TAX X <- A BPF_MISC+BPF_TXA A <- X Modified: head/share/man/man4/bt.4 ============================================================================== --- head/share/man/man4/bt.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/bt.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -50,7 +50,6 @@ In This driver provides access to the .Tn SCSI bus connected to a Buslogic/Mylex MultiMaster or compatible controller: -.Pp .Bd -ragged -offset indent .Bl -column "BT-956CD " "ISA " "Commands " Description MultiMaster "W" Series Host Adapters: Modified: head/share/man/man4/bwi.4 ============================================================================== --- head/share/man/man4/bwi.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/bwi.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -106,7 +106,6 @@ The v4 version of the firmware that uses does not support these chips. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev bwi0 inet 192.168.0.20 \e netmask 0xffffff00 Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/bwn.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -96,7 +96,6 @@ because the v4 version of the firmware d The newer firmware is too big to fit into these old chips. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev bwn0 inet 192.168.0.20 \e netmask 0xffffff00 Modified: head/share/man/man4/cd.4 ============================================================================== --- head/share/man/man4/cd.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/cd.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -102,7 +102,6 @@ in the header files .In sys/cdio.h and .In sys/disklabel.h . -.Pp .Bl -tag -width CDIOCREADSUBCHANNEL .It Dv DIOCGDINFO .It Dv DIOCSDINFO Modified: head/share/man/man4/ch.4 ============================================================================== --- head/share/man/man4/ch.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/ch.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -96,7 +96,6 @@ calls apply to the changer. They are defined in the header file .In sys/chio.h . -.Pp .Bl -tag -width CHIOEXCHANGE .It Dv CHIOMOVE .Pq Vt "struct changer_move" Modified: head/share/man/man4/cpuctl.4 ============================================================================== --- head/share/man/man4/cpuctl.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/cpuctl.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -74,7 +74,6 @@ The structure is defined in .In sys/cpuctl.h as: -.Pp .Bd -literal typedef struct { int msr; /* MSR to read */ @@ -90,7 +89,6 @@ field. Retrieve CPUID information. Arguments are supplied in the following struct: -.Pp .Bd -literal typedef struct { int level; /* CPUID level */ @@ -108,7 +106,6 @@ Update CPU firmware (microcode). The structure is defined in .In sys/cpuctl.h as: -.Pp .Bd -literal typedef struct { void *data; Modified: head/share/man/man4/dc.4 ============================================================================== --- head/share/man/man4/dc.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/dc.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -92,7 +92,6 @@ difficult to provide a complete list of The .Nm driver supports the following media types: -.Pp .Bl -tag -width ".Cm 10baseT/UTP" .It Cm autoselect Enable autoselection of the media type and options. @@ -138,7 +137,6 @@ mode. The .Nm driver supports the following media options: -.Pp .Bl -tag -width ".Cm full-duplex" .It Cm full-duplex Force full duplex operation. Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/ddb.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -802,7 +802,6 @@ Displays short info about all currently .Pp .It Ic show Cm mount Ar addr Displays details about the given mount point. -.Pp .\" .Pp .It Ic show Cm object Ns Oo Li / Ns Cm f Oc Ar addr Modified: head/share/man/man4/de.4 ============================================================================== --- head/share/man/man4/de.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/de.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -55,7 +55,6 @@ chips. The .Nm driver supports the following media types: -.Pp .Bl -tag -width xxxxxxxxxxxxxxx .It autoselect Enable autoselection of the media type and options @@ -76,7 +75,6 @@ Set 100Mbps operation (4-pair cat-3 cabl The .Nm driver supports the following media options: -.Pp .Bl -tag -width xxxxxxxxxxxxxxx .It full-duplex Set full duplex operation Modified: head/share/man/man4/digi.4 ============================================================================== --- head/share/man/man4/digi.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/digi.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -51,7 +51,6 @@ likely be gone over with a fine tooth co with the digi driver. .Pp When not defined the number is computed: -.Pp .Bd -ragged -offset 4n default .Dv NDGBPORTS Modified: head/share/man/man4/igmp.4 ============================================================================== --- head/share/man/man4/igmp.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/igmp.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -61,7 +61,6 @@ they are only interested in receiving mu particular sources. .\" .Sh SYSCTL VARIABLES -.Pp .Bl -tag -width indent .\" .It net.inet.igmp.stats Modified: head/share/man/man4/inet.4 ============================================================================== --- head/share/man/man4/inet.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/inet.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -141,7 +141,6 @@ they have the same form as the .Dv SIOCIFADDR command (see .Xr intro 4 ) . -.Pp .Bl -tag -width SIOCSIFNETMASK .It Dv SIOCSIFNETMASK Set interface network mask. Modified: head/share/man/man4/ipw.4 ============================================================================== --- head/share/man/man4/ipw.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/ipw.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -90,7 +90,6 @@ firmware license .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev ipw0 inet 192.168.0.20 \e netmask 0xffffff00 Modified: head/share/man/man4/iscsi_initiator.4 ============================================================================== --- head/share/man/man4/iscsi_initiator.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/iscsi_initiator.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -64,7 +64,6 @@ the initiator part of the Session Identi .El .Pp The following are informative only: -.Pp .Bl -tag -width "net.iscsi.n.targedaddress" .It Va net.iscsi.driver_version the current version of the driver. Modified: head/share/man/man4/isp.4 ============================================================================== --- head/share/man/man4/isp.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/isp.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -94,7 +94,6 @@ as it is the most likely to have been te Cards supported by the .Nm driver include: -.Pp .Bl -tag -width xxxxxx -offset indent .It ISP1000 SBus Fast Wide, Ultra Fast Wide cards, Single Ended or Differential @@ -201,7 +200,6 @@ A hint value for a driver debug level (s for the values. .El .Sh SYSCTL OPTIONS -.Pp .Bl -tag -width indent .It Va dev.isp.N.loop_down_limit This value says how long to wait in seconds after loop has gone down before Modified: head/share/man/man4/iwi.4 ============================================================================== --- head/share/man/man4/iwi.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/iwi.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -90,7 +90,6 @@ firmware license .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev iwi0 inet 192.168.0.20 \e netmask 0xffffff00 Modified: head/share/man/man4/iwn.4 ============================================================================== --- head/share/man/man4/iwn.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/iwn.4 Fri Oct 8 12:40:16 2010 (r213573) @@ -96,7 +96,6 @@ This driver requires the firmware built module to work. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Pp .Bd -literal -offset indent ifconfig wlan create wlandev iwn0 inet 192.168.0.20 \e netmask 0xffffff00 Modified: head/share/man/man4/joy.4 ============================================================================== --- head/share/man/man4/joy.4 Fri Oct 8 12:39:49 2010 (r213572) +++ head/share/man/man4/joy.4 Fri Oct 8 12:40:16 2010 (r213573) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 13:48:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4037510656B4; Fri, 8 Oct 2010 13:48:22 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4784E8FC22; Fri, 8 Oct 2010 13:48:20 +0000 (UTC) Received: by ewy27 with SMTP id 27so397728ewy.13 for ; Fri, 08 Oct 2010 06:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=DDlReh4iUQEkuzzycR1rI8wXEiu5pZjTX8+ySKPDurI=; b=Sm+54xkhthz0TrIa/6KSbGCWK8XS6GEjF0HOGBYYBphd2Nk2wobySBT8a6AG5NKCS4 oywRrOJxINAMKAaVi8vwN0SrqhALvpytV01X4EJjw3oc2BcSHfuZvkhplAv03mOeh12Z IPYfnpftRDllSFXEgC0P5zNgID3vz9joLwu1M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=oY9PYd2lev//Fv+HnqNFSstqv013/4i2L0T60KgNwn/RvnK1N6fGe31dLiRcMTcM73 iRYeUPNiYKV/NrfQff2RapALgrAhqJ+TQPjBvOBHfLZEp4J/l+loZADh67KftmyJ5NAy LewwvQleLlUY+/4rP75XP5K+1dKCU6zm/u01Q= Received: by 10.213.35.6 with SMTP id n6mr1482140ebd.0.1286545699162; Fri, 08 Oct 2010 06:48:19 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id e17sm2514904qcs.22.2010.10.08.06.48.17 (version=SSLv3 cipher=RC4-MD5); Fri, 08 Oct 2010 06:48:17 -0700 (PDT) Date: Fri, 8 Oct 2010 09:48:06 -0400 From: Alexander Kabaev To: David Xu Message-ID: <20101008094806.502c1e5a@kan.dnsalias.net> In-Reply-To: <201010080147.o981lEZ6074243@svn.freebsd.org> References: <201010080147.o981lEZ6074243@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ZCjR5a=N9EuRzTSDcH0qnKU"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213539 - head/lib/libthr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 13:48:22 -0000 --Sig_/ZCjR5a=N9EuRzTSDcH0qnKU Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 8 Oct 2010 01:47:14 +0000 (UTC) David Xu wrote: > Author: davidxu > Date: Fri Oct 8 01:47:14 2010 > New Revision: 213539 > URL: http://svn.freebsd.org/changeset/base/213539 >=20 > Log: > unwind.h was imported, gcc directory is no longer needed. >=20 > Modified: > head/lib/libthr/Makefile >=20 > Modified: head/lib/libthr/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libthr/Makefile Fri Oct 8 01:17:22 2010 > (r213538) +++ head/lib/libthr/Makefile Fri Oct 8 01:47:14 > 2010 (r213539) @@ -27,7 +27,6 @@ > CFLAGS+=3D-I${.CURDIR}/../libthread_db CFLAGS+=3D-Winline > =20 > .ifndef NO_THREAD_UNWIND_STACK > -CFLAGS+=3D-I${.CURDIR}/../../contrib/gcc -fexceptions=20 > CFLAGS+=3D-D_PTHREAD_FORCED_UNWIND > .endif > =20 Thank you for pushing this to completion. --=20 Alexander Kabaev --Sig_/ZCjR5a=N9EuRzTSDcH0qnKU Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iD8DBQFMryEfQ6z1jMm+XZYRAnCeAJ0T/79MK93IMx0kjciK8c6lK/DrdACgvhEH z0rEWyVmASmyd8JUPVQq0rQ= =bsJp -----END PGP SIGNATURE----- --Sig_/ZCjR5a=N9EuRzTSDcH0qnKU-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 14:31:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AD64106566C; Fri, 8 Oct 2010 14:31:50 +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 2F1158FC12; Fri, 8 Oct 2010 14:31: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 o98EVoub096430; Fri, 8 Oct 2010 14:31:50 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98EVooZ096427; Fri, 8 Oct 2010 14:31:50 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201010081431.o98EVooZ096427@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 8 Oct 2010 14:31: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: r213574 - in head/tools/tools/netrate: juggle tcpconnect X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 14:31:50 -0000 Author: pluknet Date: Fri Oct 8 14:31:49 2010 New Revision: 213574 URL: http://svn.freebsd.org/changeset/base/213574 Log: Clean up tools in tools/tools/netrate. - tcpconnect incorrectly uses err() in usage() with errx() semantics [1] That produces dirty error message: tcpconnect: usage: tcpconnect [ip]: Unknown error: 0 - 64-bit aware fixes in printf() usage [2] o netrate/juggle: time_t has arch-dependent size o netrate/tcpconnect: don't assume %ll has always 64bit. PR: 146088 [1], 146086 [2] (modified) Approved by: kib (mentor) MFC after: 1 week Modified: head/tools/tools/netrate/juggle/juggle.c head/tools/tools/netrate/tcpconnect/tcpconnect.c Modified: head/tools/tools/netrate/juggle/juggle.c ============================================================================== --- head/tools/tools/netrate/juggle/juggle.c Fri Oct 8 12:40:16 2010 (r213573) +++ head/tools/tools/netrate/juggle/juggle.c Fri Oct 8 14:31:49 2010 (r213574) @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -557,7 +558,8 @@ main(int argc, char *argv[]) if (j != 0) printf(", "); scale_timespec(&juggle_results[j], p); - printf("%u.%09lu", juggle_results[j].tv_sec, + printf("%jd.%09lu", + (intmax_t)juggle_results[j].tv_sec, juggle_results[j].tv_nsec); } printf("\n"); @@ -567,7 +569,8 @@ main(int argc, char *argv[]) if (j != 0) printf(", "); scale_timespec(&process_results[j], p); - printf("%u.%09lu", process_results[j].tv_sec, + printf("%jd.%09lu", + (intmax_t)process_results[j].tv_sec, process_results[j].tv_nsec); } printf("\n"); @@ -577,7 +580,8 @@ main(int argc, char *argv[]) if (j != 0) printf(", "); scale_timespec(&thread_results[j], p); - printf("%u.%09lu", thread_results[j].tv_sec, + printf("%jd.%09lu", + (intmax_t)thread_results[j].tv_sec, thread_results[j].tv_nsec); } printf("\n"); Modified: head/tools/tools/netrate/tcpconnect/tcpconnect.c ============================================================================== --- head/tools/tools/netrate/tcpconnect/tcpconnect.c Fri Oct 8 12:40:16 2010 (r213573) +++ head/tools/tools/netrate/tcpconnect/tcpconnect.c Fri Oct 8 14:31:49 2010 (r213574) @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -110,7 +111,7 @@ main(int argc, char *argv[]) u_int64_t counter; if (argc != 2) - err(-1, "usage: tcpconnect [ip]"); + errx(-1, "usage: tcpconnect [ip]"); bzero(&sin, sizeof(sin)); sin.sin_family = AF_INET; @@ -128,8 +129,8 @@ main(int argc, char *argv[]) if (try_connect(&sin) == 0) counter++; } - printf("%llu count\n", counter); - printf("%llu connections/second\n", counter / SECONDS); + printf("%ju count\n", (uintmax_t)counter); + printf("%ju connections/second\n", (uintmax_t)(counter / SECONDS)); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 14:50:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 180DE1065672; Fri, 8 Oct 2010 14:50:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07CDD8FC17; Fri, 8 Oct 2010 14:50: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 o98EowYa096957; Fri, 8 Oct 2010 14:50:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98EowPO096955; Fri, 8 Oct 2010 14:50:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010081450.o98EowPO096955@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Oct 2010 14:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213575 - head/sys/sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 14:50:59 -0000 Author: marius Date: Fri Oct 8 14:50:58 2010 New Revision: 213575 URL: http://svn.freebsd.org/changeset/base/213575 Log: Just use the sparc64 version of this header rather than duplicating it. Modified: head/sys/sun4v/include/endian.h Modified: head/sys/sun4v/include/endian.h ============================================================================== --- head/sys/sun4v/include/endian.h Fri Oct 8 14:31:49 2010 (r213574) +++ head/sys/sun4v/include/endian.h Fri Oct 8 14:50:58 2010 (r213575) @@ -1,122 +1,7 @@ /*- - * Copyright (c) 1987, 1991, 1993 - * The Regents of the University of California. All rights reserved. + * This file is in the public domain. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)endian.h 8.1 (Berkeley) 6/10/93 * $FreeBSD$ */ -#ifndef _MACHINE_ENDIAN_H_ -#define _MACHINE_ENDIAN_H_ - -#include -#include - -/* - * Define the order of 32-bit words in 64-bit words. - */ -#define _QUAD_HIGHWORD 0 -#define _QUAD_LOWWORD 1 - -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _BIG_ENDIAN - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) && defined(__OPTIMIZE__) -#define __is_constant(x) __builtin_constant_p(x) -#else -#define __is_constant(x) 0 -#endif - -#define __bswap16_const(x) ((((x) >> 8) & 0xff) | \ - (((x) << 8) & 0xff00)) -#define __bswap32_const(x) ((((x) >> 24) & 0xff) | \ - (((x) >> 8) & 0xff00) | (((x) << 8) & 0xff0000) | \ - (((x) << 24) & 0xff000000)) -#define __bswap64_const(x) ((((x) >> 56) & 0xff) | \ - (((x) >> 40) & 0xff00) | (((x) >> 24) & 0xff0000) | \ - (((x) >> 8) & 0xff000000) | \ - (((x) << 8) & ((__uint64_t)0xff << 32)) | \ - (((x) << 24) & ((__uint64_t)0xff << 40)) | \ - (((x) << 40) & ((__uint64_t)0xff << 48)) | \ - (((x) << 56) & ((__uint64_t)0xff << 56))) - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return ((_x >> 8) | ((_x << 8) & 0xff00)); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | - ((_x << 24) & 0xff000000)); -} - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} - -#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x)) -#define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ - __bswap32_var(x)) -#define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ - __bswap64_var(x)) - -#define __htonl(x) ((__uint32_t)(x)) -#define __htons(x) ((__uint16_t)(x)) -#define __ntohl(x) ((__uint32_t)(x)) -#define __ntohs(x) ((__uint16_t)(x)) - -#endif /* !_MACHINE_ENDIAN_H_ */ +#include From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 14:56:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CED3106566C; Fri, 8 Oct 2010 14:56:39 +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 4C9288FC13; Fri, 8 Oct 2010 14:56: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 o98EudTj097166; Fri, 8 Oct 2010 14:56:39 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Eudsg097164; Fri, 8 Oct 2010 14:56:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010081456.o98Eudsg097164@svn.freebsd.org> From: Ed Maste Date: Fri, 8 Oct 2010 14:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213576 - stable/8/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 14:56:39 -0000 Author: emaste Date: Fri Oct 8 14:56:39 2010 New Revision: 213576 URL: http://svn.freebsd.org/changeset/base/213576 Log: MFC r212570: Allow a kernel config to specify a set but empty value via 'makeoptions OPTION=' for consistency with the make commandline. Previously 'makeoptions WERROR=' would result in a syntax error; now it produces the same effect as 'makeoptions WERROR'. Both forms now result in 'WERROR=' in the generated Makefile. Modified: stable/8/usr.sbin/config/config.y Directory Properties: stable/8/usr.sbin/config/ (props changed) Modified: stable/8/usr.sbin/config/config.y ============================================================================== --- stable/8/usr.sbin/config/config.y Fri Oct 8 14:50:58 2010 (r213575) +++ stable/8/usr.sbin/config/config.y Fri Oct 8 14:56:39 2010 (r213576) @@ -261,6 +261,7 @@ Mkopt_list: Mkoption: Save_id { newopt(&mkopt, $1, ns(""), 0); } | + Save_id EQUALS { newopt(&mkopt, $1, ns(""), 0); } | Save_id EQUALS Opt_value { newopt(&mkopt, $1, $3, 0); } | Save_id PLUSEQUALS Opt_value { newopt(&mkopt, $1, $3, 1); } ; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 14:59:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26B67106564A; Fri, 8 Oct 2010 14:59:15 +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 162CC8FC08; Fri, 8 Oct 2010 14:59: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 o98ExELb097278; Fri, 8 Oct 2010 14:59:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98ExEEh097276; Fri, 8 Oct 2010 14:59:14 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010081459.o98ExEEh097276@svn.freebsd.org> From: Ed Maste Date: Fri, 8 Oct 2010 14:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213577 - stable/8/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 14:59:15 -0000 Author: emaste Date: Fri Oct 8 14:59:14 2010 New Revision: 213577 URL: http://svn.freebsd.org/changeset/base/213577 Log: MFC r213013: Move test for zero bufp or size before rseq and wseq calculation. This avoids spinning in an infinite loop for some (possibly corrupt?) core files at work. Modified: stable/8/gnu/usr.bin/gdb/kgdb/main.c Directory Properties: stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) Modified: stable/8/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- stable/8/gnu/usr.bin/gdb/kgdb/main.c Fri Oct 8 14:56:39 2010 (r213576) +++ stable/8/gnu/usr.bin/gdb/kgdb/main.c Fri Oct 8 14:59:14 2010 (r213577) @@ -222,11 +222,13 @@ kgdb_dmesg(void) return; bufp = kgdb_parse("msgbufp->msg_ptr"); size = (int)kgdb_parse("msgbufp->msg_size"); + if (bufp == 0 || size == 0) + return; rseq = (int)kgdb_parse("msgbufp->msg_rseq"); wseq = (int)kgdb_parse("msgbufp->msg_wseq"); rseq = MSGBUF_SEQ_TO_POS(size, rseq); wseq = MSGBUF_SEQ_TO_POS(size, wseq); - if (bufp == 0 || size == 0 || rseq == wseq) + if (rseq == wseq) return; printf("\nUnread portion of the kernel message buffer:\n"); From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 14:59:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD767106566C; Fri, 8 Oct 2010 14:59:45 +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 B38338FC13; Fri, 8 Oct 2010 14:59: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 o98Exjkf097323; Fri, 8 Oct 2010 14:59:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98ExjAb097321; Fri, 8 Oct 2010 14:59:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010081459.o98ExjAb097321@svn.freebsd.org> From: Marius Strobl Date: Fri, 8 Oct 2010 14:59: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: r213578 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 14:59:46 -0000 Author: marius Date: Fri Oct 8 14:59:45 2010 New Revision: 213578 URL: http://svn.freebsd.org/changeset/base/213578 Log: In the replacement text of the __bswapN_const() macros cast the argument to the expected type so they work like the corresponding __bswapN_var() functions and the compiler doesn't complain when arguments of different width are passed. Modified: head/sys/sparc64/include/endian.h Modified: head/sys/sparc64/include/endian.h ============================================================================== --- head/sys/sparc64/include/endian.h Fri Oct 8 14:59:14 2010 (r213577) +++ head/sys/sparc64/include/endian.h Fri Oct 8 14:59:45 2010 (r213578) @@ -69,18 +69,20 @@ #define __is_constant(x) 0 #endif -#define __bswap16_const(x) ((((x) >> 8) & 0xff) | \ - (((x) << 8) & 0xff00)) -#define __bswap32_const(x) ((((x) >> 24) & 0xff) | \ - (((x) >> 8) & 0xff00) | (((x) << 8) & 0xff0000) | \ - (((x) << 24) & 0xff000000)) -#define __bswap64_const(x) ((((x) >> 56) & 0xff) | \ - (((x) >> 40) & 0xff00) | (((x) >> 24) & 0xff0000) | \ - (((x) >> 8) & 0xff000000) | \ - (((x) << 8) & ((__uint64_t)0xff << 32)) | \ - (((x) << 24) & ((__uint64_t)0xff << 40)) | \ - (((x) << 40) & ((__uint64_t)0xff << 48)) | \ - (((x) << 56) & ((__uint64_t)0xff << 56))) +#define __bswap16_const(x) ((((__uint16_t)(x) >> 8) & 0xff) | \ + (((__uint16_t)(x) << 8) & 0xff00)) +#define __bswap32_const(x) ((((__uint32_t)(x) >> 24) & 0xff) | \ + (((__uint32_t)(x) >> 8) & 0xff00) | \ + (((__uint32_t)(x)<< 8) & 0xff0000) | \ + (((__uint32_t)(x) << 24) & 0xff000000)) +#define __bswap64_const(x) ((((__uint64_t)(x) >> 56) & 0xff) | \ + (((__uint64_t)(x) >> 40) & 0xff00) | \ + (((__uint64_t)(x) >> 24) & 0xff0000) | \ + (((__uint64_t)(x) >> 8) & 0xff000000) | \ + (((__uint64_t)(x) << 8) & ((__uint64_t)0xff << 32)) | \ + (((__uint64_t)(x) << 24) & ((__uint64_t)0xff << 40)) | \ + (((__uint64_t)(x) << 40) & ((__uint64_t)0xff << 48)) | \ + (((__uint64_t)(x) << 56) & ((__uint64_t)0xff << 56))) static __inline __uint16_t __bswap16_var(__uint16_t _x) From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 15:02:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E05511065674; Fri, 8 Oct 2010 15:02:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D110C8FC1C; Fri, 8 Oct 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 o98F2Fl6097445; Fri, 8 Oct 2010 15:02:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98F2FZK097443; Fri, 8 Oct 2010 15:02:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010081502.o98F2FZK097443@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 8 Oct 2010 15:02: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: r213579 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 15:02:16 -0000 Author: pjd Date: Fri Oct 8 15:02:15 2010 New Revision: 213579 URL: http://svn.freebsd.org/changeset/base/213579 Log: We close the event socketpair early in the mainloop to prevent spaming with error messages, so when we clean up after child process, we have to check if the event socketpair is still there. Submitted by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/control.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Fri Oct 8 14:59:45 2010 (r213578) +++ head/sbin/hastd/control.c Fri Oct 8 15:02:15 2010 (r213579) @@ -58,8 +58,10 @@ child_cleanup(struct hast_resource *res) proto_close(res->hr_ctrl); res->hr_ctrl = NULL; - proto_close(res->hr_event); - res->hr_event = NULL; + if (res->hr_event != NULL) { + proto_close(res->hr_event); + res->hr_event = NULL; + } res->hr_workerpid = 0; } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 15:05:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BD871065670; Fri, 8 Oct 2010 15:05:39 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 550398FC18; Fri, 8 Oct 2010 15:05: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 o98F5dni097597; Fri, 8 Oct 2010 15:05:39 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98F5dWE097595; Fri, 8 Oct 2010 15:05:39 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010081505.o98F5dWE097595@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 8 Oct 2010 15:05: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: r213580 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 15:05:39 -0000 Author: pjd Date: Fri Oct 8 15:05:39 2010 New Revision: 213580 URL: http://svn.freebsd.org/changeset/base/213580 Log: We can't zero out ggio request, as we have some fields in there we initialize once during start-up. Reported by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Oct 8 15:02:15 2010 (r213579) +++ head/sbin/hastd/primary.c Fri Oct 8 15:05:39 2010 (r213580) @@ -930,7 +930,6 @@ ggate_recv_thread(void *arg) QUEUE_TAKE2(hio, free); pjdlog_debug(2, "ggate_recv: (%p) Got free request.", hio); ggio = &hio->hio_ggio; - bzero(ggio, sizeof(*ggio)); ggio->gctl_unit = res->hr_ggateunit; ggio->gctl_length = MAXPHYS; ggio->gctl_error = 0; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 15:14:36 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D29E106564A; Fri, 8 Oct 2010 15:14:36 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A79F68FC0C; Fri, 8 Oct 2010 15:14:35 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 7E3BE45B36; Fri, 8 Oct 2010 17:14:34 +0200 (CEST) Received: from localhost (chello089073192049.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id B095A45683; Fri, 8 Oct 2010 17:14:28 +0200 (CEST) Date: Fri, 8 Oct 2010 17:14:02 +0200 From: Pawel Jakub Dawidek To: Ulrich =?iso-8859-1?Q?Sp=F6rlein?= , Ivan Voras , Alexander Best , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Message-ID: <20101008151402.GI1733@garage.freebsd.pl> References: <201010040617.o946HkOO002409@svn.freebsd.org> <20101004092559.GB7322@garage.freebsd.pl> <20101004095845.GA99361@freebsd.org> <20101004104257.GH7322@garage.freebsd.pl> <20101004114248.GA16641@freebsd.org> <20101008103238.GV65440@acme.spoerlein.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x0KprKst+ZOYEj2z" Content-Disposition: inline In-Reply-To: <20101008103238.GV65440@acme.spoerlein.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=4.5 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: Subject: Re: svn commit: r213398 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 15:14:36 -0000 --x0KprKst+ZOYEj2z Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 08, 2010 at 12:32:38PM +0200, Ulrich Sp=F6rlein wrote: > On Mon, 04.10.2010 at 14:04:53 +0200, Ivan Voras wrote: > > On 4 October 2010 13:42, Alexander Best wrote: > >=20 > > > good point. ZFS should really be added to the list and LFS should go = away. are > > > there any other relevant filesystems without a fixed-block size that = need to be > > > mentioned? what about afs? or tmpfs? > >=20 > > (it's not that the block sizes aren't fixed, it's that the assignment > > of blocks to the file is not fixed). >=20 > Review of attached patch, anyone? I didn't come up with a clever way to > describe non-COW file systems :/ Looks good, but I'd use a bit different wording. Instead of: +option assumes that the underlying file system does not allocate new blocks +when writing to existing blocks. Maybe something like this: +option assumes that the underlying file system updates existing blocks +in-place and does not store new data in new location. ? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --x0KprKst+ZOYEj2z Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkyvNToACgkQForvXbEpPzTUQACeIytDJAW4y1pEiFiitxFN59Lw T+IAnAiaqZX1p1pfviXF7iL2ThBUzvha =3vUd -----END PGP SIGNATURE----- --x0KprKst+ZOYEj2z-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 15:20:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F06421065670; Fri, 8 Oct 2010 15:20:20 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E11A88FC12; Fri, 8 Oct 2010 15:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98FKKg4098030; Fri, 8 Oct 2010 15:20:20 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98FKK4R098027; Fri, 8 Oct 2010 15:20:20 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201010081520.o98FKK4R098027@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 8 Oct 2010 15:20: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: r213582 - head/bin/rm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 15:20:21 -0000 Author: uqs Date: Fri Oct 8 15:20:20 2010 New Revision: 213582 URL: http://svn.freebsd.org/changeset/base/213582 Log: rm(1): clarify that -P works only when blocks are updated in-place Suggested by: pjd, ivoras, arundel Modified: head/bin/rm/rm.1 head/bin/rm/rm.c Modified: head/bin/rm/rm.1 ============================================================================== --- head/bin/rm/rm.1 Fri Oct 8 15:10:30 2010 (r213581) +++ head/bin/rm/rm.1 Fri Oct 8 15:20:20 2010 (r213582) @@ -32,7 +32,7 @@ .\" @(#)rm.1 8.5 (Berkeley) 12/5/94 .\" $FreeBSD$ .\" -.Dd October 3, 2010 +.Dd October 8, 2010 .Dt RM 1 .Os .Sh NAME @@ -229,8 +229,8 @@ command appeared in .Sh BUGS The .Fl P -option assumes that the underlying file system is a fixed-block file -system. -UFS is a fixed-block file system, LFS is not. +option assumes that the underlying file system updates existing blocks +in-place and does not store new data in a new location. +This is true for UFS but not for ZFS, which is using a Copy-On-Write strategy. In addition, only regular files are overwritten, other types of files are not. Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Fri Oct 8 15:10:30 2010 (r213581) +++ head/bin/rm/rm.c Fri Oct 8 15:20:20 2010 (r213582) @@ -402,8 +402,8 @@ rm_file(char **argv) * This is a cheap way to *really* delete files. Note that only regular * files are deleted, directories (and therefore names) will remain. * Also, this assumes a fixed-block file system (like FFS, or a V7 or a - * System V file system). In a logging file system, you'll have to have - * kernel support. + * System V file system). In a logging or COW file system, you'll have to + * have kernel support. */ int rm_overwrite(char *file, struct stat *sbp) From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 15:41:57 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E46E106564A; Fri, 8 Oct 2010 15:41:57 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9AF2B8FC08; Fri, 8 Oct 2010 15:41:56 +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 o98Fftl3015615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Oct 2010 17:41:55 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o98Fft9D015614; Fri, 8 Oct 2010 17:41:55 +0200 (CEST) (envelope-from uqs@FreeBSD.org) Date: Fri, 8 Oct 2010 17:41:55 +0200 From: Ulrich Spoerlein To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20101008154155.GA65440@acme.spoerlein.net> Mail-Followup-To: Ulrich Spoerlein , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201010081240.o98CeG2A093563@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201010081240.o98CeG2A093563@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r213573 - in head: bin/chflags bin/stty games/caesar lib/libarchive lib/libc/gen lib/libc/locale lib/libc/net lib/libc/posix1e lib/libc/regex lib/libc/stdlib lib/libc/sys lib/libc/uuid ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 15:41:57 -0000 On Fri, 08.10.2010 at 12:40:16 +0000, Ulrich Spörlein wrote: > Author: uqs > Date: Fri Oct 8 12:40:16 2010 > New Revision: 213573 > URL: http://svn.freebsd.org/changeset/base/213573 > > Log: > mdoc: drop redundant .Pp and .LP calls This is weird, I had two more files in the git commit that was pushed to svn, but they somehow got lost in transit. Which should have aborted the commit and not finished it anyway. Looks like a regression in git-svn, just FYI. Uli From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 17:42:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 326CA1065698; Fri, 8 Oct 2010 17:42:10 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242888FC1A; Fri, 8 Oct 2010 17:42: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 o98HgAhv001606; Fri, 8 Oct 2010 17:42:10 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98HgAbO001604; Fri, 8 Oct 2010 17:42:10 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201010081742.o98HgAbO001604@svn.freebsd.org> From: Mark Murray Date: Fri, 8 Oct 2010 17:42: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: r213585 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 17:42:10 -0000 Author: markm Date: Fri Oct 8 17:42:09 2010 New Revision: 213585 URL: http://svn.freebsd.org/changeset/base/213585 Log: Don't blow away /bin/rmail symlink if we are keeping mailwrapper. Mailwrapper can provide a perfectly good rmail with other mailers. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Oct 8 16:33:25 2010 (r213584) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Oct 8 17:42:09 2010 (r213585) @@ -2003,7 +2003,9 @@ OLD_FILES+=etc/periodic/daily/210.backup OLD_FILES+=etc/periodic/daily/440.status-mailq OLD_FILES+=etc/periodic/daily/460.status-mail-rejects OLD_FILES+=etc/periodic/daily/500.queuerun +.if ${MK_MAILWRAPPER} == no OLD_FILES+=bin/rmail +.endif OLD_FILES+=usr/bin/vacation OLD_FILES+=usr/include/libmilter/mfapi.h OLD_FILES+=usr/include/libmilter/mfdef.h From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 17:58:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9230E1065675; Fri, 8 Oct 2010 17:58:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83EC58FC1D; Fri, 8 Oct 2010 17:58: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 o98Hw7SS002026; Fri, 8 Oct 2010 17:58:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Hw7fU002024; Fri, 8 Oct 2010 17:58:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081758.o98Hw7fU002024@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 17:58: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: r213587 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 17:58:07 -0000 Author: yongari Date: Fri Oct 8 17:58:07 2010 New Revision: 213587 URL: http://svn.freebsd.org/changeset/base/213587 Log: Do not blindly UP the interface when interface's MTU is changed. If driver is not running there is no need to up the interface. While I'm here hold driver lock before modifying MTU as it is referenced in RX handler. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Fri Oct 8 17:46:51 2010 (r213586) +++ head/sys/dev/bge/if_bge.c Fri Oct 8 17:58:07 2010 (r213587) @@ -4631,6 +4631,7 @@ bge_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFMTU: + BGE_LOCK(sc); if (ifr->ifr_mtu < ETHERMIN || ((BGE_IS_JUMBO_CAPABLE(sc)) && ifr->ifr_mtu > BGE_JUMBO_MTU) || @@ -4639,9 +4640,12 @@ bge_ioctl(struct ifnet *ifp, u_long comm error = EINVAL; else if (ifp->if_mtu != ifr->ifr_mtu) { ifp->if_mtu = ifr->ifr_mtu; - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - bge_init(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + bge_init_locked(sc); + } } + BGE_UNLOCK(sc); break; case SIOCSIFFLAGS: BGE_LOCK(sc); From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:06:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 664F11065670; Fri, 8 Oct 2010 18:06:15 +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 571EF8FC14; Fri, 8 Oct 2010 18:06: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 o98I6Fhx002282; Fri, 8 Oct 2010 18:06:15 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98I6Fmh002280; Fri, 8 Oct 2010 18:06:15 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010081806.o98I6Fmh002280@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 8 Oct 2010 18:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213588 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:06:15 -0000 Author: mdf Date: Fri Oct 8 18:06:15 2010 New Revision: 213588 URL: http://svn.freebsd.org/changeset/base/213588 Log: MFC r212926: Use destroy_dev_sched(9) instead of destroy_dev(9) in passcleanup() as it is indirectly a d_close method. Modified: stable/8/sys/cam/scsi/scsi_pass.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_pass.c Fri Oct 8 17:58:07 2010 (r213587) +++ stable/8/sys/cam/scsi/scsi_pass.c Fri Oct 8 18:06:15 2010 (r213588) @@ -169,7 +169,11 @@ passcleanup(struct cam_periph *periph) xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); - destroy_dev(softc->dev); + /* + * passcleanup() is indirectly a d_close method via passclose, + * so using destroy_dev(9) directly can result in deadlock. + */ + destroy_dev_sched(softc->dev); cam_periph_lock(periph); free(softc, M_DEVBUF); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:06:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F921065670; Fri, 8 Oct 2010 18:06:30 +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 759628FC08; Fri, 8 Oct 2010 18:06: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 o98I6UKd002323; Fri, 8 Oct 2010 18:06:30 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98I6Ujv002321; Fri, 8 Oct 2010 18:06:30 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010081806.o98I6Ujv002321@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 8 Oct 2010 18:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213589 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:06:30 -0000 Author: mdf Date: Fri Oct 8 18:06:30 2010 New Revision: 213589 URL: http://svn.freebsd.org/changeset/base/213589 Log: MFC r212926: Use destroy_dev_sched(9) instead of destroy_dev(9) in passcleanup() as it is indirectly a d_close method. Modified: stable/7/sys/cam/scsi/scsi_pass.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_pass.c Fri Oct 8 18:06:15 2010 (r213588) +++ stable/7/sys/cam/scsi/scsi_pass.c Fri Oct 8 18:06:30 2010 (r213589) @@ -169,7 +169,11 @@ passcleanup(struct cam_periph *periph) xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); - destroy_dev(softc->dev); + /* + * passcleanup() is indirectly a d_close method via passclose, + * so using destroy_dev(9) directly can result in deadlock. + */ + destroy_dev_sched(softc->dev); cam_periph_lock(periph); free(softc, M_DEVBUF); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:13:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF7DA106564A; Fri, 8 Oct 2010 18:13:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BFBAC8FC1C; Fri, 8 Oct 2010 18:13:50 +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 65E7F46B82; Fri, 8 Oct 2010 14:13:50 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9110F8A03C; Fri, 8 Oct 2010 14:13:49 -0400 (EDT) From: John Baldwin To: Nathan Whitehorn Date: Fri, 8 Oct 2010 13:46:21 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010031750.o93Hoh2D082550@svn.freebsd.org> In-Reply-To: <201010031750.o93Hoh2D082550@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201010081346.21360.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 08 Oct 2010 14:13:49 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213386 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:13:51 -0000 On Sunday, October 03, 2010 1:50:43 pm Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun Oct 3 17:50:43 2010 > New Revision: 213386 > URL: http://svn.freebsd.org/changeset/base/213386 > > Log: > Extend sysinstall to handle powerpc64 by teaching it that powerpc64 has > a lib32 distribution, and that the GENERIC kernel is named GENERIC64. > More modifications will be required later for installations from ftp due > to the shared platform name with 32-bit powerpc, but this is enough for > snapshot CDs to work. Perhaps add a 'WITH_LIB32' flag similar to the existing 'WITH_SYSCONS', etc. flags in sysinstall.h so that there is only one place to update in the future to add support for lib32 on other platforms? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:19:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55721106567A; Fri, 8 Oct 2010 18:19:06 +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 453C68FC0A; Fri, 8 Oct 2010 18:19: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 o98IJ6X4002674; Fri, 8 Oct 2010 18:19:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98IJ6VJ002672; Fri, 8 Oct 2010 18:19:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081819.o98IJ6VJ002672@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213590 - stable/8/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:19:06 -0000 Author: yongari Date: Fri Oct 8 18:19:05 2010 New Revision: 213590 URL: http://svn.freebsd.org/changeset/base/213590 Log: MFC r213306: Rename rl_setmulti() to rl_rxfilter() as rl_rxfilter() will handle IFF_ALLMULTI/IFF_PROMISC as well as multicast filter configuration. Rewrite RX filter logic to reduce number of register accesses and make it handle promiscuous/allmulti toggling without controller reinitialization. Previously rl(4) counted on controller reinitialization to reprogram promiscuous configuration but r211767 resulted in avoiding controller reinitialization whenever promiscuous mode is toggled. To address this, keep track of driver's view of interface state and handle IFF_ALLMULTI/IFF_PROMISC changes without reinitializing controller. This should fix a regression introduced in r211267. While I'm here remove unnecessary variable reassignment in ioctl handler. PR: kern/151079 Modified: stable/8/sys/pci/if_rl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/pci/if_rl.c ============================================================================== --- stable/8/sys/pci/if_rl.c Fri Oct 8 18:06:30 2010 (r213589) +++ stable/8/sys/pci/if_rl.c Fri Oct 8 18:19:05 2010 (r213590) @@ -203,7 +203,7 @@ static void rl_read_eeprom(struct rl_sof static void rl_reset(struct rl_softc *); static int rl_resume(device_t); static int rl_rxeof(struct rl_softc *); -static void rl_setmulti(struct rl_softc *); +static void rl_rxfilter(struct rl_softc *); static int rl_shutdown(device_t); static void rl_start(struct ifnet *); static void rl_start_locked(struct ifnet *); @@ -655,54 +655,51 @@ rl_miibus_statchg(device_t dev) * Program the 64-bit multicast hash filter. */ static void -rl_setmulti(struct rl_softc *sc) +rl_rxfilter(struct rl_softc *sc) { struct ifnet *ifp = sc->rl_ifp; int h = 0; uint32_t hashes[2] = { 0, 0 }; struct ifmultiaddr *ifma; uint32_t rxfilt; - int mcnt = 0; RL_LOCK_ASSERT(sc); rxfilt = CSR_READ_4(sc, RL_RXCFG); - + rxfilt &= ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_BROAD | + RL_RXCFG_RX_MULTI); + /* Always accept frames destined for this host. */ + rxfilt |= RL_RXCFG_RX_INDIV; + /* Set capture broadcast bit to capture broadcast frames. */ + if (ifp->if_flags & IFF_BROADCAST) + rxfilt |= RL_RXCFG_RX_BROAD; if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { rxfilt |= RL_RXCFG_RX_MULTI; - CSR_WRITE_4(sc, RL_RXCFG, rxfilt); - CSR_WRITE_4(sc, RL_MAR0, 0xFFFFFFFF); - CSR_WRITE_4(sc, RL_MAR4, 0xFFFFFFFF); - return; - } - - /* first, zot all the existing hash bits */ - CSR_WRITE_4(sc, RL_MAR0, 0); - CSR_WRITE_4(sc, RL_MAR4, 0); - - /* now program new ones */ - if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - h = ether_crc32_be(LLADDR((struct sockaddr_dl *) - ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; - if (h < 32) - hashes[0] |= (1 << h); - else - hashes[1] |= (1 << (h - 32)); - mcnt++; + if (ifp->if_flags & IFF_PROMISC) + rxfilt |= RL_RXCFG_RX_ALLPHYS; + hashes[0] = 0xFFFFFFFF; + hashes[1] = 0xFFFFFFFF; + } else { + /* Now program new ones. */ + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + if (h < 32) + hashes[0] |= (1 << h); + else + hashes[1] |= (1 << (h - 32)); + } + if_maddr_runlock(ifp); + if (hashes[0] != 0 || hashes[1] != 0) + rxfilt |= RL_RXCFG_RX_MULTI; } - if_maddr_runlock(ifp); - - if (mcnt) - rxfilt |= RL_RXCFG_RX_MULTI; - else - rxfilt &= ~RL_RXCFG_RX_MULTI; - CSR_WRITE_4(sc, RL_RXCFG, rxfilt); CSR_WRITE_4(sc, RL_MAR0, hashes[0]); CSR_WRITE_4(sc, RL_MAR4, hashes[1]); + CSR_WRITE_4(sc, RL_RXCFG, rxfilt); } static void @@ -1807,7 +1804,6 @@ rl_init_locked(struct rl_softc *sc) { struct ifnet *ifp = sc->rl_ifp; struct mii_data *mii; - uint32_t rxcfg = 0; uint32_t eaddr[2]; RL_LOCK_ASSERT(sc); @@ -1864,30 +1860,8 @@ rl_init_locked(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG); - /* Set the individual bit to receive frames for this host only. */ - rxcfg = CSR_READ_4(sc, RL_RXCFG); - rxcfg |= RL_RXCFG_RX_INDIV; - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - rxcfg |= RL_RXCFG_RX_ALLPHYS; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - } else { - rxcfg &= ~RL_RXCFG_RX_ALLPHYS; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - } - - /* Set capture broadcast bit to capture broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - rxcfg |= RL_RXCFG_RX_BROAD; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - } else { - rxcfg &= ~RL_RXCFG_RX_BROAD; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - } - - /* Program the multicast filter, if necessary. */ - rl_setmulti(sc); + /* Set RX filter. */ + rl_rxfilter(sc); #ifdef DEVICE_POLLING /* Disable interrupts if we are polling. */ @@ -1966,20 +1940,22 @@ rl_ioctl(struct ifnet *ifp, u_long comma case SIOCSIFFLAGS: RL_LOCK(sc); if (ifp->if_flags & IFF_UP) { - rl_init_locked(sc); - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rl_stop(sc); - } + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + ((ifp->if_flags ^ sc->rl_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI))) + rl_rxfilter(sc); + else + rl_init_locked(sc); + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) + rl_stop(sc); + sc->rl_if_flags = ifp->if_flags; RL_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: RL_LOCK(sc); - rl_setmulti(sc); + rl_rxfilter(sc); RL_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:26:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F8E106564A; Fri, 8 Oct 2010 18:26: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 D549F8FC08; Fri, 8 Oct 2010 18:26: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 o98IQEtf002901; Fri, 8 Oct 2010 18:26:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98IQEth002899; Fri, 8 Oct 2010 18:26:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081826.o98IQEth002899@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213591 - stable/7/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:26:15 -0000 Author: yongari Date: Fri Oct 8 18:26:14 2010 New Revision: 213591 URL: http://svn.freebsd.org/changeset/base/213591 Log: MFC r213306: Rename rl_setmulti() to rl_rxfilter() as rl_rxfilter() will handle IFF_ALLMULTI/IFF_PROMISC as well as multicast filter configuration. Rewrite RX filter logic to reduce number of register accesses and make it handle promiscuous/allmulti toggling without controller reinitialization. Previously rl(4) counted on controller reinitialization to reprogram promiscuous configuration but r211767 resulted in avoiding controller reinitialization whenever promiscuous mode is toggled. To address this, keep track of driver's view of interface state and handle IFF_ALLMULTI/IFF_PROMISC changes without reinitializing controller. This should fix a regression introduced in r211267. While I'm here remove unnecessary variable reassignment in ioctl handler. PR: kern/151079 Modified: stable/7/sys/pci/if_rl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Fri Oct 8 18:19:05 2010 (r213590) +++ stable/7/sys/pci/if_rl.c Fri Oct 8 18:26:14 2010 (r213591) @@ -203,7 +203,7 @@ static void rl_read_eeprom(struct rl_sof static void rl_reset(struct rl_softc *); static int rl_resume(device_t); static void rl_rxeof(struct rl_softc *); -static void rl_setmulti(struct rl_softc *); +static void rl_rxfilter(struct rl_softc *); static int rl_shutdown(device_t); static void rl_start(struct ifnet *); static void rl_start_locked(struct ifnet *); @@ -655,54 +655,51 @@ rl_miibus_statchg(device_t dev) * Program the 64-bit multicast hash filter. */ static void -rl_setmulti(struct rl_softc *sc) +rl_rxfilter(struct rl_softc *sc) { struct ifnet *ifp = sc->rl_ifp; int h = 0; uint32_t hashes[2] = { 0, 0 }; struct ifmultiaddr *ifma; uint32_t rxfilt; - int mcnt = 0; RL_LOCK_ASSERT(sc); rxfilt = CSR_READ_4(sc, RL_RXCFG); - + rxfilt &= ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_BROAD | + RL_RXCFG_RX_MULTI); + /* Always accept frames destined for this host. */ + rxfilt |= RL_RXCFG_RX_INDIV; + /* Set capture broadcast bit to capture broadcast frames. */ + if (ifp->if_flags & IFF_BROADCAST) + rxfilt |= RL_RXCFG_RX_BROAD; if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { rxfilt |= RL_RXCFG_RX_MULTI; - CSR_WRITE_4(sc, RL_RXCFG, rxfilt); - CSR_WRITE_4(sc, RL_MAR0, 0xFFFFFFFF); - CSR_WRITE_4(sc, RL_MAR4, 0xFFFFFFFF); - return; - } - - /* first, zot all the existing hash bits */ - CSR_WRITE_4(sc, RL_MAR0, 0); - CSR_WRITE_4(sc, RL_MAR4, 0); - - /* now program new ones */ - IF_ADDR_LOCK(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - h = ether_crc32_be(LLADDR((struct sockaddr_dl *) - ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; - if (h < 32) - hashes[0] |= (1 << h); - else - hashes[1] |= (1 << (h - 32)); - mcnt++; + if (ifp->if_flags & IFF_PROMISC) + rxfilt |= RL_RXCFG_RX_ALLPHYS; + hashes[0] = 0xFFFFFFFF; + hashes[1] = 0xFFFFFFFF; + } else { + /* Now program new ones. */ + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + if (h < 32) + hashes[0] |= (1 << h); + else + hashes[1] |= (1 << (h - 32)); + } + IF_ADDR_UNLOCK(ifp); + if (hashes[0] != 0 || hashes[1] != 0) + rxfilt |= RL_RXCFG_RX_MULTI; } - IF_ADDR_UNLOCK(ifp); - - if (mcnt) - rxfilt |= RL_RXCFG_RX_MULTI; - else - rxfilt &= ~RL_RXCFG_RX_MULTI; - CSR_WRITE_4(sc, RL_RXCFG, rxfilt); CSR_WRITE_4(sc, RL_MAR0, hashes[0]); CSR_WRITE_4(sc, RL_MAR4, hashes[1]); + CSR_WRITE_4(sc, RL_RXCFG, rxfilt); } static void @@ -1800,7 +1797,6 @@ rl_init_locked(struct rl_softc *sc) { struct ifnet *ifp = sc->rl_ifp; struct mii_data *mii; - uint32_t rxcfg = 0; uint32_t eaddr[2]; RL_LOCK_ASSERT(sc); @@ -1857,30 +1853,8 @@ rl_init_locked(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); CSR_WRITE_4(sc, RL_RXCFG, RL_RXCFG_CONFIG); - /* Set the individual bit to receive frames for this host only. */ - rxcfg = CSR_READ_4(sc, RL_RXCFG); - rxcfg |= RL_RXCFG_RX_INDIV; - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - rxcfg |= RL_RXCFG_RX_ALLPHYS; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - } else { - rxcfg &= ~RL_RXCFG_RX_ALLPHYS; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - } - - /* Set capture broadcast bit to capture broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - rxcfg |= RL_RXCFG_RX_BROAD; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - } else { - rxcfg &= ~RL_RXCFG_RX_BROAD; - CSR_WRITE_4(sc, RL_RXCFG, rxcfg); - } - - /* Program the multicast filter, if necessary. */ - rl_setmulti(sc); + /* Set RX filter. */ + rl_rxfilter(sc); #ifdef DEVICE_POLLING /* Disable interrupts if we are polling. */ @@ -1959,20 +1933,22 @@ rl_ioctl(struct ifnet *ifp, u_long comma case SIOCSIFFLAGS: RL_LOCK(sc); if (ifp->if_flags & IFF_UP) { - rl_init_locked(sc); - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rl_stop(sc); - } + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + ((ifp->if_flags ^ sc->rl_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI))) + rl_rxfilter(sc); + else + rl_init_locked(sc); + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) + rl_stop(sc); + sc->rl_if_flags = ifp->if_flags; RL_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: RL_LOCK(sc); - rl_setmulti(sc); + rl_rxfilter(sc); RL_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:31:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7F6106564A; Fri, 8 Oct 2010 18:31:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D3AE8FC12; Fri, 8 Oct 2010 18:31:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98IVuUK003073; Fri, 8 Oct 2010 18:31:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98IVuAT003071; Fri, 8 Oct 2010 18:31:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081831.o98IVuAT003071@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213592 - stable/7/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:31:56 -0000 Author: yongari Date: Fri Oct 8 18:31:56 2010 New Revision: 213592 URL: http://svn.freebsd.org/changeset/base/213592 Log: MFC r188392: Destroy TX tag outside of loop scope. Found with: Coverity Prevent(tm) CID: 3886 Modified: stable/7/sys/pci/if_rl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Fri Oct 8 18:26:14 2010 (r213591) +++ stable/7/sys/pci/if_rl.c Fri Oct 8 18:31:56 2010 (r213592) @@ -1173,9 +1173,9 @@ rl_dma_free(struct rl_softc *sc) sc->rl_cdata.rl_tx_dmamap[i]); sc->rl_cdata.rl_tx_dmamap[i] = NULL; } + } bus_dma_tag_destroy(sc->rl_cdata.rl_tx_tag); sc->rl_cdata.rl_tx_tag = NULL; - } } if (sc->rl_parent_tag != NULL) { From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:43:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ECE8106566C; Fri, 8 Oct 2010 18:43:06 +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 4C4578FC13; Fri, 8 Oct 2010 18:43: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 o98Ih6Fr003404; Fri, 8 Oct 2010 18:43:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Ih6Bh003401; Fri, 8 Oct 2010 18:43:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081843.o98Ih6Bh003401@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213593 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:43:06 -0000 Author: yongari Date: Fri Oct 8 18:43:06 2010 New Revision: 213593 URL: http://svn.freebsd.org/changeset/base/213593 Log: MFC r212061,212065,212302: r212061: Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA tag. All controllers that are not BCM5755 or higher have 4GB boundary DMA bug. Previously bge(4) used 32bit DMA address to workaround the bug(r199670). However this caused the use of bounce buffers such that it resulted in poor performance for systems which have more than 4GB memory. Because bus_dma(9) honors boundary restriction requirement of DMA tag for dynamic buffers, having a separate TX/RX mbuf DMA tag will greatly reduce the possibility of using bounce buffers. For DMA buffers allocated with bus_dmamem_alloc(9), now bge(4) explicitly checks whether the requested memory region crossed the boundary or not. With this change, only the DMA buffer that crossed the boundary will use 32bit DMA address. Other DMA buffers are not affected as separate DMA tag is created for each DMA buffer. Even if 32bit DMA address space is used for a buffer, the chance to use bounce buffer is still very low as the size of buffer is small. This change should eliminate most usage of bounce buffers on systems that have more than 4GB memory. More correct fix would be teaching bus_dma(9) to honor boundary restriction for buffers created with bus_dmamem_alloc(9) but it seems that is not easy. While I'm here cleanup bge_dma_map_addr() and remove unnecessary member variables in bge_dmamap_arg structure. Tested by: marcel r212065: Handle PAE case correctly. You cannot effectively specify a 4GB boundary in PAE case so use a 2GB boundary for PAE as suggested by jhb. Pointed out by: jhb Reviewed by: jhb r212302: Make sure to create DMA'able memory for statistics block. This was missed in r212061 and it caused crashes for 570x controllers as controller DMAed statistics to physical address 0. Reported by: kan Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Fri Oct 8 18:31:56 2010 (r213592) +++ stable/8/sys/dev/bge/if_bge.c Fri Oct 8 18:43:06 2010 (r213593) @@ -355,8 +355,10 @@ static int bge_suspend(device_t); static int bge_resume(device_t); static void bge_release_resources(struct bge_softc *); static void bge_dma_map_addr(void *, bus_dma_segment_t *, int, int); -static int bge_dma_alloc(device_t); +static int bge_dma_alloc(struct bge_softc *); static void bge_dma_free(struct bge_softc *); +static int bge_dma_ring_alloc(struct bge_softc *, bus_size_t, bus_size_t, + bus_dma_tag_t *, uint8_t **, bus_dmamap_t *, bus_addr_t *, const char *); static int bge_get_eaddr_fw(struct bge_softc *sc, uint8_t ether_addr[]); static int bge_get_eaddr_mem(struct bge_softc *, uint8_t[]); @@ -614,13 +616,9 @@ bge_dma_map_addr(void *arg, bus_dma_segm if (error) return; - ctx = arg; - - if (nseg > ctx->bge_maxsegs) { - ctx->bge_maxsegs = 0; - return; - } + KASSERT(nseg == 1, ("%s: %d segments returned!", __func__, nseg)); + ctx = arg; ctx->bge_busaddr = segs->ds_addr; } @@ -2122,27 +2120,84 @@ bge_dma_free(struct bge_softc *sc) if (sc->bge_cdata.bge_stats_tag) bus_dma_tag_destroy(sc->bge_cdata.bge_stats_tag); + if (sc->bge_cdata.bge_buffer_tag) + bus_dma_tag_destroy(sc->bge_cdata.bge_buffer_tag); + /* Destroy the parent tag. */ if (sc->bge_cdata.bge_parent_tag) bus_dma_tag_destroy(sc->bge_cdata.bge_parent_tag); } static int -bge_dma_alloc(device_t dev) +bge_dma_ring_alloc(struct bge_softc *sc, bus_size_t alignment, + bus_size_t maxsize, bus_dma_tag_t *tag, uint8_t **ring, bus_dmamap_t *map, + bus_addr_t *paddr, const char *msg) { struct bge_dmamap_arg ctx; - struct bge_softc *sc; bus_addr_t lowaddr; - bus_size_t sbsz, txsegsz, txmaxsegsz; - int i, error; + bus_size_t ring_end; + int error; - sc = device_get_softc(dev); + lowaddr = BUS_SPACE_MAXADDR; +again: + error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, + alignment, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, + NULL, maxsize, 1, maxsize, 0, NULL, NULL, tag); + if (error != 0) { + device_printf(sc->bge_dev, + "could not create %s dma tag\n", msg); + return (ENOMEM); + } + /* Allocate DMA'able memory for ring. */ + error = bus_dmamem_alloc(*tag, (void **)ring, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, map); + if (error != 0) { + device_printf(sc->bge_dev, + "could not allocate DMA'able memory for %s\n", msg); + return (ENOMEM); + } + /* Load the address of the ring. */ + ctx.bge_busaddr = 0; + error = bus_dmamap_load(*tag, *map, *ring, maxsize, bge_dma_map_addr, + &ctx, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->bge_dev, + "could not load DMA'able memory for %s\n", msg); + return (ENOMEM); + } + *paddr = ctx.bge_busaddr; + ring_end = *paddr + maxsize; + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0 && + BGE_ADDR_HI(*paddr) != BGE_ADDR_HI(ring_end)) { + /* + * 4GB boundary crossed. Limit maximum allowable DMA + * address space to 32bit and try again. + */ + bus_dmamap_unload(*tag, *map); + bus_dmamem_free(*tag, *ring, *map); + bus_dma_tag_destroy(*tag); + if (bootverbose) + device_printf(sc->bge_dev, "4GB boundary crossed, " + "limit DMA address space to 32bit for %s\n", msg); + *ring = NULL; + *tag = NULL; + *map = NULL; + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } + return (0); +} + +static int +bge_dma_alloc(struct bge_softc *sc) +{ + bus_addr_t lowaddr; + bus_size_t boundary, sbsz, txsegsz, txmaxsegsz; + int i, error; lowaddr = BUS_SPACE_MAXADDR; if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) lowaddr = BGE_DMA_MAXADDR; - if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) - lowaddr = BUS_SPACE_MAXADDR_32BIT; /* * Allocate the parent bus DMA tag appropriate for PCI. */ @@ -2150,16 +2205,93 @@ bge_dma_alloc(device_t dev) 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); - if (error != 0) { device_printf(sc->bge_dev, "could not allocate parent dma tag\n"); return (ENOMEM); } + /* Create tag for standard RX ring. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_STD_RX_RING_SZ, + &sc->bge_cdata.bge_rx_std_ring_tag, + (uint8_t **)&sc->bge_ldata.bge_rx_std_ring, + &sc->bge_cdata.bge_rx_std_ring_map, + &sc->bge_ldata.bge_rx_std_ring_paddr, "RX ring"); + if (error) + return (error); + + /* Create tag for RX return ring. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_RX_RTN_RING_SZ(sc), + &sc->bge_cdata.bge_rx_return_ring_tag, + (uint8_t **)&sc->bge_ldata.bge_rx_return_ring, + &sc->bge_cdata.bge_rx_return_ring_map, + &sc->bge_ldata.bge_rx_return_ring_paddr, "RX return ring"); + if (error) + return (error); + + /* Create tag for TX ring. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_TX_RING_SZ, + &sc->bge_cdata.bge_tx_ring_tag, + (uint8_t **)&sc->bge_ldata.bge_tx_ring, + &sc->bge_cdata.bge_tx_ring_map, + &sc->bge_ldata.bge_tx_ring_paddr, "TX ring"); + if (error) + return (error); + /* - * Create tag for Tx mbufs. + * Create tag for status block. + * Because we only use single Tx/Rx/Rx return ring, use + * minimum status block size except BCM5700 AX/BX which + * seems to want to see full status block size regardless + * of configured number of ring. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + sbsz = BGE_STATUS_BLK_SZ; + else + sbsz = 32; + error = bge_dma_ring_alloc(sc, PAGE_SIZE, sbsz, + &sc->bge_cdata.bge_status_tag, + (uint8_t **)&sc->bge_ldata.bge_status_block, + &sc->bge_cdata.bge_status_map, + &sc->bge_ldata.bge_status_block_paddr, "status block"); + if (error) + return (error); + + /* Create tag for statistics block. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_STATS_SZ, + &sc->bge_cdata.bge_stats_tag, + (uint8_t **)&sc->bge_ldata.bge_stats, + &sc->bge_cdata.bge_stats_map, + &sc->bge_ldata.bge_stats_paddr, "statistics block"); + if (error) + return (error); + + /* Create tag for jumbo RX ring. */ + if (BGE_IS_JUMBO_CAPABLE(sc)) { + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_JUMBO_RX_RING_SZ, + &sc->bge_cdata.bge_rx_jumbo_ring_tag, + (uint8_t **)&sc->bge_ldata.bge_rx_jumbo_ring, + &sc->bge_cdata.bge_rx_jumbo_ring_map, + &sc->bge_ldata.bge_rx_jumbo_ring_paddr, "jumbo RX ring"); + if (error) + return (error); + } + + /* Create parent tag for buffers. */ + boundary = 0; + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) + boundary = BGE_DMA_BNDRY; + error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), + 1, boundary, lowaddr, BUS_SPACE_MAXADDR, NULL, + NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, + 0, NULL, NULL, &sc->bge_cdata.bge_buffer_tag); + if (error != 0) { + device_printf(sc->bge_dev, + "could not allocate buffer dma tag\n"); + return (ENOMEM); + } + /* Create tag for Tx mbufs. */ if (sc->bge_flags & BGE_FLAG_TSO) { txsegsz = BGE_TSOSEG_SZ; txmaxsegsz = 65535 + sizeof(struct ether_vlan_header); @@ -2167,7 +2299,7 @@ bge_dma_alloc(device_t dev) txsegsz = MCLBYTES; txmaxsegsz = MCLBYTES * BGE_NSEG_NEW; } - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, + error = bus_dma_tag_create(sc->bge_cdata.bge_buffer_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, txmaxsegsz, BGE_NSEG_NEW, txsegsz, 0, NULL, NULL, &sc->bge_cdata.bge_tx_mtag); @@ -2177,10 +2309,8 @@ bge_dma_alloc(device_t dev) return (ENOMEM); } - /* - * Create tag for Rx mbufs. - */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, + /* Create tag for Rx mbufs. */ + error = bus_dma_tag_create(sc->bge_cdata.bge_buffer_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); @@ -2218,42 +2348,9 @@ bge_dma_alloc(device_t dev) } } - /* Create tag for standard RX ring. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_STD_RX_RING_SZ, 1, BGE_STD_RX_RING_SZ, 0, - NULL, NULL, &sc->bge_cdata.bge_rx_std_ring_tag); - - if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for standard RX ring. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_rx_std_ring_tag, - (void **)&sc->bge_ldata.bge_rx_std_ring, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_rx_std_ring_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); - - /* Load the address of the standard RX ring. */ - ctx.bge_maxsegs = 1; - ctx.sc = sc; - - error = bus_dmamap_load(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, sc->bge_ldata.bge_rx_std_ring, - BGE_STD_RX_RING_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_rx_std_ring_paddr = ctx.bge_busaddr; - - /* Create tags for jumbo mbufs. */ + /* Create tags for jumbo RX buffers. */ if (BGE_IS_JUMBO_CAPABLE(sc)) { - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, + error = bus_dma_tag_create(sc->bge_cdata.bge_buffer_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MJUM9BYTES, BGE_NSEG_JUMBO, PAGE_SIZE, 0, NULL, NULL, &sc->bge_cdata.bge_mtag_jumbo); @@ -2262,41 +2359,6 @@ bge_dma_alloc(device_t dev) "could not allocate jumbo dma tag\n"); return (ENOMEM); } - - /* Create tag for jumbo RX ring. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_JUMBO_RX_RING_SZ, 1, BGE_JUMBO_RX_RING_SZ, 0, - NULL, NULL, &sc->bge_cdata.bge_rx_jumbo_ring_tag); - - if (error) { - device_printf(sc->bge_dev, - "could not allocate jumbo ring dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for jumbo RX ring. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_rx_jumbo_ring_tag, - (void **)&sc->bge_ldata.bge_rx_jumbo_ring, - BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->bge_cdata.bge_rx_jumbo_ring_map); - if (error) - return (ENOMEM); - - /* Load the address of the jumbo RX ring. */ - ctx.bge_maxsegs = 1; - ctx.sc = sc; - - error = bus_dmamap_load(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, - sc->bge_ldata.bge_rx_jumbo_ring, BGE_JUMBO_RX_RING_SZ, - bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_rx_jumbo_ring_paddr = ctx.bge_busaddr; - /* Create DMA maps for jumbo RX buffers. */ error = bus_dmamap_create(sc->bge_cdata.bge_mtag_jumbo, 0, &sc->bge_cdata.bge_rx_jumbo_sparemap); @@ -2314,154 +2376,8 @@ bge_dma_alloc(device_t dev) return (ENOMEM); } } - - } - - /* Create tag for RX return ring. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_RX_RTN_RING_SZ(sc), 1, BGE_RX_RTN_RING_SZ(sc), 0, - NULL, NULL, &sc->bge_cdata.bge_rx_return_ring_tag); - - if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for RX return ring. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_rx_return_ring_tag, - (void **)&sc->bge_ldata.bge_rx_return_ring, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_rx_return_ring_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_rx_return_ring, - BGE_RX_RTN_RING_SZ(sc)); - - /* Load the address of the RX return ring. */ - ctx.bge_maxsegs = 1; - ctx.sc = sc; - - error = bus_dmamap_load(sc->bge_cdata.bge_rx_return_ring_tag, - sc->bge_cdata.bge_rx_return_ring_map, - sc->bge_ldata.bge_rx_return_ring, BGE_RX_RTN_RING_SZ(sc), - bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_rx_return_ring_paddr = ctx.bge_busaddr; - - /* Create tag for TX ring. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_TX_RING_SZ, 1, BGE_TX_RING_SZ, 0, NULL, NULL, - &sc->bge_cdata.bge_tx_ring_tag); - - if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for TX ring. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_tx_ring_tag, - (void **)&sc->bge_ldata.bge_tx_ring, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_tx_ring_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_tx_ring, BGE_TX_RING_SZ); - - /* Load the address of the TX ring. */ - ctx.bge_maxsegs = 1; - ctx.sc = sc; - - error = bus_dmamap_load(sc->bge_cdata.bge_tx_ring_tag, - sc->bge_cdata.bge_tx_ring_map, sc->bge_ldata.bge_tx_ring, - BGE_TX_RING_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_tx_ring_paddr = ctx.bge_busaddr; - - /* - * Create tag for status block. - * Because we only use single Tx/Rx/Rx return ring, use - * minimum status block size except BCM5700 AX/BX which - * seems to want to see full status block size regardless - * of configured number of ring. - */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && - sc->bge_chipid != BGE_CHIPID_BCM5700_C0) - sbsz = BGE_STATUS_BLK_SZ; - else - sbsz = 32; - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, sbsz, 1, sbsz, 0, NULL, NULL, &sc->bge_cdata.bge_status_tag); - - if (error) { - device_printf(sc->bge_dev, - "could not allocate status dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for status block. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_status_tag, - (void **)&sc->bge_ldata.bge_status_block, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_status_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_status_block, sbsz); - - /* Load the address of the status block. */ - ctx.sc = sc; - ctx.bge_maxsegs = 1; - - error = bus_dmamap_load(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, sc->bge_ldata.bge_status_block, - sbsz, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_status_block_paddr = ctx.bge_busaddr; - - /* Create tag for statistics block. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_STATS_SZ, 1, BGE_STATS_SZ, 0, NULL, NULL, - &sc->bge_cdata.bge_stats_tag); - - if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); - return (ENOMEM); } - /* Allocate DMA'able memory for statistics block. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_stats_tag, - (void **)&sc->bge_ldata.bge_stats, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_stats_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_stats, BGE_STATS_SZ); - - /* Load the address of the statstics block. */ - ctx.sc = sc; - ctx.bge_maxsegs = 1; - - error = bus_dmamap_load(sc->bge_cdata.bge_stats_tag, - sc->bge_cdata.bge_stats_map, sc->bge_ldata.bge_stats, - BGE_STATS_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_stats_paddr = ctx.bge_busaddr; - return (0); } @@ -2788,7 +2704,7 @@ bge_attach(device_t dev) else sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT; - if (bge_dma_alloc(dev)) { + if (bge_dma_alloc(sc)) { device_printf(sc->bge_dev, "failed to allocate DMA resources\n"); error = ENXIO; Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Fri Oct 8 18:31:56 2010 (r213592) +++ stable/8/sys/dev/bge/if_bgereg.h Fri Oct 8 18:43:06 2010 (r213593) @@ -2487,6 +2487,16 @@ struct bge_gib { #define BGE_DMA_MAXADDR 0xFFFFFFFFFF #endif +#ifdef PAE +#define BGE_DMA_BNDRY 0x80000000 +#else +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#define BGE_DMA_BNDRY 0x100000000 +#else +#define BGE_DMA_BNDRY 0 +#endif +#endif + /* * Ring structures. Most of these reside in host memory and we tell * the NIC where they are via the ring control blocks. The exceptions @@ -2530,6 +2540,7 @@ struct bge_ring_data { */ struct bge_chain_data { bus_dma_tag_t bge_parent_tag; + bus_dma_tag_t bge_buffer_tag; bus_dma_tag_t bge_rx_std_ring_tag; bus_dma_tag_t bge_rx_jumbo_ring_tag; bus_dma_tag_t bge_rx_return_ring_tag; @@ -2558,12 +2569,7 @@ struct bge_chain_data { }; struct bge_dmamap_arg { - struct bge_softc *sc; bus_addr_t bge_busaddr; - uint16_t bge_flags; - int bge_idx; - int bge_maxsegs; - struct bge_tx_bd *bge_ring; }; #define BGE_HWREV_TIGON 0x01 From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:46:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B046A106564A; Fri, 8 Oct 2010 18:46:02 +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 9DD828FC1A; Fri, 8 Oct 2010 18:46: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 o98Ik2qn003620; Fri, 8 Oct 2010 18:46:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Ik2hL003617; Fri, 8 Oct 2010 18:46:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081846.o98Ik2hL003617@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213594 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:46:02 -0000 Author: yongari Date: Fri Oct 8 18:46:02 2010 New Revision: 213594 URL: http://svn.freebsd.org/changeset/base/213594 Log: MFC r212061,212065,212302: r212061: Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA tag. All controllers that are not BCM5755 or higher have 4GB boundary DMA bug. Previously bge(4) used 32bit DMA address to workaround the bug(r199670). However this caused the use of bounce buffers such that it resulted in poor performance for systems which have more than 4GB memory. Because bus_dma(9) honors boundary restriction requirement of DMA tag for dynamic buffers, having a separate TX/RX mbuf DMA tag will greatly reduce the possibility of using bounce buffers. For DMA buffers allocated with bus_dmamem_alloc(9), now bge(4) explicitly checks whether the requested memory region crossed the boundary or not. With this change, only the DMA buffer that crossed the boundary will use 32bit DMA address. Other DMA buffers are not affected as separate DMA tag is created for each DMA buffer. Even if 32bit DMA address space is used for a buffer, the chance to use bounce buffer is still very low as the size of buffer is small. This change should eliminate most usage of bounce buffers on systems that have more than 4GB memory. More correct fix would be teaching bus_dma(9) to honor boundary restriction for buffers created with bus_dmamem_alloc(9) but it seems that is not easy. While I'm here cleanup bge_dma_map_addr() and remove unnecessary member variables in bge_dmamap_arg structure. Tested by: marcel r212065: Handle PAE case correctly. You cannot effectively specify a 4GB boundary in PAE case so use a 2GB boundary for PAE as suggested by jhb. Pointed out by: jhb Reviewed by: jhb r212302: Make sure to create DMA'able memory for statistics block. This was missed in r212061 and it caused crashes for 570x controllers as controller DMAed statistics to physical address 0. Reported by: kan Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Fri Oct 8 18:43:06 2010 (r213593) +++ stable/7/sys/dev/bge/if_bge.c Fri Oct 8 18:46:02 2010 (r213594) @@ -355,8 +355,10 @@ static int bge_suspend(device_t); static int bge_resume(device_t); static void bge_release_resources(struct bge_softc *); static void bge_dma_map_addr(void *, bus_dma_segment_t *, int, int); -static int bge_dma_alloc(device_t); +static int bge_dma_alloc(struct bge_softc *); static void bge_dma_free(struct bge_softc *); +static int bge_dma_ring_alloc(struct bge_softc *, bus_size_t, bus_size_t, + bus_dma_tag_t *, uint8_t **, bus_dmamap_t *, bus_addr_t *, const char *); static int bge_get_eaddr_fw(struct bge_softc *sc, uint8_t ether_addr[]); static int bge_get_eaddr_mem(struct bge_softc *, uint8_t[]); @@ -614,13 +616,9 @@ bge_dma_map_addr(void *arg, bus_dma_segm if (error) return; - ctx = arg; - - if (nseg > ctx->bge_maxsegs) { - ctx->bge_maxsegs = 0; - return; - } + KASSERT(nseg == 1, ("%s: %d segments returned!", __func__, nseg)); + ctx = arg; ctx->bge_busaddr = segs->ds_addr; } @@ -2122,27 +2120,84 @@ bge_dma_free(struct bge_softc *sc) if (sc->bge_cdata.bge_stats_tag) bus_dma_tag_destroy(sc->bge_cdata.bge_stats_tag); + if (sc->bge_cdata.bge_buffer_tag) + bus_dma_tag_destroy(sc->bge_cdata.bge_buffer_tag); + /* Destroy the parent tag. */ if (sc->bge_cdata.bge_parent_tag) bus_dma_tag_destroy(sc->bge_cdata.bge_parent_tag); } static int -bge_dma_alloc(device_t dev) +bge_dma_ring_alloc(struct bge_softc *sc, bus_size_t alignment, + bus_size_t maxsize, bus_dma_tag_t *tag, uint8_t **ring, bus_dmamap_t *map, + bus_addr_t *paddr, const char *msg) { struct bge_dmamap_arg ctx; - struct bge_softc *sc; bus_addr_t lowaddr; - bus_size_t sbsz, txsegsz, txmaxsegsz; - int i, error; + bus_size_t ring_end; + int error; - sc = device_get_softc(dev); + lowaddr = BUS_SPACE_MAXADDR; +again: + error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, + alignment, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, + NULL, maxsize, 1, maxsize, 0, NULL, NULL, tag); + if (error != 0) { + device_printf(sc->bge_dev, + "could not create %s dma tag\n", msg); + return (ENOMEM); + } + /* Allocate DMA'able memory for ring. */ + error = bus_dmamem_alloc(*tag, (void **)ring, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, map); + if (error != 0) { + device_printf(sc->bge_dev, + "could not allocate DMA'able memory for %s\n", msg); + return (ENOMEM); + } + /* Load the address of the ring. */ + ctx.bge_busaddr = 0; + error = bus_dmamap_load(*tag, *map, *ring, maxsize, bge_dma_map_addr, + &ctx, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->bge_dev, + "could not load DMA'able memory for %s\n", msg); + return (ENOMEM); + } + *paddr = ctx.bge_busaddr; + ring_end = *paddr + maxsize; + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0 && + BGE_ADDR_HI(*paddr) != BGE_ADDR_HI(ring_end)) { + /* + * 4GB boundary crossed. Limit maximum allowable DMA + * address space to 32bit and try again. + */ + bus_dmamap_unload(*tag, *map); + bus_dmamem_free(*tag, *ring, *map); + bus_dma_tag_destroy(*tag); + if (bootverbose) + device_printf(sc->bge_dev, "4GB boundary crossed, " + "limit DMA address space to 32bit for %s\n", msg); + *ring = NULL; + *tag = NULL; + *map = NULL; + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } + return (0); +} + +static int +bge_dma_alloc(struct bge_softc *sc) +{ + bus_addr_t lowaddr; + bus_size_t boundary, sbsz, txsegsz, txmaxsegsz; + int i, error; lowaddr = BUS_SPACE_MAXADDR; if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) lowaddr = BGE_DMA_MAXADDR; - if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) - lowaddr = BUS_SPACE_MAXADDR_32BIT; /* * Allocate the parent bus DMA tag appropriate for PCI. */ @@ -2150,16 +2205,93 @@ bge_dma_alloc(device_t dev) 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); - if (error != 0) { device_printf(sc->bge_dev, "could not allocate parent dma tag\n"); return (ENOMEM); } + /* Create tag for standard RX ring. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_STD_RX_RING_SZ, + &sc->bge_cdata.bge_rx_std_ring_tag, + (uint8_t **)&sc->bge_ldata.bge_rx_std_ring, + &sc->bge_cdata.bge_rx_std_ring_map, + &sc->bge_ldata.bge_rx_std_ring_paddr, "RX ring"); + if (error) + return (error); + + /* Create tag for RX return ring. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_RX_RTN_RING_SZ(sc), + &sc->bge_cdata.bge_rx_return_ring_tag, + (uint8_t **)&sc->bge_ldata.bge_rx_return_ring, + &sc->bge_cdata.bge_rx_return_ring_map, + &sc->bge_ldata.bge_rx_return_ring_paddr, "RX return ring"); + if (error) + return (error); + + /* Create tag for TX ring. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_TX_RING_SZ, + &sc->bge_cdata.bge_tx_ring_tag, + (uint8_t **)&sc->bge_ldata.bge_tx_ring, + &sc->bge_cdata.bge_tx_ring_map, + &sc->bge_ldata.bge_tx_ring_paddr, "TX ring"); + if (error) + return (error); + /* - * Create tag for Tx mbufs. + * Create tag for status block. + * Because we only use single Tx/Rx/Rx return ring, use + * minimum status block size except BCM5700 AX/BX which + * seems to want to see full status block size regardless + * of configured number of ring. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + sbsz = BGE_STATUS_BLK_SZ; + else + sbsz = 32; + error = bge_dma_ring_alloc(sc, PAGE_SIZE, sbsz, + &sc->bge_cdata.bge_status_tag, + (uint8_t **)&sc->bge_ldata.bge_status_block, + &sc->bge_cdata.bge_status_map, + &sc->bge_ldata.bge_status_block_paddr, "status block"); + if (error) + return (error); + + /* Create tag for statistics block. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_STATS_SZ, + &sc->bge_cdata.bge_stats_tag, + (uint8_t **)&sc->bge_ldata.bge_stats, + &sc->bge_cdata.bge_stats_map, + &sc->bge_ldata.bge_stats_paddr, "statistics block"); + if (error) + return (error); + + /* Create tag for jumbo RX ring. */ + if (BGE_IS_JUMBO_CAPABLE(sc)) { + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_JUMBO_RX_RING_SZ, + &sc->bge_cdata.bge_rx_jumbo_ring_tag, + (uint8_t **)&sc->bge_ldata.bge_rx_jumbo_ring, + &sc->bge_cdata.bge_rx_jumbo_ring_map, + &sc->bge_ldata.bge_rx_jumbo_ring_paddr, "jumbo RX ring"); + if (error) + return (error); + } + + /* Create parent tag for buffers. */ + boundary = 0; + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) + boundary = BGE_DMA_BNDRY; + error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), + 1, boundary, lowaddr, BUS_SPACE_MAXADDR, NULL, + NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, + 0, NULL, NULL, &sc->bge_cdata.bge_buffer_tag); + if (error != 0) { + device_printf(sc->bge_dev, + "could not allocate buffer dma tag\n"); + return (ENOMEM); + } + /* Create tag for Tx mbufs. */ if (sc->bge_flags & BGE_FLAG_TSO) { txsegsz = BGE_TSOSEG_SZ; txmaxsegsz = 65535 + sizeof(struct ether_vlan_header); @@ -2167,7 +2299,7 @@ bge_dma_alloc(device_t dev) txsegsz = MCLBYTES; txmaxsegsz = MCLBYTES * BGE_NSEG_NEW; } - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, + error = bus_dma_tag_create(sc->bge_cdata.bge_buffer_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, txmaxsegsz, BGE_NSEG_NEW, txsegsz, 0, NULL, NULL, &sc->bge_cdata.bge_tx_mtag); @@ -2177,10 +2309,8 @@ bge_dma_alloc(device_t dev) return (ENOMEM); } - /* - * Create tag for Rx mbufs. - */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, + /* Create tag for Rx mbufs. */ + error = bus_dma_tag_create(sc->bge_cdata.bge_buffer_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, MCLBYTES, 0, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); @@ -2218,42 +2348,9 @@ bge_dma_alloc(device_t dev) } } - /* Create tag for standard RX ring. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_STD_RX_RING_SZ, 1, BGE_STD_RX_RING_SZ, 0, - NULL, NULL, &sc->bge_cdata.bge_rx_std_ring_tag); - - if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for standard RX ring. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_rx_std_ring_tag, - (void **)&sc->bge_ldata.bge_rx_std_ring, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_rx_std_ring_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); - - /* Load the address of the standard RX ring. */ - ctx.bge_maxsegs = 1; - ctx.sc = sc; - - error = bus_dmamap_load(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, sc->bge_ldata.bge_rx_std_ring, - BGE_STD_RX_RING_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_rx_std_ring_paddr = ctx.bge_busaddr; - - /* Create tags for jumbo mbufs. */ + /* Create tags for jumbo RX buffers. */ if (BGE_IS_JUMBO_CAPABLE(sc)) { - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, + error = bus_dma_tag_create(sc->bge_cdata.bge_buffer_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MJUM9BYTES, BGE_NSEG_JUMBO, PAGE_SIZE, 0, NULL, NULL, &sc->bge_cdata.bge_mtag_jumbo); @@ -2262,41 +2359,6 @@ bge_dma_alloc(device_t dev) "could not allocate jumbo dma tag\n"); return (ENOMEM); } - - /* Create tag for jumbo RX ring. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_JUMBO_RX_RING_SZ, 1, BGE_JUMBO_RX_RING_SZ, 0, - NULL, NULL, &sc->bge_cdata.bge_rx_jumbo_ring_tag); - - if (error) { - device_printf(sc->bge_dev, - "could not allocate jumbo ring dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for jumbo RX ring. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_rx_jumbo_ring_tag, - (void **)&sc->bge_ldata.bge_rx_jumbo_ring, - BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->bge_cdata.bge_rx_jumbo_ring_map); - if (error) - return (ENOMEM); - - /* Load the address of the jumbo RX ring. */ - ctx.bge_maxsegs = 1; - ctx.sc = sc; - - error = bus_dmamap_load(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, - sc->bge_ldata.bge_rx_jumbo_ring, BGE_JUMBO_RX_RING_SZ, - bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_rx_jumbo_ring_paddr = ctx.bge_busaddr; - /* Create DMA maps for jumbo RX buffers. */ error = bus_dmamap_create(sc->bge_cdata.bge_mtag_jumbo, 0, &sc->bge_cdata.bge_rx_jumbo_sparemap); @@ -2314,154 +2376,8 @@ bge_dma_alloc(device_t dev) return (ENOMEM); } } - - } - - /* Create tag for RX return ring. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_RX_RTN_RING_SZ(sc), 1, BGE_RX_RTN_RING_SZ(sc), 0, - NULL, NULL, &sc->bge_cdata.bge_rx_return_ring_tag); - - if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for RX return ring. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_rx_return_ring_tag, - (void **)&sc->bge_ldata.bge_rx_return_ring, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_rx_return_ring_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_rx_return_ring, - BGE_RX_RTN_RING_SZ(sc)); - - /* Load the address of the RX return ring. */ - ctx.bge_maxsegs = 1; - ctx.sc = sc; - - error = bus_dmamap_load(sc->bge_cdata.bge_rx_return_ring_tag, - sc->bge_cdata.bge_rx_return_ring_map, - sc->bge_ldata.bge_rx_return_ring, BGE_RX_RTN_RING_SZ(sc), - bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_rx_return_ring_paddr = ctx.bge_busaddr; - - /* Create tag for TX ring. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_TX_RING_SZ, 1, BGE_TX_RING_SZ, 0, NULL, NULL, - &sc->bge_cdata.bge_tx_ring_tag); - - if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for TX ring. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_tx_ring_tag, - (void **)&sc->bge_ldata.bge_tx_ring, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_tx_ring_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_tx_ring, BGE_TX_RING_SZ); - - /* Load the address of the TX ring. */ - ctx.bge_maxsegs = 1; - ctx.sc = sc; - - error = bus_dmamap_load(sc->bge_cdata.bge_tx_ring_tag, - sc->bge_cdata.bge_tx_ring_map, sc->bge_ldata.bge_tx_ring, - BGE_TX_RING_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_tx_ring_paddr = ctx.bge_busaddr; - - /* - * Create tag for status block. - * Because we only use single Tx/Rx/Rx return ring, use - * minimum status block size except BCM5700 AX/BX which - * seems to want to see full status block size regardless - * of configured number of ring. - */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && - sc->bge_chipid != BGE_CHIPID_BCM5700_C0) - sbsz = BGE_STATUS_BLK_SZ; - else - sbsz = 32; - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, sbsz, 1, sbsz, 0, NULL, NULL, &sc->bge_cdata.bge_status_tag); - - if (error) { - device_printf(sc->bge_dev, - "could not allocate status dma tag\n"); - return (ENOMEM); - } - - /* Allocate DMA'able memory for status block. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_status_tag, - (void **)&sc->bge_ldata.bge_status_block, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_status_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_status_block, sbsz); - - /* Load the address of the status block. */ - ctx.sc = sc; - ctx.bge_maxsegs = 1; - - error = bus_dmamap_load(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, sc->bge_ldata.bge_status_block, - sbsz, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_status_block_paddr = ctx.bge_busaddr; - - /* Create tag for statistics block. */ - error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_STATS_SZ, 1, BGE_STATS_SZ, 0, NULL, NULL, - &sc->bge_cdata.bge_stats_tag); - - if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); - return (ENOMEM); } - /* Allocate DMA'able memory for statistics block. */ - error = bus_dmamem_alloc(sc->bge_cdata.bge_stats_tag, - (void **)&sc->bge_ldata.bge_stats, BUS_DMA_NOWAIT, - &sc->bge_cdata.bge_stats_map); - if (error) - return (ENOMEM); - - bzero((char *)sc->bge_ldata.bge_stats, BGE_STATS_SZ); - - /* Load the address of the statstics block. */ - ctx.sc = sc; - ctx.bge_maxsegs = 1; - - error = bus_dmamap_load(sc->bge_cdata.bge_stats_tag, - sc->bge_cdata.bge_stats_map, sc->bge_ldata.bge_stats, - BGE_STATS_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - - if (error) - return (ENOMEM); - - sc->bge_ldata.bge_stats_paddr = ctx.bge_busaddr; - return (0); } @@ -2788,7 +2704,7 @@ bge_attach(device_t dev) else sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT; - if (bge_dma_alloc(dev)) { + if (bge_dma_alloc(sc)) { device_printf(sc->bge_dev, "failed to allocate DMA resources\n"); error = ENXIO; Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Fri Oct 8 18:43:06 2010 (r213593) +++ stable/7/sys/dev/bge/if_bgereg.h Fri Oct 8 18:46:02 2010 (r213594) @@ -2487,6 +2487,16 @@ struct bge_gib { #define BGE_DMA_MAXADDR 0xFFFFFFFFFF #endif +#ifdef PAE +#define BGE_DMA_BNDRY 0x80000000 +#else +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#define BGE_DMA_BNDRY 0x100000000 +#else +#define BGE_DMA_BNDRY 0 +#endif +#endif + /* * Ring structures. Most of these reside in host memory and we tell * the NIC where they are via the ring control blocks. The exceptions @@ -2530,6 +2540,7 @@ struct bge_ring_data { */ struct bge_chain_data { bus_dma_tag_t bge_parent_tag; + bus_dma_tag_t bge_buffer_tag; bus_dma_tag_t bge_rx_std_ring_tag; bus_dma_tag_t bge_rx_jumbo_ring_tag; bus_dma_tag_t bge_rx_return_ring_tag; @@ -2558,12 +2569,7 @@ struct bge_chain_data { }; struct bge_dmamap_arg { - struct bge_softc *sc; bus_addr_t bge_busaddr; - uint16_t bge_flags; - int bge_idx; - int bge_maxsegs; - struct bge_tx_bd *bge_ring; }; #define BGE_HWREV_TIGON 0x01 From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:49:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0B1A106564A; Fri, 8 Oct 2010 18:49:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B59508FC08; Fri, 8 Oct 2010 18:49: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 o98InxGD003766; Fri, 8 Oct 2010 18:49:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98InxK1003763; Fri, 8 Oct 2010 18:49:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081849.o98InxK1003763@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213595 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:50:00 -0000 Author: yongari Date: Fri Oct 8 18:49:59 2010 New Revision: 213595 URL: http://svn.freebsd.org/changeset/base/213595 Log: MFC r212069,212071: r212069: bge_txeof() already checks whether it has to free transmitted mbufs or not by comparing reported TX consumer index with saved index. So remove unnecessary check done after freeing transmitted mbufs. While I'm here nuke unnecessary variable initializations. r212071: Remove unnecessary atomic operation in bge_poll. bge(4) always holds a driver lock in the function entry and memory synchronization is handled by bus_dmamap_sync(9). Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Fri Oct 8 18:46:02 2010 (r213594) +++ stable/8/sys/dev/bge/if_bge.c Fri Oct 8 18:49:59 2010 (r213595) @@ -3405,7 +3405,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t static void bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { - struct bge_tx_bd *cur_tx = NULL; + struct bge_tx_bd *cur_tx; struct ifnet *ifp; BGE_LOCK_ASSERT(sc); @@ -3423,7 +3423,7 @@ bge_txeof(struct bge_softc *sc, uint16_t * frames that have been sent. */ while (sc->bge_tx_saved_considx != tx_cons) { - uint32_t idx = 0; + uint32_t idx; idx = sc->bge_tx_saved_considx; cur_tx = &sc->bge_ldata.bge_tx_ring[idx]; @@ -3442,8 +3442,7 @@ bge_txeof(struct bge_softc *sc, uint16_t BGE_INC(sc->bge_tx_saved_considx, BGE_TX_RING_CNT); } - if (cur_tx != NULL) - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (sc->bge_txcnt == 0) sc->bge_timer = 0; } @@ -3469,8 +3468,8 @@ bge_poll(struct ifnet *ifp, enum poll_cm rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; - statusword = atomic_readandclear_32( - &sc->bge_ldata.bge_status_block->bge_status); + statusword = sc->bge_ldata.bge_status_block->bge_status; + sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:51:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF27A106566C; Fri, 8 Oct 2010 18:51:28 +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 B3DB88FC19; Fri, 8 Oct 2010 18:51: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 o98IpSbk003872; Fri, 8 Oct 2010 18:51:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98IpSTf003870; Fri, 8 Oct 2010 18:51:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081851.o98IpSTf003870@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213596 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:51:29 -0000 Author: yongari Date: Fri Oct 8 18:51:28 2010 New Revision: 213596 URL: http://svn.freebsd.org/changeset/base/213596 Log: MFC r212069,212071: r212069: bge_txeof() already checks whether it has to free transmitted mbufs or not by comparing reported TX consumer index with saved index. So remove unnecessary check done after freeing transmitted mbufs. While I'm here nuke unnecessary variable initializations. r212071: Remove unnecessary atomic operation in bge_poll. bge(4) always holds a driver lock in the function entry and memory synchronization is handled by bus_dmamap_sync(9). Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Fri Oct 8 18:49:59 2010 (r213595) +++ stable/7/sys/dev/bge/if_bge.c Fri Oct 8 18:51:28 2010 (r213596) @@ -3403,7 +3403,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t static void bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { - struct bge_tx_bd *cur_tx = NULL; + struct bge_tx_bd *cur_tx; struct ifnet *ifp; BGE_LOCK_ASSERT(sc); @@ -3421,7 +3421,7 @@ bge_txeof(struct bge_softc *sc, uint16_t * frames that have been sent. */ while (sc->bge_tx_saved_considx != tx_cons) { - uint32_t idx = 0; + uint32_t idx; idx = sc->bge_tx_saved_considx; cur_tx = &sc->bge_ldata.bge_tx_ring[idx]; @@ -3440,8 +3440,7 @@ bge_txeof(struct bge_softc *sc, uint16_t BGE_INC(sc->bge_tx_saved_considx, BGE_TX_RING_CNT); } - if (cur_tx != NULL) - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (sc->bge_txcnt == 0) sc->bge_timer = 0; } @@ -3466,8 +3465,8 @@ bge_poll(struct ifnet *ifp, enum poll_cm rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; - statusword = atomic_readandclear_32( - &sc->bge_ldata.bge_status_block->bge_status); + statusword = sc->bge_ldata.bge_status_block->bge_status; + sc->bge_ldata.bge_status_block->bge_status = 0; bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 18:58:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70271065698; Fri, 8 Oct 2010 18:58:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A53388FC26; Fri, 8 Oct 2010 18:58: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 o98Iw1Ei004099; Fri, 8 Oct 2010 18:58:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Iw1CN004096; Fri, 8 Oct 2010 18:58:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081858.o98Iw1CN004096@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 18:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213597 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 18:58:01 -0000 Author: yongari Date: Fri Oct 8 18:58:01 2010 New Revision: 213597 URL: http://svn.freebsd.org/changeset/base/213597 Log: MFC r212306-212307,212342: r212306: Remove trailing CR at EOL. r212307: Consistently use tab characters instead of tab + space characters. No functional changes. r212342: Correct definition of T2 mode bit of MRBE Message Page 5 Next Page Control Register. Modified: stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/brgphyreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Fri Oct 8 18:51:28 2010 (r213596) +++ stable/8/sys/dev/mii/brgphy.c Fri Oct 8 18:58:01 2010 (r213597) @@ -140,7 +140,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5784), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), - MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; @@ -242,11 +242,12 @@ brgphy_attach(device_t dev) bsc->serdes_flags |= BRGPHY_5708S; sc->mii_flags |= MIIF_HAVEFIBER; break; - case MII_MODEL_xxBROADCOM_ALT1_BCM5709S: - bsc->serdes_flags |= BRGPHY_5709S; - sc->mii_flags |= MIIF_HAVEFIBER; - break; - } break; + case MII_MODEL_xxBROADCOM_ALT1_BCM5709S: + bsc->serdes_flags |= BRGPHY_5709S; + sc->mii_flags |= MIIF_HAVEFIBER; + break; + } + break; default: device_printf(dev, "Unrecognized OUI for PHY!\n"); } @@ -637,7 +638,7 @@ brgphy_status(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); xstat = PHY_READ(sc, BRGPHY_5708S_PG0_1000X_STAT1); - /* Check for MRBE auto-negotiated speed results. */ + /* Check for MRBE auto-negotiated speed results. */ switch (xstat & BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK) { case BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10: mii->mii_media_active |= IFM_10_FL; break; @@ -649,39 +650,39 @@ brgphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_2500_SX; break; } - /* Check for MRBE auto-negotiated duplex results. */ + /* Check for MRBE auto-negotiated duplex results. */ if (xstat & BRGPHY_5708S_PG0_1000X_STAT1_FDX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; - } else if (bsc->serdes_flags & BRGPHY_5709S) { + } else if (bsc->serdes_flags & BRGPHY_5709S) { - /* Select GP Status Block of the AN MMD, get autoneg results. */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_GP_STATUS); + /* Select GP Status Block of the AN MMD, get autoneg results. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_GP_STATUS); xstat = PHY_READ(sc, BRGPHY_GP_STATUS_TOP_ANEG_STATUS); - /* Restore IEEE0 block (assumed in all brgphy(4) code). */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + /* Restore IEEE0 block (assumed in all brgphy(4) code). */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); - /* Check for MRBE auto-negotiated speed results. */ - switch (xstat & BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK) { - case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10: - mii->mii_media_active |= IFM_10_FL; break; - case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100: - mii->mii_media_active |= IFM_100_FX; break; - case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G: - mii->mii_media_active |= IFM_1000_SX; break; - case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G: - mii->mii_media_active |= IFM_2500_SX; break; + /* Check for MRBE auto-negotiated speed results. */ + switch (xstat & BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK) { + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10: + mii->mii_media_active |= IFM_10_FL; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100: + mii->mii_media_active |= IFM_100_FX; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G: + mii->mii_media_active |= IFM_1000_SX; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G: + mii->mii_media_active |= IFM_2500_SX; break; } - /* Check for MRBE auto-negotiated duplex results. */ + /* Check for MRBE auto-negotiated duplex results. */ if (xstat & BRGPHY_GP_STATUS_TOP_ANEG_FDX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; - } + } } @@ -1127,50 +1128,50 @@ brgphy_reset(struct mii_softc *sc) } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709 && (bce_sc->bce_phy_flags & BCE_PHY_SERDES_FLAG)) { - /* Select the SerDes Digital block of the AN MMD. */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_SERDES_DIG); + /* Select the SerDes Digital block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_SERDES_DIG); val = PHY_READ(sc, BRGPHY_SERDES_DIG_1000X_CTL1); val &= ~BRGPHY_SD_DIG_1000X_CTL1_AUTODET; val |= BRGPHY_SD_DIG_1000X_CTL1_FIBER; PHY_WRITE(sc, BRGPHY_SERDES_DIG_1000X_CTL1, val); - /* Select the Over 1G block of the AN MMD. */ + /* Select the Over 1G block of the AN MMD. */ PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_OVER_1G); - /* Enable autoneg "Next Page" to advertise 2.5G support. */ - val = PHY_READ(sc, BRGPHY_OVER_1G_UNFORMAT_PG1); + /* Enable autoneg "Next Page" to advertise 2.5G support. */ + val = PHY_READ(sc, BRGPHY_OVER_1G_UNFORMAT_PG1); if (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) val |= BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G; else val &= ~BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G; PHY_WRITE(sc, BRGPHY_OVER_1G_UNFORMAT_PG1, val); - /* Select the Multi-Rate Backplane Ethernet block of the AN MMD. */ + /* Select the Multi-Rate Backplane Ethernet block of the AN MMD. */ PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_MRBE); - /* Enable MRBE speed autoneg. */ - val = PHY_READ(sc, BRGPHY_MRBE_MSG_PG5_NP); + /* Enable MRBE speed autoneg. */ + val = PHY_READ(sc, BRGPHY_MRBE_MSG_PG5_NP); val |= BRGPHY_MRBE_MSG_PG5_NP_MBRE | BRGPHY_MRBE_MSG_PG5_NP_T2; PHY_WRITE(sc, BRGPHY_MRBE_MSG_PG5_NP, val); - /* Select the Clause 73 User B0 block of the AN MMD. */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_CL73_USER_B0); + /* Select the Clause 73 User B0 block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_CL73_USER_B0); - /* Enable MRBE speed autoneg. */ + /* Enable MRBE speed autoneg. */ PHY_WRITE(sc, BRGPHY_CL73_USER_B0_MBRE_CTL1, BRGPHY_CL73_USER_B0_MBRE_CTL1_NP_AFT_BP | BRGPHY_CL73_USER_B0_MBRE_CTL1_STA_MGR | BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG); - /* Restore IEEE0 block (assumed in all brgphy(4) code). */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + /* Restore IEEE0 block (assumed in all brgphy(4) code). */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709) { if ((BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Ax) || (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) brgphy_fixup_disable_early_dac(sc); - + brgphy_jumbo_settings(sc, ifp->if_mtu); brgphy_ethernet_wirespeed(sc); } else { Modified: stable/8/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/8/sys/dev/mii/brgphyreg.h Fri Oct 8 18:51:28 2010 (r213596) +++ stable/8/sys/dev/mii/brgphyreg.h Fri Oct 8 18:58:01 2010 (r213597) @@ -39,21 +39,21 @@ * Broadcom BCM5400 registers */ -#define BRGPHY_MII_BMCR 0x00 -#define BRGPHY_BMCR_RESET 0x8000 -#define BRGPHY_BMCR_LOOP 0x4000 -#define BRGPHY_BMCR_SPD0 0x2000 /* Speed select, lower bit */ -#define BRGPHY_BMCR_AUTOEN 0x1000 /* Autoneg enabled */ -#define BRGPHY_BMCR_PDOWN 0x0800 /* Power down */ -#define BRGPHY_BMCR_ISO 0x0400 /* Isolate */ +#define BRGPHY_MII_BMCR 0x00 +#define BRGPHY_BMCR_RESET 0x8000 +#define BRGPHY_BMCR_LOOP 0x4000 +#define BRGPHY_BMCR_SPD0 0x2000 /* Speed select, lower bit */ +#define BRGPHY_BMCR_AUTOEN 0x1000 /* Autoneg enabled */ +#define BRGPHY_BMCR_PDOWN 0x0800 /* Power down */ +#define BRGPHY_BMCR_ISO 0x0400 /* Isolate */ #define BRGPHY_BMCR_STARTNEG 0x0200 /* Restart autoneg */ -#define BRGPHY_BMCR_FDX 0x0100 /* Duplex mode */ -#define BRGPHY_BMCR_CTEST 0x0080 /* Collision test enable */ -#define BRGPHY_BMCR_SPD1 0x0040 /* Speed select, upper bit */ - -#define BRGPHY_S1000 BRGPHY_BMCR_SPD1 /* 1000mbps */ -#define BRGPHY_S100 BRGPHY_BMCR_SPD0 /* 100mpbs */ -#define BRGPHY_S10 0 /* 10mbps */ +#define BRGPHY_BMCR_FDX 0x0100 /* Duplex mode */ +#define BRGPHY_BMCR_CTEST 0x0080 /* Collision test enable */ +#define BRGPHY_BMCR_SPD1 0x0040 /* Speed select, upper bit */ + +#define BRGPHY_S1000 BRGPHY_BMCR_SPD1 /* 1000mbps */ +#define BRGPHY_S100 BRGPHY_BMCR_SPD0 /* 100mpbs */ +#define BRGPHY_S10 0 /* 10mbps */ #define BRGPHY_MII_BMSR 0x01 #define BRGPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ @@ -262,153 +262,153 @@ #define BRGPHY_IMR_LNK_CHG 0x0002 /* Link status change */ #define BRGPHY_IMR_CRCERR 0x0001 /* CRC error */ -/*******************************************************/ -/* Begin: Shared SerDes PHY register definitions */ -/*******************************************************/ - -/* SerDes autoneg is different from copper */ -#define BRGPHY_SERDES_ANAR 0x04 -#define BRGPHY_SERDES_ANAR_FDX 0x0020 -#define BRGPHY_SERDES_ANAR_HDX 0x0040 -#define BRGPHY_SERDES_ANAR_NO_PAUSE (0x0 << 7) -#define BRGPHY_SERDES_ANAR_SYM_PAUSE (0x1 << 7) -#define BRGPHY_SERDES_ANAR_ASYM_PAUSE (0x2 << 7) -#define BRGPHY_SERDES_ANAR_BOTH_PAUSE (0x3 << 7) - -#define BRGPHY_SERDES_ANLPAR 0x05 -#define BRGPHY_SERDES_ANLPAR_FDX 0x0020 -#define BRGPHY_SERDES_ANLPAR_HDX 0x0040 -#define BRGPHY_SERDES_ANLPAR_NO_PAUSE (0x0 << 7) -#define BRGPHY_SERDES_ANLPAR_SYM_PAUSE (0x1 << 7) -#define BRGPHY_SERDES_ANLPAR_ASYM_PAUSE (0x2 << 7) -#define BRGPHY_SERDES_ANLPAR_BOTH_PAUSE (0x3 << 7) - -/*******************************************************/ -/* End: Shared SerDes PHY register definitions */ -/*******************************************************/ - -/*******************************************************/ -/* Begin: PHY register values for the 5706 PHY */ -/*******************************************************/ - -/* - * Shadow register 0x1C, bit 15 is write enable, - * bits 14-10 select function (0x00 to 0x1F). - */ -#define BRGPHY_MII_SHADOW_1C 0x1C -#define BRGPHY_SHADOW_1C_WRITE_EN 0x8000 -#define BRGPHY_SHADOW_1C_SELECT_MASK 0x7C00 - +/*******************************************************/ +/* Begin: Shared SerDes PHY register definitions */ +/*******************************************************/ + +/* SerDes autoneg is different from copper */ +#define BRGPHY_SERDES_ANAR 0x04 +#define BRGPHY_SERDES_ANAR_FDX 0x0020 +#define BRGPHY_SERDES_ANAR_HDX 0x0040 +#define BRGPHY_SERDES_ANAR_NO_PAUSE (0x0 << 7) +#define BRGPHY_SERDES_ANAR_SYM_PAUSE (0x1 << 7) +#define BRGPHY_SERDES_ANAR_ASYM_PAUSE (0x2 << 7) +#define BRGPHY_SERDES_ANAR_BOTH_PAUSE (0x3 << 7) + +#define BRGPHY_SERDES_ANLPAR 0x05 +#define BRGPHY_SERDES_ANLPAR_FDX 0x0020 +#define BRGPHY_SERDES_ANLPAR_HDX 0x0040 +#define BRGPHY_SERDES_ANLPAR_NO_PAUSE (0x0 << 7) +#define BRGPHY_SERDES_ANLPAR_SYM_PAUSE (0x1 << 7) +#define BRGPHY_SERDES_ANLPAR_ASYM_PAUSE (0x2 << 7) +#define BRGPHY_SERDES_ANLPAR_BOTH_PAUSE (0x3 << 7) + +/*******************************************************/ +/* End: Shared SerDes PHY register definitions */ +/*******************************************************/ + +/*******************************************************/ +/* Begin: PHY register values for the 5706 PHY */ +/*******************************************************/ + +/* + * Shadow register 0x1C, bit 15 is write enable, + * bits 14-10 select function (0x00 to 0x1F). + */ +#define BRGPHY_MII_SHADOW_1C 0x1C +#define BRGPHY_SHADOW_1C_WRITE_EN 0x8000 +#define BRGPHY_SHADOW_1C_SELECT_MASK 0x7C00 + /* Shadow 0x1C Mode Control Register (select value 0x1F) */ -#define BRGPHY_SHADOW_1C_MODE_CTRL (0x1F << 10) +#define BRGPHY_SHADOW_1C_MODE_CTRL (0x1F << 10) /* When set, Regs 0-0x0F are 1000X, else 1000T */ -#define BRGPHY_SHADOW_1C_ENA_1000X 0x0001 +#define BRGPHY_SHADOW_1C_ENA_1000X 0x0001 + +#define BRGPHY_MII_TEST1 0x1E +#define BRGPHY_TEST1_TRIM_EN 0x0010 +#define BRGPHY_TEST1_CRC_EN 0x8000 + +#define BRGPHY_MII_TEST2 0x1F + +/*******************************************************/ +/* End: PHY register values for the 5706 PHY */ +/*******************************************************/ + +/*******************************************************/ +/* Begin: PHY register values for the 5708S SerDes PHY */ +/*******************************************************/ + +/* Autoneg Next Page Transmit 1 Regiser */ +#define BRGPHY_5708S_ANEG_NXT_PG_XMIT1 0x0B +#define BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G 0x0001 + +/* Use the BLOCK_ADDR register to select the page for registers 0x10 to 0x1E */ +#define BRGPHY_5708S_BLOCK_ADDR 0x1f +#define BRGPHY_5708S_DIG_PG0 0x0000 +#define BRGPHY_5708S_DIG3_PG2 0x0002 +#define BRGPHY_5708S_TX_MISC_PG5 0x0005 + +/* 5708S SerDes "Digital" Registers (page 0) */ +#define BRGPHY_5708S_PG0_1000X_CTL1 0x10 +#define BRGPHY_5708S_PG0_1000X_CTL1_AUTODET_EN 0x0010 +#define BRGPHY_5708S_PG0_1000X_CTL1_FIBER_MODE 0x0001 + +#define BRGPHY_5708S_PG0_1000X_STAT1 0x14 +#define BRGPHY_5708S_PG0_1000X_STAT1_LINK 0x0002 +#define BRGPHY_5708S_PG0_1000X_STAT1_FDX 0x0004 +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK 0x0018 +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10 (0x0 << 3) +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_100 (0x1 << 3) +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_1G (0x2 << 3) +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_25G (0x3 << 3) + + +#define BRGPHY_5708S_PG0_1000X_CTL2 0x11 +#define BRGPHY_5708S_PG0_1000X_CTL2_PAR_DET_EN 0x0001 + +/* 5708S SerDes "Digital 3" Registers (page 2) */ +#define BRGPHY_5708S_PG2_DIGCTL_3_0 0x10 +#define BRGPHY_5708S_PG2_DIGCTL_3_0_USE_IEEE 0x0001 + +/* 5708S SerDes "TX Misc" Registers (page 5) */ +#define BRGPHY_5708S_PG5_2500STATUS1 0x10 +#define BRGPHY_5708S_PG5_TXACTL1 0x15 +#define BRGPHY_5708S_PG5_TXACTL3 0x17 + +/*******************************************************/ +/* End: PHY register values for the 5708S SerDes PHY */ +/*******************************************************/ -#define BRGPHY_MII_TEST1 0x1E -#define BRGPHY_TEST1_TRIM_EN 0x0010 -#define BRGPHY_TEST1_CRC_EN 0x8000 - -#define BRGPHY_MII_TEST2 0x1F - -/*******************************************************/ -/* End: PHY register values for the 5706 PHY */ -/*******************************************************/ - -/*******************************************************/ -/* Begin: PHY register values for the 5708S SerDes PHY */ -/*******************************************************/ - -/* Autoneg Next Page Transmit 1 Regiser */ -#define BRGPHY_5708S_ANEG_NXT_PG_XMIT1 0x0B -#define BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G 0x0001 - -/* Use the BLOCK_ADDR register to select the page for registers 0x10 to 0x1E */ -#define BRGPHY_5708S_BLOCK_ADDR 0x1f -#define BRGPHY_5708S_DIG_PG0 0x0000 -#define BRGPHY_5708S_DIG3_PG2 0x0002 -#define BRGPHY_5708S_TX_MISC_PG5 0x0005 - -/* 5708S SerDes "Digital" Registers (page 0) */ -#define BRGPHY_5708S_PG0_1000X_CTL1 0x10 -#define BRGPHY_5708S_PG0_1000X_CTL1_AUTODET_EN 0x0010 -#define BRGPHY_5708S_PG0_1000X_CTL1_FIBER_MODE 0x0001 - -#define BRGPHY_5708S_PG0_1000X_STAT1 0x14 -#define BRGPHY_5708S_PG0_1000X_STAT1_LINK 0x0002 -#define BRGPHY_5708S_PG0_1000X_STAT1_FDX 0x0004 -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK 0x0018 -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10 (0x0 << 3) -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_100 (0x1 << 3) -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_1G (0x2 << 3) -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_25G (0x3 << 3) - - -#define BRGPHY_5708S_PG0_1000X_CTL2 0x11 -#define BRGPHY_5708S_PG0_1000X_CTL2_PAR_DET_EN 0x0001 - -/* 5708S SerDes "Digital 3" Registers (page 2) */ -#define BRGPHY_5708S_PG2_DIGCTL_3_0 0x10 -#define BRGPHY_5708S_PG2_DIGCTL_3_0_USE_IEEE 0x0001 - -/* 5708S SerDes "TX Misc" Registers (page 5) */ -#define BRGPHY_5708S_PG5_2500STATUS1 0x10 -#define BRGPHY_5708S_PG5_TXACTL1 0x15 -#define BRGPHY_5708S_PG5_TXACTL3 0x17 - -/*******************************************************/ -/* End: PHY register values for the 5708S SerDes PHY */ -/*******************************************************/ - /*******************************************************/ /* Begin: PHY register values for the 5709S SerDes PHY */ /*******************************************************/ /* 5709S SerDes "General Purpose Status" Registers */ -#define BRGPHY_BLOCK_ADDR_GP_STATUS 0x8120 -#define BRGPHY_GP_STATUS_TOP_ANEG_STATUS 0x1B -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK 0x3F00 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10 0x0000 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100 0x0100 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G 0x0200 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G 0x0300 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1GKX 0x0D00 -#define BRGPHY_GP_STATUS_TOP_ANEG_FDX 0x0008 -#define BRGPHY_GP_STATUS_TOP_ANEG_LINK_UP 0x0004 -#define BRGPHY_GP_STATUS_TOP_ANEG_CL73_COMP 0x0001 +#define BRGPHY_BLOCK_ADDR_GP_STATUS 0x8120 +#define BRGPHY_GP_STATUS_TOP_ANEG_STATUS 0x1B +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK 0x3F00 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10 0x0000 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100 0x0100 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G 0x0200 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G 0x0300 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1GKX 0x0D00 +#define BRGPHY_GP_STATUS_TOP_ANEG_FDX 0x0008 +#define BRGPHY_GP_STATUS_TOP_ANEG_LINK_UP 0x0004 +#define BRGPHY_GP_STATUS_TOP_ANEG_CL73_COMP 0x0001 /* 5709S SerDes "SerDes Digital" Registers */ -#define BRGPHY_BLOCK_ADDR_SERDES_DIG 0x8300 -#define BRGPHY_SERDES_DIG_1000X_CTL1 0x0010 -#define BRGPHY_SD_DIG_1000X_CTL1_AUTODET 0x0010 -#define BRGPHY_SD_DIG_1000X_CTL1_FIBER 0x0001 +#define BRGPHY_BLOCK_ADDR_SERDES_DIG 0x8300 +#define BRGPHY_SERDES_DIG_1000X_CTL1 0x0010 +#define BRGPHY_SD_DIG_1000X_CTL1_AUTODET 0x0010 +#define BRGPHY_SD_DIG_1000X_CTL1_FIBER 0x0001 /* 5709S SerDes "Over 1G" Registers */ -#define BRGPHY_BLOCK_ADDR_OVER_1G 0x8320 -#define BRGPHY_OVER_1G_UNFORMAT_PG1 0x19 +#define BRGPHY_BLOCK_ADDR_OVER_1G 0x8320 +#define BRGPHY_OVER_1G_UNFORMAT_PG1 0x19 /* 5709S SerDes "Multi-Rate Backplane Ethernet" Registers */ -#define BRGPHY_BLOCK_ADDR_MRBE 0x8350 -#define BRGPHY_MRBE_MSG_PG5_NP 0x10 -#define BRGPHY_MRBE_MSG_PG5_NP_MBRE 0x0001 -#define BRGPHY_MRBE_MSG_PG5_NP_T2 0x0001 +#define BRGPHY_BLOCK_ADDR_MRBE 0x8350 +#define BRGPHY_MRBE_MSG_PG5_NP 0x10 +#define BRGPHY_MRBE_MSG_PG5_NP_MBRE 0x0001 +#define BRGPHY_MRBE_MSG_PG5_NP_T2 0x0002 /* 5709S SerDes "IEEE Clause 73 User B0" Registers */ -#define BRGPHY_BLOCK_ADDR_CL73_USER_B0 0x8370 -#define BRGPHY_CL73_USER_B0_MBRE_CTL1 0x12 +#define BRGPHY_BLOCK_ADDR_CL73_USER_B0 0x8370 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1 0x12 #define BRGPHY_CL73_USER_B0_MBRE_CTL1_NP_AFT_BP 0x2000 #define BRGPHY_CL73_USER_B0_MBRE_CTL1_STA_MGR 0x4000 -#define BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG 0x8000 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG 0x8000 /* 5709S SerDes "IEEE Clause 73 User B0" Registers */ -#define BRGPHY_BLOCK_ADDR_ADDR_EXT 0xFFD0 +#define BRGPHY_BLOCK_ADDR_ADDR_EXT 0xFFD0 /* 5709S SerDes "Combo IEEE 0" Registers */ -#define BRGPHY_BLOCK_ADDR_COMBO_IEEE0 0xFFE0 +#define BRGPHY_BLOCK_ADDR_COMBO_IEEE0 0xFFE0 -#define BRGPHY_ADDR_EXT 0x1E -#define BRGPHY_BLOCK_ADDR 0x1F +#define BRGPHY_ADDR_EXT 0x1E +#define BRGPHY_BLOCK_ADDR 0x1F -#define BRGPHY_ADDR_EXT_AN_MMD 0x3800 +#define BRGPHY_ADDR_EXT_AN_MMD 0x3800 /*******************************************************/ /* End: PHY register values for the 5709S SerDes PHY */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:00:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E022106564A; Fri, 8 Oct 2010 19:00:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C2888FC19; Fri, 8 Oct 2010 19:00: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 o98J0aSd004255; Fri, 8 Oct 2010 19:00:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98J0aaq004252; Fri, 8 Oct 2010 19:00:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081900.o98J0aaq004252@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213598 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:00:36 -0000 Author: yongari Date: Fri Oct 8 19:00:36 2010 New Revision: 213598 URL: http://svn.freebsd.org/changeset/base/213598 Log: MFC r212306-212307,212342: r212306: Remove trailing CR at EOL. r212307: Consistently use tab characters instead of tab + space characters. No functional changes. r212342: Correct definition of T2 mode bit of MRBE Message Page 5 Next Page Control Register. Modified: stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/brgphyreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Fri Oct 8 18:58:01 2010 (r213597) +++ stable/7/sys/dev/mii/brgphy.c Fri Oct 8 19:00:36 2010 (r213598) @@ -140,7 +140,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5784), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), - MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709S), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; @@ -242,11 +242,12 @@ brgphy_attach(device_t dev) bsc->serdes_flags |= BRGPHY_5708S; sc->mii_flags |= MIIF_HAVEFIBER; break; - case MII_MODEL_xxBROADCOM_ALT1_BCM5709S: - bsc->serdes_flags |= BRGPHY_5709S; - sc->mii_flags |= MIIF_HAVEFIBER; - break; - } break; + case MII_MODEL_xxBROADCOM_ALT1_BCM5709S: + bsc->serdes_flags |= BRGPHY_5709S; + sc->mii_flags |= MIIF_HAVEFIBER; + break; + } + break; default: device_printf(dev, "Unrecognized OUI for PHY!\n"); } @@ -625,7 +626,7 @@ brgphy_status(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); xstat = PHY_READ(sc, BRGPHY_5708S_PG0_1000X_STAT1); - /* Check for MRBE auto-negotiated speed results. */ + /* Check for MRBE auto-negotiated speed results. */ switch (xstat & BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK) { case BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10: mii->mii_media_active |= IFM_10_FL; break; @@ -637,39 +638,39 @@ brgphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_2500_SX; break; } - /* Check for MRBE auto-negotiated duplex results. */ + /* Check for MRBE auto-negotiated duplex results. */ if (xstat & BRGPHY_5708S_PG0_1000X_STAT1_FDX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; - } else if (bsc->serdes_flags & BRGPHY_5709S) { + } else if (bsc->serdes_flags & BRGPHY_5709S) { - /* Select GP Status Block of the AN MMD, get autoneg results. */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_GP_STATUS); + /* Select GP Status Block of the AN MMD, get autoneg results. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_GP_STATUS); xstat = PHY_READ(sc, BRGPHY_GP_STATUS_TOP_ANEG_STATUS); - /* Restore IEEE0 block (assumed in all brgphy(4) code). */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + /* Restore IEEE0 block (assumed in all brgphy(4) code). */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); - /* Check for MRBE auto-negotiated speed results. */ - switch (xstat & BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK) { - case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10: - mii->mii_media_active |= IFM_10_FL; break; - case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100: - mii->mii_media_active |= IFM_100_FX; break; - case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G: - mii->mii_media_active |= IFM_1000_SX; break; - case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G: - mii->mii_media_active |= IFM_2500_SX; break; + /* Check for MRBE auto-negotiated speed results. */ + switch (xstat & BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK) { + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10: + mii->mii_media_active |= IFM_10_FL; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100: + mii->mii_media_active |= IFM_100_FX; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G: + mii->mii_media_active |= IFM_1000_SX; break; + case BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G: + mii->mii_media_active |= IFM_2500_SX; break; } - /* Check for MRBE auto-negotiated duplex results. */ + /* Check for MRBE auto-negotiated duplex results. */ if (xstat & BRGPHY_GP_STATUS_TOP_ANEG_FDX) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; - } + } } @@ -1115,50 +1116,50 @@ brgphy_reset(struct mii_softc *sc) } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709 && (bce_sc->bce_phy_flags & BCE_PHY_SERDES_FLAG)) { - /* Select the SerDes Digital block of the AN MMD. */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_SERDES_DIG); + /* Select the SerDes Digital block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_SERDES_DIG); val = PHY_READ(sc, BRGPHY_SERDES_DIG_1000X_CTL1); val &= ~BRGPHY_SD_DIG_1000X_CTL1_AUTODET; val |= BRGPHY_SD_DIG_1000X_CTL1_FIBER; PHY_WRITE(sc, BRGPHY_SERDES_DIG_1000X_CTL1, val); - /* Select the Over 1G block of the AN MMD. */ + /* Select the Over 1G block of the AN MMD. */ PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_OVER_1G); - /* Enable autoneg "Next Page" to advertise 2.5G support. */ - val = PHY_READ(sc, BRGPHY_OVER_1G_UNFORMAT_PG1); + /* Enable autoneg "Next Page" to advertise 2.5G support. */ + val = PHY_READ(sc, BRGPHY_OVER_1G_UNFORMAT_PG1); if (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) val |= BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G; else val &= ~BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G; PHY_WRITE(sc, BRGPHY_OVER_1G_UNFORMAT_PG1, val); - /* Select the Multi-Rate Backplane Ethernet block of the AN MMD. */ + /* Select the Multi-Rate Backplane Ethernet block of the AN MMD. */ PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_MRBE); - /* Enable MRBE speed autoneg. */ - val = PHY_READ(sc, BRGPHY_MRBE_MSG_PG5_NP); + /* Enable MRBE speed autoneg. */ + val = PHY_READ(sc, BRGPHY_MRBE_MSG_PG5_NP); val |= BRGPHY_MRBE_MSG_PG5_NP_MBRE | BRGPHY_MRBE_MSG_PG5_NP_T2; PHY_WRITE(sc, BRGPHY_MRBE_MSG_PG5_NP, val); - /* Select the Clause 73 User B0 block of the AN MMD. */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_CL73_USER_B0); + /* Select the Clause 73 User B0 block of the AN MMD. */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_CL73_USER_B0); - /* Enable MRBE speed autoneg. */ + /* Enable MRBE speed autoneg. */ PHY_WRITE(sc, BRGPHY_CL73_USER_B0_MBRE_CTL1, BRGPHY_CL73_USER_B0_MBRE_CTL1_NP_AFT_BP | BRGPHY_CL73_USER_B0_MBRE_CTL1_STA_MGR | BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG); - /* Restore IEEE0 block (assumed in all brgphy(4) code). */ - PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); + /* Restore IEEE0 block (assumed in all brgphy(4) code). */ + PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709) { if ((BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Ax) || (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) brgphy_fixup_disable_early_dac(sc); - + brgphy_jumbo_settings(sc, ifp->if_mtu); brgphy_ethernet_wirespeed(sc); } else { Modified: stable/7/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/7/sys/dev/mii/brgphyreg.h Fri Oct 8 18:58:01 2010 (r213597) +++ stable/7/sys/dev/mii/brgphyreg.h Fri Oct 8 19:00:36 2010 (r213598) @@ -39,21 +39,21 @@ * Broadcom BCM5400 registers */ -#define BRGPHY_MII_BMCR 0x00 -#define BRGPHY_BMCR_RESET 0x8000 -#define BRGPHY_BMCR_LOOP 0x4000 -#define BRGPHY_BMCR_SPD0 0x2000 /* Speed select, lower bit */ -#define BRGPHY_BMCR_AUTOEN 0x1000 /* Autoneg enabled */ -#define BRGPHY_BMCR_PDOWN 0x0800 /* Power down */ -#define BRGPHY_BMCR_ISO 0x0400 /* Isolate */ +#define BRGPHY_MII_BMCR 0x00 +#define BRGPHY_BMCR_RESET 0x8000 +#define BRGPHY_BMCR_LOOP 0x4000 +#define BRGPHY_BMCR_SPD0 0x2000 /* Speed select, lower bit */ +#define BRGPHY_BMCR_AUTOEN 0x1000 /* Autoneg enabled */ +#define BRGPHY_BMCR_PDOWN 0x0800 /* Power down */ +#define BRGPHY_BMCR_ISO 0x0400 /* Isolate */ #define BRGPHY_BMCR_STARTNEG 0x0200 /* Restart autoneg */ -#define BRGPHY_BMCR_FDX 0x0100 /* Duplex mode */ -#define BRGPHY_BMCR_CTEST 0x0080 /* Collision test enable */ -#define BRGPHY_BMCR_SPD1 0x0040 /* Speed select, upper bit */ - -#define BRGPHY_S1000 BRGPHY_BMCR_SPD1 /* 1000mbps */ -#define BRGPHY_S100 BRGPHY_BMCR_SPD0 /* 100mpbs */ -#define BRGPHY_S10 0 /* 10mbps */ +#define BRGPHY_BMCR_FDX 0x0100 /* Duplex mode */ +#define BRGPHY_BMCR_CTEST 0x0080 /* Collision test enable */ +#define BRGPHY_BMCR_SPD1 0x0040 /* Speed select, upper bit */ + +#define BRGPHY_S1000 BRGPHY_BMCR_SPD1 /* 1000mbps */ +#define BRGPHY_S100 BRGPHY_BMCR_SPD0 /* 100mpbs */ +#define BRGPHY_S10 0 /* 10mbps */ #define BRGPHY_MII_BMSR 0x01 #define BRGPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ @@ -262,153 +262,153 @@ #define BRGPHY_IMR_LNK_CHG 0x0002 /* Link status change */ #define BRGPHY_IMR_CRCERR 0x0001 /* CRC error */ -/*******************************************************/ -/* Begin: Shared SerDes PHY register definitions */ -/*******************************************************/ - -/* SerDes autoneg is different from copper */ -#define BRGPHY_SERDES_ANAR 0x04 -#define BRGPHY_SERDES_ANAR_FDX 0x0020 -#define BRGPHY_SERDES_ANAR_HDX 0x0040 -#define BRGPHY_SERDES_ANAR_NO_PAUSE (0x0 << 7) -#define BRGPHY_SERDES_ANAR_SYM_PAUSE (0x1 << 7) -#define BRGPHY_SERDES_ANAR_ASYM_PAUSE (0x2 << 7) -#define BRGPHY_SERDES_ANAR_BOTH_PAUSE (0x3 << 7) - -#define BRGPHY_SERDES_ANLPAR 0x05 -#define BRGPHY_SERDES_ANLPAR_FDX 0x0020 -#define BRGPHY_SERDES_ANLPAR_HDX 0x0040 -#define BRGPHY_SERDES_ANLPAR_NO_PAUSE (0x0 << 7) -#define BRGPHY_SERDES_ANLPAR_SYM_PAUSE (0x1 << 7) -#define BRGPHY_SERDES_ANLPAR_ASYM_PAUSE (0x2 << 7) -#define BRGPHY_SERDES_ANLPAR_BOTH_PAUSE (0x3 << 7) - -/*******************************************************/ -/* End: Shared SerDes PHY register definitions */ -/*******************************************************/ - -/*******************************************************/ -/* Begin: PHY register values for the 5706 PHY */ -/*******************************************************/ - -/* - * Shadow register 0x1C, bit 15 is write enable, - * bits 14-10 select function (0x00 to 0x1F). - */ -#define BRGPHY_MII_SHADOW_1C 0x1C -#define BRGPHY_SHADOW_1C_WRITE_EN 0x8000 -#define BRGPHY_SHADOW_1C_SELECT_MASK 0x7C00 - +/*******************************************************/ +/* Begin: Shared SerDes PHY register definitions */ +/*******************************************************/ + +/* SerDes autoneg is different from copper */ +#define BRGPHY_SERDES_ANAR 0x04 +#define BRGPHY_SERDES_ANAR_FDX 0x0020 +#define BRGPHY_SERDES_ANAR_HDX 0x0040 +#define BRGPHY_SERDES_ANAR_NO_PAUSE (0x0 << 7) +#define BRGPHY_SERDES_ANAR_SYM_PAUSE (0x1 << 7) +#define BRGPHY_SERDES_ANAR_ASYM_PAUSE (0x2 << 7) +#define BRGPHY_SERDES_ANAR_BOTH_PAUSE (0x3 << 7) + +#define BRGPHY_SERDES_ANLPAR 0x05 +#define BRGPHY_SERDES_ANLPAR_FDX 0x0020 +#define BRGPHY_SERDES_ANLPAR_HDX 0x0040 +#define BRGPHY_SERDES_ANLPAR_NO_PAUSE (0x0 << 7) +#define BRGPHY_SERDES_ANLPAR_SYM_PAUSE (0x1 << 7) +#define BRGPHY_SERDES_ANLPAR_ASYM_PAUSE (0x2 << 7) +#define BRGPHY_SERDES_ANLPAR_BOTH_PAUSE (0x3 << 7) + +/*******************************************************/ +/* End: Shared SerDes PHY register definitions */ +/*******************************************************/ + +/*******************************************************/ +/* Begin: PHY register values for the 5706 PHY */ +/*******************************************************/ + +/* + * Shadow register 0x1C, bit 15 is write enable, + * bits 14-10 select function (0x00 to 0x1F). + */ +#define BRGPHY_MII_SHADOW_1C 0x1C +#define BRGPHY_SHADOW_1C_WRITE_EN 0x8000 +#define BRGPHY_SHADOW_1C_SELECT_MASK 0x7C00 + /* Shadow 0x1C Mode Control Register (select value 0x1F) */ -#define BRGPHY_SHADOW_1C_MODE_CTRL (0x1F << 10) +#define BRGPHY_SHADOW_1C_MODE_CTRL (0x1F << 10) /* When set, Regs 0-0x0F are 1000X, else 1000T */ -#define BRGPHY_SHADOW_1C_ENA_1000X 0x0001 +#define BRGPHY_SHADOW_1C_ENA_1000X 0x0001 + +#define BRGPHY_MII_TEST1 0x1E +#define BRGPHY_TEST1_TRIM_EN 0x0010 +#define BRGPHY_TEST1_CRC_EN 0x8000 + +#define BRGPHY_MII_TEST2 0x1F + +/*******************************************************/ +/* End: PHY register values for the 5706 PHY */ +/*******************************************************/ + +/*******************************************************/ +/* Begin: PHY register values for the 5708S SerDes PHY */ +/*******************************************************/ + +/* Autoneg Next Page Transmit 1 Regiser */ +#define BRGPHY_5708S_ANEG_NXT_PG_XMIT1 0x0B +#define BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G 0x0001 + +/* Use the BLOCK_ADDR register to select the page for registers 0x10 to 0x1E */ +#define BRGPHY_5708S_BLOCK_ADDR 0x1f +#define BRGPHY_5708S_DIG_PG0 0x0000 +#define BRGPHY_5708S_DIG3_PG2 0x0002 +#define BRGPHY_5708S_TX_MISC_PG5 0x0005 + +/* 5708S SerDes "Digital" Registers (page 0) */ +#define BRGPHY_5708S_PG0_1000X_CTL1 0x10 +#define BRGPHY_5708S_PG0_1000X_CTL1_AUTODET_EN 0x0010 +#define BRGPHY_5708S_PG0_1000X_CTL1_FIBER_MODE 0x0001 + +#define BRGPHY_5708S_PG0_1000X_STAT1 0x14 +#define BRGPHY_5708S_PG0_1000X_STAT1_LINK 0x0002 +#define BRGPHY_5708S_PG0_1000X_STAT1_FDX 0x0004 +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK 0x0018 +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10 (0x0 << 3) +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_100 (0x1 << 3) +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_1G (0x2 << 3) +#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_25G (0x3 << 3) + + +#define BRGPHY_5708S_PG0_1000X_CTL2 0x11 +#define BRGPHY_5708S_PG0_1000X_CTL2_PAR_DET_EN 0x0001 + +/* 5708S SerDes "Digital 3" Registers (page 2) */ +#define BRGPHY_5708S_PG2_DIGCTL_3_0 0x10 +#define BRGPHY_5708S_PG2_DIGCTL_3_0_USE_IEEE 0x0001 + +/* 5708S SerDes "TX Misc" Registers (page 5) */ +#define BRGPHY_5708S_PG5_2500STATUS1 0x10 +#define BRGPHY_5708S_PG5_TXACTL1 0x15 +#define BRGPHY_5708S_PG5_TXACTL3 0x17 + +/*******************************************************/ +/* End: PHY register values for the 5708S SerDes PHY */ +/*******************************************************/ -#define BRGPHY_MII_TEST1 0x1E -#define BRGPHY_TEST1_TRIM_EN 0x0010 -#define BRGPHY_TEST1_CRC_EN 0x8000 - -#define BRGPHY_MII_TEST2 0x1F - -/*******************************************************/ -/* End: PHY register values for the 5706 PHY */ -/*******************************************************/ - -/*******************************************************/ -/* Begin: PHY register values for the 5708S SerDes PHY */ -/*******************************************************/ - -/* Autoneg Next Page Transmit 1 Regiser */ -#define BRGPHY_5708S_ANEG_NXT_PG_XMIT1 0x0B -#define BRGPHY_5708S_ANEG_NXT_PG_XMIT1_25G 0x0001 - -/* Use the BLOCK_ADDR register to select the page for registers 0x10 to 0x1E */ -#define BRGPHY_5708S_BLOCK_ADDR 0x1f -#define BRGPHY_5708S_DIG_PG0 0x0000 -#define BRGPHY_5708S_DIG3_PG2 0x0002 -#define BRGPHY_5708S_TX_MISC_PG5 0x0005 - -/* 5708S SerDes "Digital" Registers (page 0) */ -#define BRGPHY_5708S_PG0_1000X_CTL1 0x10 -#define BRGPHY_5708S_PG0_1000X_CTL1_AUTODET_EN 0x0010 -#define BRGPHY_5708S_PG0_1000X_CTL1_FIBER_MODE 0x0001 - -#define BRGPHY_5708S_PG0_1000X_STAT1 0x14 -#define BRGPHY_5708S_PG0_1000X_STAT1_LINK 0x0002 -#define BRGPHY_5708S_PG0_1000X_STAT1_FDX 0x0004 -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK 0x0018 -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10 (0x0 << 3) -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_100 (0x1 << 3) -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_1G (0x2 << 3) -#define BRGPHY_5708S_PG0_1000X_STAT1_SPEED_25G (0x3 << 3) - - -#define BRGPHY_5708S_PG0_1000X_CTL2 0x11 -#define BRGPHY_5708S_PG0_1000X_CTL2_PAR_DET_EN 0x0001 - -/* 5708S SerDes "Digital 3" Registers (page 2) */ -#define BRGPHY_5708S_PG2_DIGCTL_3_0 0x10 -#define BRGPHY_5708S_PG2_DIGCTL_3_0_USE_IEEE 0x0001 - -/* 5708S SerDes "TX Misc" Registers (page 5) */ -#define BRGPHY_5708S_PG5_2500STATUS1 0x10 -#define BRGPHY_5708S_PG5_TXACTL1 0x15 -#define BRGPHY_5708S_PG5_TXACTL3 0x17 - -/*******************************************************/ -/* End: PHY register values for the 5708S SerDes PHY */ -/*******************************************************/ - /*******************************************************/ /* Begin: PHY register values for the 5709S SerDes PHY */ /*******************************************************/ /* 5709S SerDes "General Purpose Status" Registers */ -#define BRGPHY_BLOCK_ADDR_GP_STATUS 0x8120 -#define BRGPHY_GP_STATUS_TOP_ANEG_STATUS 0x1B -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK 0x3F00 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10 0x0000 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100 0x0100 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G 0x0200 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G 0x0300 -#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1GKX 0x0D00 -#define BRGPHY_GP_STATUS_TOP_ANEG_FDX 0x0008 -#define BRGPHY_GP_STATUS_TOP_ANEG_LINK_UP 0x0004 -#define BRGPHY_GP_STATUS_TOP_ANEG_CL73_COMP 0x0001 +#define BRGPHY_BLOCK_ADDR_GP_STATUS 0x8120 +#define BRGPHY_GP_STATUS_TOP_ANEG_STATUS 0x1B +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_MASK 0x3F00 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_10 0x0000 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_100 0x0100 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1G 0x0200 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_25G 0x0300 +#define BRGPHY_GP_STATUS_TOP_ANEG_SPEED_1GKX 0x0D00 +#define BRGPHY_GP_STATUS_TOP_ANEG_FDX 0x0008 +#define BRGPHY_GP_STATUS_TOP_ANEG_LINK_UP 0x0004 +#define BRGPHY_GP_STATUS_TOP_ANEG_CL73_COMP 0x0001 /* 5709S SerDes "SerDes Digital" Registers */ -#define BRGPHY_BLOCK_ADDR_SERDES_DIG 0x8300 -#define BRGPHY_SERDES_DIG_1000X_CTL1 0x0010 -#define BRGPHY_SD_DIG_1000X_CTL1_AUTODET 0x0010 -#define BRGPHY_SD_DIG_1000X_CTL1_FIBER 0x0001 +#define BRGPHY_BLOCK_ADDR_SERDES_DIG 0x8300 +#define BRGPHY_SERDES_DIG_1000X_CTL1 0x0010 +#define BRGPHY_SD_DIG_1000X_CTL1_AUTODET 0x0010 +#define BRGPHY_SD_DIG_1000X_CTL1_FIBER 0x0001 /* 5709S SerDes "Over 1G" Registers */ -#define BRGPHY_BLOCK_ADDR_OVER_1G 0x8320 -#define BRGPHY_OVER_1G_UNFORMAT_PG1 0x19 +#define BRGPHY_BLOCK_ADDR_OVER_1G 0x8320 +#define BRGPHY_OVER_1G_UNFORMAT_PG1 0x19 /* 5709S SerDes "Multi-Rate Backplane Ethernet" Registers */ -#define BRGPHY_BLOCK_ADDR_MRBE 0x8350 -#define BRGPHY_MRBE_MSG_PG5_NP 0x10 -#define BRGPHY_MRBE_MSG_PG5_NP_MBRE 0x0001 -#define BRGPHY_MRBE_MSG_PG5_NP_T2 0x0001 +#define BRGPHY_BLOCK_ADDR_MRBE 0x8350 +#define BRGPHY_MRBE_MSG_PG5_NP 0x10 +#define BRGPHY_MRBE_MSG_PG5_NP_MBRE 0x0001 +#define BRGPHY_MRBE_MSG_PG5_NP_T2 0x0002 /* 5709S SerDes "IEEE Clause 73 User B0" Registers */ -#define BRGPHY_BLOCK_ADDR_CL73_USER_B0 0x8370 -#define BRGPHY_CL73_USER_B0_MBRE_CTL1 0x12 +#define BRGPHY_BLOCK_ADDR_CL73_USER_B0 0x8370 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1 0x12 #define BRGPHY_CL73_USER_B0_MBRE_CTL1_NP_AFT_BP 0x2000 #define BRGPHY_CL73_USER_B0_MBRE_CTL1_STA_MGR 0x4000 -#define BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG 0x8000 +#define BRGPHY_CL73_USER_B0_MBRE_CTL1_ANEG 0x8000 /* 5709S SerDes "IEEE Clause 73 User B0" Registers */ -#define BRGPHY_BLOCK_ADDR_ADDR_EXT 0xFFD0 +#define BRGPHY_BLOCK_ADDR_ADDR_EXT 0xFFD0 /* 5709S SerDes "Combo IEEE 0" Registers */ -#define BRGPHY_BLOCK_ADDR_COMBO_IEEE0 0xFFE0 +#define BRGPHY_BLOCK_ADDR_COMBO_IEEE0 0xFFE0 -#define BRGPHY_ADDR_EXT 0x1E -#define BRGPHY_BLOCK_ADDR 0x1F +#define BRGPHY_ADDR_EXT 0x1E +#define BRGPHY_BLOCK_ADDR 0x1F -#define BRGPHY_ADDR_EXT_AN_MMD 0x3800 +#define BRGPHY_ADDR_EXT_AN_MMD 0x3800 /*******************************************************/ /* End: PHY register values for the 5709S SerDes PHY */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:08:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4034A106567A; Fri, 8 Oct 2010 19:08:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 101AA8FC12; Fri, 8 Oct 2010 19:08:39 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A239846B1A; Fri, 8 Oct 2010 15:08:38 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D277B8A03C; Fri, 8 Oct 2010 15:08:37 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Date: Fri, 8 Oct 2010 14:33:15 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010042322.o94NM3Sl030836@svn.freebsd.org> <4CAACF80.5050009@gmail.com> <201010050914.30675.hselasky@freebsd.org> In-Reply-To: <201010050914.30675.hselasky@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201010081433.15935.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 08 Oct 2010 15:08:37 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: "svn-src-head@freebsd.org" , Niclas Zeising , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r213437 - in head/sys: conf modules/usb modules/usb/xhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:08:39 -0000 On Tuesday, October 05, 2010 3:14:30 am Hans Petter Selasky wrote: > On Tuesday 05 October 2010 09:10:56 Niclas Zeising wrote: > > On 2010-10-05 01:22, Hans Petter Selasky wrote: > > > Author: hselasky > > > Date: Mon Oct 4 23:22:03 2010 > > > New Revision: 213437 > > > URL: http://svn.freebsd.org/changeset/base/213437 > > > > > > Log: > > > Link the XHCI (USB 3.0 hardware driver) into the default kernel build. > > > > > > Approved by: thompsa (mentor) > > > > > > Added: > > > head/sys/modules/usb/xhci/ > > > head/sys/modules/usb/xhci/Makefile (contents, props changed) > > > > > > Modified: > > > head/sys/conf/files > > > head/sys/modules/usb/Makefile > > > > Shouldn't this be added to the corresponding kernel config files as well > > as NOTES? > > Keep up the good work! > > Regards! > > //Niclas > > Yes, but I'm not sure who will do that. You should certainly go ahead and add it to NOTES. If it replaces the other *hci drivers then you might want to wait a bit before adding it to GENERIC. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:19:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B68E8106566B; Fri, 8 Oct 2010 19:19: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 8B8E08FC16; Fri, 8 Oct 2010 19:19: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 o98JJpgd004715; Fri, 8 Oct 2010 19:19:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JJpR1004713; Fri, 8 Oct 2010 19:19:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081919.o98JJpR1004713@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213599 - stable/8/sys/dev/ae X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:19:51 -0000 Author: yongari Date: Fri Oct 8 19:19:51 2010 New Revision: 213599 URL: http://svn.freebsd.org/changeset/base/213599 Log: MFC r212968: Remove unnecessary controller reinitialization. PR: kern/87506 Modified: stable/8/sys/dev/ae/if_ae.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ae/if_ae.c ============================================================================== --- stable/8/sys/dev/ae/if_ae.c Fri Oct 8 19:00:36 2010 (r213598) +++ stable/8/sys/dev/ae/if_ae.c Fri Oct 8 19:19:51 2010 (r213599) @@ -565,6 +565,8 @@ ae_init_locked(ae_softc_t *sc) AE_LOCK_ASSERT(sc); ifp = sc->ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return (0); mii = device_get_softc(sc->miibus); ae_stop(sc); @@ -1786,7 +1788,10 @@ ae_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if ((val & (AE_ISR_DMAR_TIMEOUT | AE_ISR_DMAW_TIMEOUT | AE_ISR_PHY_LINKDOWN)) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); + AE_UNLOCK(sc); + return; } if ((val & AE_ISR_TX_EVENT) != 0) ae_tx_intr(sc); @@ -1997,6 +2002,7 @@ ae_watchdog(ae_softc_t *sc) if_printf(ifp, "watchdog timeout - resetting.\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->tq, &sc->tx_task); @@ -2107,8 +2113,10 @@ ae_ioctl(struct ifnet *ifp, u_long cmd, else if (ifp->if_mtu != ifr->ifr_mtu) { AE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); + } AE_UNLOCK(sc); } break; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:21:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D240106564A; Fri, 8 Oct 2010 19:21:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C9888FC0A; Fri, 8 Oct 2010 19:21: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 o98JLGYA004803; Fri, 8 Oct 2010 19:21:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JLGaD004801; Fri, 8 Oct 2010 19:21:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081921.o98JLGaD004801@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213600 - stable/7/sys/dev/ae X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:21:16 -0000 Author: yongari Date: Fri Oct 8 19:21:16 2010 New Revision: 213600 URL: http://svn.freebsd.org/changeset/base/213600 Log: MFC r212968: Remove unnecessary controller reinitialization. PR: kern/87506 Modified: stable/7/sys/dev/ae/if_ae.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ae/if_ae.c ============================================================================== --- stable/7/sys/dev/ae/if_ae.c Fri Oct 8 19:19:51 2010 (r213599) +++ stable/7/sys/dev/ae/if_ae.c Fri Oct 8 19:21:16 2010 (r213600) @@ -565,6 +565,8 @@ ae_init_locked(ae_softc_t *sc) AE_LOCK_ASSERT(sc); ifp = sc->ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return (0); mii = device_get_softc(sc->miibus); ae_stop(sc); @@ -1786,7 +1788,10 @@ ae_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if ((val & (AE_ISR_DMAR_TIMEOUT | AE_ISR_DMAW_TIMEOUT | AE_ISR_PHY_LINKDOWN)) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); + AE_UNLOCK(sc); + return; } if ((val & AE_ISR_TX_EVENT) != 0) ae_tx_intr(sc); @@ -1997,6 +2002,7 @@ ae_watchdog(ae_softc_t *sc) if_printf(ifp, "watchdog timeout - resetting.\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->tq, &sc->tx_task); @@ -2107,8 +2113,10 @@ ae_ioctl(struct ifnet *ifp, u_long cmd, else if (ifp->if_mtu != ifr->ifr_mtu) { AE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ae_init_locked(sc); + } AE_UNLOCK(sc); } break; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:24:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FBD0106566B; Fri, 8 Oct 2010 19:24:38 +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 4F4518FC15; Fri, 8 Oct 2010 19:24: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 o98JOcW5006155; Fri, 8 Oct 2010 19:24:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JOcGA006153; Fri, 8 Oct 2010 19:24:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081924.o98JOcGA006153@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213601 - stable/8/sys/dev/et X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:24:38 -0000 Author: yongari Date: Fri Oct 8 19:24:38 2010 New Revision: 213601 URL: http://svn.freebsd.org/changeset/base/213601 Log: MFC r212969: Make sure to clear IFF_DRV_RUNNING to reinitialize controller. While I'm here update if_oerrors counter when driver encounters watchdog timeout. Modified: stable/8/sys/dev/et/if_et.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/et/if_et.c ============================================================================== --- stable/8/sys/dev/et/if_et.c Fri Oct 8 19:21:16 2010 (r213600) +++ stable/8/sys/dev/et/if_et.c Fri Oct 8 19:24:38 2010 (r213601) @@ -1320,6 +1320,8 @@ et_watchdog(struct et_softc *sc) if_printf(sc->ifp, "watchdog timed out\n"); + sc->ifp->if_oerrors++; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; et_init_locked(sc); et_start_locked(sc->ifp); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:25:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 529A4106566B; Fri, 8 Oct 2010 19:25:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41EB58FC0A; Fri, 8 Oct 2010 19:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98JPlkg006781; Fri, 8 Oct 2010 19:25:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JPlI1006779; Fri, 8 Oct 2010 19:25:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081925.o98JPlI1006779@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213602 - stable/7/sys/dev/et X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:25:47 -0000 Author: yongari Date: Fri Oct 8 19:25:46 2010 New Revision: 213602 URL: http://svn.freebsd.org/changeset/base/213602 Log: MFC r212969: Make sure to clear IFF_DRV_RUNNING to reinitialize controller. While I'm here update if_oerrors counter when driver encounters watchdog timeout. Modified: stable/7/sys/dev/et/if_et.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c ============================================================================== --- stable/7/sys/dev/et/if_et.c Fri Oct 8 19:24:38 2010 (r213601) +++ stable/7/sys/dev/et/if_et.c Fri Oct 8 19:25:46 2010 (r213602) @@ -1320,6 +1320,8 @@ et_watchdog(struct et_softc *sc) if_printf(sc->ifp, "watchdog timed out\n"); + sc->ifp->if_oerrors++; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; et_init_locked(sc); et_start_locked(sc->ifp); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:27:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C76E106566C; Fri, 8 Oct 2010 19:27:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 112968FC0C; Fri, 8 Oct 2010 19:27: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 o98JRY0V007756; Fri, 8 Oct 2010 19:27:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JRYEn007754; Fri, 8 Oct 2010 19:27:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081927.o98JRYEn007754@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213603 - stable/8/sys/dev/sf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:27:35 -0000 Author: yongari Date: Fri Oct 8 19:27:34 2010 New Revision: 213603 URL: http://svn.freebsd.org/changeset/base/213603 Log: MFC r212971: Remove unnecessary controller reinitialization. StarFire controller does not require controller reinitialization to program perfect filters. While here, make driver immediately exit from interrupt/polling handler if driver reinitialized controller. PR: kern/87506 Modified: stable/8/sys/dev/sf/if_sf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sf/if_sf.c ============================================================================== --- stable/8/sys/dev/sf/if_sf.c Fri Oct 8 19:25:46 2010 (r213602) +++ stable/8/sys/dev/sf/if_sf.c Fri Oct 8 19:27:34 2010 (r213603) @@ -1826,7 +1826,10 @@ sf_poll(struct ifnet *ifp, enum poll_cmd else if ((status & SF_ISR_DMAERR) != 0) { device_printf(sc->sf_dev, "DMA error, resetting\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); + SF_UNLOCK(sc); + return (rx_npkts); } else if ((status & SF_ISR_NO_TX_CSUM) != 0) { sc->sf_statistics.sf_tx_gfp_stall++; #ifdef SF_GFP_DEBUG @@ -1894,8 +1897,10 @@ sf_intr(void *arg) else if ((status & SF_ISR_DMAERR) != 0) { device_printf(sc->sf_dev, "DMA error, resetting\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); - break; + SF_UNLOCK(sc); + return; } else if ((status & SF_ISR_NO_TX_CSUM) != 0) { sc->sf_statistics.sf_tx_gfp_stall++; #ifdef SF_GFP_DEBUG @@ -1984,6 +1989,8 @@ sf_init_locked(struct sf_softc *sc) SF_LOCK_ASSERT(sc); ifp = sc->sf_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; mii = device_get_softc(sc->sf_miibus); sf_stop(sc); @@ -2547,6 +2554,7 @@ sf_watchdog(struct sf_softc *sc) if_printf(ifp, "watchdog timeout, %d Tx descs are active\n", sc->sf_cdata.sf_tx_cnt); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:29:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 927CD106567A; Fri, 8 Oct 2010 19:29:17 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6776A8FC19; Fri, 8 Oct 2010 19:29: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 o98JTHhJ008669; Fri, 8 Oct 2010 19:29:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JTHqu008667; Fri, 8 Oct 2010 19:29:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081929.o98JTHqu008667@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213604 - stable/7/sys/dev/sf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:29:17 -0000 Author: yongari Date: Fri Oct 8 19:29:17 2010 New Revision: 213604 URL: http://svn.freebsd.org/changeset/base/213604 Log: MFC r212971: Remove unnecessary controller reinitialization. StarFire controller does not require controller reinitialization to program perfect filters. While here, make driver immediately exit from interrupt/polling handler if driver reinitialized controller. PR: kern/87506 Modified: stable/7/sys/dev/sf/if_sf.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sf/if_sf.c ============================================================================== --- stable/7/sys/dev/sf/if_sf.c Fri Oct 8 19:27:34 2010 (r213603) +++ stable/7/sys/dev/sf/if_sf.c Fri Oct 8 19:29:17 2010 (r213604) @@ -1821,7 +1821,10 @@ sf_poll(struct ifnet *ifp, enum poll_cmd else if ((status & SF_ISR_DMAERR) != 0) { device_printf(sc->sf_dev, "DMA error, resetting\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); + SF_UNLOCK(sc); + return (rx_npkts); } else if ((status & SF_ISR_NO_TX_CSUM) != 0) { sc->sf_statistics.sf_tx_gfp_stall++; #ifdef SF_GFP_DEBUG @@ -1888,8 +1891,10 @@ sf_intr(void *arg) else if ((status & SF_ISR_DMAERR) != 0) { device_printf(sc->sf_dev, "DMA error, resetting\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); - break; + SF_UNLOCK(sc); + return; } else if ((status & SF_ISR_NO_TX_CSUM) != 0) { sc->sf_statistics.sf_tx_gfp_stall++; #ifdef SF_GFP_DEBUG @@ -1978,6 +1983,8 @@ sf_init_locked(struct sf_softc *sc) SF_LOCK_ASSERT(sc); ifp = sc->sf_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; mii = device_get_softc(sc->sf_miibus); sf_stop(sc); @@ -2541,6 +2548,7 @@ sf_watchdog(struct sf_softc *sc) if_printf(ifp, "watchdog timeout, %d Tx descs are active\n", sc->sf_cdata.sf_tx_cnt); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:32:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03DFA106566C; Fri, 8 Oct 2010 19:32: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 CCA5F8FC1A; Fri, 8 Oct 2010 19:32: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 o98JWdhJ010435; Fri, 8 Oct 2010 19:32:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JWdj2010433; Fri, 8 Oct 2010 19:32:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081932.o98JWdj2010433@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213605 - stable/8/sys/dev/stge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:32:40 -0000 Author: yongari Date: Fri Oct 8 19:32:39 2010 New Revision: 213605 URL: http://svn.freebsd.org/changeset/base/213605 Log: MFC r212972,21300: r212972: Remove unnecessary controller reinitialization. PR: kern/87506 r213000: Fix build breakage introduced in r212972. Modified: stable/8/sys/dev/stge/if_stge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/stge/if_stge.c ============================================================================== --- stable/8/sys/dev/stge/if_stge.c Fri Oct 8 19:29:17 2010 (r213604) +++ stable/8/sys/dev/stge/if_stge.c Fri Oct 8 19:32:39 2010 (r213605) @@ -1384,6 +1384,7 @@ stge_watchdog(struct stge_softc *sc) ifp = sc->sc_ifp; if_printf(sc->sc_ifp, "device timeout\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) stge_start_locked(ifp); @@ -1412,7 +1413,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd else if (ifp->if_mtu != ifr->ifr_mtu) { ifp->if_mtu = ifr->ifr_mtu; STGE_LOCK(sc); - stge_init_locked(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + stge_init_locked(sc); + } STGE_UNLOCK(sc); } break; @@ -1646,8 +1650,10 @@ stge_intr(void *arg) } force_init: - if (reinit != 0) + if (reinit != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); + } /* Re-enable interrupts. */ CSR_WRITE_2(sc, STGE_IntEnable, sc->sc_IntEnable); @@ -1943,11 +1949,14 @@ stge_poll(struct ifnet *ifp, enum poll_c if ((status & IS_HostError) != 0) { device_printf(sc->sc_dev, "Host interface error, resetting...\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); } if ((status & IS_TxComplete) != 0) { - if (stge_tx_error(sc) != 0) + if (stge_tx_error(sc) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); + } } } @@ -2128,6 +2137,8 @@ stge_init_locked(struct stge_softc *sc) STGE_LOCK_ASSERT(sc); ifp = sc->sc_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; mii = device_get_softc(sc->sc_miibus); /* From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:34:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99CBE1065696; Fri, 8 Oct 2010 19:34:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EDC78FC08; Fri, 8 Oct 2010 19:34:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98JYNZ7010830; Fri, 8 Oct 2010 19:34:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JYNkO010828; Fri, 8 Oct 2010 19:34:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081934.o98JYNkO010828@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213606 - stable/7/sys/dev/stge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:34:23 -0000 Author: yongari Date: Fri Oct 8 19:34:23 2010 New Revision: 213606 URL: http://svn.freebsd.org/changeset/base/213606 Log: MFC r212972,21300: r212972: Remove unnecessary controller reinitialization. PR: kern/87506 r213000: Fix build breakage introduced in r212972. Modified: stable/7/sys/dev/stge/if_stge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/stge/if_stge.c ============================================================================== --- stable/7/sys/dev/stge/if_stge.c Fri Oct 8 19:32:39 2010 (r213605) +++ stable/7/sys/dev/stge/if_stge.c Fri Oct 8 19:34:23 2010 (r213606) @@ -1386,6 +1386,7 @@ stge_watchdog(struct stge_softc *sc) ifp = sc->sc_ifp; if_printf(sc->sc_ifp, "device timeout\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) stge_start_locked(ifp); @@ -1414,7 +1415,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd else if (ifp->if_mtu != ifr->ifr_mtu) { ifp->if_mtu = ifr->ifr_mtu; STGE_LOCK(sc); - stge_init_locked(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + stge_init_locked(sc); + } STGE_UNLOCK(sc); } break; @@ -1648,8 +1652,10 @@ stge_intr(void *arg) } force_init: - if (reinit != 0) + if (reinit != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); + } /* Re-enable interrupts. */ CSR_WRITE_2(sc, STGE_IntEnable, sc->sc_IntEnable); @@ -1940,11 +1946,14 @@ stge_poll(struct ifnet *ifp, enum poll_c if ((status & IS_HostError) != 0) { device_printf(sc->sc_dev, "Host interface error, resetting...\n"); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); } if ((status & IS_TxComplete) != 0) { - if (stge_tx_error(sc) != 0) + if (stge_tx_error(sc) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; stge_init_locked(sc); + } } } @@ -2124,6 +2133,8 @@ stge_init_locked(struct stge_softc *sc) STGE_LOCK_ASSERT(sc); ifp = sc->sc_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; mii = device_get_softc(sc->sc_miibus); /* From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 19:39:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52575106566B; Fri, 8 Oct 2010 19:39:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 408268FC0C; Fri, 8 Oct 2010 19:39: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 o98JdZD4011042; Fri, 8 Oct 2010 19:39:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98JdZ7l011039; Fri, 8 Oct 2010 19:39:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010081939.o98JdZ7l011039@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 19:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213607 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 19:39:35 -0000 Author: yongari Date: Fri Oct 8 19:39:35 2010 New Revision: 213607 URL: http://svn.freebsd.org/changeset/base/213607 Log: MFC r212103-212105: r212103: Remove leading and trailing white spaces. No functional changes. r212104: style(9) - space after keywords. r212105: Nuke unnecessary return at the end of function. Modified: stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sis/if_sisreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 19:34:23 2010 (r213606) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 19:39:35 2010 (r213607) @@ -203,7 +203,7 @@ sis_reverse(uint16_t n) n = ((n >> 4) & 0x0f0f) | ((n << 4) & 0xf0f0); n = ((n >> 8) & 0x00ff) | ((n << 8) & 0xff00); - return(n); + return (n); } static void @@ -342,7 +342,7 @@ sis_find_bridge(device_t dev) int i, j; if ((pci_devclass = devclass_find("pci")) == NULL) - return(NULL); + return (NULL); devclass_get_devices(pci_devclass, &pci_devices, &pci_count); @@ -363,7 +363,7 @@ sis_find_bridge(device_t dev) done: free(pci_devices, M_TEMP); - return(child); + return (child); } static void @@ -393,7 +393,6 @@ sis_read_cmos(struct sis_softc *sc, devi } pci_write_config(bridge, 0x48, reg & ~0x40, 1); - return; } static void @@ -406,7 +405,7 @@ sis_read_mac(struct sis_softc *sc, devic CSR_WRITE_4(sc, SIS_CSR, SIS_CSR_RELOAD | filtsave); CSR_WRITE_4(sc, SIS_CSR, 0); - + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave & ~SIS_RXFILTCTL_ENABLE); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0); @@ -418,7 +417,6 @@ sis_read_mac(struct sis_softc *sc, devic CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); CSR_WRITE_4(sc, SIS_CSR, csrsave); - return; } #endif @@ -429,9 +427,9 @@ static void sis_mii_sync(struct sis_softc *sc) { int i; - + SIO_SET(SIS_MII_DIR|SIS_MII_DATA); - + for (i = 0; i < 32; i++) { SIO_SET(SIS_MII_CLK); DELAY(1); @@ -439,7 +437,7 @@ sis_mii_sync(struct sis_softc *sc) DELAY(1); } } - + /* * Clock a series of bits through the MII. */ @@ -447,9 +445,9 @@ static void sis_mii_send(struct sis_softc *sc, uint32_t bits, int cnt) { int i; - + SIO_CLR(SIS_MII_CLK); - + for (i = (0x1 << (cnt - 1)); i; i >>= 1) { if (bits & i) { SIO_SET(SIS_MII_DATA); @@ -462,7 +460,7 @@ sis_mii_send(struct sis_softc *sc, uint3 SIO_SET(SIS_MII_CLK); } } - + /* * Read an PHY register through the MII. */ @@ -470,7 +468,7 @@ static int sis_mii_readreg(struct sis_softc *sc, struct sis_mii_frame *frame) { int i, ack; - + /* * Set up frame for RX. */ @@ -478,14 +476,14 @@ sis_mii_readreg(struct sis_softc *sc, st frame->mii_opcode = SIS_MII_READOP; frame->mii_turnaround = 0; frame->mii_data = 0; - + /* * Turn on data xmit. */ SIO_SET(SIS_MII_DIR); sis_mii_sync(sc); - + /* * Send command/address info. */ @@ -493,29 +491,29 @@ sis_mii_readreg(struct sis_softc *sc, st sis_mii_send(sc, frame->mii_opcode, 2); sis_mii_send(sc, frame->mii_phyaddr, 5); sis_mii_send(sc, frame->mii_regaddr, 5); - + /* Idle bit */ SIO_CLR((SIS_MII_CLK|SIS_MII_DATA)); DELAY(1); SIO_SET(SIS_MII_CLK); DELAY(1); - + /* Turn off xmit. */ SIO_CLR(SIS_MII_DIR); - + /* Check for ack */ SIO_CLR(SIS_MII_CLK); DELAY(1); ack = CSR_READ_4(sc, SIS_EECTL) & SIS_MII_DATA; SIO_SET(SIS_MII_CLK); DELAY(1); - + /* * Now try reading data bits. If the ack failed, we still * need to clock through 16 cycles to keep the PHY(s) in sync. */ if (ack) { - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { SIO_CLR(SIS_MII_CLK); DELAY(1); SIO_SET(SIS_MII_CLK); @@ -523,7 +521,7 @@ sis_mii_readreg(struct sis_softc *sc, st } goto fail; } - + for (i = 0x8000; i; i >>= 1) { SIO_CLR(SIS_MII_CLK); DELAY(1); @@ -544,51 +542,51 @@ fail: DELAY(1); if (ack) - return(1); - return(0); + return (1); + return (0); } - + /* * Write to a PHY register through the MII. */ static int sis_mii_writereg(struct sis_softc *sc, struct sis_mii_frame *frame) { - + /* * Set up frame for TX. */ - + frame->mii_stdelim = SIS_MII_STARTDELIM; frame->mii_opcode = SIS_MII_WRITEOP; frame->mii_turnaround = SIS_MII_TURNAROUND; - + /* * Turn on data output. */ SIO_SET(SIS_MII_DIR); - + sis_mii_sync(sc); - + sis_mii_send(sc, frame->mii_stdelim, 2); sis_mii_send(sc, frame->mii_opcode, 2); sis_mii_send(sc, frame->mii_phyaddr, 5); sis_mii_send(sc, frame->mii_regaddr, 5); sis_mii_send(sc, frame->mii_turnaround, 2); sis_mii_send(sc, frame->mii_data, 16); - + /* Idle bit. */ SIO_SET(SIS_MII_CLK); DELAY(1); SIO_CLR(SIS_MII_CLK); DELAY(1); - + /* * Turn off xmit. */ SIO_CLR(SIS_MII_DIR); - - return(0); + + return (0); } static int @@ -601,7 +599,7 @@ sis_miibus_readreg(device_t dev, int phy if (sc->sis_type == SIS_TYPE_83815) { if (phy != 0) - return(0); + return (0); /* * The NatSemi chip can take a while after * a reset to come ready, during which the BMSR @@ -627,7 +625,7 @@ sis_miibus_readreg(device_t dev, int phy int i, val = 0; if (phy != 0) - return(0); + return (0); CSR_WRITE_4(sc, SIS_PHYCTL, (phy << 11) | (reg << 6) | SIS_PHYOP_READ); @@ -640,15 +638,15 @@ sis_miibus_readreg(device_t dev, int phy if (i == SIS_TIMEOUT) { device_printf(sc->sis_dev, "PHY failed to come ready\n"); - return(0); + return (0); } val = (CSR_READ_4(sc, SIS_PHYCTL) >> 16) & 0xFFFF; if (val == 0xFFFF) - return(0); + return (0); - return(val); + return (val); } else { bzero((char *)&frame, sizeof(frame)); @@ -656,7 +654,7 @@ sis_miibus_readreg(device_t dev, int phy frame.mii_regaddr = reg; sis_mii_readreg(sc, &frame); - return(frame.mii_data); + return (frame.mii_data); } } @@ -670,9 +668,9 @@ sis_miibus_writereg(device_t dev, int ph if (sc->sis_type == SIS_TYPE_83815) { if (phy != 0) - return(0); + return (0); CSR_WRITE_4(sc, NS_BMCR + (reg * 4), data); - return(0); + return (0); } /* @@ -685,7 +683,7 @@ sis_miibus_writereg(device_t dev, int ph int i; if (phy != 0) - return(0); + return (0); CSR_WRITE_4(sc, SIS_PHYCTL, (data << 16) | (phy << 11) | (reg << 6) | SIS_PHYOP_WRITE); @@ -706,7 +704,7 @@ sis_miibus_writereg(device_t dev, int ph frame.mii_data = data; sis_mii_writereg(sc, &frame); } - return(0); + return (0); } static void @@ -789,8 +787,6 @@ sis_setmulti_ns(struct sis_softc *sc) if_maddr_runlock(ifp); CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); - - return; } static void @@ -876,8 +872,6 @@ sis_reset(struct sis_softc *sc) CSR_WRITE_4(sc, NS_CLKRUN, NS_CLKRUN_PMESTS); CSR_WRITE_4(sc, NS_CLKRUN, 0); } - - return; } /* @@ -891,7 +885,7 @@ sis_probe(device_t dev) t = sis_devs; - while(t->sis_name != NULL) { + while (t->sis_name != NULL) { if ((pci_get_vendor(dev) == t->sis_vid) && (pci_get_device(dev) == t->sis_did)) { device_set_desc(dev, t->sis_name); @@ -900,7 +894,7 @@ sis_probe(device_t dev) t++; } - return(ENXIO); + return (ENXIO); } /* @@ -947,8 +941,8 @@ sis_attach(device_t dev) sis_reset(sc); if (sc->sis_type == SIS_TYPE_900 && - (sc->sis_rev == SIS_REV_635 || - sc->sis_rev == SIS_REV_900B)) { + (sc->sis_rev == SIS_REV_635 || + sc->sis_rev == SIS_REV_900B)) { SIO_SET(SIS_CFG_RND_CNT); SIO_SET(SIS_CFG_PERR_DETECT); } @@ -1065,13 +1059,13 @@ sis_attach(device_t dev) * Allocate the parent bus DMA tag appropriate for PCI. */ #define SIS_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(NULL, /* parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ MAXBSIZE, SIS_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ + BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->sis_parent_tag); @@ -1213,7 +1207,7 @@ sis_attach(device_t dev) * Call MI attach routine. */ ether_ifattach(ifp, eaddr); - + /* * Tell the upper layer(s) we support long frames. */ @@ -1238,7 +1232,7 @@ fail: if (error) sis_detach(dev); - return(error); + return (error); } /* @@ -1304,7 +1298,7 @@ sis_detach(device_t dev) mtx_destroy(&sc->sis_mtx); - return(0); + return (0); } /* @@ -1342,7 +1336,7 @@ sis_ring_init(struct sis_softc *sc) for (i = 0; i < SIS_RX_LIST_CNT; i++, dp++) { error = sis_newbuf(sc, dp, NULL); if (error) - return(error); + return (error); if (i == (SIS_RX_LIST_CNT - 1)) dp->sis_nextdesc = &sc->sis_rx_list[0]; else @@ -1358,7 +1352,7 @@ sis_ring_init(struct sis_softc *sc) sc->sis_rx_pdsc = &sc->sis_rx_list[0]; - return(0); + return (0); } /* @@ -1369,12 +1363,12 @@ sis_newbuf(struct sis_softc *sc, struct { if (c == NULL) - return(EINVAL); + return (EINVAL); if (m == NULL) { m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) - return(ENOBUFS); + return (ENOBUFS); } else m->m_data = m->m_ext.ext_buf; @@ -1387,7 +1381,7 @@ sis_newbuf(struct sis_softc *sc, struct sis_dma_map_desc_ptr, c, 0); bus_dmamap_sync(sc->sis_tag, c->sis_map, BUS_DMASYNC_PREREAD); - return(0); + return (0); } /* @@ -1407,7 +1401,7 @@ sis_rxeof(struct sis_softc *sc) ifp = sc->sis_ifp; - for(cur_rx = sc->sis_rx_pdsc; SIS_OWNDESC(cur_rx); + for (cur_rx = sc->sis_rx_pdsc; SIS_OWNDESC(cur_rx); cur_rx = cur_rx->sis_nextdesc) { #ifdef DEVICE_POLLING @@ -1444,7 +1438,7 @@ sis_rxeof(struct sis_softc *sc) continue; } - /* No errors; receive the packet. */ + /* No errors; receive the packet. */ #ifdef __NO_STRICT_ALIGNMENT /* * On architectures without alignment problems we try to @@ -1538,8 +1532,6 @@ sis_txeof(struct sis_softc *sc) } sc->sis_watchdog_timer = (sc->sis_tx_cnt == 0) ? 0 : 5; - - return; } static void @@ -1655,7 +1647,7 @@ sis_intr(void *arg) if (status & (SIS_ISR_TX_DESC_OK | SIS_ISR_TX_ERR | - SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) ) + SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) ) sis_txeof(sc); if (status & (SIS_ISR_RX_DESC_OK | SIS_ISR_RX_OK | @@ -1717,7 +1709,7 @@ sis_encap(struct sis_softc *sc, struct m return (ENOBUFS); *m_head = m; } - + /* * Start packing the mbufs in this chain into * the fragment pointers. Stop when we run out @@ -1729,7 +1721,7 @@ sis_encap(struct sis_softc *sc, struct m if (m->m_len != 0) { if ((SIS_TX_LIST_CNT - (sc->sis_tx_cnt + cnt)) < 2) - return(ENOBUFS); + return (ENOBUFS); f = &sc->sis_tx_list[frag]; f->sis_ctl = SIS_CMDSTS_MORE | m->m_len; bus_dmamap_create(sc->sis_tag, 0, &f->sis_map); @@ -1747,7 +1739,7 @@ sis_encap(struct sis_softc *sc, struct m } if (m != NULL) - return(ENOBUFS); + return (ENOBUFS); sc->sis_tx_list[cur].sis_mbuf = *m_head; sc->sis_tx_list[cur].sis_ctl &= ~SIS_CMDSTS_MORE; @@ -1755,7 +1747,7 @@ sis_encap(struct sis_softc *sc, struct m sc->sis_tx_cnt += cnt; *txidx = frag; - return(0); + return (0); } /* @@ -1795,7 +1787,7 @@ sis_startl(struct ifnet *ifp) if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - while(sc->sis_tx_list[idx].sis_mbuf == NULL) { + while (sc->sis_tx_list[idx].sis_mbuf == NULL) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -2003,7 +1995,7 @@ sis_initl(struct sis_softc *sc) uint32_t reg; /* - * Short Cable Receive Errors (MP21.E) + * Short Cable Receive Errors (MP21.E) */ CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001); reg = CSR_READ_4(sc, NS_PHY_DSPCFG) & 0xfff; @@ -2071,7 +2063,7 @@ sis_ifmedia_upd(struct ifnet *ifp) mii_mediachg(mii); SIS_UNLOCK(sc); - return(0); + return (0); } /* @@ -2101,7 +2093,7 @@ sis_ioctl(struct ifnet *ifp, u_long comm struct mii_data *mii; int error = 0; - switch(command) { + switch (command) { case SIOCSIFFLAGS: SIS_LOCK(sc); if (ifp->if_flags & IFF_UP) { @@ -2134,14 +2126,14 @@ sis_ioctl(struct ifnet *ifp, u_long comm !(ifp->if_capenable & IFCAP_POLLING)) { error = ether_poll_register(sis_poll, ifp); if (error) - return(error); + return (error); SIS_LOCK(sc); /* Disable interrupts */ CSR_WRITE_4(sc, SIS_IER, 0); ifp->if_capenable |= IFCAP_POLLING; SIS_UNLOCK(sc); return (error); - + } if (!(ifr->ifr_reqcap & IFCAP_POLLING) && ifp->if_capenable & IFCAP_POLLING) { @@ -2160,7 +2152,7 @@ sis_ioctl(struct ifnet *ifp, u_long comm break; } - return(error); + return (error); } static void Modified: stable/8/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 19:34:23 2010 (r213606) +++ stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 19:39:35 2010 (r213607) @@ -252,7 +252,7 @@ SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1536)) #define SIS_RXCFG_DRAIN_THRESH 0x0000003E /* 8-byte units */ -#define SIS_TXCFG_MPII03D 0x00040000 /* "Must be 1" */ +#define SIS_TXCFG_MPII03D 0x00040000 /* "Must be 1" */ #define SIS_RXCFG_DMABURST 0x00700000 #define SIS_RXCFG_RX_JABBER 0x08000000 #define SIS_RXCFG_RX_TXPKTS 0x10000000 From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:12:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15FBF106564A; Fri, 8 Oct 2010 20:12:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 052A48FC08; Fri, 8 Oct 2010 20:12: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 o98KC04v011846; Fri, 8 Oct 2010 20:12:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KC0VT011844; Fri, 8 Oct 2010 20:12:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082012.o98KC0VT011844@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213608 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:12:01 -0000 Author: yongari Date: Fri Oct 8 20:12:00 2010 New Revision: 213608 URL: http://svn.freebsd.org/changeset/base/213608 Log: MFC r182065: There actually were bugs in the original handling that I missed last night. Free the children after each pci bus that is searched. Otherwise we leak them. With free in the new place, we also have to free children before going to done when we find the device we're looking for. Also, if we can't get the children of a device, just ignore that bus. Modified: stable/7/sys/dev/sis/if_sis.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 19:39:35 2010 (r213607) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:12:00 2010 (r213608) @@ -347,21 +347,22 @@ sis_find_bridge(device_t dev) devclass_get_devices(pci_devclass, &pci_devices, &pci_count); for (i = 0, busp = pci_devices; i < pci_count; i++, busp++) { - pci_childcount = 0; - device_get_children(*busp, &pci_children, &pci_childcount); + if (device_get_children(*busp, &pci_children, &pci_childcount)) + continue; for (j = 0, childp = pci_children; j < pci_childcount; j++, childp++) { if (pci_get_vendor(*childp) == SIS_VENDORID && pci_get_device(*childp) == 0x0008) { child = *childp; + free(pci_children, M_TEMP); goto done; } } + free(pci_children, M_TEMP); } done: free(pci_devices, M_TEMP); - free(pci_children, M_TEMP); return(child); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:13:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 688AD1065672; Fri, 8 Oct 2010 20:13:12 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58E6C8FC15; Fri, 8 Oct 2010 20: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 o98KDCLm011946; Fri, 8 Oct 2010 20:13:12 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KDChd011944; Fri, 8 Oct 2010 20:13:12 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201010082013.o98KDChd011944@svn.freebsd.org> From: Mark Murray Date: Fri, 8 Oct 2010 20: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: r213609 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:13:12 -0000 Author: markm Date: Fri Oct 8 20:13:12 2010 New Revision: 213609 URL: http://svn.freebsd.org/changeset/base/213609 Log: Extend the "example" section a bit, for other mailers. Modified: head/share/man/man5/mailer.conf.5 Modified: head/share/man/man5/mailer.conf.5 ============================================================================== --- head/share/man/man5/mailer.conf.5 Fri Oct 8 20:12:00 2010 (r213608) +++ head/share/man/man5/mailer.conf.5 Fri Oct 8 20:13:12 2010 (r213609) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2006 +.Dd October 8, 2010 .Dt MAILER.CONF 5 .Os .Sh NAME @@ -99,8 +99,9 @@ mailq /usr/libexec/sendmail/sendmail newaliases /usr/libexec/sendmail/sendmail .Ed .Pp -This example shows how to invoke a sendmail-workalike like Postfix in -place of +This example shows how to invoke a sendmail-workalike like +.Nm Postfix +in place of .Xr sendmail 8 : .Bd -literal -offset indent # Emulate sendmail using postfix @@ -110,6 +111,22 @@ mailq /usr/local/sbin/sendmail newaliases /usr/local/sbin/sendmail .Ed .Pp +This example shows +how to invoke +a sendmail-workalike with +.Nm Exim +(from ports) +in place of +.Xr sendmail 8 : +.Bd -literal -offset indent +# Emulate sendmail using exim +sendmail /usr/local/sbin/exim +send-mail /usr/local/sbin/exim +mailq /usr/local/sbin/exim -bp +newaliases /usr/bin/true +rmail /usr/local/sbin/exim -i -oee +.Ed +.Pp This example shows the use of the .Nm mini_sendmail package from ports in place of From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:13:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3633106566C; Fri, 8 Oct 2010 20:13:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1CA98FC1D; Fri, 8 Oct 2010 20:13: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 o98KDgk3011992; Fri, 8 Oct 2010 20:13:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KDgGt011989; Fri, 8 Oct 2010 20:13:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082013.o98KDgGt011989@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213610 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:13:42 -0000 Author: yongari Date: Fri Oct 8 20:13:42 2010 New Revision: 213610 URL: http://svn.freebsd.org/changeset/base/213610 Log: MFC r212103-212105: r212103: Remove leading and trailing white spaces. No functional changes. r212104: style(9) - space after keywords. r212105: Nuke unnecessary return at the end of function. Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:13:12 2010 (r213609) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:13:42 2010 (r213610) @@ -203,7 +203,7 @@ sis_reverse(uint16_t n) n = ((n >> 4) & 0x0f0f) | ((n << 4) & 0xf0f0); n = ((n >> 8) & 0x00ff) | ((n << 8) & 0xff00); - return(n); + return (n); } static void @@ -342,7 +342,7 @@ sis_find_bridge(device_t dev) int i, j; if ((pci_devclass = devclass_find("pci")) == NULL) - return(NULL); + return (NULL); devclass_get_devices(pci_devclass, &pci_devices, &pci_count); @@ -363,7 +363,7 @@ sis_find_bridge(device_t dev) done: free(pci_devices, M_TEMP); - return(child); + return (child); } static void @@ -393,7 +393,6 @@ sis_read_cmos(struct sis_softc *sc, devi } pci_write_config(bridge, 0x48, reg & ~0x40, 1); - return; } static void @@ -406,7 +405,7 @@ sis_read_mac(struct sis_softc *sc, devic CSR_WRITE_4(sc, SIS_CSR, SIS_CSR_RELOAD | filtsave); CSR_WRITE_4(sc, SIS_CSR, 0); - + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave & ~SIS_RXFILTCTL_ENABLE); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0); @@ -418,7 +417,6 @@ sis_read_mac(struct sis_softc *sc, devic CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); CSR_WRITE_4(sc, SIS_CSR, csrsave); - return; } #endif @@ -429,9 +427,9 @@ static void sis_mii_sync(struct sis_softc *sc) { int i; - + SIO_SET(SIS_MII_DIR|SIS_MII_DATA); - + for (i = 0; i < 32; i++) { SIO_SET(SIS_MII_CLK); DELAY(1); @@ -439,7 +437,7 @@ sis_mii_sync(struct sis_softc *sc) DELAY(1); } } - + /* * Clock a series of bits through the MII. */ @@ -447,9 +445,9 @@ static void sis_mii_send(struct sis_softc *sc, uint32_t bits, int cnt) { int i; - + SIO_CLR(SIS_MII_CLK); - + for (i = (0x1 << (cnt - 1)); i; i >>= 1) { if (bits & i) { SIO_SET(SIS_MII_DATA); @@ -462,7 +460,7 @@ sis_mii_send(struct sis_softc *sc, uint3 SIO_SET(SIS_MII_CLK); } } - + /* * Read an PHY register through the MII. */ @@ -470,7 +468,7 @@ static int sis_mii_readreg(struct sis_softc *sc, struct sis_mii_frame *frame) { int i, ack; - + /* * Set up frame for RX. */ @@ -478,14 +476,14 @@ sis_mii_readreg(struct sis_softc *sc, st frame->mii_opcode = SIS_MII_READOP; frame->mii_turnaround = 0; frame->mii_data = 0; - + /* * Turn on data xmit. */ SIO_SET(SIS_MII_DIR); sis_mii_sync(sc); - + /* * Send command/address info. */ @@ -493,29 +491,29 @@ sis_mii_readreg(struct sis_softc *sc, st sis_mii_send(sc, frame->mii_opcode, 2); sis_mii_send(sc, frame->mii_phyaddr, 5); sis_mii_send(sc, frame->mii_regaddr, 5); - + /* Idle bit */ SIO_CLR((SIS_MII_CLK|SIS_MII_DATA)); DELAY(1); SIO_SET(SIS_MII_CLK); DELAY(1); - + /* Turn off xmit. */ SIO_CLR(SIS_MII_DIR); - + /* Check for ack */ SIO_CLR(SIS_MII_CLK); DELAY(1); ack = CSR_READ_4(sc, SIS_EECTL) & SIS_MII_DATA; SIO_SET(SIS_MII_CLK); DELAY(1); - + /* * Now try reading data bits. If the ack failed, we still * need to clock through 16 cycles to keep the PHY(s) in sync. */ if (ack) { - for(i = 0; i < 16; i++) { + for (i = 0; i < 16; i++) { SIO_CLR(SIS_MII_CLK); DELAY(1); SIO_SET(SIS_MII_CLK); @@ -523,7 +521,7 @@ sis_mii_readreg(struct sis_softc *sc, st } goto fail; } - + for (i = 0x8000; i; i >>= 1) { SIO_CLR(SIS_MII_CLK); DELAY(1); @@ -544,51 +542,51 @@ fail: DELAY(1); if (ack) - return(1); - return(0); + return (1); + return (0); } - + /* * Write to a PHY register through the MII. */ static int sis_mii_writereg(struct sis_softc *sc, struct sis_mii_frame *frame) { - + /* * Set up frame for TX. */ - + frame->mii_stdelim = SIS_MII_STARTDELIM; frame->mii_opcode = SIS_MII_WRITEOP; frame->mii_turnaround = SIS_MII_TURNAROUND; - + /* * Turn on data output. */ SIO_SET(SIS_MII_DIR); - + sis_mii_sync(sc); - + sis_mii_send(sc, frame->mii_stdelim, 2); sis_mii_send(sc, frame->mii_opcode, 2); sis_mii_send(sc, frame->mii_phyaddr, 5); sis_mii_send(sc, frame->mii_regaddr, 5); sis_mii_send(sc, frame->mii_turnaround, 2); sis_mii_send(sc, frame->mii_data, 16); - + /* Idle bit. */ SIO_SET(SIS_MII_CLK); DELAY(1); SIO_CLR(SIS_MII_CLK); DELAY(1); - + /* * Turn off xmit. */ SIO_CLR(SIS_MII_DIR); - - return(0); + + return (0); } static int @@ -601,7 +599,7 @@ sis_miibus_readreg(device_t dev, int phy if (sc->sis_type == SIS_TYPE_83815) { if (phy != 0) - return(0); + return (0); /* * The NatSemi chip can take a while after * a reset to come ready, during which the BMSR @@ -627,7 +625,7 @@ sis_miibus_readreg(device_t dev, int phy int i, val = 0; if (phy != 0) - return(0); + return (0); CSR_WRITE_4(sc, SIS_PHYCTL, (phy << 11) | (reg << 6) | SIS_PHYOP_READ); @@ -640,15 +638,15 @@ sis_miibus_readreg(device_t dev, int phy if (i == SIS_TIMEOUT) { device_printf(sc->sis_dev, "PHY failed to come ready\n"); - return(0); + return (0); } val = (CSR_READ_4(sc, SIS_PHYCTL) >> 16) & 0xFFFF; if (val == 0xFFFF) - return(0); + return (0); - return(val); + return (val); } else { bzero((char *)&frame, sizeof(frame)); @@ -656,7 +654,7 @@ sis_miibus_readreg(device_t dev, int phy frame.mii_regaddr = reg; sis_mii_readreg(sc, &frame); - return(frame.mii_data); + return (frame.mii_data); } } @@ -670,9 +668,9 @@ sis_miibus_writereg(device_t dev, int ph if (sc->sis_type == SIS_TYPE_83815) { if (phy != 0) - return(0); + return (0); CSR_WRITE_4(sc, NS_BMCR + (reg * 4), data); - return(0); + return (0); } /* @@ -685,7 +683,7 @@ sis_miibus_writereg(device_t dev, int ph int i; if (phy != 0) - return(0); + return (0); CSR_WRITE_4(sc, SIS_PHYCTL, (data << 16) | (phy << 11) | (reg << 6) | SIS_PHYOP_WRITE); @@ -706,7 +704,7 @@ sis_miibus_writereg(device_t dev, int ph frame.mii_data = data; sis_mii_writereg(sc, &frame); } - return(0); + return (0); } static void @@ -789,8 +787,6 @@ sis_setmulti_ns(struct sis_softc *sc) IF_ADDR_UNLOCK(ifp); CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); - - return; } static void @@ -876,8 +872,6 @@ sis_reset(struct sis_softc *sc) CSR_WRITE_4(sc, NS_CLKRUN, NS_CLKRUN_PMESTS); CSR_WRITE_4(sc, NS_CLKRUN, 0); } - - return; } /* @@ -891,7 +885,7 @@ sis_probe(device_t dev) t = sis_devs; - while(t->sis_name != NULL) { + while (t->sis_name != NULL) { if ((pci_get_vendor(dev) == t->sis_vid) && (pci_get_device(dev) == t->sis_did)) { device_set_desc(dev, t->sis_name); @@ -900,7 +894,7 @@ sis_probe(device_t dev) t++; } - return(ENXIO); + return (ENXIO); } /* @@ -947,8 +941,8 @@ sis_attach(device_t dev) sis_reset(sc); if (sc->sis_type == SIS_TYPE_900 && - (sc->sis_rev == SIS_REV_635 || - sc->sis_rev == SIS_REV_900B)) { + (sc->sis_rev == SIS_REV_635 || + sc->sis_rev == SIS_REV_900B)) { SIO_SET(SIS_CFG_RND_CNT); SIO_SET(SIS_CFG_PERR_DETECT); } @@ -1065,13 +1059,13 @@ sis_attach(device_t dev) * Allocate the parent bus DMA tag appropriate for PCI. */ #define SIS_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(NULL, /* parent */ 1, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ MAXBSIZE, SIS_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ + BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->sis_parent_tag); @@ -1213,7 +1207,7 @@ sis_attach(device_t dev) * Call MI attach routine. */ ether_ifattach(ifp, eaddr); - + /* * Tell the upper layer(s) we support long frames. */ @@ -1238,7 +1232,7 @@ fail: if (error) sis_detach(dev); - return(error); + return (error); } /* @@ -1304,7 +1298,7 @@ sis_detach(device_t dev) mtx_destroy(&sc->sis_mtx); - return(0); + return (0); } /* @@ -1342,7 +1336,7 @@ sis_ring_init(struct sis_softc *sc) for (i = 0; i < SIS_RX_LIST_CNT; i++, dp++) { error = sis_newbuf(sc, dp, NULL); if (error) - return(error); + return (error); if (i == (SIS_RX_LIST_CNT - 1)) dp->sis_nextdesc = &sc->sis_rx_list[0]; else @@ -1358,7 +1352,7 @@ sis_ring_init(struct sis_softc *sc) sc->sis_rx_pdsc = &sc->sis_rx_list[0]; - return(0); + return (0); } /* @@ -1369,12 +1363,12 @@ sis_newbuf(struct sis_softc *sc, struct { if (c == NULL) - return(EINVAL); + return (EINVAL); if (m == NULL) { m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) - return(ENOBUFS); + return (ENOBUFS); } else m->m_data = m->m_ext.ext_buf; @@ -1387,7 +1381,7 @@ sis_newbuf(struct sis_softc *sc, struct sis_dma_map_desc_ptr, c, 0); bus_dmamap_sync(sc->sis_tag, c->sis_map, BUS_DMASYNC_PREREAD); - return(0); + return (0); } /* @@ -1407,7 +1401,7 @@ sis_rxeof(struct sis_softc *sc) ifp = sc->sis_ifp; - for(cur_rx = sc->sis_rx_pdsc; SIS_OWNDESC(cur_rx); + for (cur_rx = sc->sis_rx_pdsc; SIS_OWNDESC(cur_rx); cur_rx = cur_rx->sis_nextdesc) { #ifdef DEVICE_POLLING @@ -1444,7 +1438,7 @@ sis_rxeof(struct sis_softc *sc) continue; } - /* No errors; receive the packet. */ + /* No errors; receive the packet. */ #ifdef __NO_STRICT_ALIGNMENT /* * On architectures without alignment problems we try to @@ -1536,8 +1530,6 @@ sis_txeof(struct sis_softc *sc) } sc->sis_watchdog_timer = (sc->sis_tx_cnt == 0) ? 0 : 5; - - return; } static void @@ -1651,7 +1643,7 @@ sis_intr(void *arg) if (status & (SIS_ISR_TX_DESC_OK | SIS_ISR_TX_ERR | - SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) ) + SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) ) sis_txeof(sc); if (status & (SIS_ISR_RX_DESC_OK | SIS_ISR_RX_OK | @@ -1713,7 +1705,7 @@ sis_encap(struct sis_softc *sc, struct m return (ENOBUFS); *m_head = m; } - + /* * Start packing the mbufs in this chain into * the fragment pointers. Stop when we run out @@ -1725,7 +1717,7 @@ sis_encap(struct sis_softc *sc, struct m if (m->m_len != 0) { if ((SIS_TX_LIST_CNT - (sc->sis_tx_cnt + cnt)) < 2) - return(ENOBUFS); + return (ENOBUFS); f = &sc->sis_tx_list[frag]; f->sis_ctl = SIS_CMDSTS_MORE | m->m_len; bus_dmamap_create(sc->sis_tag, 0, &f->sis_map); @@ -1743,7 +1735,7 @@ sis_encap(struct sis_softc *sc, struct m } if (m != NULL) - return(ENOBUFS); + return (ENOBUFS); sc->sis_tx_list[cur].sis_mbuf = *m_head; sc->sis_tx_list[cur].sis_ctl &= ~SIS_CMDSTS_MORE; @@ -1751,7 +1743,7 @@ sis_encap(struct sis_softc *sc, struct m sc->sis_tx_cnt += cnt; *txidx = frag; - return(0); + return (0); } /* @@ -1791,7 +1783,7 @@ sis_startl(struct ifnet *ifp) if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - while(sc->sis_tx_list[idx].sis_mbuf == NULL) { + while (sc->sis_tx_list[idx].sis_mbuf == NULL) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -1999,7 +1991,7 @@ sis_initl(struct sis_softc *sc) uint32_t reg; /* - * Short Cable Receive Errors (MP21.E) + * Short Cable Receive Errors (MP21.E) */ CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001); reg = CSR_READ_4(sc, NS_PHY_DSPCFG) & 0xfff; @@ -2067,7 +2059,7 @@ sis_ifmedia_upd(struct ifnet *ifp) mii_mediachg(mii); SIS_UNLOCK(sc); - return(0); + return (0); } /* @@ -2097,7 +2089,7 @@ sis_ioctl(struct ifnet *ifp, u_long comm struct mii_data *mii; int error = 0; - switch(command) { + switch (command) { case SIOCSIFFLAGS: SIS_LOCK(sc); if (ifp->if_flags & IFF_UP) { @@ -2130,14 +2122,14 @@ sis_ioctl(struct ifnet *ifp, u_long comm !(ifp->if_capenable & IFCAP_POLLING)) { error = ether_poll_register(sis_poll, ifp); if (error) - return(error); + return (error); SIS_LOCK(sc); /* Disable interrupts */ CSR_WRITE_4(sc, SIS_IER, 0); ifp->if_capenable |= IFCAP_POLLING; SIS_UNLOCK(sc); return (error); - + } if (!(ifr->ifr_reqcap & IFCAP_POLLING) && ifp->if_capenable & IFCAP_POLLING) { @@ -2156,7 +2148,7 @@ sis_ioctl(struct ifnet *ifp, u_long comm break; } - return(error); + return (error); } static void Modified: stable/7/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:13:12 2010 (r213609) +++ stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:13:42 2010 (r213610) @@ -252,7 +252,7 @@ SIS_TXCFG_FILL(64)|SIS_TXCFG_DRAIN(1536)) #define SIS_RXCFG_DRAIN_THRESH 0x0000003E /* 8-byte units */ -#define SIS_TXCFG_MPII03D 0x00040000 /* "Must be 1" */ +#define SIS_TXCFG_MPII03D 0x00040000 /* "Must be 1" */ #define SIS_RXCFG_DMABURST 0x00700000 #define SIS_RXCFG_RX_JABBER 0x08000000 #define SIS_RXCFG_RX_TXPKTS 0x10000000 From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:17:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63243106564A; Fri, 8 Oct 2010 20:17:18 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38CDA8FC1C; Fri, 8 Oct 2010 20:17: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 o98KHIeX012164; Fri, 8 Oct 2010 20:17:18 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KHIk1012162; Fri, 8 Oct 2010 20:17:18 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201010082017.o98KHIk1012162@svn.freebsd.org> From: Mark Murray Date: Fri, 8 Oct 2010 20:17: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: r213611 - head/usr.sbin/ypbind X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:17:18 -0000 Author: markm Date: Fri Oct 8 20:17:17 2010 New Revision: 213611 URL: http://svn.freebsd.org/changeset/base/213611 Log: Don't let the "available"/"not available" logs flap quite so badly. In the case of a multi-interfaced host, sub-second flapping can fill up the logs too quickly. This fixes that. Modified: head/usr.sbin/ypbind/ypbind.c Modified: head/usr.sbin/ypbind/ypbind.c ============================================================================== --- head/usr.sbin/ypbind/ypbind.c Fri Oct 8 20:13:42 2010 (r213610) +++ head/usr.sbin/ypbind/ypbind.c Fri Oct 8 20:17:17 2010 (r213611) @@ -116,6 +116,9 @@ int ypsetmode = YPSET_NO; int ypsecuremode = 0; int ppid; +#define NOT_RESPONDING_HYSTERESIS 10 +static int not_responding_count = 0; + /* * Special restricted mode variables: when in restricted mode, only the * specified restricted_domain will be bound, and only the servers listed @@ -654,9 +657,13 @@ broadcast(struct _dom_binding *ypdb) return; } - if (ypdb->dom_vers == -1 && (long)ypdb->dom_server_addr.sin_addr.s_addr) - syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" not responding", - inet_ntoa(ypdb->dom_server_addr.sin_addr), ypdb->dom_domain); + if (ypdb->dom_vers == -1 && (long)ypdb->dom_server_addr.sin_addr.s_addr) { + if (not_responding_count++ >= NOT_RESPONDING_HYSTERESIS) { + not_responding_count = NOT_RESPONDING_HYSTERESIS; + syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" not responding", + inet_ntoa(ypdb->dom_server_addr.sin_addr), ypdb->dom_domain); + } + } broad_domain = ypdb; flock(ypdb->dom_lockfd, LOCK_UN); @@ -886,9 +893,13 @@ rpc_received(char *dom, struct sockaddr_ } /* We've recovered from a crash: inform the world. */ - if (ypdb->dom_vers == -1 && ypdb->dom_server_addr.sin_addr.s_addr) - syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" OK", - inet_ntoa(raddrp->sin_addr), ypdb->dom_domain); + if (ypdb->dom_vers == -1 && ypdb->dom_server_addr.sin_addr.s_addr) { + if (not_responding_count >= NOT_RESPONDING_HYSTERESIS) { + not_responding_count = 0; + syslog(LOG_WARNING, "NIS server [%s] for domain \"%s\" OK", + inet_ntoa(raddrp->sin_addr), ypdb->dom_domain); + } + } bcopy(raddrp, &ypdb->dom_server_addr, sizeof ypdb->dom_server_addr); From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:18:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 427FA106564A; Fri, 8 Oct 2010 20:18:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3075B8FC0A; Fri, 8 Oct 2010 20:18: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 o98KIjRQ012268; Fri, 8 Oct 2010 20:18:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KIjCq012265; Fri, 8 Oct 2010 20:18:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082018.o98KIjCq012265@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213612 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:18:45 -0000 Author: yongari Date: Fri Oct 8 20:18:44 2010 New Revision: 213612 URL: http://svn.freebsd.org/changeset/base/213612 Log: MFC r212109,212124,212185: r212109: bus_dma(9) cleanup. o Enforce TX/RX descriptor ring alignment. NS data sheet says the controller needs 4 bytes alignment but use 16 to cover both SiS and NS controllers. I don't have SiS data sheet so I'm not sure what is alignment restriction of SiS controller but 16 would be enough because it's larger than the size of a TX/RX descriptor. Previously sis(4) ignored the alignment restriction. o Enforce RX buffer alignment, 4. Previously sis(4) ignored RX buffer alignment restriction. o Limit number of TX DMA segment to be used to 16. It seems controller has no restriction on number of DMA segments but using more than 16 looks resource waste. o Collapse long mbuf chains with m_collapse(9) instead of calling expensive m_defrag(9). o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove unnecessary callbacks. o Initial endianness support. o Prefer local alignment fixup code to m_devget(9). o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying these maps in fast TX/RX path. On non-x86 architectures, this is very expensive operation and there is no need to do that. o Add missing bus_dmamap_sync(9) in TX/RX path. o watchdog is now unarmed only when there are no pending frames on controller. Previously sis(4) blindly unarmed watchdog without checking the number of queued frames. o For efficiency, loaded DMA map is reused for error frames. o DMA map loading failure is now gracefully handled. Previously sis(4) ignored any DMA map loading errors. o Nuke unused macros which are not appropriate for endianness operation. o Stop embedding driver maintained structures into descriptor rings. Because TX/RX descriptor structures are shared between host and controller, frequent bus_dmamap_sync(9) operations are required in fast path. Embedding driver structures will increase the size of DMA map which in turn will slow down performance. r212124: Fix stupid error in r212109 which didn't swap DMA maps. This caused IOMMU panic on sparc64 under high TX load. r212185: Fix another bug introduced in r212109. We should unload DMA maps only after sending the last fragment of a frame so the mbuf pointer also should be stored in the last descriptor index. Modified: stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sis/if_sisreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:17:17 2010 (r213611) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:18:44 2010 (r213612) @@ -64,12 +64,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include #include +#include +#include +#include #include #include +#include #include #include @@ -127,13 +130,23 @@ static struct sis_type sis_devs[] = { }; static int sis_detach(device_t); +static __inline void sis_discard_rxbuf(struct sis_rxdesc *); +static int sis_dma_alloc(struct sis_softc *); +static void sis_dma_free(struct sis_softc *); +static int sis_dma_ring_alloc(struct sis_softc *, bus_size_t, bus_size_t, + bus_dma_tag_t *, uint8_t **, bus_dmamap_t *, bus_addr_t *, const char *); +static void sis_dmamap_cb(void *, bus_dma_segment_t *, int, int); +#ifndef __NO_STRICT_ALIGNMENT +static __inline void sis_fixup_rx(struct mbuf *); +#endif static void sis_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int sis_ifmedia_upd(struct ifnet *); static void sis_init(void *); static void sis_initl(struct sis_softc *); static void sis_intr(void *); static int sis_ioctl(struct ifnet *, u_long, caddr_t); -static int sis_newbuf(struct sis_softc *, struct sis_desc *, struct mbuf *); +static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); +static int sis_rxeof(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); @@ -164,33 +177,6 @@ static struct resource_spec sis_res_spec #define SIO_CLR(x) \ CSR_WRITE_4(sc, SIS_EECTL, CSR_READ_4(sc, SIS_EECTL) & ~x) -static void -sis_dma_map_desc_next(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct sis_desc *r; - - r = arg; - r->sis_next = segs->ds_addr; -} - -static void -sis_dma_map_desc_ptr(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct sis_desc *r; - - r = arg; - r->sis_ptr = segs->ds_addr; -} - -static void -sis_dma_map_ring(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - u_int32_t *p; - - p = arg; - *p = segs->ds_addr; -} - /* * Routine to reverse the bits in a word. Stolen almost * verbatim from /usr/games/fortune. @@ -1055,127 +1041,10 @@ sis_attach(device_t dev) break; } - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define SIS_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, SIS_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->sis_parent_tag); - if (error) - goto fail; - - /* - * Now allocate a tag for the DMA descriptor lists and a chunk - * of DMA-able memory based on the tag. Also obtain the physical - * addresses of the RX and TX ring, which we'll need later. - * All of our lists are allocated as a contiguous block - * of memory. - */ - error = bus_dma_tag_create(sc->sis_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - SIS_RX_LIST_SZ, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - 0, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ - &sc->sis_rx_tag); - if (error) - goto fail; - - error = bus_dmamem_alloc(sc->sis_rx_tag, - (void **)&sc->sis_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->sis_rx_dmamap); - - if (error) { - device_printf(dev, "no memory for rx list buffers!\n"); - bus_dma_tag_destroy(sc->sis_rx_tag); - sc->sis_rx_tag = NULL; - goto fail; - } - - error = bus_dmamap_load(sc->sis_rx_tag, - sc->sis_rx_dmamap, &(sc->sis_rx_list[0]), - sizeof(struct sis_desc), sis_dma_map_ring, - &sc->sis_rx_paddr, 0); - - if (error) { - device_printf(dev, "cannot get address of the rx ring!\n"); - bus_dmamem_free(sc->sis_rx_tag, - sc->sis_rx_list, sc->sis_rx_dmamap); - bus_dma_tag_destroy(sc->sis_rx_tag); - sc->sis_rx_tag = NULL; - goto fail; - } - - error = bus_dma_tag_create(sc->sis_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - SIS_TX_LIST_SZ, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - 0, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ - &sc->sis_tx_tag); - if (error) - goto fail; - - error = bus_dmamem_alloc(sc->sis_tx_tag, - (void **)&sc->sis_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->sis_tx_dmamap); - - if (error) { - device_printf(dev, "no memory for tx list buffers!\n"); - bus_dma_tag_destroy(sc->sis_tx_tag); - sc->sis_tx_tag = NULL; - goto fail; - } - - error = bus_dmamap_load(sc->sis_tx_tag, - sc->sis_tx_dmamap, &(sc->sis_tx_list[0]), - sizeof(struct sis_desc), sis_dma_map_ring, - &sc->sis_tx_paddr, 0); - - if (error) { - device_printf(dev, "cannot get address of the tx ring!\n"); - bus_dmamem_free(sc->sis_tx_tag, - sc->sis_tx_list, sc->sis_tx_dmamap); - bus_dma_tag_destroy(sc->sis_tx_tag); - sc->sis_tx_tag = NULL; - goto fail; - } - - error = bus_dma_tag_create(sc->sis_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MCLBYTES, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - 0, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ - &sc->sis_tag); - if (error) + /* Allocate DMA'able memory. */ + if ((error = sis_dma_alloc(sc)) != 0) goto fail; - /* - * Obtain the physical addresses of the RX and TX - * rings which we'll need later in the init routine. - */ - ifp = sc->sis_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -1277,30 +1146,206 @@ sis_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->sis_rx_tag) { - bus_dmamap_unload(sc->sis_rx_tag, - sc->sis_rx_dmamap); - bus_dmamem_free(sc->sis_rx_tag, - sc->sis_rx_list, sc->sis_rx_dmamap); - bus_dma_tag_destroy(sc->sis_rx_tag); + sis_dma_free(sc); + + mtx_destroy(&sc->sis_mtx); + + return (0); +} + +struct sis_dmamap_arg { + bus_addr_t sis_busaddr; +}; + +static void +sis_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct sis_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct sis_dmamap_arg *)arg; + ctx->sis_busaddr = segs[0].ds_addr; +} + +static int +sis_dma_ring_alloc(struct sis_softc *sc, bus_size_t alignment, + bus_size_t maxsize, bus_dma_tag_t *tag, uint8_t **ring, bus_dmamap_t *map, + bus_addr_t *paddr, const char *msg) +{ + struct sis_dmamap_arg ctx; + int error; + + error = bus_dma_tag_create(sc->sis_parent_tag, alignment, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, maxsize, 1, + maxsize, 0, NULL, NULL, tag); + if (error != 0) { + device_printf(sc->sis_dev, + "could not create %s dma tag\n", msg); + return (ENOMEM); } - if (sc->sis_tx_tag) { - bus_dmamap_unload(sc->sis_tx_tag, - sc->sis_tx_dmamap); - bus_dmamem_free(sc->sis_tx_tag, - sc->sis_tx_list, sc->sis_tx_dmamap); - bus_dma_tag_destroy(sc->sis_tx_tag); + /* Allocate DMA'able memory for ring. */ + error = bus_dmamem_alloc(*tag, (void **)ring, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, map); + if (error != 0) { + device_printf(sc->sis_dev, + "could not allocate DMA'able memory for %s\n", msg); + return (ENOMEM); } - if (sc->sis_parent_tag) - bus_dma_tag_destroy(sc->sis_parent_tag); - if (sc->sis_tag) - bus_dma_tag_destroy(sc->sis_tag); + /* Load the address of the ring. */ + ctx.sis_busaddr = 0; + error = bus_dmamap_load(*tag, *map, *ring, maxsize, sis_dmamap_cb, + &ctx, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->sis_dev, + "could not load DMA'able memory for %s\n", msg); + return (ENOMEM); + } + *paddr = ctx.sis_busaddr; + return (0); +} - mtx_destroy(&sc->sis_mtx); +static int +sis_dma_alloc(struct sis_softc *sc) +{ + struct sis_rxdesc *rxd; + struct sis_txdesc *txd; + int error, i; + + /* Allocate the parent bus DMA tag appropriate for PCI. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->sis_dev), + 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, + NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, + 0, NULL, NULL, &sc->sis_parent_tag); + if (error != 0) { + device_printf(sc->sis_dev, + "could not allocate parent dma tag\n"); + return (ENOMEM); + } + + /* Create RX ring. */ + error = sis_dma_ring_alloc(sc, SIS_DESC_ALIGN, SIS_RX_LIST_SZ, + &sc->sis_rx_list_tag, (uint8_t **)&sc->sis_rx_list, + &sc->sis_rx_list_map, &sc->sis_rx_paddr, "RX ring"); + if (error) + return (error); + + /* Create TX ring. */ + error = sis_dma_ring_alloc(sc, SIS_DESC_ALIGN, SIS_TX_LIST_SZ, + &sc->sis_tx_list_tag, (uint8_t **)&sc->sis_tx_list, + &sc->sis_tx_list_map, &sc->sis_tx_paddr, "TX ring"); + if (error) + return (error); + + /* Create tag for RX mbufs. */ + error = bus_dma_tag_create(sc->sis_parent_tag, SIS_RX_BUF_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, + MCLBYTES, 0, NULL, NULL, &sc->sis_rx_tag); + if (error) { + device_printf(sc->sis_dev, "could not allocate RX dma tag\n"); + return (error); + } + + /* Create tag for TX mbufs. */ + error = bus_dma_tag_create(sc->sis_parent_tag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + MCLBYTES * SIS_MAXTXSEGS, SIS_MAXTXSEGS, MCLBYTES, 0, NULL, NULL, + &sc->sis_tx_tag); + if (error) { + device_printf(sc->sis_dev, "could not allocate TX dma tag\n"); + return (error); + } + + /* Create DMA maps for RX buffers. */ + error = bus_dmamap_create(sc->sis_rx_tag, 0, &sc->sis_rx_sparemap); + if (error) { + device_printf(sc->sis_dev, + "can't create spare DMA map for RX\n"); + return (error); + } + for (i = 0; i < SIS_RX_LIST_CNT; i++) { + rxd = &sc->sis_rxdesc[i]; + rxd->rx_m = NULL; + error = bus_dmamap_create(sc->sis_rx_tag, 0, &rxd->rx_dmamap); + if (error) { + device_printf(sc->sis_dev, + "can't create DMA map for RX\n"); + return (error); + } + } + + /* Create DMA maps for TX buffers. */ + for (i = 0; i < SIS_TX_LIST_CNT; i++) { + txd = &sc->sis_txdesc[i]; + txd->tx_m = NULL; + error = bus_dmamap_create(sc->sis_tx_tag, 0, &txd->tx_dmamap); + if (error) { + device_printf(sc->sis_dev, + "can't create DMA map for TX\n"); + return (error); + } + } return (0); } +static void +sis_dma_free(struct sis_softc *sc) +{ + struct sis_rxdesc *rxd; + struct sis_txdesc *txd; + int i; + + /* Destroy DMA maps for RX buffers. */ + for (i = 0; i < SIS_RX_LIST_CNT; i++) { + rxd = &sc->sis_rxdesc[i]; + if (rxd->rx_dmamap) + bus_dmamap_destroy(sc->sis_rx_tag, rxd->rx_dmamap); + } + if (sc->sis_rx_sparemap) + bus_dmamap_destroy(sc->sis_rx_tag, sc->sis_rx_sparemap); + + /* Destroy DMA maps for TX buffers. */ + for (i = 0; i < SIS_TX_LIST_CNT; i++) { + txd = &sc->sis_txdesc[i]; + if (txd->tx_dmamap) + bus_dmamap_destroy(sc->sis_tx_tag, txd->tx_dmamap); + } + + if (sc->sis_rx_tag) + bus_dma_tag_destroy(sc->sis_rx_tag); + if (sc->sis_tx_tag) + bus_dma_tag_destroy(sc->sis_tx_tag); + + /* Destroy RX ring. */ + if (sc->sis_rx_list_map) + bus_dmamap_unload(sc->sis_rx_list_tag, sc->sis_rx_list_map); + if (sc->sis_rx_list_map && sc->sis_rx_list) + bus_dmamem_free(sc->sis_rx_list_tag, sc->sis_rx_list, + sc->sis_rx_list_map); + + if (sc->sis_rx_list_tag) + bus_dma_tag_destroy(sc->sis_rx_list_tag); + + /* Destroy TX ring. */ + if (sc->sis_tx_list_map) + bus_dmamap_unload(sc->sis_tx_list_tag, sc->sis_tx_list_map); + + if (sc->sis_tx_list_map && sc->sis_tx_list) + bus_dmamem_free(sc->sis_tx_list_tag, sc->sis_tx_list, + sc->sis_tx_list_map); + + if (sc->sis_tx_list_tag) + bus_dma_tag_destroy(sc->sis_tx_list_tag); + + /* Destroy the parent tag. */ + if (sc->sis_parent_tag) + bus_dma_tag_destroy(sc->sis_parent_tag); +} + /* * Initialize the TX and RX descriptors and allocate mbufs for them. Note that * we arrange the descriptors in a closed ring, so that the last descriptor @@ -1309,48 +1354,41 @@ sis_detach(device_t dev) static int sis_ring_init(struct sis_softc *sc) { - int i, error; - struct sis_desc *dp; - - dp = &sc->sis_tx_list[0]; - for (i = 0; i < SIS_TX_LIST_CNT; i++, dp++) { - if (i == (SIS_TX_LIST_CNT - 1)) - dp->sis_nextdesc = &sc->sis_tx_list[0]; + struct sis_rxdesc *rxd; + struct sis_txdesc *txd; + bus_addr_t next; + int error, i; + + bzero(&sc->sis_tx_list[0], SIS_TX_LIST_SZ); + for (i = 0; i < SIS_TX_LIST_CNT; i++) { + txd = &sc->sis_txdesc[i]; + txd->tx_m = NULL; + if (i == SIS_TX_LIST_CNT - 1) + next = SIS_TX_RING_ADDR(sc, 0); else - dp->sis_nextdesc = dp + 1; - bus_dmamap_load(sc->sis_tx_tag, - sc->sis_tx_dmamap, - dp->sis_nextdesc, sizeof(struct sis_desc), - sis_dma_map_desc_next, dp, 0); - dp->sis_mbuf = NULL; - dp->sis_ptr = 0; - dp->sis_ctl = 0; + next = SIS_TX_RING_ADDR(sc, i + 1); + sc->sis_tx_list[i].sis_next = htole32(SIS_ADDR_LO(next)); } - sc->sis_tx_prod = sc->sis_tx_cons = sc->sis_tx_cnt = 0; + bus_dmamap_sync(sc->sis_tx_list_tag, sc->sis_tx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(sc->sis_tx_tag, - sc->sis_tx_dmamap, BUS_DMASYNC_PREWRITE); - - dp = &sc->sis_rx_list[0]; - for (i = 0; i < SIS_RX_LIST_CNT; i++, dp++) { - error = sis_newbuf(sc, dp, NULL); + sc->sis_rx_cons = 0; + bzero(&sc->sis_rx_list[0], SIS_RX_LIST_SZ); + for (i = 0; i < SIS_RX_LIST_CNT; i++) { + rxd = &sc->sis_rxdesc[i]; + rxd->rx_desc = &sc->sis_rx_list[i]; + if (i == SIS_RX_LIST_CNT - 1) + next = SIS_RX_RING_ADDR(sc, 0); + else + next = SIS_RX_RING_ADDR(sc, i + 1); + rxd->rx_desc->sis_next = htole32(SIS_ADDR_LO(next)); + error = sis_newbuf(sc, rxd); if (error) return (error); - if (i == (SIS_RX_LIST_CNT - 1)) - dp->sis_nextdesc = &sc->sis_rx_list[0]; - else - dp->sis_nextdesc = dp + 1; - bus_dmamap_load(sc->sis_rx_tag, - sc->sis_rx_dmamap, - dp->sis_nextdesc, sizeof(struct sis_desc), - sis_dma_map_desc_next, dp, 0); - } - - bus_dmamap_sync(sc->sis_rx_tag, - sc->sis_rx_dmamap, BUS_DMASYNC_PREWRITE); - - sc->sis_rx_pdsc = &sc->sis_rx_list[0]; + } + bus_dmamap_sync(sc->sis_rx_list_tag, sc->sis_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } @@ -1359,30 +1397,66 @@ sis_ring_init(struct sis_softc *sc) * Initialize an RX descriptor and attach an MBUF cluster. */ static int -sis_newbuf(struct sis_softc *sc, struct sis_desc *c, struct mbuf *m) +sis_newbuf(struct sis_softc *sc, struct sis_rxdesc *rxd) { + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int nsegs; - if (c == NULL) - return (EINVAL); + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = SIS_RXLEN; +#ifndef __NO_STRICT_ALIGNMENT + m_adj(m, SIS_RX_BUF_ALIGN); +#endif - if (m == NULL) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (m == NULL) - return (ENOBUFS); - } else - m->m_data = m->m_ext.ext_buf; + if (bus_dmamap_load_mbuf_sg(sc->sis_rx_tag, sc->sis_rx_sparemap, m, + segs, &nsegs, 0) != 0) { + m_freem(m); + return (ENOBUFS); + } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - c->sis_mbuf = m; - c->sis_ctl = SIS_RXLEN; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->sis_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->sis_rx_tag, rxd->rx_dmamap); + } + map = rxd->rx_dmamap; + rxd->rx_dmamap = sc->sis_rx_sparemap; + sc->sis_rx_sparemap = map; + bus_dmamap_sync(sc->sis_rx_tag, rxd->rx_dmamap, BUS_DMASYNC_PREREAD); + rxd->rx_m = m; + rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); + rxd->rx_desc->sis_ptr = htole32(SIS_ADDR_LO(segs[0].ds_addr)); + return (0); +} - bus_dmamap_create(sc->sis_tag, 0, &c->sis_map); - bus_dmamap_load(sc->sis_tag, c->sis_map, - mtod(m, void *), MCLBYTES, - sis_dma_map_desc_ptr, c, 0); - bus_dmamap_sync(sc->sis_tag, c->sis_map, BUS_DMASYNC_PREREAD); +static __inline void +sis_discard_rxbuf(struct sis_rxdesc *rxd) +{ - return (0); + rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); +} + +#ifndef __NO_STRICT_ALIGNMENT +static __inline void +sis_fixup_rx(struct mbuf *m) +{ + uint16_t *src, *dst; + int i; + + src = mtod(m, uint16_t *); + dst = src - (SIS_RX_BUF_ALIGN - ETHER_ALIGN) / sizeof(*src); + + for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++) + *dst++ = *src++; + + m->m_data -= SIS_RX_BUF_ALIGN - ETHER_ALIGN; } +#endif /* * A frame has been uploaded: pass the resulting mbuf chain up to @@ -1391,19 +1465,23 @@ sis_newbuf(struct sis_softc *sc, struct static int sis_rxeof(struct sis_softc *sc) { - struct mbuf *m, *m0; + struct mbuf *m; struct ifnet *ifp; + struct sis_rxdesc *rxd; struct sis_desc *cur_rx; - int total_len = 0, rx_npkts = 0; - u_int32_t rxstat; + int prog, rx_cons, rx_npkts = 0, total_len; + uint32_t rxstat; SIS_LOCK_ASSERT(sc); - ifp = sc->sis_ifp; + bus_dmamap_sync(sc->sis_rx_list_tag, sc->sis_rx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - for (cur_rx = sc->sis_rx_pdsc; SIS_OWNDESC(cur_rx); - cur_rx = cur_rx->sis_nextdesc) { + rx_cons = sc->sis_rx_cons; + ifp = sc->sis_ifp; + for (prog = 0; (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; + SIS_INC(rx_cons, SIS_RX_LIST_CNT), prog++) { #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { if (sc->rxcycles <= 0) @@ -1411,21 +1489,13 @@ sis_rxeof(struct sis_softc *sc) sc->rxcycles--; } #endif - rxstat = cur_rx->sis_rxstat; - bus_dmamap_sync(sc->sis_tag, - cur_rx->sis_map, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->sis_tag, cur_rx->sis_map); - bus_dmamap_destroy(sc->sis_tag, cur_rx->sis_map); - m = cur_rx->sis_mbuf; - cur_rx->sis_mbuf = NULL; - total_len = SIS_RXBYTES(cur_rx); + cur_rx = &sc->sis_rx_list[rx_cons]; + rxstat = le32toh(cur_rx->sis_cmdsts); + if ((rxstat & SIS_CMDSTS_OWN) == 0) + break; + rxd = &sc->sis_rxdesc[rx_cons]; - /* - * If an error occurs, update stats, clear the - * status word and leave the mbuf cluster in place: - * it should simply get re-used next time this descriptor - * comes up in the ring. - */ + total_len = (rxstat & SIS_CMDSTS_BUFLEN) - ETHER_CRC_LEN; if ((ifp->if_capenable & IFCAP_VLAN_MTU) != 0 && total_len <= (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - ETHER_CRC_LEN)) @@ -1434,36 +1504,29 @@ sis_rxeof(struct sis_softc *sc) ifp->if_ierrors++; if (rxstat & SIS_RXSTAT_COLL) ifp->if_collisions++; - sis_newbuf(sc, cur_rx, m); + sis_discard_rxbuf(rxd); + continue; + } + + /* Add a new receive buffer to the ring. */ + m = rxd->rx_m; + if (sis_newbuf(sc, rxd) != 0) { + ifp->if_iqdrops++; + sis_discard_rxbuf(rxd); continue; } /* No errors; receive the packet. */ -#ifdef __NO_STRICT_ALIGNMENT + m->m_pkthdr.len = m->m_len = total_len; +#ifndef __NO_STRICT_ALIGNMENT /* * On architectures without alignment problems we try to * allocate a new buffer for the receive ring, and pass up * the one where the packet is already, saving the expensive - * copy done in m_devget(). - * If we are on an architecture with alignment problems, or - * if the allocation fails, then use m_devget and leave the - * existing buffer in the receive ring. + * copy operation. */ - if (sis_newbuf(sc, cur_rx, NULL) == 0) - m->m_pkthdr.len = m->m_len = total_len; - else + sis_fixup_rx(m); #endif - { - m0 = m_devget(mtod(m, char *), total_len, - ETHER_ALIGN, ifp, NULL); - sis_newbuf(sc, cur_rx, m); - if (m0 == NULL) { - ifp->if_ierrors++; - continue; - } - m = m0; - } - ifp->if_ipackets++; m->m_pkthdr.rcvif = ifp; @@ -1473,7 +1536,12 @@ sis_rxeof(struct sis_softc *sc) rx_npkts++; } - sc->sis_rx_pdsc = cur_rx; + if (prog > 0) { + sc->sis_rx_cons = rx_cons; + bus_dmamap_sync(sc->sis_rx_list_tag, sc->sis_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } + return (rx_npkts); } @@ -1486,52 +1554,54 @@ static void sis_txeof(struct sis_softc *sc) { struct ifnet *ifp; - u_int32_t idx; + struct sis_desc *cur_tx; + struct sis_txdesc *txd; + uint32_t cons, txstat; SIS_LOCK_ASSERT(sc); + + cons = sc->sis_tx_cons; + if (cons == sc->sis_tx_prod) + return; + ifp = sc->sis_ifp; + bus_dmamap_sync(sc->sis_tx_list_tag, sc->sis_tx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* * Go through our tx list and free mbufs for those * frames that have been transmitted. */ - for (idx = sc->sis_tx_cons; sc->sis_tx_cnt > 0; - sc->sis_tx_cnt--, SIS_INC(idx, SIS_TX_LIST_CNT) ) { - struct sis_desc *cur_tx = &sc->sis_tx_list[idx]; - - if (SIS_OWNDESC(cur_tx)) + for (; cons != sc->sis_tx_prod; SIS_INC(cons, SIS_TX_LIST_CNT)) { + cur_tx = &sc->sis_tx_list[cons]; + txstat = le32toh(cur_tx->sis_cmdsts); + if ((txstat & SIS_CMDSTS_OWN) != 0) break; - - if (cur_tx->sis_ctl & SIS_CMDSTS_MORE) - continue; - - if (!(cur_tx->sis_ctl & SIS_CMDSTS_PKT_OK)) { - ifp->if_oerrors++; - if (cur_tx->sis_txstat & SIS_TXSTAT_EXCESSCOLLS) - ifp->if_collisions++; - if (cur_tx->sis_txstat & SIS_TXSTAT_OUTOFWINCOLL) - ifp->if_collisions++; - } - - ifp->if_collisions += - (cur_tx->sis_txstat & SIS_TXSTAT_COLLCNT) >> 16; - - ifp->if_opackets++; - if (cur_tx->sis_mbuf != NULL) { - m_freem(cur_tx->sis_mbuf); - cur_tx->sis_mbuf = NULL; - bus_dmamap_unload(sc->sis_tag, cur_tx->sis_map); - bus_dmamap_destroy(sc->sis_tag, cur_tx->sis_map); + txd = &sc->sis_txdesc[cons]; + if (txd->tx_m != NULL) { + bus_dmamap_sync(sc->sis_tx_tag, txd->tx_dmamap, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->sis_tx_tag, txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + if ((txstat & SIS_CMDSTS_PKT_OK) != 0) { + ifp->if_opackets++; + ifp->if_collisions += + (txstat & SIS_TXSTAT_COLLCNT) >> 16; + } else { + ifp->if_oerrors++; + if (txstat & SIS_TXSTAT_EXCESSCOLLS) + ifp->if_collisions++; + if (txstat & SIS_TXSTAT_OUTOFWINCOLL) + ifp->if_collisions++; + } } - } - - if (idx != sc->sis_tx_cons) { - /* we freed up some buffers */ - sc->sis_tx_cons = idx; + sc->sis_tx_cnt--; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - - sc->sis_watchdog_timer = (sc->sis_tx_cnt == 0) ? 0 : 5; + sc->sis_tx_cons = cons; + if (sc->sis_tx_cnt == 0) + sc->sis_watchdog_timer = 0; } static void @@ -1680,83 +1750,80 @@ sis_intr(void *arg) * pointers to the fragment pointers. */ static int -sis_encap(struct sis_softc *sc, struct mbuf **m_head, uint32_t *txidx) +sis_encap(struct sis_softc *sc, struct mbuf **m_head) { - struct sis_desc *f = NULL; struct mbuf *m; - int frag, cur, cnt = 0, chainlen = 0; - - /* - * If there's no way we can send any packets, return now. - */ - if (SIS_TX_LIST_CNT - sc->sis_tx_cnt < 2) - return (ENOBUFS); - - /* - * Count the number of frags in this chain to see if - * we need to m_defrag. Since the descriptor list is shared - * by all packets, we'll m_defrag long chains so that they - * do not use up the entire list, even if they would fit. - */ - - for (m = *m_head; m != NULL; m = m->m_next) - chainlen++; - - if ((chainlen > SIS_TX_LIST_CNT / 4) || - ((SIS_TX_LIST_CNT - (chainlen + sc->sis_tx_cnt)) < 2)) { - m = m_defrag(*m_head, M_DONTWAIT); - if (m == NULL) + struct sis_txdesc *txd; + struct sis_desc *f; + bus_dma_segment_t segs[SIS_MAXTXSEGS]; + bus_dmamap_t map; + int error, i, frag, nsegs, prod; + + prod = sc->sis_tx_prod; + txd = &sc->sis_txdesc[prod]; + error = bus_dmamap_load_mbuf_sg(sc->sis_tx_tag, txd->tx_dmamap, + *m_head, segs, &nsegs, 0); + if (error == EFBIG) { + m = m_collapse(*m_head, M_DONTWAIT, SIS_MAXTXSEGS); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; return (ENOBUFS); + } *m_head = m; - } - - /* - * Start packing the mbufs in this chain into - * the fragment pointers. Stop when we run out - * of fragments or hit the end of the mbuf chain. - */ - cur = frag = *txidx; - - for (m = *m_head; m != NULL; m = m->m_next) { - if (m->m_len != 0) { - if ((SIS_TX_LIST_CNT - - (sc->sis_tx_cnt + cnt)) < 2) - return (ENOBUFS); - f = &sc->sis_tx_list[frag]; - f->sis_ctl = SIS_CMDSTS_MORE | m->m_len; - bus_dmamap_create(sc->sis_tag, 0, &f->sis_map); - bus_dmamap_load(sc->sis_tag, f->sis_map, - mtod(m, void *), m->m_len, - sis_dma_map_desc_ptr, f, 0); - bus_dmamap_sync(sc->sis_tag, - f->sis_map, BUS_DMASYNC_PREREAD); - if (cnt != 0) - f->sis_ctl |= SIS_CMDSTS_OWN; - cur = frag; - SIS_INC(frag, SIS_TX_LIST_CNT); - cnt++; + error = bus_dmamap_load_mbuf_sg(sc->sis_tx_tag, txd->tx_dmamap, + *m_head, segs, &nsegs, 0); + if (error != 0) { + m_freem(*m_head); + *m_head = NULL; + return (error); } - } + } else if (error != 0) + return (error); - if (m != NULL) + /* Check for descriptor overruns. */ + if (sc->sis_tx_cnt + nsegs > SIS_TX_LIST_CNT - 1) { + bus_dmamap_unload(sc->sis_tx_tag, txd->tx_dmamap); return (ENOBUFS); + } - sc->sis_tx_list[cur].sis_mbuf = *m_head; - sc->sis_tx_list[cur].sis_ctl &= ~SIS_CMDSTS_MORE; - sc->sis_tx_list[*txidx].sis_ctl |= SIS_CMDSTS_OWN; - sc->sis_tx_cnt += cnt; - *txidx = frag; + bus_dmamap_sync(sc->sis_tx_tag, txd->tx_dmamap, BUS_DMASYNC_PREWRITE); + + frag = prod; + for (i = 0; i < nsegs; i++) { + f = &sc->sis_tx_list[prod]; + if (i == 0) + f->sis_cmdsts = htole32(segs[i].ds_len | + SIS_CMDSTS_MORE); + else + f->sis_cmdsts = htole32(segs[i].ds_len | + SIS_CMDSTS_OWN | SIS_CMDSTS_MORE); + f->sis_ptr = htole32(SIS_ADDR_LO(segs[i].ds_addr)); + SIS_INC(prod, SIS_TX_LIST_CNT); + sc->sis_tx_cnt++; + } + + /* Update producer index. */ + sc->sis_tx_prod = prod; + + /* Remove MORE flag on the last descriptor. */ + prod = (prod - 1) & (SIS_TX_LIST_CNT - 1); + f = &sc->sis_tx_list[prod]; + f->sis_cmdsts &= ~htole32(SIS_CMDSTS_MORE); + + /* Lastly transfer ownership of packet to the controller. */ + f = &sc->sis_tx_list[frag]; + f->sis_cmdsts |= htole32(SIS_CMDSTS_OWN); + + /* Swap the last and the first dmamaps. */ + map = txd->tx_dmamap; + txd->tx_dmamap = sc->sis_txdesc[prod].tx_dmamap; + sc->sis_txdesc[prod].tx_dmamap = map; + sc->sis_txdesc[prod].tx_m = *m_head; return (0); } -/* - * Main transmit routine. To avoid having to do mbuf copies, we put pointers - * to the mbuf data regions directly in the transmit lists. We also save a - * copy of the pointers since the transmit list fragment pointers are - * physical addresses. - */ - static void sis_start(struct ifnet *ifp) { @@ -1772,27 +1839,26 @@ static void sis_startl(struct ifnet *ifp) { struct sis_softc *sc; - struct mbuf *m_head = NULL; - u_int32_t idx, queued = 0; + struct mbuf *m_head; + int queued; sc = ifp->if_softc; SIS_LOCK_ASSERT(sc); - if (!sc->sis_link) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || sc->sis_link == 0) return; - idx = sc->sis_tx_prod; - - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) - return; - - while (sc->sis_tx_list[idx].sis_mbuf == NULL) { + for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && + sc->sis_tx_cnt < SIS_TX_LIST_CNT - 4;) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; - if (sis_encap(sc, &m_head, &idx)) { + if (sis_encap(sc, &m_head) != 0) { + if (m_head == NULL) + break; IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; @@ -1805,12 +1871,12 @@ sis_startl(struct ifnet *ifp) * to him. */ BPF_MTAP(ifp, m_head); - } if (queued) { /* Transmit */ - sc->sis_tx_prod = idx; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:27:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC2A6106566B; Fri, 8 Oct 2010 20:27: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 9A2C08FC0C; Fri, 8 Oct 2010 20:27: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 o98KRpS7012590; Fri, 8 Oct 2010 20:27:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KRp2u012587; Fri, 8 Oct 2010 20:27:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082027.o98KRp2u012587@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213613 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:27:51 -0000 Author: yongari Date: Fri Oct 8 20:27:51 2010 New Revision: 213613 URL: http://svn.freebsd.org/changeset/base/213613 Log: MFC r212109,212124,212185: r212109: bus_dma(9) cleanup. o Enforce TX/RX descriptor ring alignment. NS data sheet says the controller needs 4 bytes alignment but use 16 to cover both SiS and NS controllers. I don't have SiS data sheet so I'm not sure what is alignment restriction of SiS controller but 16 would be enough because it's larger than the size of a TX/RX descriptor. Previously sis(4) ignored the alignment restriction. o Enforce RX buffer alignment, 4. Previously sis(4) ignored RX buffer alignment restriction. o Limit number of TX DMA segment to be used to 16. It seems controller has no restriction on number of DMA segments but using more than 16 looks resource waste. o Collapse long mbuf chains with m_collapse(9) instead of calling expensive m_defrag(9). o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove unnecessary callbacks. o Initial endianness support. o Prefer local alignment fixup code to m_devget(9). o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying these maps in fast TX/RX path. On non-x86 architectures, this is very expensive operation and there is no need to do that. o Add missing bus_dmamap_sync(9) in TX/RX path. o watchdog is now unarmed only when there are no pending frames on controller. Previously sis(4) blindly unarmed watchdog without checking the number of queued frames. o For efficiency, loaded DMA map is reused for error frames. o DMA map loading failure is now gracefully handled. Previously sis(4) ignored any DMA map loading errors. o Nuke unused macros which are not appropriate for endianness operation. o Stop embedding driver maintained structures into descriptor rings. Because TX/RX descriptor structures are shared between host and controller, frequent bus_dmamap_sync(9) operations are required in fast path. Embedding driver structures will increase the size of DMA map which in turn will slow down performance. r212124: Fix stupid error in r212109 which didn't swap DMA maps. This caused IOMMU panic on sparc64 under high TX load. r212185: Fix another bug introduced in r212109. We should unload DMA maps only after sending the last fragment of a frame so the mbuf pointer also should be stored in the last descriptor index. Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:18:44 2010 (r213612) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:27:51 2010 (r213613) @@ -64,12 +64,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include #include +#include +#include +#include #include #include +#include #include #include @@ -127,13 +130,23 @@ static struct sis_type sis_devs[] = { }; static int sis_detach(device_t); +static __inline void sis_discard_rxbuf(struct sis_rxdesc *); +static int sis_dma_alloc(struct sis_softc *); +static void sis_dma_free(struct sis_softc *); +static int sis_dma_ring_alloc(struct sis_softc *, bus_size_t, bus_size_t, + bus_dma_tag_t *, uint8_t **, bus_dmamap_t *, bus_addr_t *, const char *); +static void sis_dmamap_cb(void *, bus_dma_segment_t *, int, int); +#ifndef __NO_STRICT_ALIGNMENT +static __inline void sis_fixup_rx(struct mbuf *); +#endif static void sis_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int sis_ifmedia_upd(struct ifnet *); static void sis_init(void *); static void sis_initl(struct sis_softc *); static void sis_intr(void *); static int sis_ioctl(struct ifnet *, u_long, caddr_t); -static int sis_newbuf(struct sis_softc *, struct sis_desc *, struct mbuf *); +static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); +static void sis_rxeof(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); @@ -164,33 +177,6 @@ static struct resource_spec sis_res_spec #define SIO_CLR(x) \ CSR_WRITE_4(sc, SIS_EECTL, CSR_READ_4(sc, SIS_EECTL) & ~x) -static void -sis_dma_map_desc_next(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct sis_desc *r; - - r = arg; - r->sis_next = segs->ds_addr; -} - -static void -sis_dma_map_desc_ptr(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct sis_desc *r; - - r = arg; - r->sis_ptr = segs->ds_addr; -} - -static void -sis_dma_map_ring(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - u_int32_t *p; - - p = arg; - *p = segs->ds_addr; -} - /* * Routine to reverse the bits in a word. Stolen almost * verbatim from /usr/games/fortune. @@ -1055,127 +1041,10 @@ sis_attach(device_t dev) break; } - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define SIS_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, SIS_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->sis_parent_tag); - if (error) - goto fail; - - /* - * Now allocate a tag for the DMA descriptor lists and a chunk - * of DMA-able memory based on the tag. Also obtain the physical - * addresses of the RX and TX ring, which we'll need later. - * All of our lists are allocated as a contiguous block - * of memory. - */ - error = bus_dma_tag_create(sc->sis_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - SIS_RX_LIST_SZ, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - 0, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ - &sc->sis_rx_tag); - if (error) - goto fail; - - error = bus_dmamem_alloc(sc->sis_rx_tag, - (void **)&sc->sis_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->sis_rx_dmamap); - - if (error) { - device_printf(dev, "no memory for rx list buffers!\n"); - bus_dma_tag_destroy(sc->sis_rx_tag); - sc->sis_rx_tag = NULL; - goto fail; - } - - error = bus_dmamap_load(sc->sis_rx_tag, - sc->sis_rx_dmamap, &(sc->sis_rx_list[0]), - sizeof(struct sis_desc), sis_dma_map_ring, - &sc->sis_rx_paddr, 0); - - if (error) { - device_printf(dev, "cannot get address of the rx ring!\n"); - bus_dmamem_free(sc->sis_rx_tag, - sc->sis_rx_list, sc->sis_rx_dmamap); - bus_dma_tag_destroy(sc->sis_rx_tag); - sc->sis_rx_tag = NULL; - goto fail; - } - - error = bus_dma_tag_create(sc->sis_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - SIS_TX_LIST_SZ, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - 0, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ - &sc->sis_tx_tag); - if (error) - goto fail; - - error = bus_dmamem_alloc(sc->sis_tx_tag, - (void **)&sc->sis_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->sis_tx_dmamap); - - if (error) { - device_printf(dev, "no memory for tx list buffers!\n"); - bus_dma_tag_destroy(sc->sis_tx_tag); - sc->sis_tx_tag = NULL; - goto fail; - } - - error = bus_dmamap_load(sc->sis_tx_tag, - sc->sis_tx_dmamap, &(sc->sis_tx_list[0]), - sizeof(struct sis_desc), sis_dma_map_ring, - &sc->sis_tx_paddr, 0); - - if (error) { - device_printf(dev, "cannot get address of the tx ring!\n"); - bus_dmamem_free(sc->sis_tx_tag, - sc->sis_tx_list, sc->sis_tx_dmamap); - bus_dma_tag_destroy(sc->sis_tx_tag); - sc->sis_tx_tag = NULL; - goto fail; - } - - error = bus_dma_tag_create(sc->sis_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MCLBYTES, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - 0, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ - &sc->sis_tag); - if (error) + /* Allocate DMA'able memory. */ + if ((error = sis_dma_alloc(sc)) != 0) goto fail; - /* - * Obtain the physical addresses of the RX and TX - * rings which we'll need later in the init routine. - */ - ifp = sc->sis_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -1277,30 +1146,206 @@ sis_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->sis_rx_tag) { - bus_dmamap_unload(sc->sis_rx_tag, - sc->sis_rx_dmamap); - bus_dmamem_free(sc->sis_rx_tag, - sc->sis_rx_list, sc->sis_rx_dmamap); - bus_dma_tag_destroy(sc->sis_rx_tag); + sis_dma_free(sc); + + mtx_destroy(&sc->sis_mtx); + + return (0); +} + +struct sis_dmamap_arg { + bus_addr_t sis_busaddr; +}; + +static void +sis_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct sis_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct sis_dmamap_arg *)arg; + ctx->sis_busaddr = segs[0].ds_addr; +} + +static int +sis_dma_ring_alloc(struct sis_softc *sc, bus_size_t alignment, + bus_size_t maxsize, bus_dma_tag_t *tag, uint8_t **ring, bus_dmamap_t *map, + bus_addr_t *paddr, const char *msg) +{ + struct sis_dmamap_arg ctx; + int error; + + error = bus_dma_tag_create(sc->sis_parent_tag, alignment, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, maxsize, 1, + maxsize, 0, NULL, NULL, tag); + if (error != 0) { + device_printf(sc->sis_dev, + "could not create %s dma tag\n", msg); + return (ENOMEM); } - if (sc->sis_tx_tag) { - bus_dmamap_unload(sc->sis_tx_tag, - sc->sis_tx_dmamap); - bus_dmamem_free(sc->sis_tx_tag, - sc->sis_tx_list, sc->sis_tx_dmamap); - bus_dma_tag_destroy(sc->sis_tx_tag); + /* Allocate DMA'able memory for ring. */ + error = bus_dmamem_alloc(*tag, (void **)ring, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, map); + if (error != 0) { + device_printf(sc->sis_dev, + "could not allocate DMA'able memory for %s\n", msg); + return (ENOMEM); } - if (sc->sis_parent_tag) - bus_dma_tag_destroy(sc->sis_parent_tag); - if (sc->sis_tag) - bus_dma_tag_destroy(sc->sis_tag); + /* Load the address of the ring. */ + ctx.sis_busaddr = 0; + error = bus_dmamap_load(*tag, *map, *ring, maxsize, sis_dmamap_cb, + &ctx, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->sis_dev, + "could not load DMA'able memory for %s\n", msg); + return (ENOMEM); + } + *paddr = ctx.sis_busaddr; + return (0); +} - mtx_destroy(&sc->sis_mtx); +static int +sis_dma_alloc(struct sis_softc *sc) +{ + struct sis_rxdesc *rxd; + struct sis_txdesc *txd; + int error, i; + + /* Allocate the parent bus DMA tag appropriate for PCI. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->sis_dev), + 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, + NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, + 0, NULL, NULL, &sc->sis_parent_tag); + if (error != 0) { + device_printf(sc->sis_dev, + "could not allocate parent dma tag\n"); + return (ENOMEM); + } + + /* Create RX ring. */ + error = sis_dma_ring_alloc(sc, SIS_DESC_ALIGN, SIS_RX_LIST_SZ, + &sc->sis_rx_list_tag, (uint8_t **)&sc->sis_rx_list, + &sc->sis_rx_list_map, &sc->sis_rx_paddr, "RX ring"); + if (error) + return (error); + + /* Create TX ring. */ + error = sis_dma_ring_alloc(sc, SIS_DESC_ALIGN, SIS_TX_LIST_SZ, + &sc->sis_tx_list_tag, (uint8_t **)&sc->sis_tx_list, + &sc->sis_tx_list_map, &sc->sis_tx_paddr, "TX ring"); + if (error) + return (error); + + /* Create tag for RX mbufs. */ + error = bus_dma_tag_create(sc->sis_parent_tag, SIS_RX_BUF_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, + MCLBYTES, 0, NULL, NULL, &sc->sis_rx_tag); + if (error) { + device_printf(sc->sis_dev, "could not allocate RX dma tag\n"); + return (error); + } + + /* Create tag for TX mbufs. */ + error = bus_dma_tag_create(sc->sis_parent_tag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + MCLBYTES * SIS_MAXTXSEGS, SIS_MAXTXSEGS, MCLBYTES, 0, NULL, NULL, + &sc->sis_tx_tag); + if (error) { + device_printf(sc->sis_dev, "could not allocate TX dma tag\n"); + return (error); + } + + /* Create DMA maps for RX buffers. */ + error = bus_dmamap_create(sc->sis_rx_tag, 0, &sc->sis_rx_sparemap); + if (error) { + device_printf(sc->sis_dev, + "can't create spare DMA map for RX\n"); + return (error); + } + for (i = 0; i < SIS_RX_LIST_CNT; i++) { + rxd = &sc->sis_rxdesc[i]; + rxd->rx_m = NULL; + error = bus_dmamap_create(sc->sis_rx_tag, 0, &rxd->rx_dmamap); + if (error) { + device_printf(sc->sis_dev, + "can't create DMA map for RX\n"); + return (error); + } + } + + /* Create DMA maps for TX buffers. */ + for (i = 0; i < SIS_TX_LIST_CNT; i++) { + txd = &sc->sis_txdesc[i]; + txd->tx_m = NULL; + error = bus_dmamap_create(sc->sis_tx_tag, 0, &txd->tx_dmamap); + if (error) { + device_printf(sc->sis_dev, + "can't create DMA map for TX\n"); + return (error); + } + } return (0); } +static void +sis_dma_free(struct sis_softc *sc) +{ + struct sis_rxdesc *rxd; + struct sis_txdesc *txd; + int i; + + /* Destroy DMA maps for RX buffers. */ + for (i = 0; i < SIS_RX_LIST_CNT; i++) { + rxd = &sc->sis_rxdesc[i]; + if (rxd->rx_dmamap) + bus_dmamap_destroy(sc->sis_rx_tag, rxd->rx_dmamap); + } + if (sc->sis_rx_sparemap) + bus_dmamap_destroy(sc->sis_rx_tag, sc->sis_rx_sparemap); + + /* Destroy DMA maps for TX buffers. */ + for (i = 0; i < SIS_TX_LIST_CNT; i++) { + txd = &sc->sis_txdesc[i]; + if (txd->tx_dmamap) + bus_dmamap_destroy(sc->sis_tx_tag, txd->tx_dmamap); + } + + if (sc->sis_rx_tag) + bus_dma_tag_destroy(sc->sis_rx_tag); + if (sc->sis_tx_tag) + bus_dma_tag_destroy(sc->sis_tx_tag); + + /* Destroy RX ring. */ + if (sc->sis_rx_list_map) + bus_dmamap_unload(sc->sis_rx_list_tag, sc->sis_rx_list_map); + if (sc->sis_rx_list_map && sc->sis_rx_list) + bus_dmamem_free(sc->sis_rx_list_tag, sc->sis_rx_list, + sc->sis_rx_list_map); + + if (sc->sis_rx_list_tag) + bus_dma_tag_destroy(sc->sis_rx_list_tag); + + /* Destroy TX ring. */ + if (sc->sis_tx_list_map) + bus_dmamap_unload(sc->sis_tx_list_tag, sc->sis_tx_list_map); + + if (sc->sis_tx_list_map && sc->sis_tx_list) + bus_dmamem_free(sc->sis_tx_list_tag, sc->sis_tx_list, + sc->sis_tx_list_map); + + if (sc->sis_tx_list_tag) + bus_dma_tag_destroy(sc->sis_tx_list_tag); + + /* Destroy the parent tag. */ + if (sc->sis_parent_tag) + bus_dma_tag_destroy(sc->sis_parent_tag); +} + /* * Initialize the TX and RX descriptors and allocate mbufs for them. Note that * we arrange the descriptors in a closed ring, so that the last descriptor @@ -1309,48 +1354,41 @@ sis_detach(device_t dev) static int sis_ring_init(struct sis_softc *sc) { - int i, error; - struct sis_desc *dp; - - dp = &sc->sis_tx_list[0]; - for (i = 0; i < SIS_TX_LIST_CNT; i++, dp++) { - if (i == (SIS_TX_LIST_CNT - 1)) - dp->sis_nextdesc = &sc->sis_tx_list[0]; + struct sis_rxdesc *rxd; + struct sis_txdesc *txd; + bus_addr_t next; + int error, i; + + bzero(&sc->sis_tx_list[0], SIS_TX_LIST_SZ); + for (i = 0; i < SIS_TX_LIST_CNT; i++) { + txd = &sc->sis_txdesc[i]; + txd->tx_m = NULL; + if (i == SIS_TX_LIST_CNT - 1) + next = SIS_TX_RING_ADDR(sc, 0); else - dp->sis_nextdesc = dp + 1; - bus_dmamap_load(sc->sis_tx_tag, - sc->sis_tx_dmamap, - dp->sis_nextdesc, sizeof(struct sis_desc), - sis_dma_map_desc_next, dp, 0); - dp->sis_mbuf = NULL; - dp->sis_ptr = 0; - dp->sis_ctl = 0; + next = SIS_TX_RING_ADDR(sc, i + 1); + sc->sis_tx_list[i].sis_next = htole32(SIS_ADDR_LO(next)); } - sc->sis_tx_prod = sc->sis_tx_cons = sc->sis_tx_cnt = 0; + bus_dmamap_sync(sc->sis_tx_list_tag, sc->sis_tx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(sc->sis_tx_tag, - sc->sis_tx_dmamap, BUS_DMASYNC_PREWRITE); - - dp = &sc->sis_rx_list[0]; - for (i = 0; i < SIS_RX_LIST_CNT; i++, dp++) { - error = sis_newbuf(sc, dp, NULL); + sc->sis_rx_cons = 0; + bzero(&sc->sis_rx_list[0], SIS_RX_LIST_SZ); + for (i = 0; i < SIS_RX_LIST_CNT; i++) { + rxd = &sc->sis_rxdesc[i]; + rxd->rx_desc = &sc->sis_rx_list[i]; + if (i == SIS_RX_LIST_CNT - 1) + next = SIS_RX_RING_ADDR(sc, 0); + else + next = SIS_RX_RING_ADDR(sc, i + 1); + rxd->rx_desc->sis_next = htole32(SIS_ADDR_LO(next)); + error = sis_newbuf(sc, rxd); if (error) return (error); - if (i == (SIS_RX_LIST_CNT - 1)) - dp->sis_nextdesc = &sc->sis_rx_list[0]; - else - dp->sis_nextdesc = dp + 1; - bus_dmamap_load(sc->sis_rx_tag, - sc->sis_rx_dmamap, - dp->sis_nextdesc, sizeof(struct sis_desc), - sis_dma_map_desc_next, dp, 0); - } - - bus_dmamap_sync(sc->sis_rx_tag, - sc->sis_rx_dmamap, BUS_DMASYNC_PREWRITE); - - sc->sis_rx_pdsc = &sc->sis_rx_list[0]; + } + bus_dmamap_sync(sc->sis_rx_list_tag, sc->sis_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } @@ -1359,30 +1397,66 @@ sis_ring_init(struct sis_softc *sc) * Initialize an RX descriptor and attach an MBUF cluster. */ static int -sis_newbuf(struct sis_softc *sc, struct sis_desc *c, struct mbuf *m) +sis_newbuf(struct sis_softc *sc, struct sis_rxdesc *rxd) { + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int nsegs; - if (c == NULL) - return (EINVAL); + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = SIS_RXLEN; +#ifndef __NO_STRICT_ALIGNMENT + m_adj(m, SIS_RX_BUF_ALIGN); +#endif - if (m == NULL) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (m == NULL) - return (ENOBUFS); - } else - m->m_data = m->m_ext.ext_buf; + if (bus_dmamap_load_mbuf_sg(sc->sis_rx_tag, sc->sis_rx_sparemap, m, + segs, &nsegs, 0) != 0) { + m_freem(m); + return (ENOBUFS); + } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - c->sis_mbuf = m; - c->sis_ctl = SIS_RXLEN; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->sis_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->sis_rx_tag, rxd->rx_dmamap); + } + map = rxd->rx_dmamap; + rxd->rx_dmamap = sc->sis_rx_sparemap; + sc->sis_rx_sparemap = map; + bus_dmamap_sync(sc->sis_rx_tag, rxd->rx_dmamap, BUS_DMASYNC_PREREAD); + rxd->rx_m = m; + rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); + rxd->rx_desc->sis_ptr = htole32(SIS_ADDR_LO(segs[0].ds_addr)); + return (0); +} - bus_dmamap_create(sc->sis_tag, 0, &c->sis_map); - bus_dmamap_load(sc->sis_tag, c->sis_map, - mtod(m, void *), MCLBYTES, - sis_dma_map_desc_ptr, c, 0); - bus_dmamap_sync(sc->sis_tag, c->sis_map, BUS_DMASYNC_PREREAD); +static __inline void +sis_discard_rxbuf(struct sis_rxdesc *rxd) +{ - return (0); + rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); +} + +#ifndef __NO_STRICT_ALIGNMENT +static __inline void +sis_fixup_rx(struct mbuf *m) +{ + uint16_t *src, *dst; + int i; + + src = mtod(m, uint16_t *); + dst = src - (SIS_RX_BUF_ALIGN - ETHER_ALIGN) / sizeof(*src); + + for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++) + *dst++ = *src++; + + m->m_data -= SIS_RX_BUF_ALIGN - ETHER_ALIGN; } +#endif /* * A frame has been uploaded: pass the resulting mbuf chain up to @@ -1391,19 +1465,23 @@ sis_newbuf(struct sis_softc *sc, struct static void sis_rxeof(struct sis_softc *sc) { - struct mbuf *m, *m0; + struct mbuf *m; struct ifnet *ifp; + struct sis_rxdesc *rxd; struct sis_desc *cur_rx; - int total_len = 0; - u_int32_t rxstat; + int prog, rx_cons, total_len; + uint32_t rxstat; SIS_LOCK_ASSERT(sc); - ifp = sc->sis_ifp; + bus_dmamap_sync(sc->sis_rx_list_tag, sc->sis_rx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - for (cur_rx = sc->sis_rx_pdsc; SIS_OWNDESC(cur_rx); - cur_rx = cur_rx->sis_nextdesc) { + rx_cons = sc->sis_rx_cons; + ifp = sc->sis_ifp; + for (prog = 0; (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; + SIS_INC(rx_cons, SIS_RX_LIST_CNT), prog++) { #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { if (sc->rxcycles <= 0) @@ -1411,21 +1489,13 @@ sis_rxeof(struct sis_softc *sc) sc->rxcycles--; } #endif - rxstat = cur_rx->sis_rxstat; - bus_dmamap_sync(sc->sis_tag, - cur_rx->sis_map, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->sis_tag, cur_rx->sis_map); - bus_dmamap_destroy(sc->sis_tag, cur_rx->sis_map); - m = cur_rx->sis_mbuf; - cur_rx->sis_mbuf = NULL; - total_len = SIS_RXBYTES(cur_rx); + cur_rx = &sc->sis_rx_list[rx_cons]; + rxstat = le32toh(cur_rx->sis_cmdsts); + if ((rxstat & SIS_CMDSTS_OWN) == 0) + break; + rxd = &sc->sis_rxdesc[rx_cons]; - /* - * If an error occurs, update stats, clear the - * status word and leave the mbuf cluster in place: - * it should simply get re-used next time this descriptor - * comes up in the ring. - */ + total_len = (rxstat & SIS_CMDSTS_BUFLEN) - ETHER_CRC_LEN; if ((ifp->if_capenable & IFCAP_VLAN_MTU) != 0 && total_len <= (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN - ETHER_CRC_LEN)) @@ -1434,36 +1504,29 @@ sis_rxeof(struct sis_softc *sc) ifp->if_ierrors++; if (rxstat & SIS_RXSTAT_COLL) ifp->if_collisions++; - sis_newbuf(sc, cur_rx, m); + sis_discard_rxbuf(rxd); + continue; + } + + /* Add a new receive buffer to the ring. */ + m = rxd->rx_m; + if (sis_newbuf(sc, rxd) != 0) { + ifp->if_iqdrops++; + sis_discard_rxbuf(rxd); continue; } /* No errors; receive the packet. */ -#ifdef __NO_STRICT_ALIGNMENT + m->m_pkthdr.len = m->m_len = total_len; +#ifndef __NO_STRICT_ALIGNMENT /* * On architectures without alignment problems we try to * allocate a new buffer for the receive ring, and pass up * the one where the packet is already, saving the expensive - * copy done in m_devget(). - * If we are on an architecture with alignment problems, or - * if the allocation fails, then use m_devget and leave the - * existing buffer in the receive ring. + * copy operation. */ - if (sis_newbuf(sc, cur_rx, NULL) == 0) - m->m_pkthdr.len = m->m_len = total_len; - else + sis_fixup_rx(m); #endif - { - m0 = m_devget(mtod(m, char *), total_len, - ETHER_ALIGN, ifp, NULL); - sis_newbuf(sc, cur_rx, m); - if (m0 == NULL) { - ifp->if_ierrors++; - continue; - } - m = m0; - } - ifp->if_ipackets++; m->m_pkthdr.rcvif = ifp; @@ -1472,7 +1535,12 @@ sis_rxeof(struct sis_softc *sc) SIS_LOCK(sc); } - sc->sis_rx_pdsc = cur_rx; + if (prog > 0) { + sc->sis_rx_cons = rx_cons; + bus_dmamap_sync(sc->sis_rx_list_tag, sc->sis_rx_list_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } + } /* @@ -1484,52 +1552,54 @@ static void sis_txeof(struct sis_softc *sc) { struct ifnet *ifp; - u_int32_t idx; + struct sis_desc *cur_tx; + struct sis_txdesc *txd; + uint32_t cons, txstat; SIS_LOCK_ASSERT(sc); + + cons = sc->sis_tx_cons; + if (cons == sc->sis_tx_prod) + return; + ifp = sc->sis_ifp; + bus_dmamap_sync(sc->sis_tx_list_tag, sc->sis_tx_list_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); /* * Go through our tx list and free mbufs for those * frames that have been transmitted. */ - for (idx = sc->sis_tx_cons; sc->sis_tx_cnt > 0; - sc->sis_tx_cnt--, SIS_INC(idx, SIS_TX_LIST_CNT) ) { - struct sis_desc *cur_tx = &sc->sis_tx_list[idx]; - - if (SIS_OWNDESC(cur_tx)) + for (; cons != sc->sis_tx_prod; SIS_INC(cons, SIS_TX_LIST_CNT)) { + cur_tx = &sc->sis_tx_list[cons]; + txstat = le32toh(cur_tx->sis_cmdsts); + if ((txstat & SIS_CMDSTS_OWN) != 0) break; - - if (cur_tx->sis_ctl & SIS_CMDSTS_MORE) - continue; - - if (!(cur_tx->sis_ctl & SIS_CMDSTS_PKT_OK)) { - ifp->if_oerrors++; - if (cur_tx->sis_txstat & SIS_TXSTAT_EXCESSCOLLS) - ifp->if_collisions++; - if (cur_tx->sis_txstat & SIS_TXSTAT_OUTOFWINCOLL) - ifp->if_collisions++; - } - - ifp->if_collisions += - (cur_tx->sis_txstat & SIS_TXSTAT_COLLCNT) >> 16; - - ifp->if_opackets++; - if (cur_tx->sis_mbuf != NULL) { - m_freem(cur_tx->sis_mbuf); - cur_tx->sis_mbuf = NULL; - bus_dmamap_unload(sc->sis_tag, cur_tx->sis_map); - bus_dmamap_destroy(sc->sis_tag, cur_tx->sis_map); + txd = &sc->sis_txdesc[cons]; + if (txd->tx_m != NULL) { + bus_dmamap_sync(sc->sis_tx_tag, txd->tx_dmamap, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->sis_tx_tag, txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + if ((txstat & SIS_CMDSTS_PKT_OK) != 0) { + ifp->if_opackets++; + ifp->if_collisions += + (txstat & SIS_TXSTAT_COLLCNT) >> 16; + } else { + ifp->if_oerrors++; + if (txstat & SIS_TXSTAT_EXCESSCOLLS) + ifp->if_collisions++; + if (txstat & SIS_TXSTAT_OUTOFWINCOLL) + ifp->if_collisions++; + } } - } - - if (idx != sc->sis_tx_cons) { - /* we freed up some buffers */ - sc->sis_tx_cons = idx; + sc->sis_tx_cnt--; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - - sc->sis_watchdog_timer = (sc->sis_tx_cnt == 0) ? 0 : 5; + sc->sis_tx_cons = cons; + if (sc->sis_tx_cnt == 0) + sc->sis_watchdog_timer = 0; } static void @@ -1676,83 +1746,80 @@ sis_intr(void *arg) * pointers to the fragment pointers. */ static int -sis_encap(struct sis_softc *sc, struct mbuf **m_head, uint32_t *txidx) +sis_encap(struct sis_softc *sc, struct mbuf **m_head) { - struct sis_desc *f = NULL; struct mbuf *m; - int frag, cur, cnt = 0, chainlen = 0; - - /* - * If there's no way we can send any packets, return now. - */ - if (SIS_TX_LIST_CNT - sc->sis_tx_cnt < 2) - return (ENOBUFS); - - /* - * Count the number of frags in this chain to see if - * we need to m_defrag. Since the descriptor list is shared - * by all packets, we'll m_defrag long chains so that they - * do not use up the entire list, even if they would fit. - */ - - for (m = *m_head; m != NULL; m = m->m_next) - chainlen++; - - if ((chainlen > SIS_TX_LIST_CNT / 4) || - ((SIS_TX_LIST_CNT - (chainlen + sc->sis_tx_cnt)) < 2)) { - m = m_defrag(*m_head, M_DONTWAIT); - if (m == NULL) + struct sis_txdesc *txd; + struct sis_desc *f; + bus_dma_segment_t segs[SIS_MAXTXSEGS]; + bus_dmamap_t map; + int error, i, frag, nsegs, prod; + + prod = sc->sis_tx_prod; + txd = &sc->sis_txdesc[prod]; + error = bus_dmamap_load_mbuf_sg(sc->sis_tx_tag, txd->tx_dmamap, + *m_head, segs, &nsegs, 0); + if (error == EFBIG) { + m = m_collapse(*m_head, M_DONTWAIT, SIS_MAXTXSEGS); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; return (ENOBUFS); + } *m_head = m; - } - - /* - * Start packing the mbufs in this chain into - * the fragment pointers. Stop when we run out - * of fragments or hit the end of the mbuf chain. - */ - cur = frag = *txidx; - - for (m = *m_head; m != NULL; m = m->m_next) { - if (m->m_len != 0) { - if ((SIS_TX_LIST_CNT - - (sc->sis_tx_cnt + cnt)) < 2) - return (ENOBUFS); - f = &sc->sis_tx_list[frag]; - f->sis_ctl = SIS_CMDSTS_MORE | m->m_len; - bus_dmamap_create(sc->sis_tag, 0, &f->sis_map); - bus_dmamap_load(sc->sis_tag, f->sis_map, - mtod(m, void *), m->m_len, - sis_dma_map_desc_ptr, f, 0); - bus_dmamap_sync(sc->sis_tag, - f->sis_map, BUS_DMASYNC_PREREAD); - if (cnt != 0) - f->sis_ctl |= SIS_CMDSTS_OWN; - cur = frag; - SIS_INC(frag, SIS_TX_LIST_CNT); - cnt++; + error = bus_dmamap_load_mbuf_sg(sc->sis_tx_tag, txd->tx_dmamap, + *m_head, segs, &nsegs, 0); + if (error != 0) { + m_freem(*m_head); + *m_head = NULL; + return (error); } - } + } else if (error != 0) + return (error); - if (m != NULL) + /* Check for descriptor overruns. */ + if (sc->sis_tx_cnt + nsegs > SIS_TX_LIST_CNT - 1) { + bus_dmamap_unload(sc->sis_tx_tag, txd->tx_dmamap); return (ENOBUFS); + } - sc->sis_tx_list[cur].sis_mbuf = *m_head; - sc->sis_tx_list[cur].sis_ctl &= ~SIS_CMDSTS_MORE; - sc->sis_tx_list[*txidx].sis_ctl |= SIS_CMDSTS_OWN; - sc->sis_tx_cnt += cnt; - *txidx = frag; + bus_dmamap_sync(sc->sis_tx_tag, txd->tx_dmamap, BUS_DMASYNC_PREWRITE); + + frag = prod; + for (i = 0; i < nsegs; i++) { + f = &sc->sis_tx_list[prod]; + if (i == 0) + f->sis_cmdsts = htole32(segs[i].ds_len | + SIS_CMDSTS_MORE); + else + f->sis_cmdsts = htole32(segs[i].ds_len | + SIS_CMDSTS_OWN | SIS_CMDSTS_MORE); + f->sis_ptr = htole32(SIS_ADDR_LO(segs[i].ds_addr)); + SIS_INC(prod, SIS_TX_LIST_CNT); + sc->sis_tx_cnt++; + } + + /* Update producer index. */ + sc->sis_tx_prod = prod; + + /* Remove MORE flag on the last descriptor. */ + prod = (prod - 1) & (SIS_TX_LIST_CNT - 1); + f = &sc->sis_tx_list[prod]; + f->sis_cmdsts &= ~htole32(SIS_CMDSTS_MORE); + + /* Lastly transfer ownership of packet to the controller. */ + f = &sc->sis_tx_list[frag]; + f->sis_cmdsts |= htole32(SIS_CMDSTS_OWN); + + /* Swap the last and the first dmamaps. */ + map = txd->tx_dmamap; + txd->tx_dmamap = sc->sis_txdesc[prod].tx_dmamap; + sc->sis_txdesc[prod].tx_dmamap = map; + sc->sis_txdesc[prod].tx_m = *m_head; return (0); } -/* - * Main transmit routine. To avoid having to do mbuf copies, we put pointers - * to the mbuf data regions directly in the transmit lists. We also save a - * copy of the pointers since the transmit list fragment pointers are - * physical addresses. - */ - static void sis_start(struct ifnet *ifp) { @@ -1768,27 +1835,26 @@ static void sis_startl(struct ifnet *ifp) { struct sis_softc *sc; - struct mbuf *m_head = NULL; - u_int32_t idx, queued = 0; + struct mbuf *m_head; + int queued; sc = ifp->if_softc; SIS_LOCK_ASSERT(sc); - if (!sc->sis_link) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || sc->sis_link == 0) return; - idx = sc->sis_tx_prod; - - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) - return; - - while (sc->sis_tx_list[idx].sis_mbuf == NULL) { + for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && + sc->sis_tx_cnt < SIS_TX_LIST_CNT - 4;) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; - if (sis_encap(sc, &m_head, &idx)) { + if (sis_encap(sc, &m_head) != 0) { + if (m_head == NULL) + break; IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; @@ -1801,12 +1867,12 @@ sis_startl(struct ifnet *ifp) * to him. */ BPF_MTAP(ifp, m_head); - } if (queued) { /* Transmit */ - sc->sis_tx_prod = idx; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:30:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87A4C1065672; Fri, 8 Oct 2010 20:30:08 +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 7699E8FC1B; Fri, 8 Oct 2010 20:30:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98KU8FN012695; Fri, 8 Oct 2010 20:30:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KU8Uj012692; Fri, 8 Oct 2010 20:30:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082030.o98KU8Uj012692@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213614 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:30:08 -0000 Author: yongari Date: Fri Oct 8 20:30:08 2010 New Revision: 213614 URL: http://svn.freebsd.org/changeset/base/213614 Log: MFC r212113: s/u_intXX_t/uintXX_t/g Modified: stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sis/if_sisreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:27:51 2010 (r213613) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:30:08 2010 (r213614) @@ -259,7 +259,7 @@ static void sis_eeprom_getword(struct sis_softc *sc, int addr, uint16_t *dest) { int i; - u_int16_t word = 0; + uint16_t word = 0; /* Force EEPROM to idle state. */ sis_eeprom_idle(sc); @@ -302,11 +302,11 @@ static void sis_read_eeprom(struct sis_softc *sc, caddr_t dest, int off, int cnt, int swap) { int i; - u_int16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { sis_eeprom_getword(sc, off + i, &word); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else @@ -356,7 +356,7 @@ static void sis_read_cmos(struct sis_softc *sc, device_t dev, caddr_t dest, int off, int cnt) { device_t bridge; - u_int8_t reg; + uint8_t reg; int i; bus_space_tag_t btag; @@ -384,7 +384,7 @@ sis_read_cmos(struct sis_softc *sc, devi static void sis_read_mac(struct sis_softc *sc, device_t dev, caddr_t dest) { - u_int32_t filtsave, csrsave; + uint32_t filtsave, csrsave; filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); csrsave = CSR_READ_4(sc, SIS_CSR); @@ -395,11 +395,11 @@ sis_read_mac(struct sis_softc *sc, devic CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave & ~SIS_RXFILTCTL_ENABLE); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0); - ((u_int16_t *)dest)[0] = CSR_READ_2(sc, SIS_RXFILT_DATA); + ((uint16_t *)dest)[0] = CSR_READ_2(sc, SIS_RXFILT_DATA); CSR_WRITE_4(sc, SIS_RXFILT_CTL,SIS_FILTADDR_PAR1); - ((u_int16_t *)dest)[1] = CSR_READ_2(sc, SIS_RXFILT_DATA); + ((uint16_t *)dest)[1] = CSR_READ_2(sc, SIS_RXFILT_DATA); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR2); - ((u_int16_t *)dest)[2] = CSR_READ_2(sc, SIS_RXFILT_DATA); + ((uint16_t *)dest)[2] = CSR_READ_2(sc, SIS_RXFILT_DATA); CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); CSR_WRITE_4(sc, SIS_CSR, csrsave); @@ -731,7 +731,7 @@ sis_setmulti_ns(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - u_int32_t h = 0, i, filtsave; + uint32_t h = 0, i, filtsave; int bit, index; ifp = sc->sis_ifp; @@ -780,8 +780,8 @@ sis_setmulti_sis(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - u_int32_t h, i, n, ctl; - u_int16_t hashes[16]; + uint32_t h, i, n, ctl; + uint16_t hashes[16]; ifp = sc->sis_ifp; @@ -963,7 +963,7 @@ sis_attach(device_t dev) * Why? Who the hell knows. */ { - u_int16_t tmp[4]; + uint16_t tmp[4]; sis_read_eeprom(sc, (caddr_t)&tmp, NS_EE_NODEADDR, 4, 0); @@ -1661,7 +1661,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm sis_startl(ifp); if (sc->rxcycles > 0 || cmd == POLL_AND_CHECK_STATUS) { - u_int32_t status; + uint32_t status; /* Reading the ISR register clears all interrupts. */ status = CSR_READ_4(sc, SIS_ISR); @@ -1688,7 +1688,7 @@ sis_intr(void *arg) { struct sis_softc *sc; struct ifnet *ifp; - u_int32_t status; + uint32_t status; sc = arg; ifp = sc->sis_ifp; @@ -1926,23 +1926,23 @@ sis_initl(struct sis_softc *sc) if (sc->sis_type == SIS_TYPE_83815) { CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR0); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[0]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[0]); CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR1); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[1]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[1]); CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR2); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[2]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[2]); } else { CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[0]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[0]); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR1); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[1]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[1]); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR2); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[2]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[2]); } /* Init circular TX/RX lists. */ Modified: stable/8/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 20:27:51 2010 (r213613) +++ stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 20:30:08 2010 (r213614) @@ -308,9 +308,9 @@ */ struct sis_desc { /* SiS hardware descriptor section */ - u_int32_t sis_next; - u_int32_t sis_cmdsts; - u_int32_t sis_ptr; + uint32_t sis_next; + uint32_t sis_cmdsts; + uint32_t sis_ptr; }; #define SIS_CMDSTS_BUFLEN 0x00000FFF @@ -403,18 +403,18 @@ struct sis_desc { #define NS_DEVICEID_DP83815 0x0020 struct sis_type { - u_int16_t sis_vid; - u_int16_t sis_did; + uint16_t sis_vid; + uint16_t sis_did; char *sis_name; }; struct sis_mii_frame { - u_int8_t mii_stdelim; - u_int8_t mii_opcode; - u_int8_t mii_phyaddr; - u_int8_t mii_regaddr; - u_int8_t mii_turnaround; - u_int16_t mii_data; + uint8_t mii_stdelim; + uint8_t mii_opcode; + uint8_t mii_phyaddr; + uint8_t mii_regaddr; + uint8_t mii_turnaround; + uint16_t mii_data; }; /* @@ -447,10 +447,10 @@ struct sis_softc { void *sis_intrhand; device_t sis_dev; device_t sis_miibus; - u_int8_t sis_type; - u_int8_t sis_rev; - u_int8_t sis_link; - u_int sis_srr; + uint8_t sis_type; + uint8_t sis_rev; + uint8_t sis_link; + uint32_t sis_srr; struct sis_desc *sis_rx_list; struct sis_desc *sis_tx_list; bus_dma_tag_t sis_rx_list_tag; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:31:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10DAD106564A; Fri, 8 Oct 2010 20:31:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3D268FC14; Fri, 8 Oct 2010 20:31: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 o98KVZ6m012774; Fri, 8 Oct 2010 20:31:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KVZ7X012771; Fri, 8 Oct 2010 20:31:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082031.o98KVZ7X012771@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213615 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:31:36 -0000 Author: yongari Date: Fri Oct 8 20:31:35 2010 New Revision: 213615 URL: http://svn.freebsd.org/changeset/base/213615 Log: MFC r212113: s/u_intXX_t/uintXX_t/g Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:30:08 2010 (r213614) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:31:35 2010 (r213615) @@ -259,7 +259,7 @@ static void sis_eeprom_getword(struct sis_softc *sc, int addr, uint16_t *dest) { int i; - u_int16_t word = 0; + uint16_t word = 0; /* Force EEPROM to idle state. */ sis_eeprom_idle(sc); @@ -302,11 +302,11 @@ static void sis_read_eeprom(struct sis_softc *sc, caddr_t dest, int off, int cnt, int swap) { int i; - u_int16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { sis_eeprom_getword(sc, off + i, &word); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else @@ -356,7 +356,7 @@ static void sis_read_cmos(struct sis_softc *sc, device_t dev, caddr_t dest, int off, int cnt) { device_t bridge; - u_int8_t reg; + uint8_t reg; int i; bus_space_tag_t btag; @@ -384,7 +384,7 @@ sis_read_cmos(struct sis_softc *sc, devi static void sis_read_mac(struct sis_softc *sc, device_t dev, caddr_t dest) { - u_int32_t filtsave, csrsave; + uint32_t filtsave, csrsave; filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); csrsave = CSR_READ_4(sc, SIS_CSR); @@ -395,11 +395,11 @@ sis_read_mac(struct sis_softc *sc, devic CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave & ~SIS_RXFILTCTL_ENABLE); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0); - ((u_int16_t *)dest)[0] = CSR_READ_2(sc, SIS_RXFILT_DATA); + ((uint16_t *)dest)[0] = CSR_READ_2(sc, SIS_RXFILT_DATA); CSR_WRITE_4(sc, SIS_RXFILT_CTL,SIS_FILTADDR_PAR1); - ((u_int16_t *)dest)[1] = CSR_READ_2(sc, SIS_RXFILT_DATA); + ((uint16_t *)dest)[1] = CSR_READ_2(sc, SIS_RXFILT_DATA); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR2); - ((u_int16_t *)dest)[2] = CSR_READ_2(sc, SIS_RXFILT_DATA); + ((uint16_t *)dest)[2] = CSR_READ_2(sc, SIS_RXFILT_DATA); CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); CSR_WRITE_4(sc, SIS_CSR, csrsave); @@ -731,7 +731,7 @@ sis_setmulti_ns(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - u_int32_t h = 0, i, filtsave; + uint32_t h = 0, i, filtsave; int bit, index; ifp = sc->sis_ifp; @@ -780,8 +780,8 @@ sis_setmulti_sis(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - u_int32_t h, i, n, ctl; - u_int16_t hashes[16]; + uint32_t h, i, n, ctl; + uint16_t hashes[16]; ifp = sc->sis_ifp; @@ -963,7 +963,7 @@ sis_attach(device_t dev) * Why? Who the hell knows. */ { - u_int16_t tmp[4]; + uint16_t tmp[4]; sis_read_eeprom(sc, (caddr_t)&tmp, NS_EE_NODEADDR, 4, 0); @@ -1658,7 +1658,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm sis_startl(ifp); if (sc->rxcycles > 0 || cmd == POLL_AND_CHECK_STATUS) { - u_int32_t status; + uint32_t status; /* Reading the ISR register clears all interrupts. */ status = CSR_READ_4(sc, SIS_ISR); @@ -1684,7 +1684,7 @@ sis_intr(void *arg) { struct sis_softc *sc; struct ifnet *ifp; - u_int32_t status; + uint32_t status; sc = arg; ifp = sc->sis_ifp; @@ -1922,23 +1922,23 @@ sis_initl(struct sis_softc *sc) if (sc->sis_type == SIS_TYPE_83815) { CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR0); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[0]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[0]); CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR1); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[1]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[1]); CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR2); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[2]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[2]); } else { CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[0]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[0]); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR1); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[1]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[1]); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR2); CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[2]); + ((uint16_t *)IF_LLADDR(sc->sis_ifp))[2]); } /* Init circular TX/RX lists. */ Modified: stable/7/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:30:08 2010 (r213614) +++ stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:31:35 2010 (r213615) @@ -308,9 +308,9 @@ */ struct sis_desc { /* SiS hardware descriptor section */ - u_int32_t sis_next; - u_int32_t sis_cmdsts; - u_int32_t sis_ptr; + uint32_t sis_next; + uint32_t sis_cmdsts; + uint32_t sis_ptr; }; #define SIS_CMDSTS_BUFLEN 0x00000FFF @@ -403,18 +403,18 @@ struct sis_desc { #define NS_DEVICEID_DP83815 0x0020 struct sis_type { - u_int16_t sis_vid; - u_int16_t sis_did; + uint16_t sis_vid; + uint16_t sis_did; char *sis_name; }; struct sis_mii_frame { - u_int8_t mii_stdelim; - u_int8_t mii_opcode; - u_int8_t mii_phyaddr; - u_int8_t mii_regaddr; - u_int8_t mii_turnaround; - u_int16_t mii_data; + uint8_t mii_stdelim; + uint8_t mii_opcode; + uint8_t mii_phyaddr; + uint8_t mii_regaddr; + uint8_t mii_turnaround; + uint16_t mii_data; }; /* @@ -447,10 +447,10 @@ struct sis_softc { void *sis_intrhand; device_t sis_dev; device_t sis_miibus; - u_int8_t sis_type; - u_int8_t sis_rev; - u_int8_t sis_link; - u_int sis_srr; + uint8_t sis_type; + uint8_t sis_rev; + uint8_t sis_link; + uint32_t sis_srr; struct sis_desc *sis_rx_list; struct sis_desc *sis_tx_list; bus_dma_tag_t sis_rx_list_tag; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:33:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DA04106566B; Fri, 8 Oct 2010 20:33: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 4C5EA8FC17; Fri, 8 Oct 2010 20:33: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 o98KXhC4012878; Fri, 8 Oct 2010 20:33:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KXhbi012875; Fri, 8 Oct 2010 20:33:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082033.o98KXhbi012875@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213616 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:33:43 -0000 Author: yongari Date: Fri Oct 8 20:33:43 2010 New Revision: 213616 URL: http://svn.freebsd.org/changeset/base/213616 Log: MFC r212116: Overhaul link state change handling. Previously sis(4) blindly configured TX/RX MACs before getting a valid link. After that, when link state change callback is called, it called device initialization again to reconfigure TX/RX MACs depending on resolved link state. This hack created several bad side effects and it required more hacks to not collide with sis_tick callback as well as disabling switching to currently selected media in device initialization. Also it seems sis(4) was used to be a template driver for long time so other drivers which was modeled after sis(4) also should be changed. TX/RX MACs are now reconfigured after getting a valid link. Fix for short cable error is also applied after getting a link because it's only valid when the resolved speed is 100Mbps. While I'm here slightly reorganize interrupt handler such that sis(4) always read SIS_ISR register to see whether the interrupt is ours or not. This change removes another hack and make it possible to nuke sis_stopped variable in softc. Modified: stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sis/if_sisreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:31:35 2010 (r213615) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:33:43 2010 (r213616) @@ -697,10 +697,86 @@ static void sis_miibus_statchg(device_t dev) { struct sis_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint32_t reg; sc = device_get_softc(dev); SIS_LOCK_ASSERT(sc); - sis_initl(sc); + + mii = device_get_softc(sc->sis_miibus); + ifp = sc->sis_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->sis_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: + sc->sis_link++; + CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_10); + break; + case IFM_100_TX: + sc->sis_link++; + CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_100); + break; + default: + break; + } + } + + if (sc->sis_link == 0) { + /* + * Stopping MACs seem to reset SIS_TX_LISTPTR and + * SIS_RX_LISTPTR which in turn requires resetting + * TX/RX buffers. So just don't do anything for + * lost link. + */ + return; + } + + /* Set full/half duplex mode. */ + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + SIS_SETBIT(sc, SIS_TX_CFG, + (SIS_TXCFG_IGN_HBEAT | SIS_TXCFG_IGN_CARR)); + SIS_SETBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS); + } else { + SIS_CLRBIT(sc, SIS_TX_CFG, + (SIS_TXCFG_IGN_HBEAT | SIS_TXCFG_IGN_CARR)); + SIS_CLRBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS); + } + + if (sc->sis_type == SIS_TYPE_83816) { + /* + * MPII03.D: Half Duplex Excessive Collisions. + * Also page 49 in 83816 manual + */ + SIS_SETBIT(sc, SIS_TX_CFG, SIS_TXCFG_MPII03D); + } + + if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr < NS_SRR_16A && + IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) { + /* + * Short Cable Receive Errors (MP21.E) + */ + CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001); + reg = CSR_READ_4(sc, NS_PHY_DSPCFG) & 0xfff; + CSR_WRITE_4(sc, NS_PHY_DSPCFG, reg | 0x1000); + DELAY(100); + reg = CSR_READ_4(sc, NS_PHY_TDATA) & 0xff; + if ((reg & 0x0080) == 0 || (reg > 0xd8 && reg <= 0xff)) { + device_printf(sc->sis_dev, + "Applying short cable fix (reg=%x)\n", reg); + CSR_WRITE_4(sc, NS_PHY_TDATA, 0x00e8); + SIS_SETBIT(sc, NS_PHY_DSPCFG, 0x20); + } + CSR_WRITE_4(sc, NS_PHY_PAGE, 0); + } + /* Enable TX/RX MACs. */ + SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_TX_DISABLE | SIS_CSR_RX_DISABLE); + SIS_SETBIT(sc, SIS_CSR, SIS_CSR_TX_ENABLE | SIS_CSR_RX_ENABLE); } static uint32_t @@ -1613,23 +1689,14 @@ sis_tick(void *xsc) sc = xsc; SIS_LOCK_ASSERT(sc); - sc->in_tick = 1; ifp = sc->sis_ifp; mii = device_get_softc(sc->sis_miibus); mii_tick(mii); - sis_watchdog(sc); - - if (!sc->sis_link && mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->sis_link++; - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - sis_startl(ifp); - } - + if (sc->sis_link == 0) + sis_miibus_statchg(sc->sis_dev); callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); - sc->in_tick = 0; } #ifdef DEVICE_POLLING @@ -1693,9 +1760,6 @@ sis_intr(void *arg) sc = arg; ifp = sc->sis_ifp; - if (sc->sis_stopped) /* Most likely shared interrupt */ - return; - SIS_LOCK(sc); #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { @@ -1704,17 +1768,17 @@ sis_intr(void *arg) } #endif + /* Reading the ISR register clears all interrupts. */ + status = CSR_READ_4(sc, SIS_ISR); + if ((status & SIS_INTRS) == 0) { + /* Not ours. */ + SIS_UNLOCK(sc); + } + /* Disable interrupts. */ CSR_WRITE_4(sc, SIS_IER, 0); - for (;;) { - SIS_LOCK_ASSERT(sc); - /* Reading the ISR register clears all interrupts. */ - status = CSR_READ_4(sc, SIS_ISR); - - if ((status & SIS_INTRS) == 0) - break; - + for (;(status & SIS_INTRS) != 0;) { if (status & (SIS_ISR_TX_DESC_OK | SIS_ISR_TX_ERR | SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) ) @@ -1733,7 +1797,10 @@ sis_intr(void *arg) if (status & SIS_ISR_SYSERR) { sis_reset(sc); sis_initl(sc); + SIS_UNLOCK(sc); + return; } + status = CSR_READ_4(sc, SIS_ISR); } /* Re-enable interrupts. */ @@ -1908,7 +1975,6 @@ sis_initl(struct sis_softc *sc) * Cancel pending I/O and free all RX/TX buffers. */ sis_stop(sc); - sc->sis_stopped = 0; #ifdef notyet if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr >= NS_SRR_16A) { @@ -1972,7 +2038,6 @@ sis_initl(struct sis_softc *sc) CSR_WRITE_4(sc, NS_PHY_PAGE, 0); } - /* * For the NatSemi chip, we have to explicitly enable the * reception of ARP frames, as well as turn on the 'perfect @@ -2030,52 +2095,11 @@ sis_initl(struct sis_softc *sc) /* Accept Long Packets for VLAN support */ SIS_SETBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_JABBER); - /* Set TX configuration */ - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T) { - CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_10); - } else { - CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_100); - } - - /* Set full/half duplex mode. */ - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) { - SIS_SETBIT(sc, SIS_TX_CFG, - (SIS_TXCFG_IGN_HBEAT|SIS_TXCFG_IGN_CARR)); - SIS_SETBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS); - } else { - SIS_CLRBIT(sc, SIS_TX_CFG, - (SIS_TXCFG_IGN_HBEAT|SIS_TXCFG_IGN_CARR)); - SIS_CLRBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS); - } - - if (sc->sis_type == SIS_TYPE_83816) { - /* - * MPII03.D: Half Duplex Excessive Collisions. - * Also page 49 in 83816 manual - */ - SIS_SETBIT(sc, SIS_TX_CFG, SIS_TXCFG_MPII03D); - } - - if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr < NS_SRR_16A && - IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) { - uint32_t reg; - - /* - * Short Cable Receive Errors (MP21.E) - */ - CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001); - reg = CSR_READ_4(sc, NS_PHY_DSPCFG) & 0xfff; - CSR_WRITE_4(sc, NS_PHY_DSPCFG, reg | 0x1000); - DELAY(100); - reg = CSR_READ_4(sc, NS_PHY_TDATA) & 0xff; - if ((reg & 0x0080) == 0 || (reg > 0xd8 && reg <= 0xff)) { - device_printf(sc->sis_dev, - "Applying short cable fix (reg=%x)\n", reg); - CSR_WRITE_4(sc, NS_PHY_TDATA, 0x00e8); - SIS_SETBIT(sc, NS_PHY_DSPCFG, 0x20); - } - CSR_WRITE_4(sc, NS_PHY_PAGE, 0); - } + /* + * Assume 100Mbps link, actual MAC configuration is done + * after getting a valid link. + */ + CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_100); /* * Enable interrupts. @@ -2092,19 +2116,16 @@ sis_initl(struct sis_softc *sc) #endif CSR_WRITE_4(sc, SIS_IER, 1); - /* Enable receiver and transmitter. */ - SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_TX_DISABLE|SIS_CSR_RX_DISABLE); - SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); + /* Clear MAC disable. */ + SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_TX_DISABLE | SIS_CSR_RX_DISABLE); -#ifdef notdef + sc->sis_link = 0; mii_mediachg(mii); -#endif ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - if (!sc->in_tick) - callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); + callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); } /* @@ -2226,10 +2247,6 @@ sis_watchdog(struct sis_softc *sc) { SIS_LOCK_ASSERT(sc); - if (sc->sis_stopped) { - SIS_UNLOCK(sc); - return; - } if (sc->sis_watchdog_timer == 0 || --sc->sis_watchdog_timer >0) return; @@ -2257,9 +2274,8 @@ sis_stop(struct sis_softc *sc) struct sis_txdesc *txd; int i; - if (sc->sis_stopped) - return; SIS_LOCK_ASSERT(sc); + ifp = sc->sis_ifp; sc->sis_watchdog_timer = 0; @@ -2303,8 +2319,6 @@ sis_stop(struct sis_softc *sc) txd->tx_m = NULL; } } - - sc->sis_stopped = 1; } /* Modified: stable/8/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 20:31:35 2010 (r213615) +++ stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 20:33:43 2010 (r213616) @@ -471,11 +471,9 @@ struct sis_softc { bus_addr_t sis_tx_paddr; struct callout sis_stat_ch; int sis_watchdog_timer; - int sis_stopped; #ifdef DEVICE_POLLING int rxcycles; #endif - int in_tick; struct mtx sis_mtx; }; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:37:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C85E7106566C; Fri, 8 Oct 2010 20:37:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6FEA8FC12; Fri, 8 Oct 2010 20:37: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 o98KbDL8013051; Fri, 8 Oct 2010 20:37:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KbD9P013048; Fri, 8 Oct 2010 20:37:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082037.o98KbD9P013048@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213618 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:37:13 -0000 Author: yongari Date: Fri Oct 8 20:37:13 2010 New Revision: 213618 URL: http://svn.freebsd.org/changeset/base/213618 Log: MFC r212116: Overhaul link state change handling. Previously sis(4) blindly configured TX/RX MACs before getting a valid link. After that, when link state change callback is called, it called device initialization again to reconfigure TX/RX MACs depending on resolved link state. This hack created several bad side effects and it required more hacks to not collide with sis_tick callback as well as disabling switching to currently selected media in device initialization. Also it seems sis(4) was used to be a template driver for long time so other drivers which was modeled after sis(4) also should be changed. TX/RX MACs are now reconfigured after getting a valid link. Fix for short cable error is also applied after getting a link because it's only valid when the resolved speed is 100Mbps. While I'm here slightly reorganize interrupt handler such that sis(4) always read SIS_ISR register to see whether the interrupt is ours or not. This change removes another hack and make it possible to nuke sis_stopped variable in softc. Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:34:23 2010 (r213617) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:37:13 2010 (r213618) @@ -697,10 +697,86 @@ static void sis_miibus_statchg(device_t dev) { struct sis_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint32_t reg; sc = device_get_softc(dev); SIS_LOCK_ASSERT(sc); - sis_initl(sc); + + mii = device_get_softc(sc->sis_miibus); + ifp = sc->sis_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->sis_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: + sc->sis_link++; + CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_10); + break; + case IFM_100_TX: + sc->sis_link++; + CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_100); + break; + default: + break; + } + } + + if (sc->sis_link == 0) { + /* + * Stopping MACs seem to reset SIS_TX_LISTPTR and + * SIS_RX_LISTPTR which in turn requires resetting + * TX/RX buffers. So just don't do anything for + * lost link. + */ + return; + } + + /* Set full/half duplex mode. */ + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + SIS_SETBIT(sc, SIS_TX_CFG, + (SIS_TXCFG_IGN_HBEAT | SIS_TXCFG_IGN_CARR)); + SIS_SETBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS); + } else { + SIS_CLRBIT(sc, SIS_TX_CFG, + (SIS_TXCFG_IGN_HBEAT | SIS_TXCFG_IGN_CARR)); + SIS_CLRBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS); + } + + if (sc->sis_type == SIS_TYPE_83816) { + /* + * MPII03.D: Half Duplex Excessive Collisions. + * Also page 49 in 83816 manual + */ + SIS_SETBIT(sc, SIS_TX_CFG, SIS_TXCFG_MPII03D); + } + + if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr < NS_SRR_16A && + IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) { + /* + * Short Cable Receive Errors (MP21.E) + */ + CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001); + reg = CSR_READ_4(sc, NS_PHY_DSPCFG) & 0xfff; + CSR_WRITE_4(sc, NS_PHY_DSPCFG, reg | 0x1000); + DELAY(100); + reg = CSR_READ_4(sc, NS_PHY_TDATA) & 0xff; + if ((reg & 0x0080) == 0 || (reg > 0xd8 && reg <= 0xff)) { + device_printf(sc->sis_dev, + "Applying short cable fix (reg=%x)\n", reg); + CSR_WRITE_4(sc, NS_PHY_TDATA, 0x00e8); + SIS_SETBIT(sc, NS_PHY_DSPCFG, 0x20); + } + CSR_WRITE_4(sc, NS_PHY_PAGE, 0); + } + /* Enable TX/RX MACs. */ + SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_TX_DISABLE | SIS_CSR_RX_DISABLE); + SIS_SETBIT(sc, SIS_CSR, SIS_CSR_TX_ENABLE | SIS_CSR_RX_ENABLE); } static uint32_t @@ -1611,23 +1687,14 @@ sis_tick(void *xsc) sc = xsc; SIS_LOCK_ASSERT(sc); - sc->in_tick = 1; ifp = sc->sis_ifp; mii = device_get_softc(sc->sis_miibus); mii_tick(mii); - sis_watchdog(sc); - - if (!sc->sis_link && mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->sis_link++; - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - sis_startl(ifp); - } - + if (sc->sis_link == 0) + sis_miibus_statchg(sc->sis_dev); callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); - sc->in_tick = 0; } #ifdef DEVICE_POLLING @@ -1689,9 +1756,6 @@ sis_intr(void *arg) sc = arg; ifp = sc->sis_ifp; - if (sc->sis_stopped) /* Most likely shared interrupt */ - return; - SIS_LOCK(sc); #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) { @@ -1700,17 +1764,17 @@ sis_intr(void *arg) } #endif + /* Reading the ISR register clears all interrupts. */ + status = CSR_READ_4(sc, SIS_ISR); + if ((status & SIS_INTRS) == 0) { + /* Not ours. */ + SIS_UNLOCK(sc); + } + /* Disable interrupts. */ CSR_WRITE_4(sc, SIS_IER, 0); - for (;;) { - SIS_LOCK_ASSERT(sc); - /* Reading the ISR register clears all interrupts. */ - status = CSR_READ_4(sc, SIS_ISR); - - if ((status & SIS_INTRS) == 0) - break; - + for (;(status & SIS_INTRS) != 0;) { if (status & (SIS_ISR_TX_DESC_OK | SIS_ISR_TX_ERR | SIS_ISR_TX_OK | SIS_ISR_TX_IDLE) ) @@ -1729,7 +1793,10 @@ sis_intr(void *arg) if (status & SIS_ISR_SYSERR) { sis_reset(sc); sis_initl(sc); + SIS_UNLOCK(sc); + return; } + status = CSR_READ_4(sc, SIS_ISR); } /* Re-enable interrupts. */ @@ -1904,7 +1971,6 @@ sis_initl(struct sis_softc *sc) * Cancel pending I/O and free all RX/TX buffers. */ sis_stop(sc); - sc->sis_stopped = 0; #ifdef notyet if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr >= NS_SRR_16A) { @@ -1968,7 +2034,6 @@ sis_initl(struct sis_softc *sc) CSR_WRITE_4(sc, NS_PHY_PAGE, 0); } - /* * For the NatSemi chip, we have to explicitly enable the * reception of ARP frames, as well as turn on the 'perfect @@ -2026,52 +2091,11 @@ sis_initl(struct sis_softc *sc) /* Accept Long Packets for VLAN support */ SIS_SETBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_JABBER); - /* Set TX configuration */ - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T) { - CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_10); - } else { - CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_100); - } - - /* Set full/half duplex mode. */ - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) { - SIS_SETBIT(sc, SIS_TX_CFG, - (SIS_TXCFG_IGN_HBEAT|SIS_TXCFG_IGN_CARR)); - SIS_SETBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS); - } else { - SIS_CLRBIT(sc, SIS_TX_CFG, - (SIS_TXCFG_IGN_HBEAT|SIS_TXCFG_IGN_CARR)); - SIS_CLRBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS); - } - - if (sc->sis_type == SIS_TYPE_83816) { - /* - * MPII03.D: Half Duplex Excessive Collisions. - * Also page 49 in 83816 manual - */ - SIS_SETBIT(sc, SIS_TX_CFG, SIS_TXCFG_MPII03D); - } - - if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr < NS_SRR_16A && - IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) { - uint32_t reg; - - /* - * Short Cable Receive Errors (MP21.E) - */ - CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001); - reg = CSR_READ_4(sc, NS_PHY_DSPCFG) & 0xfff; - CSR_WRITE_4(sc, NS_PHY_DSPCFG, reg | 0x1000); - DELAY(100); - reg = CSR_READ_4(sc, NS_PHY_TDATA) & 0xff; - if ((reg & 0x0080) == 0 || (reg > 0xd8 && reg <= 0xff)) { - device_printf(sc->sis_dev, - "Applying short cable fix (reg=%x)\n", reg); - CSR_WRITE_4(sc, NS_PHY_TDATA, 0x00e8); - SIS_SETBIT(sc, NS_PHY_DSPCFG, 0x20); - } - CSR_WRITE_4(sc, NS_PHY_PAGE, 0); - } + /* + * Assume 100Mbps link, actual MAC configuration is done + * after getting a valid link. + */ + CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_100); /* * Enable interrupts. @@ -2088,19 +2112,16 @@ sis_initl(struct sis_softc *sc) #endif CSR_WRITE_4(sc, SIS_IER, 1); - /* Enable receiver and transmitter. */ - SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_TX_DISABLE|SIS_CSR_RX_DISABLE); - SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); + /* Clear MAC disable. */ + SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_TX_DISABLE | SIS_CSR_RX_DISABLE); -#ifdef notdef + sc->sis_link = 0; mii_mediachg(mii); -#endif ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - if (!sc->in_tick) - callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); + callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); } /* @@ -2222,10 +2243,6 @@ sis_watchdog(struct sis_softc *sc) { SIS_LOCK_ASSERT(sc); - if (sc->sis_stopped) { - SIS_UNLOCK(sc); - return; - } if (sc->sis_watchdog_timer == 0 || --sc->sis_watchdog_timer >0) return; @@ -2253,9 +2270,8 @@ sis_stop(struct sis_softc *sc) struct sis_txdesc *txd; int i; - if (sc->sis_stopped) - return; SIS_LOCK_ASSERT(sc); + ifp = sc->sis_ifp; sc->sis_watchdog_timer = 0; @@ -2299,8 +2315,6 @@ sis_stop(struct sis_softc *sc) txd->tx_m = NULL; } } - - sc->sis_stopped = 1; } /* Modified: stable/7/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:34:23 2010 (r213617) +++ stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:37:13 2010 (r213618) @@ -471,11 +471,9 @@ struct sis_softc { bus_addr_t sis_tx_paddr; struct callout sis_stat_ch; int sis_watchdog_timer; - int sis_stopped; #ifdef DEVICE_POLLING int rxcycles; #endif - int in_tick; struct mtx sis_mtx; }; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:39:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D4E9106564A; Fri, 8 Oct 2010 20:39:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52B468FC15; Fri, 8 Oct 2010 20:39: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 o98Kdjft013159; Fri, 8 Oct 2010 20:39:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KdjpP013156; Fri, 8 Oct 2010 20:39:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082039.o98KdjpP013156@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213619 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:39:46 -0000 Author: yongari Date: Fri Oct 8 20:39:45 2010 New Revision: 213619 URL: http://svn.freebsd.org/changeset/base/213619 Log: MFC r212117,212119: rr212117: Report result of link state change to caller. Previously it always returned success. r212119: Do not reinitialize controller whenever promiscuous mode or allmulti is toggled. Controller does not require reinitialization. This removes unnecessary controller reinitialization whenever tcpdump is used. While I'm here remove unnecessary variable reinitialization. Modified: stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sis/if_sisreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:37:13 2010 (r213618) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:39:45 2010 (r213619) @@ -2136,6 +2136,7 @@ sis_ifmedia_upd(struct ifnet *ifp) { struct sis_softc *sc; struct mii_data *mii; + int error; sc = ifp->if_softc; @@ -2147,10 +2148,10 @@ sis_ifmedia_upd(struct ifnet *ifp) LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); SIS_UNLOCK(sc); - return (0); + return (error); } /* @@ -2184,10 +2185,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm case SIOCSIFFLAGS: SIS_LOCK(sc); if (ifp->if_flags & IFF_UP) { - sis_initl(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->sis_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) { + if (sc->sis_type == SIS_TYPE_83815) + sis_setmulti_ns(sc); + else + sis_setmulti_sis(sc); + } else + sis_initl(sc); } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { sis_stop(sc); } + sc->sis_if_flags = ifp->if_flags; SIS_UNLOCK(sc); error = 0; break; @@ -2199,7 +2209,6 @@ sis_ioctl(struct ifnet *ifp, u_long comm else sis_setmulti_sis(sc); SIS_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: Modified: stable/8/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 20:37:13 2010 (r213618) +++ stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 20:39:45 2010 (r213619) @@ -471,6 +471,7 @@ struct sis_softc { bus_addr_t sis_tx_paddr; struct callout sis_stat_ch; int sis_watchdog_timer; + int sis_if_flags; #ifdef DEVICE_POLLING int rxcycles; #endif From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:40:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1260106564A; Fri, 8 Oct 2010 20:40:05 +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 91CBF8FC1F; Fri, 8 Oct 2010 20:40: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 o98Ke5ic013222; Fri, 8 Oct 2010 20:40:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Ke5HW013220; Fri, 8 Oct 2010 20:40:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010082040.o98Ke5HW013220@svn.freebsd.org> From: Dimitry Andric Date: Fri, 8 Oct 2010 20:40: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: r213620 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:40:05 -0000 Author: dim Date: Fri Oct 8 20:40:05 2010 New Revision: 213620 URL: http://svn.freebsd.org/changeset/base/213620 Log: Remove superfluous cast in usr.bin/netstat/sctp.c. Found by: clang Submitted by: Norberto Lopes, nlopes dot ml at gmail dot com Approved by: rpaulo (mentor) Modified: head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Fri Oct 8 20:39:45 2010 (r213619) +++ head/usr.bin/netstat/sctp.c Fri Oct 8 20:40:05 2010 (r213620) @@ -355,7 +355,7 @@ sctp_process_inpcb(struct xsctp_inpcb *x first = 0; } if (Lflag && xinpcb->maxqlen == 0) { - (int)sctp_skip_xinpcb_ifneed(buf, buflen, offset); + sctp_skip_xinpcb_ifneed(buf, buflen, offset); return; } if (Aflag) From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:41:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F794106566C; Fri, 8 Oct 2010 20:41:15 +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 64FB88FC1D; Fri, 8 Oct 2010 20:41:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98KfFsC013298; Fri, 8 Oct 2010 20:41:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KfFUN013295; Fri, 8 Oct 2010 20:41:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082041.o98KfFUN013295@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213621 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:41:15 -0000 Author: yongari Date: Fri Oct 8 20:41:15 2010 New Revision: 213621 URL: http://svn.freebsd.org/changeset/base/213621 Log: MFC r212117,212119: rr212117: Report result of link state change to caller. Previously it always returned success. r212119: Do not reinitialize controller whenever promiscuous mode or allmulti is toggled. Controller does not require reinitialization. This removes unnecessary controller reinitialization whenever tcpdump is used. While I'm here remove unnecessary variable reinitialization. Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:40:05 2010 (r213620) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:41:15 2010 (r213621) @@ -2132,6 +2132,7 @@ sis_ifmedia_upd(struct ifnet *ifp) { struct sis_softc *sc; struct mii_data *mii; + int error; sc = ifp->if_softc; @@ -2143,10 +2144,10 @@ sis_ifmedia_upd(struct ifnet *ifp) LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); SIS_UNLOCK(sc); - return (0); + return (error); } /* @@ -2180,10 +2181,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm case SIOCSIFFLAGS: SIS_LOCK(sc); if (ifp->if_flags & IFF_UP) { - sis_initl(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->sis_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) { + if (sc->sis_type == SIS_TYPE_83815) + sis_setmulti_ns(sc); + else + sis_setmulti_sis(sc); + } else + sis_initl(sc); } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { sis_stop(sc); } + sc->sis_if_flags = ifp->if_flags; SIS_UNLOCK(sc); error = 0; break; @@ -2195,7 +2205,6 @@ sis_ioctl(struct ifnet *ifp, u_long comm else sis_setmulti_sis(sc); SIS_UNLOCK(sc); - error = 0; break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: Modified: stable/7/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:40:05 2010 (r213620) +++ stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:41:15 2010 (r213621) @@ -471,6 +471,7 @@ struct sis_softc { bus_addr_t sis_tx_paddr; struct callout sis_stat_ch; int sis_watchdog_timer; + int sis_if_flags; #ifdef DEVICE_POLLING int rxcycles; #endif From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:43:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B2BA106566B; Fri, 8 Oct 2010 20:43:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB71F8FC12; Fri, 8 Oct 2010 20:42: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 o98Kgxba013377; Fri, 8 Oct 2010 20:42:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KgxWw013375; Fri, 8 Oct 2010 20:42:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082042.o98KgxWw013375@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213622 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:43:00 -0000 Author: yongari Date: Fri Oct 8 20:42:59 2010 New Revision: 213622 URL: http://svn.freebsd.org/changeset/base/213622 Log: MFC r212120: Avoid controller reinitialization which could be triggered by dhclient(8) or alias addresses are added. PR: kern/87506 Modified: stable/8/sys/dev/sis/if_sis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:41:15 2010 (r213621) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:42:59 2010 (r213622) @@ -1741,6 +1741,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm if (status & SIS_ISR_SYSERR) { sis_reset(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); } } @@ -1796,6 +1797,7 @@ sis_intr(void *arg) if (status & SIS_ISR_SYSERR) { sis_reset(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); SIS_UNLOCK(sc); return; @@ -1971,6 +1973,9 @@ sis_initl(struct sis_softc *sc) SIS_LOCK_ASSERT(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel pending I/O and free all RX/TX buffers. */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:44:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5852A106564A; Fri, 8 Oct 2010 20:44:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 481AA8FC17; Fri, 8 Oct 2010 20:44: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 o98KiZ0o013472; Fri, 8 Oct 2010 20:44:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KiZhI013470; Fri, 8 Oct 2010 20:44:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082044.o98KiZhI013470@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213623 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:44:35 -0000 Author: yongari Date: Fri Oct 8 20:44:35 2010 New Revision: 213623 URL: http://svn.freebsd.org/changeset/base/213623 Log: MFC r212120: Avoid controller reinitialization which could be triggered by dhclient(8) or alias addresses are added. PR: kern/87506 Modified: stable/7/sys/dev/sis/if_sis.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:42:59 2010 (r213622) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:44:35 2010 (r213623) @@ -1738,6 +1738,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm if (status & SIS_ISR_SYSERR) { sis_reset(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); } } @@ -1792,6 +1793,7 @@ sis_intr(void *arg) if (status & SIS_ISR_SYSERR) { sis_reset(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); SIS_UNLOCK(sc); return; @@ -1967,6 +1969,9 @@ sis_initl(struct sis_softc *sc) SIS_LOCK_ASSERT(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel pending I/O and free all RX/TX buffers. */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:48:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5A161065702; Fri, 8 Oct 2010 20:48: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 94C618FC19; Fri, 8 Oct 2010 20:48: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 o98Km9tv013607; Fri, 8 Oct 2010 20:48:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Km9A9013605; Fri, 8 Oct 2010 20:48:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082048.o98Km9A9013605@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213624 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:48:09 -0000 Author: yongari Date: Fri Oct 8 20:48:09 2010 New Revision: 213624 URL: http://svn.freebsd.org/changeset/base/213624 Log: MFC r212121,212156: r212121: Move sis_reset() to sis_initl(). This ensures driver starts with known good state of controller. r212156: Fix the last endianness issue on handling station address which prevented driver from working on big-endian machines. Also rewrite station address programming to make it work on strict-alignment architectures. With this change, sis(4) now works on sparc64 and performance number looks good even though sis(4) have to apply fixup code to align received frames on 2 bytes boundary on sparc64. Modified: stable/8/sys/dev/sis/if_sis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:44:35 2010 (r213623) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:48:09 2010 (r213624) @@ -1057,7 +1057,12 @@ sis_attach(device_t dev) tmp[2] = sis_reverse(tmp[2]); tmp[1] = sis_reverse(tmp[1]); - bcopy((char *)&tmp[1], eaddr, ETHER_ADDR_LEN); + eaddr[0] = (tmp[1] >> 0) & 0xFF; + eaddr[1] = (tmp[1] >> 8) & 0xFF; + eaddr[2] = (tmp[2] >> 0) & 0xFF; + eaddr[3] = (tmp[2] >> 8) & 0xFF; + eaddr[4] = (tmp[3] >> 0) & 0xFF; + eaddr[5] = (tmp[3] >> 8) & 0xFF; } break; case SIS_VENDORID: @@ -1205,7 +1210,6 @@ sis_detach(device_t dev) /* These should only be active if attach succeeded. */ if (device_is_attached(dev)) { SIS_LOCK(sc); - sis_reset(sc); sis_stop(sc); SIS_UNLOCK(sc); callout_drain(&sc->sis_stat_ch); @@ -1740,7 +1744,6 @@ sis_poll(struct ifnet *ifp, enum poll_cm SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); if (status & SIS_ISR_SYSERR) { - sis_reset(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); } @@ -1796,7 +1799,6 @@ sis_intr(void *arg) SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); if (status & SIS_ISR_SYSERR) { - sis_reset(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); SIS_UNLOCK(sc); @@ -1970,6 +1972,7 @@ sis_initl(struct sis_softc *sc) { struct ifnet *ifp = sc->sis_ifp; struct mii_data *mii; + uint8_t *eaddr; SIS_LOCK_ASSERT(sc); @@ -1980,7 +1983,10 @@ sis_initl(struct sis_softc *sc) * Cancel pending I/O and free all RX/TX buffers. */ sis_stop(sc); - + /* + * Reset the chip to a known state. + */ + sis_reset(sc); #ifdef notyet if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr >= NS_SRR_16A) { /* @@ -1994,26 +2000,21 @@ sis_initl(struct sis_softc *sc) mii = device_get_softc(sc->sis_miibus); /* Set MAC address */ + eaddr = IF_LLADDR(sc->sis_ifp); if (sc->sis_type == SIS_TYPE_83815) { CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR0); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[0]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[0] | eaddr[1] << 8); CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR1); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[1]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[2] | eaddr[3] << 8); CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR2); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[2]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[4] | eaddr[5] << 8); } else { CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[0]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[0] | eaddr[1] << 8); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR1); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[1]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[2] | eaddr[3] << 8); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR2); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[2]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[4] | eaddr[5] << 8); } /* Init circular TX/RX lists. */ @@ -2268,8 +2269,7 @@ sis_watchdog(struct sis_softc *sc) device_printf(sc->sis_dev, "watchdog timeout\n"); sc->sis_ifp->if_oerrors++; - sis_stop(sc); - sis_reset(sc); + sc->sis_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); if (!IFQ_DRV_IS_EMPTY(&sc->sis_ifp->if_snd)) @@ -2346,7 +2346,6 @@ sis_shutdown(device_t dev) sc = device_get_softc(dev); SIS_LOCK(sc); - sis_reset(sc); sis_stop(sc); SIS_UNLOCK(sc); return (0); From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:49:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 680891065697; Fri, 8 Oct 2010 20:49:44 +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 575948FC14; Fri, 8 Oct 2010 20:49: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 o98KniUP013698; Fri, 8 Oct 2010 20:49:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KniYi013696; Fri, 8 Oct 2010 20:49:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082049.o98KniYi013696@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213625 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:49:44 -0000 Author: yongari Date: Fri Oct 8 20:49:44 2010 New Revision: 213625 URL: http://svn.freebsd.org/changeset/base/213625 Log: MFC r212121,212156: r212121: Move sis_reset() to sis_initl(). This ensures driver starts with known good state of controller. r212156: Fix the last endianness issue on handling station address which prevented driver from working on big-endian machines. Also rewrite station address programming to make it work on strict-alignment architectures. With this change, sis(4) now works on sparc64 and performance number looks good even though sis(4) have to apply fixup code to align received frames on 2 bytes boundary on sparc64. Modified: stable/7/sys/dev/sis/if_sis.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:48:09 2010 (r213624) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:49:44 2010 (r213625) @@ -1057,7 +1057,12 @@ sis_attach(device_t dev) tmp[2] = sis_reverse(tmp[2]); tmp[1] = sis_reverse(tmp[1]); - bcopy((char *)&tmp[1], eaddr, ETHER_ADDR_LEN); + eaddr[0] = (tmp[1] >> 0) & 0xFF; + eaddr[1] = (tmp[1] >> 8) & 0xFF; + eaddr[2] = (tmp[2] >> 0) & 0xFF; + eaddr[3] = (tmp[2] >> 8) & 0xFF; + eaddr[4] = (tmp[3] >> 0) & 0xFF; + eaddr[5] = (tmp[3] >> 8) & 0xFF; } break; case SIS_VENDORID: @@ -1205,7 +1210,6 @@ sis_detach(device_t dev) /* These should only be active if attach succeeded. */ if (device_is_attached(dev)) { SIS_LOCK(sc); - sis_reset(sc); sis_stop(sc); SIS_UNLOCK(sc); callout_drain(&sc->sis_stat_ch); @@ -1737,7 +1741,6 @@ sis_poll(struct ifnet *ifp, enum poll_cm SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); if (status & SIS_ISR_SYSERR) { - sis_reset(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); } @@ -1792,7 +1795,6 @@ sis_intr(void *arg) SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); if (status & SIS_ISR_SYSERR) { - sis_reset(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); SIS_UNLOCK(sc); @@ -1966,6 +1968,7 @@ sis_initl(struct sis_softc *sc) { struct ifnet *ifp = sc->sis_ifp; struct mii_data *mii; + uint8_t *eaddr; SIS_LOCK_ASSERT(sc); @@ -1976,7 +1979,10 @@ sis_initl(struct sis_softc *sc) * Cancel pending I/O and free all RX/TX buffers. */ sis_stop(sc); - + /* + * Reset the chip to a known state. + */ + sis_reset(sc); #ifdef notyet if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr >= NS_SRR_16A) { /* @@ -1990,26 +1996,21 @@ sis_initl(struct sis_softc *sc) mii = device_get_softc(sc->sis_miibus); /* Set MAC address */ + eaddr = IF_LLADDR(sc->sis_ifp); if (sc->sis_type == SIS_TYPE_83815) { CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR0); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[0]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[0] | eaddr[1] << 8); CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR1); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[1]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[2] | eaddr[3] << 8); CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR2); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[2]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[4] | eaddr[5] << 8); } else { CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[0]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[0] | eaddr[1] << 8); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR1); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[1]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[2] | eaddr[3] << 8); CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR2); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, - ((uint16_t *)IF_LLADDR(sc->sis_ifp))[2]); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, eaddr[4] | eaddr[5] << 8); } /* Init circular TX/RX lists. */ @@ -2264,8 +2265,7 @@ sis_watchdog(struct sis_softc *sc) device_printf(sc->sis_dev, "watchdog timeout\n"); sc->sis_ifp->if_oerrors++; - sis_stop(sc); - sis_reset(sc); + sc->sis_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sis_initl(sc); if (!IFQ_DRV_IS_EMPTY(&sc->sis_ifp->if_snd)) @@ -2342,7 +2342,6 @@ sis_shutdown(device_t dev) sc = device_get_softc(dev); SIS_LOCK(sc); - sis_reset(sc); sis_stop(sc); SIS_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:51:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4206810657A3; Fri, 8 Oct 2010 20:51:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0D08FC13; Fri, 8 Oct 2010 20:51: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 o98KpY2t013795; Fri, 8 Oct 2010 20:51:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KpYlZ013792; Fri, 8 Oct 2010 20:51:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082051.o98KpYlZ013792@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213626 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:51:34 -0000 Author: yongari Date: Fri Oct 8 20:51:33 2010 New Revision: 213626 URL: http://svn.freebsd.org/changeset/base/213626 Log: MFC r212157: Unlike most other controllers, NS DP83815/DP83816 controllers seem to pad with 0xFF when it encounter short frames. According to RFC 1042 the pad bytes should be 0x00. Because manual padding consumes extra CPU cycles, introduce a new tunable which controls the padding behavior. Turning this tunable on will have driver pad manually but it's disabled by default. Users can enable software padding by setting the following tunable to non-zero value. dev.sis.%d.manual_pad="1" PR: kern/35422 (patch not used) Modified: stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sis/if_sisreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:49:44 2010 (r213625) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 20:51:33 2010 (r213626) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -150,6 +151,7 @@ static int sis_rxeof(struct sis_softc *) static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); +static void sis_add_sysctls(struct sis_softc *); static void sis_watchdog(struct sis_softc *); @@ -710,24 +712,24 @@ sis_miibus_statchg(device_t dev) (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - sc->sis_link = 0; + sc->sis_flags &= ~SIS_FLAG_LINK; if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == (IFM_ACTIVE | IFM_AVALID)) { switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_10_T: - sc->sis_link++; CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_10); + sc->sis_flags |= SIS_FLAG_LINK; break; case IFM_100_TX: - sc->sis_link++; CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_100); + sc->sis_flags |= SIS_FLAG_LINK; break; default: break; } } - if (sc->sis_link == 0) { + if ((sc->sis_flags & SIS_FLAG_LINK) == 0) { /* * Stopping MACs seem to reset SIS_TX_LISTPTR and * SIS_RX_LISTPTR which in turn requires resetting @@ -1122,6 +1124,8 @@ sis_attach(device_t dev) break; } + sis_add_sysctls(sc); + /* Allocate DMA'able memory. */ if ((error = sis_dma_alloc(sc)) != 0) goto fail; @@ -1698,7 +1702,7 @@ sis_tick(void *xsc) mii = device_get_softc(sc->sis_miibus); mii_tick(mii); sis_watchdog(sc); - if (sc->sis_link == 0) + if ((sc->sis_flags & SIS_FLAG_LINK) == 0) sis_miibus_statchg(sc->sis_dev); callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); } @@ -1829,9 +1833,41 @@ sis_encap(struct sis_softc *sc, struct m bus_dma_segment_t segs[SIS_MAXTXSEGS]; bus_dmamap_t map; int error, i, frag, nsegs, prod; + int padlen; prod = sc->sis_tx_prod; txd = &sc->sis_txdesc[prod]; + if ((sc->sis_flags & SIS_FLAG_MANUAL_PAD) != 0 && + (*m_head)->m_pkthdr.len < SIS_MIN_FRAMELEN) { + m = *m_head; + padlen = SIS_MIN_FRAMELEN - m->m_pkthdr.len; + if (M_WRITABLE(m) == 0) { + /* Get a writable copy. */ + m = m_dup(*m_head, M_DONTWAIT); + m_freem(*m_head); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + *m_head = m; + } + if (m->m_next != NULL || M_TRAILINGSPACE(m) < padlen) { + m = m_defrag(m, M_DONTWAIT); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOBUFS); + } + } + /* + * Manually pad short frames, and zero the pad space + * to avoid leaking data. + */ + bzero(mtod(m, char *) + m->m_pkthdr.len, padlen); + m->m_pkthdr.len += padlen; + m->m_len = m->m_pkthdr.len; + *m_head = m; + } error = bus_dmamap_load_mbuf_sg(sc->sis_tx_tag, txd->tx_dmamap, *m_head, segs, &nsegs, 0); if (error == EFBIG) { @@ -1918,7 +1954,7 @@ sis_startl(struct ifnet *ifp) SIS_LOCK_ASSERT(sc); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || sc->sis_link == 0) + IFF_DRV_RUNNING || (sc->sis_flags & SIS_FLAG_LINK) == 0) return; for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && @@ -2025,6 +2061,13 @@ sis_initl(struct sis_softc *sc) return; } + if (sc->sis_type == SIS_TYPE_83815 || sc->sis_type == SIS_TYPE_83816) { + if (sc->sis_manual_pad != 0) + sc->sis_flags |= SIS_FLAG_MANUAL_PAD; + else + sc->sis_flags &= ~SIS_FLAG_MANUAL_PAD; + } + /* * Short Cable Receive Errors (MP21.E) * also: Page 78 of the DP83815 data sheet (september 2002 version) @@ -2125,7 +2168,7 @@ sis_initl(struct sis_softc *sc) /* Clear MAC disable. */ SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_TX_DISABLE | SIS_CSR_RX_DISABLE); - sc->sis_link = 0; + sc->sis_flags &= ~SIS_FLAG_LINK; mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -2148,7 +2191,6 @@ sis_ifmedia_upd(struct ifnet *ifp) SIS_LOCK(sc); mii = device_get_softc(sc->sis_miibus); - sc->sis_link = 0; if (mii->mii_instance) { struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) @@ -2304,7 +2346,7 @@ sis_stop(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_TX_LISTPTR, 0); CSR_WRITE_4(sc, SIS_RX_LISTPTR, 0); - sc->sis_link = 0; + sc->sis_flags &= ~SIS_FLAG_LINK; /* * Free data in the RX lists. @@ -2351,6 +2393,32 @@ sis_shutdown(device_t dev) return (0); } +static void +sis_add_sysctls(struct sis_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *children; + char tn[32]; + int unit; + + ctx = device_get_sysctl_ctx(sc->sis_dev); + children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sis_dev)); + + unit = device_get_unit(sc->sis_dev); + /* + * Unlike most other controllers, NS DP83815/DP83816 controllers + * seem to pad with 0xFF when it encounter short frames. According + * to RFC 1042 the pad bytes should be 0x00. Turning this tunable + * on will have driver pad manully but it's disabled by default + * because it will consume extra CPU cycles for short frames. + */ + sc->sis_manual_pad = 0; + snprintf(tn, sizeof(tn), "dev.sis.%d.manual_pad", unit); + TUNABLE_INT_FETCH(tn, &sc->sis_manual_pad); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "manual_pad", + CTLFLAG_RW, &sc->sis_manual_pad, 0, "Manually pad short frames"); +} + static device_method_t sis_methods[] = { /* Device interface */ DEVMETHOD(device_probe, sis_probe), Modified: stable/8/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 20:49:44 2010 (r213625) +++ stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 20:51:33 2010 (r213626) @@ -449,7 +449,10 @@ struct sis_softc { device_t sis_miibus; uint8_t sis_type; uint8_t sis_rev; - uint8_t sis_link; + uint32_t sis_flags; +#define SIS_FLAG_MANUAL_PAD 0x0800 +#define SIS_FLAG_LINK 0x8000 + int sis_manual_pad; uint32_t sis_srr; struct sis_desc *sis_rx_list; struct sis_desc *sis_tx_list; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:52:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 337CA106566B; Fri, 8 Oct 2010 20:52:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 227078FC15; Fri, 8 Oct 2010 20:52: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 o98KqmXi013874; Fri, 8 Oct 2010 20:52:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KqlSo013871; Fri, 8 Oct 2010 20:52:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082052.o98KqlSo013871@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213627 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:52:48 -0000 Author: yongari Date: Fri Oct 8 20:52:47 2010 New Revision: 213627 URL: http://svn.freebsd.org/changeset/base/213627 Log: MFC r212157: Unlike most other controllers, NS DP83815/DP83816 controllers seem to pad with 0xFF when it encounter short frames. According to RFC 1042 the pad bytes should be 0x00. Because manual padding consumes extra CPU cycles, introduce a new tunable which controls the padding behavior. Turning this tunable on will have driver pad manually but it's disabled by default. Users can enable software padding by setting the following tunable to non-zero value. dev.sis.%d.manual_pad="1" PR: kern/35422 (patch not used) Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:51:33 2010 (r213626) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 20:52:47 2010 (r213627) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -150,6 +151,7 @@ static void sis_rxeof(struct sis_softc * static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); +static void sis_add_sysctls(struct sis_softc *); static void sis_watchdog(struct sis_softc *); @@ -710,24 +712,24 @@ sis_miibus_statchg(device_t dev) (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - sc->sis_link = 0; + sc->sis_flags &= ~SIS_FLAG_LINK; if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == (IFM_ACTIVE | IFM_AVALID)) { switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_10_T: - sc->sis_link++; CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_10); + sc->sis_flags |= SIS_FLAG_LINK; break; case IFM_100_TX: - sc->sis_link++; CSR_WRITE_4(sc, SIS_TX_CFG, SIS_TXCFG_100); + sc->sis_flags |= SIS_FLAG_LINK; break; default: break; } } - if (sc->sis_link == 0) { + if ((sc->sis_flags & SIS_FLAG_LINK) == 0) { /* * Stopping MACs seem to reset SIS_TX_LISTPTR and * SIS_RX_LISTPTR which in turn requires resetting @@ -1122,6 +1124,8 @@ sis_attach(device_t dev) break; } + sis_add_sysctls(sc); + /* Allocate DMA'able memory. */ if ((error = sis_dma_alloc(sc)) != 0) goto fail; @@ -1696,7 +1700,7 @@ sis_tick(void *xsc) mii = device_get_softc(sc->sis_miibus); mii_tick(mii); sis_watchdog(sc); - if (sc->sis_link == 0) + if ((sc->sis_flags & SIS_FLAG_LINK) == 0) sis_miibus_statchg(sc->sis_dev); callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); } @@ -1825,9 +1829,41 @@ sis_encap(struct sis_softc *sc, struct m bus_dma_segment_t segs[SIS_MAXTXSEGS]; bus_dmamap_t map; int error, i, frag, nsegs, prod; + int padlen; prod = sc->sis_tx_prod; txd = &sc->sis_txdesc[prod]; + if ((sc->sis_flags & SIS_FLAG_MANUAL_PAD) != 0 && + (*m_head)->m_pkthdr.len < SIS_MIN_FRAMELEN) { + m = *m_head; + padlen = SIS_MIN_FRAMELEN - m->m_pkthdr.len; + if (M_WRITABLE(m) == 0) { + /* Get a writable copy. */ + m = m_dup(*m_head, M_DONTWAIT); + m_freem(*m_head); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + *m_head = m; + } + if (m->m_next != NULL || M_TRAILINGSPACE(m) < padlen) { + m = m_defrag(m, M_DONTWAIT); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOBUFS); + } + } + /* + * Manually pad short frames, and zero the pad space + * to avoid leaking data. + */ + bzero(mtod(m, char *) + m->m_pkthdr.len, padlen); + m->m_pkthdr.len += padlen; + m->m_len = m->m_pkthdr.len; + *m_head = m; + } error = bus_dmamap_load_mbuf_sg(sc->sis_tx_tag, txd->tx_dmamap, *m_head, segs, &nsegs, 0); if (error == EFBIG) { @@ -1914,7 +1950,7 @@ sis_startl(struct ifnet *ifp) SIS_LOCK_ASSERT(sc); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || sc->sis_link == 0) + IFF_DRV_RUNNING || (sc->sis_flags & SIS_FLAG_LINK) == 0) return; for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && @@ -2021,6 +2057,13 @@ sis_initl(struct sis_softc *sc) return; } + if (sc->sis_type == SIS_TYPE_83815 || sc->sis_type == SIS_TYPE_83816) { + if (sc->sis_manual_pad != 0) + sc->sis_flags |= SIS_FLAG_MANUAL_PAD; + else + sc->sis_flags &= ~SIS_FLAG_MANUAL_PAD; + } + /* * Short Cable Receive Errors (MP21.E) * also: Page 78 of the DP83815 data sheet (september 2002 version) @@ -2121,7 +2164,7 @@ sis_initl(struct sis_softc *sc) /* Clear MAC disable. */ SIS_CLRBIT(sc, SIS_CSR, SIS_CSR_TX_DISABLE | SIS_CSR_RX_DISABLE); - sc->sis_link = 0; + sc->sis_flags &= ~SIS_FLAG_LINK; mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -2144,7 +2187,6 @@ sis_ifmedia_upd(struct ifnet *ifp) SIS_LOCK(sc); mii = device_get_softc(sc->sis_miibus); - sc->sis_link = 0; if (mii->mii_instance) { struct mii_softc *miisc; LIST_FOREACH(miisc, &mii->mii_phys, mii_list) @@ -2300,7 +2342,7 @@ sis_stop(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_TX_LISTPTR, 0); CSR_WRITE_4(sc, SIS_RX_LISTPTR, 0); - sc->sis_link = 0; + sc->sis_flags &= ~SIS_FLAG_LINK; /* * Free data in the RX lists. @@ -2346,6 +2388,32 @@ sis_shutdown(device_t dev) SIS_UNLOCK(sc); } +static void +sis_add_sysctls(struct sis_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *children; + char tn[32]; + int unit; + + ctx = device_get_sysctl_ctx(sc->sis_dev); + children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sis_dev)); + + unit = device_get_unit(sc->sis_dev); + /* + * Unlike most other controllers, NS DP83815/DP83816 controllers + * seem to pad with 0xFF when it encounter short frames. According + * to RFC 1042 the pad bytes should be 0x00. Turning this tunable + * on will have driver pad manully but it's disabled by default + * because it will consume extra CPU cycles for short frames. + */ + sc->sis_manual_pad = 0; + snprintf(tn, sizeof(tn), "dev.sis.%d.manual_pad", unit); + TUNABLE_INT_FETCH(tn, &sc->sis_manual_pad); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "manual_pad", + CTLFLAG_RW, &sc->sis_manual_pad, 0, "Manually pad short frames"); +} + static device_method_t sis_methods[] = { /* Device interface */ DEVMETHOD(device_probe, sis_probe), Modified: stable/7/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:51:33 2010 (r213626) +++ stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 20:52:47 2010 (r213627) @@ -449,7 +449,10 @@ struct sis_softc { device_t sis_miibus; uint8_t sis_type; uint8_t sis_rev; - uint8_t sis_link; + uint32_t sis_flags; +#define SIS_FLAG_MANUAL_PAD 0x0800 +#define SIS_FLAG_LINK 0x8000 + int sis_manual_pad; uint32_t sis_srr; struct sis_desc *sis_rx_list; struct sis_desc *sis_tx_list; From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:54:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C449C106564A; Fri, 8 Oct 2010 20:54: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 B3D5C8FC19; Fri, 8 Oct 2010 20:54: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 o98Ks9V1013956; Fri, 8 Oct 2010 20:54:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Ks98g013954; Fri, 8 Oct 2010 20:54:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082054.o98Ks98g013954@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213628 - stable/8/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:54:09 -0000 Author: yongari Date: Fri Oct 8 20:54:09 2010 New Revision: 213628 URL: http://svn.freebsd.org/changeset/base/213628 Log: MFC r212158: Enable sis(4). sis(4) should work on all architectures. Modified: stable/8/sys/sparc64/conf/GENERIC Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/conf/GENERIC ============================================================================== --- stable/8/sys/sparc64/conf/GENERIC Fri Oct 8 20:52:47 2010 (r213627) +++ stable/8/sys/sparc64/conf/GENERIC Fri Oct 8 20:54:09 2010 (r213628) @@ -181,7 +181,7 @@ device nge # NatSemi DP83820 gigabit E device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') -#device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:55:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E183D106566B; Fri, 8 Oct 2010 20:55:27 +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 D13678FC0C; Fri, 8 Oct 2010 20:55: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 o98KtRVZ014052; Fri, 8 Oct 2010 20:55:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KtRCN014050; Fri, 8 Oct 2010 20:55:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082055.o98KtRCN014050@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213629 - stable/7/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:55:28 -0000 Author: yongari Date: Fri Oct 8 20:55:27 2010 New Revision: 213629 URL: http://svn.freebsd.org/changeset/base/213629 Log: MFC r212158: Enable sis(4). sis(4) should work on all architectures. Modified: stable/7/sys/sparc64/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Fri Oct 8 20:54:09 2010 (r213628) +++ stable/7/sys/sparc64/conf/GENERIC Fri Oct 8 20:55:27 2010 (r213629) @@ -176,7 +176,7 @@ device nge # NatSemi DP83820 gigabit E device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') -#device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:58:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 020C610656A3; Fri, 8 Oct 2010 20:58:06 +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 E5C0C8FC08; Fri, 8 Oct 2010 20:58: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 o98Kw5GN014170; Fri, 8 Oct 2010 20:58:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98Kw5FH014168; Fri, 8 Oct 2010 20:58:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082058.o98Kw5FH014168@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213630 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:58:06 -0000 Author: yongari Date: Fri Oct 8 20:58:05 2010 New Revision: 213630 URL: http://svn.freebsd.org/changeset/base/213630 Log: MFC r212159,212161: r212159: Document tunable dev.sis.%unit.manual_pad While I'm here Xref vlan(4) as sis(4) supports VLAN oversized frames. r212161: Better wording. Submitted by: jkim Modified: stable/8/share/man/man4/sis.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/sis.4 ============================================================================== --- stable/8/share/man/man4/sis.4 Fri Oct 8 20:55:27 2010 (r213629) +++ stable/8/share/man/man4/sis.4 Fri Oct 8 20:58:05 2010 (r213630) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2006 +.Dd September 2, 2010 .Dt SIS 4 .Os .Sh NAME @@ -145,6 +145,22 @@ SiS 630, 635, and 735 motherboard chipse .It Soekris Engineering net45xx, net48xx, lan1621, and lan1641 .El +.Sh SYSCTL VARIABLES +The following variable is available as both +.Xr sysctl 8 +variable and +.Xr loader 8 +tunable: +.Bl -tag -width indent +.It Va dev.sis.%unit.manual_pad +This variable controls how to pad short frames for DP83815/DP83816 +controllers on the specified device. +DP83815/DP83816 controllers are known to pad 0xFF for short frames +which is violation of RFC 1042. +Set this variable to a non-zero value to let driver manually pad +each short frame with zeros at the cost of extra CPU cycles. +The default value is 0 to let hardware perform automatic padding. +.El .Sh DIAGNOSTICS .Bl -diag .It "sis%d: couldn't map ports/memory" @@ -190,6 +206,7 @@ the card should be configured correctly. .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr vlan 4 , .Xr ifconfig 8 .Rs .%T SiS 900 and SiS 7016 datasheets From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 20:58:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C6501065672; Fri, 8 Oct 2010 20:58:49 +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 42E7A8FC0A; Fri, 8 Oct 2010 20:58: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 o98Kwn5B014246; Fri, 8 Oct 2010 20:58:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98KwnJq014244; Fri, 8 Oct 2010 20:58:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082058.o98KwnJq014244@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 20:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213631 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 20:58:49 -0000 Author: yongari Date: Fri Oct 8 20:58:48 2010 New Revision: 213631 URL: http://svn.freebsd.org/changeset/base/213631 Log: MFC r212159,212161: r212159: Document tunable dev.sis.%unit.manual_pad While I'm here Xref vlan(4) as sis(4) supports VLAN oversized frames. r212161: Better wording. Submitted by: jkim Modified: stable/7/share/man/man4/sis.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/sis.4 ============================================================================== --- stable/7/share/man/man4/sis.4 Fri Oct 8 20:58:05 2010 (r213630) +++ stable/7/share/man/man4/sis.4 Fri Oct 8 20:58:48 2010 (r213631) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2006 +.Dd September 2, 2010 .Dt SIS 4 .Os .Sh NAME @@ -145,6 +145,22 @@ SiS 630, 635, and 735 motherboard chipse .It Soekris Engineering net45xx, net48xx, lan1621, and lan1641 .El +.Sh SYSCTL VARIABLES +The following variable is available as both +.Xr sysctl 8 +variable and +.Xr loader 8 +tunable: +.Bl -tag -width indent +.It Va dev.sis.%unit.manual_pad +This variable controls how to pad short frames for DP83815/DP83816 +controllers on the specified device. +DP83815/DP83816 controllers are known to pad 0xFF for short frames +which is violation of RFC 1042. +Set this variable to a non-zero value to let driver manually pad +each short frame with zeros at the cost of extra CPU cycles. +The default value is 0 to let hardware perform automatic padding. +.El .Sh DIAGNOSTICS .Bl -diag .It "sis%d: couldn't map ports/memory" @@ -190,6 +206,7 @@ the card should be configured correctly. .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , +.Xr vlan 4 , .Xr ifconfig 8 .Rs .%T SiS 900 and SiS 7016 datasheets From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 21:29:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C314D1065723; Fri, 8 Oct 2010 21:29:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B33948FC12; Fri, 8 Oct 2010 21:29: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 o98LTmnW014959; Fri, 8 Oct 2010 21:29:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98LTmml014957; Fri, 8 Oct 2010 21:29:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010082129.o98LTmml014957@svn.freebsd.org> From: Xin LI Date: Fri, 8 Oct 2010 21:29: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: r213632 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 21:29:48 -0000 Author: delphij Date: Fri Oct 8 21:29:48 2010 New Revision: 213632 URL: http://svn.freebsd.org/changeset/base/213632 Log: Document net.link.lagg.failover_rx_all. MFC after: 1 week Modified: head/share/man/man4/lagg.4 Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Fri Oct 8 20:58:48 2010 (r213631) +++ head/share/man/man4/lagg.4 Fri Oct 8 21:29:48 2010 (r213632) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2009 +.Dd October 8, 2010 .Dt LAGG 4 .Os .Sh NAME @@ -73,11 +73,19 @@ The interface link state is used to vali not. .Bl -tag -width loadbalance .It Ic failover -Sends and receives traffic only through the master port. +Sends traffic only through the master port. If the master port becomes unavailable, the next active port is used. The first interface added is the master port; any interfaces added after that are used as failover devices. +.Pp +By default, received traffic is only accepted when they are received +through the master port. +This constraint can be relaxed by setting the +.Va net.link.lagg.failover_rx_all +.Xr sysctl 8 +variable to a nonzero value, +which is useful for certain bridged network setups. .It Ic fec Supports Cisco EtherChannel. This is a static setup and does not negotiate aggregation with the peer or @@ -153,6 +161,7 @@ device as a workaround.) .Sh SEE ALSO .Xr ng_fec 4 , .Xr ng_one2many 4 , +.Xr sysctl 8 , .Xr ifconfig 8 .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 21:37:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE07010657DC; Fri, 8 Oct 2010 21:37:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 91FFB8FC16; Fri, 8 Oct 2010 21:37:37 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o98LbJSd008394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Oct 2010 08:37:35 +1100 Date: Sat, 9 Oct 2010 08:37:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Peter Holm In-Reply-To: <201010081027.o98ARrUQ087673@svn.freebsd.org> Message-ID: <20101009082104.X1487@besplex.bde.org> References: <201010081027.o98ARrUQ087673@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213568 - head/sys/boot/i386/gptboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 21:37:42 -0000 On Fri, 8 Oct 2010, Peter Holm wrote: > Log: > Ensure that a make from sys/boot does not pick up include files from > /usr/include. > > Discussed with: kib > > Modified: > head/sys/boot/i386/gptboot/Makefile > > Modified: head/sys/boot/i386/gptboot/Makefile > ============================================================================== > --- head/sys/boot/i386/gptboot/Makefile Fri Oct 8 09:43:06 2010 (r213567) > +++ head/sys/boot/i386/gptboot/Makefile Fri Oct 8 10:27:52 2010 (r213568) > @@ -36,6 +36,7 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ > -I${.CURDIR}/../common \ > -I${.CURDIR}/../btx/lib -I. \ > -I${.CURDIR}/../boot2 \ > + -I${.CURDIR}/../../.. \ > -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ > -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ > -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ > This should be handled by setting -nostdinc in the top-level Makefile.inc, as was done in 1998 or earlier by sys/i386/boot/Makefile.inc (the sys/boot hierarchy is still of amazingly lower quality than the sys/i386/boot hierarchy), or in a central foo.mk Makefile as is done for kernels and modules. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 23:01:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21E711065674; Fri, 8 Oct 2010 23:01:39 +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 1216B8FC14; Fri, 8 Oct 2010 23:01: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 o98N1c5g016986; Fri, 8 Oct 2010 23:01:38 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98N1cYn016984; Fri, 8 Oct 2010 23:01:38 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010082301.o98N1cYn016984@svn.freebsd.org> From: Martin Matuska Date: Fri, 8 Oct 2010 23:01: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: r213634 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 23:01:39 -0000 Author: mm Date: Fri Oct 8 23:01:38 2010 New Revision: 213634 URL: http://svn.freebsd.org/changeset/base/213634 Log: Change FAPPEND to IO_APPEND as this is a ioflag and not a fflag. This corrects writing to append-only files on ZFS. PR: kern/149495 [1], kern/151082 [2] Submitted by: Daniel Zhelev [1], Michael Naef [2] Approved by: delphij (mentor) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 8 21:54:33 2010 (r213633) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Oct 8 23:01:38 2010 (r213634) @@ -755,7 +755,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int i */ pflags = zp->z_phys->zp_flags; if ((pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) || - ((pflags & ZFS_APPENDONLY) && !(ioflag & FAPPEND) && + ((pflags & ZFS_APPENDONLY) && !(ioflag & IO_APPEND) && (uio->uio_loffset < zp->z_phys->zp_size))) { ZFS_EXIT(zfsvfs); return (EPERM); From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 23:11:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86CFA106564A; Fri, 8 Oct 2010 23:11:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76A508FC18; Fri, 8 Oct 2010 23:11:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98NBkIh017214; Fri, 8 Oct 2010 23:11:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98NBk6t017212; Fri, 8 Oct 2010 23:11:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082311.o98NBk6t017212@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 23:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213635 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 23:11:46 -0000 Author: yongari Date: Fri Oct 8 23:11:46 2010 New Revision: 213635 URL: http://svn.freebsd.org/changeset/base/213635 Log: MFC r212166: Implement initial device suspend/resume method. Modified: stable/8/sys/dev/sis/if_sis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 23:01:38 2010 (r213634) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 23:11:46 2010 (r213635) @@ -2393,6 +2393,35 @@ sis_shutdown(device_t dev) return (0); } +static int +sis_suspend(device_t dev) +{ + struct sis_softc *sc; + + sc = device_get_softc(dev); + SIS_LOCK(sc); + sis_stop(sc); + SIS_UNLOCK(sc); + return (0); +} + +static int +sis_resume(device_t dev) +{ + struct sis_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + SIS_LOCK(sc); + ifp = sc->sis_ifp; + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sis_initl(sc); + } + SIS_UNLOCK(sc); + return (0); +} + static void sis_add_sysctls(struct sis_softc *sc) { @@ -2425,6 +2454,8 @@ static device_method_t sis_methods[] = { DEVMETHOD(device_attach, sis_attach), DEVMETHOD(device_detach, sis_detach), DEVMETHOD(device_shutdown, sis_shutdown), + DEVMETHOD(device_suspend, sis_suspend), + DEVMETHOD(device_resume, sis_resume), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 23:14:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC57D106564A; Fri, 8 Oct 2010 23:14:21 +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 AC2238FC0A; Fri, 8 Oct 2010 23:14: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 o98NELWH017305; Fri, 8 Oct 2010 23:14:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98NELFE017303; Fri, 8 Oct 2010 23:14:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082314.o98NELFE017303@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 23:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213636 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 23:14:21 -0000 Author: yongari Date: Fri Oct 8 23:14:21 2010 New Revision: 213636 URL: http://svn.freebsd.org/changeset/base/213636 Log: MFC r212166: Implement initial device suspend/resume method. Modified: stable/7/sys/dev/sis/if_sis.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 23:11:46 2010 (r213635) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 23:14:21 2010 (r213636) @@ -2388,6 +2388,35 @@ sis_shutdown(device_t dev) SIS_UNLOCK(sc); } +static int +sis_suspend(device_t dev) +{ + struct sis_softc *sc; + + sc = device_get_softc(dev); + SIS_LOCK(sc); + sis_stop(sc); + SIS_UNLOCK(sc); + return (0); +} + +static int +sis_resume(device_t dev) +{ + struct sis_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + SIS_LOCK(sc); + ifp = sc->sis_ifp; + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sis_initl(sc); + } + SIS_UNLOCK(sc); + return (0); +} + static void sis_add_sysctls(struct sis_softc *sc) { @@ -2420,6 +2449,8 @@ static device_method_t sis_methods[] = { DEVMETHOD(device_attach, sis_attach), DEVMETHOD(device_detach, sis_detach), DEVMETHOD(device_shutdown, sis_shutdown), + DEVMETHOD(device_suspend, sis_suspend), + DEVMETHOD(device_resume, sis_resume), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 23:16:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 256571065672; Fri, 8 Oct 2010 23:16:03 +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 148338FC0C; Fri, 8 Oct 2010 23:16: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 o98NG2Qg017400; Fri, 8 Oct 2010 23:16:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98NG2qw017397; Fri, 8 Oct 2010 23:16:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082316.o98NG2qw017397@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 23:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213637 - stable/8/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 23:16:03 -0000 Author: yongari Date: Fri Oct 8 23:16:02 2010 New Revision: 213637 URL: http://svn.freebsd.org/changeset/base/213637 Log: MFC r212167: Initial WOL support. NS DP8315 was tested but SiS900/SiS7016 was not tested. While I'm here, clean up SIOCSIFCAP handler. Modified: stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/sis/if_sisreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 23:14:21 2010 (r213636) +++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 23:16:02 2010 (r213637) @@ -147,12 +147,15 @@ static void sis_initl(struct sis_softc * static void sis_intr(void *); static int sis_ioctl(struct ifnet *, u_long, caddr_t); static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); +static int sis_resume(device_t); static int sis_rxeof(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); +static int sis_suspend(device_t); static void sis_add_sysctls(struct sis_softc *); static void sis_watchdog(struct sis_softc *); +static void sis_wol(struct sis_softc *); static struct resource_spec sis_res_spec[] = { @@ -935,6 +938,9 @@ sis_reset(struct sis_softc *sc) if (sc->sis_type == SIS_TYPE_83815) { CSR_WRITE_4(sc, NS_CLKRUN, NS_CLKRUN_PMESTS); CSR_WRITE_4(sc, NS_CLKRUN, 0); + } else { + /* Disable WOL functions. */ + CSR_WRITE_4(sc, SIS_PWRMAN_CTL, 0); } } @@ -971,7 +977,7 @@ sis_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct sis_softc *sc; struct ifnet *ifp; - int error = 0, waittime = 0; + int error = 0, pmc, waittime = 0; waittime = 0; sc = device_get_softc(dev); @@ -1147,6 +1153,14 @@ sis_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = SIS_TX_LIST_CNT - 1; IFQ_SET_READY(&ifp->if_snd); + if (pci_find_extcap(sc->sis_dev, PCIY_PMG, &pmc) == 0) { + if (sc->sis_type == SIS_TYPE_83815) + ifp->if_capabilities |= IFCAP_WOL; + else + ifp->if_capabilities |= IFCAP_WOL_MAGIC; + ifp->if_capenable = ifp->if_capabilities; + } + /* * Do MII setup. */ @@ -2227,7 +2241,7 @@ sis_ioctl(struct ifnet *ifp, u_long comm struct sis_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFFLAGS: @@ -2264,32 +2278,37 @@ sis_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: - /* ok, disable interrupts */ + SIS_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING - if (ifr->ifr_reqcap & IFCAP_POLLING && - !(ifp->if_capenable & IFCAP_POLLING)) { - error = ether_poll_register(sis_poll, ifp); - if (error) - return (error); - SIS_LOCK(sc); - /* Disable interrupts */ - CSR_WRITE_4(sc, SIS_IER, 0); - ifp->if_capenable |= IFCAP_POLLING; - SIS_UNLOCK(sc); - return (error); - - } - if (!(ifr->ifr_reqcap & IFCAP_POLLING) && - ifp->if_capenable & IFCAP_POLLING) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - SIS_LOCK(sc); - CSR_WRITE_4(sc, SIS_IER, 1); - ifp->if_capenable &= ~IFCAP_POLLING; - SIS_UNLOCK(sc); - return (error); + if ((mask & IFCAP_POLLING) != 0 && + (IFCAP_POLLING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_POLLING; + if ((IFCAP_POLLING & ifp->if_capenable) != 0) { + error = ether_poll_register(sis_poll, ifp); + if (error != 0) { + SIS_UNLOCK(sc); + break; + } + /* Disable interrupts. */ + CSR_WRITE_4(sc, SIS_IER, 0); + } else { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + CSR_WRITE_4(sc, SIS_IER, 1); + } } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL) != 0 && + (ifp->if_capabilities & IFCAP_WOL) != 0) { + if ((mask & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + } + SIS_UNLOCK(sc); break; default: error = ether_ioctl(ifp, command, data); @@ -2384,13 +2403,8 @@ sis_stop(struct sis_softc *sc) static int sis_shutdown(device_t dev) { - struct sis_softc *sc; - sc = device_get_softc(dev); - SIS_LOCK(sc); - sis_stop(sc); - SIS_UNLOCK(sc); - return (0); + return (sis_suspend(dev)); } static int @@ -2401,6 +2415,7 @@ sis_suspend(device_t dev) sc = device_get_softc(dev); SIS_LOCK(sc); sis_stop(sc); + sis_wol(sc); SIS_UNLOCK(sc); return (0); } @@ -2423,6 +2438,56 @@ sis_resume(device_t dev) } static void +sis_wol(struct sis_softc *sc) +{ + struct ifnet *ifp; + uint32_t val; + uint16_t pmstat; + int pmc; + + ifp = sc->sis_ifp; + if ((ifp->if_capenable & IFCAP_WOL) == 0) + return; + + if (sc->sis_type == SIS_TYPE_83815) { + /* Reset RXDP. */ + CSR_WRITE_4(sc, SIS_RX_LISTPTR, 0); + + /* Configure WOL events. */ + CSR_READ_4(sc, NS_WCSR); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + val |= NS_WCSR_WAKE_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + val |= NS_WCSR_WAKE_MCAST; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= NS_WCSR_WAKE_MAGIC; + CSR_WRITE_4(sc, NS_WCSR, val); + /* Enable PME and clear PMESTS. */ + val = CSR_READ_4(sc, NS_CLKRUN); + val |= NS_CLKRUN_PMEENB | NS_CLKRUN_PMESTS; + CSR_WRITE_4(sc, NS_CLKRUN, val); + /* Enable silent RX mode. */ + SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); + } else { + if (pci_find_extcap(sc->sis_dev, PCIY_PMG, &pmc) != 0) + return; + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= SIS_PWRMAN_WOL_MAGIC; + CSR_WRITE_4(sc, SIS_PWRMAN_CTL, val); + /* Request PME. */ + pmstat = pci_read_config(sc->sis_dev, + pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->sis_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } +} + +static void sis_add_sysctls(struct sis_softc *sc) { struct sysctl_ctx_list *ctx; Modified: stable/8/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 23:14:21 2010 (r213636) +++ stable/8/sys/dev/sis/if_sisreg.h Fri Oct 8 23:16:02 2010 (r213637) @@ -77,6 +77,7 @@ /* NS DP83815/6 registers */ #define NS_IHR 0x1C #define NS_CLKRUN 0x3C +#define NS_WCSR 0x40 #define NS_SRR 0x58 #define NS_BMCR 0x80 #define NS_BMSR 0x84 @@ -99,6 +100,29 @@ #define NS_CLKRUN_PMEENB 0x00000100 #define NS_CLNRUN_CLKRUN_ENB 0x00000001 +#define NS_WCSR_WAKE_PHYINTR 0x00000001 +#define NS_WCSR_WAKE_UCAST 0x00000002 +#define NS_WCSR_WAKE_MCAST 0x00000004 +#define NS_WCSR_WAKE_BCAST 0x00000008 +#define NS_WCSR_WAKE_ARP 0x00000010 +#define NS_WCSR_WAKE_PATTERN0 0x00000020 +#define NS_WCSR_WAKE_PATTERN1 0x00000040 +#define NS_WCSR_WAKE_PATTERN2 0x00000080 +#define NS_WCSR_WAKE_PATTERN3 0x00000100 +#define NS_WCSR_WAKE_MAGIC 0x00000200 +#define NS_WCSR_WAKE_MAGIC_SEC 0x00000400 +#define NS_WCSR_DET_MAGIC_SECH 0x00100000 +#define NS_WCSR_DET_PHYINTR 0x00400000 +#define NS_WCSR_DET_UCAST 0x00800000 +#define NS_WCSR_DET_MCAST 0x01000000 +#define NS_WCSR_DET_BCAST 0x02000000 +#define NS_WCSR_DET_ARP 0x04000000 +#define NS_WCSR_DET_PATTERN0 0x08000000 +#define NS_WCSR_DET_PATTERN1 0x10000000 +#define NS_WCSR_DET_PATTERN2 0x20000000 +#define NS_WCSR_DET_PATTERN3 0x40000000 +#define NS_WCSR_DET_MAGIC 0x80000000 + /* NS silicon revisions */ #define NS_SRR_15C 0x302 #define NS_SRR_15D 0x403 @@ -303,6 +327,10 @@ #define NS_FILTADDR_FMEM_LO 0x00000200 #define NS_FILTADDR_FMEM_HI 0x000003FE +#define SIS_PWRMAN_WOL_LINK_OFF 0x00000001 +#define SIS_PWRMAN_WOL_LINK_ON 0x00000002 +#define SIS_PWRMAN_WOL_MAGIC 0x00000400 + /* * TX/RX DMA descriptor structures. */ From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 23:29:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51012106566B; Fri, 8 Oct 2010 23:29:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E311D8FC17; Fri, 8 Oct 2010 23:29: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 o98NTjVm017723; Fri, 8 Oct 2010 23:29:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98NTjTj017719; Fri, 8 Oct 2010 23:29:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082329.o98NTjTj017719@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 23:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213638 - in stable/7/sys: dev/sis dev/tx pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 23:29:46 -0000 Author: yongari Date: Fri Oct 8 23:29:45 2010 New Revision: 213638 URL: http://svn.freebsd.org/changeset/base/213638 Log: MFC r188463: Fix shutdown prototypes. Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/tx/if_tx.c stable/7/sys/pci/if_tl.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 23:16:02 2010 (r213637) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 23:29:45 2010 (r213638) @@ -2377,7 +2377,7 @@ sis_stop(struct sis_softc *sc) * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int sis_shutdown(device_t dev) { struct sis_softc *sc; @@ -2386,6 +2386,7 @@ sis_shutdown(device_t dev) SIS_LOCK(sc); sis_stop(sc); SIS_UNLOCK(sc); + return (0); } static int Modified: stable/7/sys/dev/tx/if_tx.c ============================================================================== --- stable/7/sys/dev/tx/if_tx.c Fri Oct 8 23:16:02 2010 (r213637) +++ stable/7/sys/dev/tx/if_tx.c Fri Oct 8 23:29:45 2010 (r213638) @@ -120,7 +120,7 @@ static void epic_ifmedia_sts(struct ifne static int epic_probe(device_t); static int epic_attach(device_t); -static void epic_shutdown(device_t); +static int epic_shutdown(device_t); static int epic_detach(device_t); static void epic_release(epic_softc_t *); static struct epic_type *epic_devtype(device_t); @@ -508,7 +508,7 @@ epic_detach(device_t dev) * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int epic_shutdown(device_t dev) { epic_softc_t *sc; @@ -516,6 +516,7 @@ epic_shutdown(device_t dev) sc = device_get_softc(dev); epic_stop(sc); + return (0); } /* Modified: stable/7/sys/pci/if_tl.c ============================================================================== --- stable/7/sys/pci/if_tl.c Fri Oct 8 23:16:02 2010 (r213637) +++ stable/7/sys/pci/if_tl.c Fri Oct 8 23:29:45 2010 (r213638) @@ -282,7 +282,7 @@ static void tl_init(void *); static void tl_init_locked(struct tl_softc *); static void tl_stop(struct tl_softc *); static void tl_watchdog(struct ifnet *); -static void tl_shutdown(device_t); +static int tl_shutdown(device_t); static int tl_ifmedia_upd(struct ifnet *); static void tl_ifmedia_sts(struct ifnet *, struct ifmediareq *); @@ -2347,7 +2347,7 @@ tl_stop(sc) * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. */ -static void +static int tl_shutdown(dev) device_t dev; { @@ -2359,5 +2359,5 @@ tl_shutdown(dev) tl_stop(sc); TL_UNLOCK(sc); - return; + return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 8 23:34:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B8F21065673; Fri, 8 Oct 2010 23:34:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8C38FC13; Fri, 8 Oct 2010 23:34: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 o98NYjN6017874; Fri, 8 Oct 2010 23:34:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98NYjcV017871; Fri, 8 Oct 2010 23:34:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082334.o98NYjcV017871@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 23:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213639 - stable/7/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 23:34:46 -0000 Author: yongari Date: Fri Oct 8 23:34:45 2010 New Revision: 213639 URL: http://svn.freebsd.org/changeset/base/213639 Log: MFC r212167: Initial WOL support. NS DP8315 was tested but SiS900/SiS7016 was not tested. While I'm here, clean up SIOCSIFCAP handler. Modified: stable/7/sys/dev/sis/if_sis.c stable/7/sys/dev/sis/if_sisreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 23:29:45 2010 (r213638) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 23:34:45 2010 (r213639) @@ -147,12 +147,15 @@ static void sis_initl(struct sis_softc * static void sis_intr(void *); static int sis_ioctl(struct ifnet *, u_long, caddr_t); static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); +static int sis_resume(device_t); static void sis_rxeof(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); +static int sis_suspend(device_t); static void sis_add_sysctls(struct sis_softc *); static void sis_watchdog(struct sis_softc *); +static void sis_wol(struct sis_softc *); static struct resource_spec sis_res_spec[] = { @@ -935,6 +938,9 @@ sis_reset(struct sis_softc *sc) if (sc->sis_type == SIS_TYPE_83815) { CSR_WRITE_4(sc, NS_CLKRUN, NS_CLKRUN_PMESTS); CSR_WRITE_4(sc, NS_CLKRUN, 0); + } else { + /* Disable WOL functions. */ + CSR_WRITE_4(sc, SIS_PWRMAN_CTL, 0); } } @@ -971,7 +977,7 @@ sis_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct sis_softc *sc; struct ifnet *ifp; - int error = 0, waittime = 0; + int error = 0, pmc, waittime = 0; waittime = 0; sc = device_get_softc(dev); @@ -1147,6 +1153,14 @@ sis_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = SIS_TX_LIST_CNT - 1; IFQ_SET_READY(&ifp->if_snd); + if (pci_find_extcap(sc->sis_dev, PCIY_PMG, &pmc) == 0) { + if (sc->sis_type == SIS_TYPE_83815) + ifp->if_capabilities |= IFCAP_WOL; + else + ifp->if_capabilities |= IFCAP_WOL_MAGIC; + ifp->if_capenable = ifp->if_capabilities; + } + /* * Do MII setup. */ @@ -2223,7 +2237,7 @@ sis_ioctl(struct ifnet *ifp, u_long comm struct sis_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFFLAGS: @@ -2260,32 +2274,37 @@ sis_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: - /* ok, disable interrupts */ + SIS_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING - if (ifr->ifr_reqcap & IFCAP_POLLING && - !(ifp->if_capenable & IFCAP_POLLING)) { - error = ether_poll_register(sis_poll, ifp); - if (error) - return (error); - SIS_LOCK(sc); - /* Disable interrupts */ - CSR_WRITE_4(sc, SIS_IER, 0); - ifp->if_capenable |= IFCAP_POLLING; - SIS_UNLOCK(sc); - return (error); - - } - if (!(ifr->ifr_reqcap & IFCAP_POLLING) && - ifp->if_capenable & IFCAP_POLLING) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - SIS_LOCK(sc); - CSR_WRITE_4(sc, SIS_IER, 1); - ifp->if_capenable &= ~IFCAP_POLLING; - SIS_UNLOCK(sc); - return (error); + if ((mask & IFCAP_POLLING) != 0 && + (IFCAP_POLLING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_POLLING; + if ((IFCAP_POLLING & ifp->if_capenable) != 0) { + error = ether_poll_register(sis_poll, ifp); + if (error != 0) { + SIS_UNLOCK(sc); + break; + } + /* Disable interrupts. */ + CSR_WRITE_4(sc, SIS_IER, 0); + } else { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + CSR_WRITE_4(sc, SIS_IER, 1); + } } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL) != 0 && + (ifp->if_capabilities & IFCAP_WOL) != 0) { + if ((mask & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + } + SIS_UNLOCK(sc); break; default: error = ether_ioctl(ifp, command, data); @@ -2380,13 +2399,8 @@ sis_stop(struct sis_softc *sc) static int sis_shutdown(device_t dev) { - struct sis_softc *sc; - sc = device_get_softc(dev); - SIS_LOCK(sc); - sis_stop(sc); - SIS_UNLOCK(sc); - return (0); + return (sis_suspend(dev)); } static int @@ -2397,6 +2411,7 @@ sis_suspend(device_t dev) sc = device_get_softc(dev); SIS_LOCK(sc); sis_stop(sc); + sis_wol(sc); SIS_UNLOCK(sc); return (0); } @@ -2419,6 +2434,56 @@ sis_resume(device_t dev) } static void +sis_wol(struct sis_softc *sc) +{ + struct ifnet *ifp; + uint32_t val; + uint16_t pmstat; + int pmc; + + ifp = sc->sis_ifp; + if ((ifp->if_capenable & IFCAP_WOL) == 0) + return; + + if (sc->sis_type == SIS_TYPE_83815) { + /* Reset RXDP. */ + CSR_WRITE_4(sc, SIS_RX_LISTPTR, 0); + + /* Configure WOL events. */ + CSR_READ_4(sc, NS_WCSR); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + val |= NS_WCSR_WAKE_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + val |= NS_WCSR_WAKE_MCAST; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= NS_WCSR_WAKE_MAGIC; + CSR_WRITE_4(sc, NS_WCSR, val); + /* Enable PME and clear PMESTS. */ + val = CSR_READ_4(sc, NS_CLKRUN); + val |= NS_CLKRUN_PMEENB | NS_CLKRUN_PMESTS; + CSR_WRITE_4(sc, NS_CLKRUN, val); + /* Enable silent RX mode. */ + SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE); + } else { + if (pci_find_extcap(sc->sis_dev, PCIY_PMG, &pmc) != 0) + return; + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= SIS_PWRMAN_WOL_MAGIC; + CSR_WRITE_4(sc, SIS_PWRMAN_CTL, val); + /* Request PME. */ + pmstat = pci_read_config(sc->sis_dev, + pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->sis_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } +} + +static void sis_add_sysctls(struct sis_softc *sc) { struct sysctl_ctx_list *ctx; Modified: stable/7/sys/dev/sis/if_sisreg.h ============================================================================== --- stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 23:29:45 2010 (r213638) +++ stable/7/sys/dev/sis/if_sisreg.h Fri Oct 8 23:34:45 2010 (r213639) @@ -77,6 +77,7 @@ /* NS DP83815/6 registers */ #define NS_IHR 0x1C #define NS_CLKRUN 0x3C +#define NS_WCSR 0x40 #define NS_SRR 0x58 #define NS_BMCR 0x80 #define NS_BMSR 0x84 @@ -99,6 +100,29 @@ #define NS_CLKRUN_PMEENB 0x00000100 #define NS_CLNRUN_CLKRUN_ENB 0x00000001 +#define NS_WCSR_WAKE_PHYINTR 0x00000001 +#define NS_WCSR_WAKE_UCAST 0x00000002 +#define NS_WCSR_WAKE_MCAST 0x00000004 +#define NS_WCSR_WAKE_BCAST 0x00000008 +#define NS_WCSR_WAKE_ARP 0x00000010 +#define NS_WCSR_WAKE_PATTERN0 0x00000020 +#define NS_WCSR_WAKE_PATTERN1 0x00000040 +#define NS_WCSR_WAKE_PATTERN2 0x00000080 +#define NS_WCSR_WAKE_PATTERN3 0x00000100 +#define NS_WCSR_WAKE_MAGIC 0x00000200 +#define NS_WCSR_WAKE_MAGIC_SEC 0x00000400 +#define NS_WCSR_DET_MAGIC_SECH 0x00100000 +#define NS_WCSR_DET_PHYINTR 0x00400000 +#define NS_WCSR_DET_UCAST 0x00800000 +#define NS_WCSR_DET_MCAST 0x01000000 +#define NS_WCSR_DET_BCAST 0x02000000 +#define NS_WCSR_DET_ARP 0x04000000 +#define NS_WCSR_DET_PATTERN0 0x08000000 +#define NS_WCSR_DET_PATTERN1 0x10000000 +#define NS_WCSR_DET_PATTERN2 0x20000000 +#define NS_WCSR_DET_PATTERN3 0x40000000 +#define NS_WCSR_DET_MAGIC 0x80000000 + /* NS silicon revisions */ #define NS_SRR_15C 0x302 #define NS_SRR_15D 0x403 @@ -303,6 +327,10 @@ #define NS_FILTADDR_FMEM_LO 0x00000200 #define NS_FILTADDR_FMEM_HI 0x000003FE +#define SIS_PWRMAN_WOL_LINK_OFF 0x00000001 +#define SIS_PWRMAN_WOL_LINK_ON 0x00000002 +#define SIS_PWRMAN_WOL_MAGIC 0x00000400 + /* * TX/RX DMA descriptor structures. */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 00:34:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47404106566C; Sat, 9 Oct 2010 00:34:59 +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 362AE8FC15; Sat, 9 Oct 2010 00:34: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 o990YxYM019153; Sat, 9 Oct 2010 00:34:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o990Yxs7019151; Sat, 9 Oct 2010 00:34:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010090034.o990Yxs7019151@svn.freebsd.org> From: Xin LI Date: Sat, 9 Oct 2010 00:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213640 - in stable: 7/gnu/usr.bin/groff/tmac 8/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 00:34:59 -0000 Author: delphij Date: Sat Oct 9 00:34:58 2010 New Revision: 213640 URL: http://svn.freebsd.org/changeset/base/213640 Log: MFC r213487: Add definition for FreeBSD 7.4, which will be used in a manual page change. Modified: stable/8/gnu/usr.bin/groff/tmac/mdoc.local Directory Properties: stable/8/gnu/usr.bin/groff/ (props changed) Changes in other areas also in this revision: Modified: stable/7/gnu/usr.bin/groff/tmac/mdoc.local (contents, props changed) Directory Properties: stable/7/gnu/usr.bin/groff/ (props changed) Modified: stable/8/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/8/gnu/usr.bin/groff/tmac/mdoc.local Fri Oct 8 23:34:45 2010 (r213639) +++ stable/8/gnu/usr.bin/groff/tmac/mdoc.local Sat Oct 9 00:34:58 2010 (r213640) @@ -72,6 +72,7 @@ .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.2 7.2 .ds doc-operating-system-FreeBSD-7.3 7.3 +.ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-9.0 9.0 From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 00:34:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 671A11065670; Sat, 9 Oct 2010 00:34:59 +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 5620B8FC17; Sat, 9 Oct 2010 00:34: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 o990YxHp019159; Sat, 9 Oct 2010 00:34:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o990Yxn2019157; Sat, 9 Oct 2010 00:34:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010090034.o990Yxn2019157@svn.freebsd.org> From: Xin LI Date: Sat, 9 Oct 2010 00:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213640 - in stable: 7/gnu/usr.bin/groff/tmac 8/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 00:34:59 -0000 Author: delphij Date: Sat Oct 9 00:34:58 2010 New Revision: 213640 URL: http://svn.freebsd.org/changeset/base/213640 Log: MFC r213487: Add definition for FreeBSD 7.4, which will be used in a manual page change. Modified: stable/7/gnu/usr.bin/groff/tmac/mdoc.local (contents, props changed) Directory Properties: stable/7/gnu/usr.bin/groff/ (props changed) Changes in other areas also in this revision: Modified: stable/8/gnu/usr.bin/groff/tmac/mdoc.local Directory Properties: stable/8/gnu/usr.bin/groff/ (props changed) Modified: stable/7/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/7/gnu/usr.bin/groff/tmac/mdoc.local Fri Oct 8 23:34:45 2010 (r213639) +++ stable/7/gnu/usr.bin/groff/tmac/mdoc.local Sat Oct 9 00:34:58 2010 (r213640) @@ -72,6 +72,7 @@ .ds doc-operating-system-FreeBSD-7.1 7.1 .ds doc-operating-system-FreeBSD-7.2 7.2 .ds doc-operating-system-FreeBSD-7.3 7.3 +.ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-9.0 9.0 From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 00:36:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60431106566C; Sat, 9 Oct 2010 00:36:32 +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 4FBC78FC17; Sat, 9 Oct 2010 00:36: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 o990aW3d019251; Sat, 9 Oct 2010 00:36:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o990aWVa019249; Sat, 9 Oct 2010 00:36:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010090036.o990aWVa019249@svn.freebsd.org> From: Xin LI Date: Sat, 9 Oct 2010 00:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213641 - in stable: 7/libexec/tftpd 8/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 00:36:32 -0000 Author: delphij Date: Sat Oct 9 00:36:32 2010 New Revision: 213641 URL: http://svn.freebsd.org/changeset/base/213641 Log: MFC r213488: Use a defined FreeBSD version. Modified: stable/8/libexec/tftpd/tftpd.8 Directory Properties: stable/8/libexec/tftpd/ (props changed) Changes in other areas also in this revision: Modified: stable/7/libexec/tftpd/tftpd.8 Directory Properties: stable/7/libexec/tftpd/ (props changed) Modified: stable/8/libexec/tftpd/tftpd.8 ============================================================================== --- stable/8/libexec/tftpd/tftpd.8 Sat Oct 9 00:34:58 2010 (r213640) +++ stable/8/libexec/tftpd/tftpd.8 Sat Oct 9 00:36:32 2010 (r213641) @@ -245,14 +245,14 @@ and the and .Fl W options were introduced in -.Fx 7 . +.Fx 7.4 . .Pp Support for Timeout Interval and Transfer Size Options (RFC2349) was introduced in .Fx 5.0 , support for the TFTP Blocksize Option (RFC2348) and the blksize2 option was introduced in -.Fx 7 . +.Fx 7.4 . .Sh BUGS Files larger than 33488896 octets (65535 blocks) cannot be transferred without client and server supporting blocksize negotiation (RFC2348). From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 00:36:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 819161065670; Sat, 9 Oct 2010 00:36:32 +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 6F74B8FC18; Sat, 9 Oct 2010 00:36: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 o990aWlf019257; Sat, 9 Oct 2010 00:36:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o990aWTT019255; Sat, 9 Oct 2010 00:36:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010090036.o990aWTT019255@svn.freebsd.org> From: Xin LI Date: Sat, 9 Oct 2010 00:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213641 - in stable: 7/libexec/tftpd 8/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 00:36:32 -0000 Author: delphij Date: Sat Oct 9 00:36:32 2010 New Revision: 213641 URL: http://svn.freebsd.org/changeset/base/213641 Log: MFC r213488: Use a defined FreeBSD version. Modified: stable/7/libexec/tftpd/tftpd.8 Directory Properties: stable/7/libexec/tftpd/ (props changed) Changes in other areas also in this revision: Modified: stable/8/libexec/tftpd/tftpd.8 Directory Properties: stable/8/libexec/tftpd/ (props changed) Modified: stable/7/libexec/tftpd/tftpd.8 ============================================================================== --- stable/7/libexec/tftpd/tftpd.8 Sat Oct 9 00:34:58 2010 (r213640) +++ stable/7/libexec/tftpd/tftpd.8 Sat Oct 9 00:36:32 2010 (r213641) @@ -245,14 +245,14 @@ and the and .Fl W options were introduced in -.Fx 7 . +.Fx 7.4 . .Pp Support for Timeout Interval and Transfer Size Options (RFC2349) was introduced in .Fx 5.0 , support for the TFTP Blocksize Option (RFC2348) and the blksize2 option was introduced in -.Fx 7 . +.Fx 7.4 . .Sh BUGS Files larger than 33488896 octets (65535 blocks) cannot be transferred without client and server supporting blocksize negotiation (RFC2348). From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 02:50:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CC5A106566B; Sat, 9 Oct 2010 02:50:23 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3C68FC15; Sat, 9 Oct 2010 02:50: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 o992oNVo022385; Sat, 9 Oct 2010 02:50:23 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o992oNw0022369; Sat, 9 Oct 2010 02:50:23 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010090250.o992oNw0022369@svn.freebsd.org> From: David Xu Date: Sat, 9 Oct 2010 02:50: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: r213642 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 02:50:23 -0000 Author: davidxu Date: Sat Oct 9 02:50:23 2010 New Revision: 213642 URL: http://svn.freebsd.org/changeset/base/213642 Log: Create a global thread hash table to speed up thread lookup, use rwlock to protect the table. In old code, thread lookup is done with process lock held, to find a thread, kernel has to iterate through process and thread list, this is quite inefficient. With this change, test shows in extreme case performance is dramatically improved. Earlier patch was reviewed by: jhb, julian Modified: head/sys/kern/init_main.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_kthread.c head/sys/kern/kern_resource.c head/sys/kern/kern_sig.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/kern/kern_time.c head/sys/kern/kern_umtx.c head/sys/kern/sys_process.c head/sys/kern/uipc_mqueue.c head/sys/kern/vfs_aio.c head/sys/sys/proc.h head/sys/sys/signalvar.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/init_main.c Sat Oct 9 02:50:23 2010 (r213642) @@ -443,6 +443,7 @@ proc0_init(void *dummy __unused) */ LIST_INSERT_HEAD(&allproc, p, p_list); LIST_INSERT_HEAD(PIDHASH(0), p, p_hash); + LIST_INSERT_HEAD(TIDHASH(0), td, td_hash); mtx_init(&pgrp0.pg_mtx, "process group", NULL, MTX_DEF | MTX_DUPOK); p->p_pgrp = &pgrp0; LIST_INSERT_HEAD(PGRPHASH(0), &pgrp0, pg_hash); Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_exit.c Sat Oct 9 02:50:23 2010 (r213642) @@ -403,6 +403,8 @@ exit1(struct thread *td, int rv) PROC_UNLOCK(p); lim_free(plim); + tidhash_remove(td); + /* * Remove proc from allproc queue and pidhash chain. * Place onto zombproc. Unlink from parent's child list. Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_fork.c Sat Oct 9 02:50:23 2010 (r213642) @@ -456,7 +456,7 @@ again: AUDIT_ARG_PID(p2->p_pid); LIST_INSERT_HEAD(&allproc, p2, p_list); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); - + tidhash_add(td2); PROC_LOCK(p2); PROC_LOCK(p1); Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_kthread.c Sat Oct 9 02:50:23 2010 (r213642) @@ -295,6 +295,7 @@ kthread_add(void (*func)(void *), void * thread_unlock(oldtd); PROC_UNLOCK(p); + tidhash_add(newtd); /* Delay putting it on the run queue until now. */ if (!(flags & RFSTOPPED)) { @@ -314,6 +315,8 @@ kthread_exit(void) p = curthread->td_proc; + tidhash_remove(curthread); + /* A module may be waiting for us to exit. */ wakeup(curthread); PROC_LOCK(p); Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_resource.c Sat Oct 9 02:50:23 2010 (r213642) @@ -295,25 +295,23 @@ rtprio_thread(struct thread *td, struct else cierror = 0; - /* - * Though lwpid is unique, only current process is supported - * since there is no efficient way to look up a LWP yet. - */ - p = td->td_proc; - PROC_LOCK(p); + if (uap->lwpid == 0 || uap->lwpid == td->td_tid) { + p = td->td_proc; + td1 = td; + PROC_LOCK(p); + } else { + /* Only look up thread in current process */ + td1 = tdfind(uap->lwpid, curproc->p_pid); + if (td1 == NULL) + return (ESRCH); + p = td1->td_proc; + } switch (uap->function) { case RTP_LOOKUP: if ((error = p_cansee(td, p))) break; - if (uap->lwpid == 0 || uap->lwpid == td->td_tid) - td1 = td; - else - td1 = thread_find(p, uap->lwpid); - if (td1 != NULL) - pri_to_rtp(td1, &rtp); - else - error = ESRCH; + pri_to_rtp(td1, &rtp); PROC_UNLOCK(p); return (copyout(&rtp, uap->rtp, sizeof(struct rtprio))); case RTP_SET: @@ -337,15 +335,7 @@ rtprio_thread(struct thread *td, struct if (error) break; } - - if (uap->lwpid == 0 || uap->lwpid == td->td_tid) - td1 = td; - else - td1 = thread_find(p, uap->lwpid); - if (td1 != NULL) - error = rtp_to_pri(&rtp, td1); - else - error = ESRCH; + error = rtp_to_pri(&rtp, td1); break; default: error = EINVAL; Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_sig.c Sat Oct 9 02:50:23 2010 (r213642) @@ -107,8 +107,6 @@ static int killpg1(struct thread *td, in ksiginfo_t *ksi); static int issignal(struct thread *td, int stop_allowed); static int sigprop(int sig); -static int tdsendsignal(struct proc *p, struct thread *td, int sig, - ksiginfo_t *ksi); static void tdsigwakeup(struct thread *, int, sig_t, int); static void sig_suspend_threads(struct thread *, struct proc *, int); static int filt_sigattach(struct knote *kn); @@ -1974,27 +1972,22 @@ pksignal(struct proc *p, int sig, ksigin return (tdsendsignal(p, NULL, sig, ksi)); } +/* Utility function for finding a thread to send signal event to. */ int -psignal_event(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi) +sigev_findtd(struct proc *p ,struct sigevent *sigev, struct thread **ttd) { - struct thread *td = NULL; - - PROC_LOCK_ASSERT(p, MA_OWNED); - - KASSERT(!KSI_ONQ(ksi), ("psignal_event: ksi on queue")); + struct thread *td; - /* - * ksi_code and other fields should be set before - * calling this function. - */ - ksi->ksi_signo = sigev->sigev_signo; - ksi->ksi_value = sigev->sigev_value; if (sigev->sigev_notify == SIGEV_THREAD_ID) { - td = thread_find(p, sigev->sigev_notify_thread_id); + td = tdfind(sigev->sigev_notify_thread_id, p->p_pid); if (td == NULL) return (ESRCH); + *ttd = td; + } else { + *ttd = NULL; + PROC_LOCK(p); } - return (tdsendsignal(p, td, ksi->ksi_signo, ksi)); + return (0); } void @@ -2015,7 +2008,7 @@ tdksignal(struct thread *td, int sig, ks (void) tdsendsignal(td->td_proc, td, sig, ksi); } -static int +int tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) { sig_t action; @@ -2026,6 +2019,7 @@ tdsendsignal(struct proc *p, struct thre int ret = 0; int wakeup_swapper; + MPASS(td == NULL || p == td->td_proc); PROC_LOCK_ASSERT(p, MA_OWNED); if (!_SIG_VALID(sig)) Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_thr.c Sat Oct 9 02:50:23 2010 (r213642) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -240,6 +241,9 @@ create_thread(struct thread *td, mcontex if (P_SHOULDSTOP(p)) newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; PROC_UNLOCK(p); + + tidhash_add(newtd); + thread_lock(newtd); if (rtp != NULL) { if (!(td->td_pri_class == PRI_TIMESHARE && @@ -281,6 +285,8 @@ thr_exit(struct thread *td, struct thr_e kern_umtx_wake(td, uap->state, INT_MAX, 0); } + tidhash_remove(td); + PROC_LOCK(p); tdsigcleanup(td); PROC_SLOCK(p); @@ -309,18 +315,17 @@ thr_kill(struct thread *td, struct thr_k int error; p = td->td_proc; - error = 0; ksiginfo_init(&ksi); ksi.ksi_signo = uap->sig; ksi.ksi_code = SI_LWP; ksi.ksi_pid = p->p_pid; ksi.ksi_uid = td->td_ucred->cr_ruid; - PROC_LOCK(p); if (uap->id == -1) { if (uap->sig != 0 && !_SIG_VALID(uap->sig)) { error = EINVAL; } else { error = ESRCH; + PROC_LOCK(p); FOREACH_THREAD_IN_PROC(p, ttd) { if (ttd != td) { error = 0; @@ -329,22 +334,21 @@ thr_kill(struct thread *td, struct thr_k tdksignal(ttd, uap->sig, &ksi); } } + PROC_UNLOCK(p); } } else { - if (uap->id != td->td_tid) - ttd = thread_find(p, uap->id); - else - ttd = td; + error = 0; + ttd = tdfind((lwpid_t)uap->id, p->p_pid); if (ttd == NULL) - error = ESRCH; - else if (uap->sig == 0) + return (ESRCH); + if (uap->sig == 0) ; else if (!_SIG_VALID(uap->sig)) error = EINVAL; - else + else tdksignal(ttd, uap->sig, &ksi); + PROC_UNLOCK(ttd->td_proc); } - PROC_UNLOCK(p); return (error); } @@ -359,51 +363,49 @@ thr_kill2(struct thread *td, struct thr_ AUDIT_ARG_SIGNUM(uap->sig); - if (uap->pid == td->td_proc->p_pid) { - p = td->td_proc; - PROC_LOCK(p); - } else if ((p = pfind(uap->pid)) == NULL) { - return (ESRCH); - } - AUDIT_ARG_PROCESS(p); - - error = p_cansignal(td, p, uap->sig); - if (error == 0) { - ksiginfo_init(&ksi); - ksi.ksi_signo = uap->sig; - ksi.ksi_code = SI_LWP; - ksi.ksi_pid = td->td_proc->p_pid; - ksi.ksi_uid = td->td_ucred->cr_ruid; - if (uap->id == -1) { - if (uap->sig != 0 && !_SIG_VALID(uap->sig)) { - error = EINVAL; - } else { - error = ESRCH; - FOREACH_THREAD_IN_PROC(p, ttd) { - if (ttd != td) { - error = 0; - if (uap->sig == 0) - break; - tdksignal(ttd, uap->sig, &ksi); - } + ksiginfo_init(&ksi); + ksi.ksi_signo = uap->sig; + ksi.ksi_code = SI_LWP; + ksi.ksi_pid = td->td_proc->p_pid; + ksi.ksi_uid = td->td_ucred->cr_ruid; + if (uap->id == -1) { + if ((p = pfind(uap->pid)) == NULL) + return (ESRCH); + AUDIT_ARG_PROCESS(p); + error = p_cansignal(td, p, uap->sig); + if (error) { + PROC_UNLOCK(p); + return (error); + } + if (uap->sig != 0 && !_SIG_VALID(uap->sig)) { + error = EINVAL; + } else { + error = ESRCH; + FOREACH_THREAD_IN_PROC(p, ttd) { + if (ttd != td) { + error = 0; + if (uap->sig == 0) + break; + tdksignal(ttd, uap->sig, &ksi); } } - } else { - if (uap->id != td->td_tid) - ttd = thread_find(p, uap->id); - else - ttd = td; - if (ttd == NULL) - error = ESRCH; - else if (uap->sig == 0) - ; - else if (!_SIG_VALID(uap->sig)) - error = EINVAL; - else - tdksignal(ttd, uap->sig, &ksi); } + PROC_UNLOCK(p); + } else { + ttd = tdfind((lwpid_t)uap->id, uap->pid); + if (ttd == NULL) + return (ESRCH); + p = ttd->td_proc; + AUDIT_ARG_PROCESS(p); + error = p_cansignal(td, p, uap->sig); + if (uap->sig == 0) + ; + else if (!_SIG_VALID(uap->sig)) + error = EINVAL; + else + tdksignal(ttd, uap->sig, &ksi); + PROC_UNLOCK(p); } - PROC_UNLOCK(p); return (error); } @@ -485,12 +487,9 @@ thr_wake(struct thread *td, struct thr_w } p = td->td_proc; - PROC_LOCK(p); - ttd = thread_find(p, uap->id); - if (ttd == NULL) { - PROC_UNLOCK(p); + ttd = tdfind((lwpid_t)uap->id, p->p_pid); + if (ttd == NULL) return (ESRCH); - } thread_lock(ttd); ttd->td_flags |= TDF_THRWAKEUP; thread_unlock(ttd); @@ -502,7 +501,7 @@ thr_wake(struct thread *td, struct thr_w int thr_set_name(struct thread *td, struct thr_set_name_args *uap) { - struct proc *p = td->td_proc; + struct proc *p; char name[MAXCOMLEN + 1]; struct thread *ttd; int error; @@ -515,15 +514,11 @@ thr_set_name(struct thread *td, struct t if (error) return (error); } - PROC_LOCK(p); - if (uap->id == td->td_tid) - ttd = td; - else - ttd = thread_find(p, uap->id); - if (ttd != NULL) - strcpy(ttd->td_name, name); - else - error = ESRCH; + p = td->td_proc; + ttd = tdfind((lwpid_t)uap->id, p->p_pid); + if (ttd == NULL) + return (ESRCH); + strcpy(ttd->td_name, name); PROC_UNLOCK(p); return (error); } Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_thread.c Sat Oct 9 02:50:23 2010 (r213642) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef HWPMC_HOOKS @@ -83,6 +84,12 @@ static void thread_zombie(struct thread struct mtx tid_lock; static struct unrhdr *tid_unrhdr; +static MALLOC_DEFINE(M_TIDHASH, "tidhash", "thread hash"); + +struct tidhashhead *tidhashtbl; +u_long tidhash; +struct rwlock tidhash_lock; + /* * Prepare a thread for use. */ @@ -230,6 +237,8 @@ threadinit(void) thread_zone = uma_zcreate("THREAD", sched_sizeof_thread(), thread_ctor, thread_dtor, thread_init, thread_fini, 16 - 1, 0); + tidhashtbl = hashinit(maxproc / 2, M_TIDHASH, &tidhash); + rw_init(&tidhash_lock, "tidhash"); } /* @@ -748,8 +757,14 @@ thread_suspend_check(int return_instead) * this thread should just suicide. * Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE. */ - if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) + if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { + PROC_SUNLOCK(p); + PROC_UNLOCK(p); + tidhash_remove(td); + PROC_LOCK(p); + PROC_SLOCK(p); thread_exit(); + } if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { if (p->p_numthreads == p->p_suspcount + 1) { thread_lock(p->p_singlethread); @@ -923,3 +938,57 @@ thread_find(struct proc *p, lwpid_t tid) } return (td); } + +/* Locate a thread by number; return with proc lock held. */ +struct thread * +tdfind(lwpid_t tid, pid_t pid) +{ +#define RUN_THRESH 16 + struct thread *td; + int run = 0; + + rw_rlock(&tidhash_lock); + LIST_FOREACH(td, TIDHASH(tid), td_hash) { + if (td->td_tid == tid) { + if (pid != -1 && td->td_proc->p_pid != pid) { + td = NULL; + break; + } + if (td->td_proc->p_state == PRS_NEW) { + td = NULL; + break; + } + if (run > RUN_THRESH) { + if (rw_try_upgrade(&tidhash_lock)) { + LIST_REMOVE(td, td_hash); + LIST_INSERT_HEAD(TIDHASH(td->td_tid), + td, td_hash); + PROC_LOCK(td->td_proc); + rw_wunlock(&tidhash_lock); + return (td); + } + } + PROC_LOCK(td->td_proc); + break; + } + run++; + } + rw_runlock(&tidhash_lock); + return (td); +} + +void +tidhash_add(struct thread *td) +{ + rw_wlock(&tidhash_lock); + LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); + rw_wunlock(&tidhash_lock); +} + +void +tidhash_remove(struct thread *td) +{ + rw_wlock(&tidhash_lock); + LIST_REMOVE(td, td_hash); + rw_wunlock(&tidhash_lock); +} Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_time.c Sat Oct 9 02:50:23 2010 (r213642) @@ -1402,28 +1402,22 @@ void itimer_fire(struct itimer *it) { struct proc *p = it->it_proc; - int ret; + struct thread *td; if (it->it_sigev.sigev_notify == SIGEV_SIGNAL || it->it_sigev.sigev_notify == SIGEV_THREAD_ID) { - PROC_LOCK(p); + if (sigev_findtd(p, &it->it_sigev, &td) != 0) { + ITIMER_LOCK(it); + timespecclear(&it->it_time.it_value); + timespecclear(&it->it_time.it_interval); + callout_stop(&it->it_callout); + ITIMER_UNLOCK(it); + return; + } if (!KSI_ONQ(&it->it_ksi)) { it->it_ksi.ksi_errno = 0; - ret = psignal_event(p, &it->it_sigev, &it->it_ksi); - if (__predict_false(ret != 0)) { - it->it_overrun++; - /* - * Broken userland code, thread went - * away, disarm the timer. - */ - if (ret == ESRCH) { - ITIMER_LOCK(it); - timespecclear(&it->it_time.it_value); - timespecclear(&it->it_time.it_interval); - callout_stop(&it->it_callout); - ITIMER_UNLOCK(it); - } - } + ksiginfo_set_sigev(&it->it_ksi, &it->it_sigev); + tdsendsignal(p, td, it->it_ksi.ksi_signo, &it->it_ksi); } else { if (it->it_overrun < INT_MAX) it->it_overrun++; Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/kern_umtx.c Sat Oct 9 02:50:23 2010 (r213642) @@ -1588,20 +1588,15 @@ umtxq_sleep_pi(struct umtx_q *uq, struct umtxq_insert(uq); mtx_lock_spin(&umtx_lock); if (pi->pi_owner == NULL) { - /* XXX - * Current, We only support process private PI-mutex, - * we need a faster way to find an owner thread for - * process-shared mutex (not available yet). - */ mtx_unlock_spin(&umtx_lock); - PROC_LOCK(curproc); - td1 = thread_find(curproc, owner); + /* XXX Only look up thread in current process. */ + td1 = tdfind(owner, curproc->p_pid); mtx_lock_spin(&umtx_lock); if (td1 != NULL && pi->pi_owner == NULL) { uq1 = td1->td_umtxq; umtx_pi_setowner(pi, td1); } - PROC_UNLOCK(curproc); + PROC_UNLOCK(td1->td_proc); } TAILQ_FOREACH(uq1, &pi->pi_blocked, uq_lockq) { Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/sys_process.c Sat Oct 9 02:50:23 2010 (r213642) @@ -721,24 +721,13 @@ kern_ptrace(struct thread *td, int req, return (ESRCH); } } else { - /* this is slow, should be optimized */ - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - FOREACH_THREAD_IN_PROC(p, td2) { - if (td2->td_tid == pid) - break; - } - if (td2 != NULL) - break; /* proc lock held */ - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); - if (p == NULL) { + td2 = tdfind(pid, -1); + if (td2 == NULL) { if (proctree_locked) sx_xunlock(&proctree_lock); return (ESRCH); } + p = td2->td_proc; tid = pid; pid = p->p_pid; } Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/uipc_mqueue.c Sat Oct 9 02:50:23 2010 (r213642) @@ -1747,15 +1747,23 @@ static void mqueue_send_notification(struct mqueue *mq) { struct mqueue_notifier *nt; + struct thread *td; struct proc *p; + int error; mtx_assert(&mq->mq_mutex, MA_OWNED); nt = mq->mq_notifier; if (nt->nt_sigev.sigev_notify != SIGEV_NONE) { p = nt->nt_proc; - PROC_LOCK(p); - if (!KSI_ONQ(&nt->nt_ksi)) - psignal_event(p, &nt->nt_sigev, &nt->nt_ksi); + error = sigev_findtd(p, &nt->nt_sigev, &td); + if (error) { + mq->mq_notifier = NULL; + return; + } + if (!KSI_ONQ(&nt->nt_ksi)) { + ksiginfo_set_sigev(&nt->nt_ksi, &nt->nt_sigev); + tdsendsignal(p, td, nt->nt_ksi.ksi_signo, &nt->nt_ksi); + } PROC_UNLOCK(p); } mq->mq_notifier = NULL; Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/kern/vfs_aio.c Sat Oct 9 02:50:23 2010 (r213642) @@ -609,16 +609,20 @@ aio_init_aioinfo(struct proc *p) static int aio_sendsig(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi) { - int ret = 0; + struct thread *td; + int error; - PROC_LOCK(p); + error = sigev_findtd(p, sigev, &td); + if (error) + return (error); if (!KSI_ONQ(ksi)) { + ksiginfo_set_sigev(ksi, sigev); ksi->ksi_code = SI_ASYNCIO; ksi->ksi_flags |= KSI_EXT | KSI_INS; - ret = psignal_event(p, sigev, ksi); + tdsendsignal(p, td, ksi->ksi_signo, ksi); } PROC_UNLOCK(p); - return (ret); + return (error); } /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/sys/proc.h Sat Oct 9 02:50:23 2010 (r213642) @@ -205,6 +205,7 @@ struct thread { TAILQ_ENTRY(thread) td_runq; /* (t) Run queue. */ TAILQ_ENTRY(thread) td_slpq; /* (t) Sleep queue. */ TAILQ_ENTRY(thread) td_lockq; /* (t) Lock queue. */ + LIST_ENTRY(thread) td_hash; /* (d) Hash chain. */ struct cpuset *td_cpuset; /* (t) CPU affinity mask. */ struct seltd *td_sel; /* Select queue/channel. */ struct sleepqueue *td_sleepqueue; /* (k) Associated sleep queue. */ @@ -766,6 +767,10 @@ MALLOC_DECLARE(M_ZOMBIE); #define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; extern u_long pidhash; +#define TIDHASH(tid) (&tidhashtbl[(tid) & tidhash]) +extern LIST_HEAD(tidhashhead, thread) *tidhashtbl; +extern u_long tidhash; +extern struct rwlock tidhash_lock; #define PGRPHASH(pgid) (&pgrphashtbl[(pgid) & pgrphash]) extern LIST_HEAD(pgrphashhead, pgrp) *pgrphashtbl; @@ -837,7 +842,10 @@ void setsugid(struct proc *p); int sigonstack(size_t sp); void sleepinit(void); void stopevent(struct proc *, u_int, u_int); +struct thread *tdfind(lwpid_t, pid_t); void threadinit(void); +void tidhash_add(struct thread *); +void tidhash_remove(struct thread *); void cpu_idle(int); int cpu_idle_wakeup(int); extern void (*cpu_idle_hook)(void); /* Hook to machdep CPU idler. */ Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Sat Oct 9 00:36:32 2010 (r213641) +++ head/sys/sys/signalvar.h Sat Oct 9 02:50:23 2010 (r213642) @@ -294,6 +294,13 @@ ksiginfo_copy(ksiginfo_t *src, ksiginfo_ (dst)->ksi_flags = (src->ksi_flags & KSI_COPYMASK); } +static __inline void +ksiginfo_set_sigev(ksiginfo_t *dst, struct sigevent *sigev) +{ + dst->ksi_signo = sigev->sigev_signo; + dst->ksi_value = sigev->sigev_value; +} + struct pgrp; struct proc; struct sigio; @@ -331,7 +338,6 @@ void pgsigio(struct sigio **sigiop, int void pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi); int postsig(int sig); void psignal(struct proc *p, int sig); -int psignal_event(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi); int ptracestop(struct thread *td, int sig); void sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *retmask); struct sigacts *sigacts_alloc(void); @@ -340,6 +346,7 @@ void sigacts_free(struct sigacts *ps); struct sigacts *sigacts_hold(struct sigacts *ps); int sigacts_shared(struct sigacts *ps); void sigexit(struct thread *td, int sig) __dead2; +int sigev_findtd(struct proc *p, struct sigevent *sigev, struct thread **); int sig_ffs(sigset_t *set); void siginit(struct proc *p); void signotify(struct thread *td); @@ -349,6 +356,8 @@ void sigqueue_flush(struct sigqueue *que void sigqueue_init(struct sigqueue *queue, struct proc *p); void sigqueue_take(ksiginfo_t *ksi); void tdksignal(struct thread *td, int sig, ksiginfo_t *ksi); +int tdsendsignal(struct proc *p, struct thread *td, int sig, + ksiginfo_t *ksi); void tdsigcleanup(struct thread *td); void tdsignal(struct thread *td, int sig); void trapsignal(struct thread *td, ksiginfo_t *ksi); From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 05:31:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7464106564A; Sat, 9 Oct 2010 05:31:08 +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 969E98FC12; Sat, 9 Oct 2010 05:31:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o995V8Sr026870; Sat, 9 Oct 2010 05:31:08 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o995V8n3026865; Sat, 9 Oct 2010 05:31:08 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201010090531.o995V8n3026865@svn.freebsd.org> From: Tim Kientzle Date: Sat, 9 Oct 2010 05:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 05:31:08 -0000 Author: kientzle Date: Sat Oct 9 05:31:08 2010 New Revision: 213643 URL: http://svn.freebsd.org/changeset/base/213643 Log: Add -D (deterministic) option to ar. When set, it forces all timestamps and owners to zero and modes to 0644. Useful for producing libraries that are bitwise identical across multiple build runs. Submitted by: Erik Cederstrand Reviewed by: Kai Wang Modified: head/usr.bin/ar/ar.1 head/usr.bin/ar/ar.c head/usr.bin/ar/ar.h head/usr.bin/ar/write.c Modified: head/usr.bin/ar/ar.1 ============================================================================== --- head/usr.bin/ar/ar.1 Sat Oct 9 02:50:23 2010 (r213642) +++ head/usr.bin/ar/ar.1 Sat Oct 9 05:31:08 2010 (r213643) @@ -62,6 +62,7 @@ .Op Fl a Ar position-after .Op Fl b Ar position-before .Op Fl c +.Op Fl D .Op Fl i Ar position-before .Op Fl j .Op Fl s @@ -179,6 +180,16 @@ from the archive specified by argument .Ar archive . The archive's symbol table, if present, is updated to reflect the new contents of the archive. +.It Fl D +When used in combination with the +.Fl r +or +.Fl q +option, insert 0's instead of the real mtime, uid and gid values +and 0644 instead of file mode from the members named by arguments +.Ar files ... . +This ensures that checksums on the resulting archives are reproducible +when member contents are identical. .It Fl f Synonymous with option .Fl T . Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Sat Oct 9 02:50:23 2010 (r213642) +++ head/usr.bin/ar/ar.c Sat Oct 9 05:31:08 2010 (r213643) @@ -154,7 +154,7 @@ main(int argc, char **argv) } } - while ((opt = getopt_long(argc, argv, "abCcdfijlMmopqrSsTtuVvxz", + while ((opt = getopt_long(argc, argv, "abCcdDfijlMmopqrSsTtuVvxz", longopts, NULL)) != -1) { switch(opt) { case 'a': @@ -173,6 +173,9 @@ main(int argc, char **argv) case 'd': set_mode(bsdar, opt); break; + case 'D': + bsdar->options |= AR_D; + break; case 'f': case 'T': bsdar->options |= AR_TR; @@ -269,6 +272,8 @@ main(int argc, char **argv) only_mode(bsdar, "-c", "qr"); if (bsdar->options & AR_CC) only_mode(bsdar, "-C", "x"); + if (bsdar->options & AR_D) + only_mode(bsdar, "-D", "qr"); if (bsdar->options & AR_O) only_mode(bsdar, "-o", "x"); if (bsdar->options & AR_SS) @@ -356,9 +361,9 @@ bsdar_usage(void) (void)fprintf(stderr, "\tar -m [-Tjsvz] archive file ...\n"); (void)fprintf(stderr, "\tar -m [-Tabijsvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n"); - (void)fprintf(stderr, "\tar -q [-Tcjsvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-Tcjsuvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-Tabcijsuvz] position archive file ...\n"); + (void)fprintf(stderr, "\tar -q [-TcDjsvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TcDjsuvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TabcDijsuvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -s [-jz] archive\n"); (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n"); (void)fprintf(stderr, "\tar -x [-CTouv] archive [file ...]\n"); Modified: head/usr.bin/ar/ar.h ============================================================================== --- head/usr.bin/ar/ar.h Sat Oct 9 02:50:23 2010 (r213642) +++ head/usr.bin/ar/ar.h Sat Oct 9 05:31:08 2010 (r213643) @@ -43,6 +43,7 @@ #define AR_U 0x0200 /* only extract or update newer members.*/ #define AR_V 0x0400 /* verbose mode */ #define AR_Z 0x0800 /* gzip compression */ +#define AR_D 0x1000 /* insert dummy mode, mtime, uid and gid */ #define DEF_BLKSZ 10240 /* default block size */ Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Sat Oct 9 02:50:23 2010 (r213642) +++ head/usr.bin/ar/write.c Sat Oct 9 05:31:08 2010 (r213643) @@ -163,11 +163,24 @@ create_obj_from_file(struct bsdar *bsdar if (mtime != 0 && bsdar->options & AR_U && sb.st_mtime <= mtime) goto giveup; - obj->uid = sb.st_uid; - obj->gid = sb.st_gid; - obj->md = sb.st_mode; + /* + * When option '-D' is specified, mtime and UID / GID from the file + * will be replaced with 0, and file mode with 644. This ensures that + * checksums will match for two archives containing the exact same + * files. + */ + if (bsdar->options & AR_D) { + obj->uid = 0; + obj->gid = 0; + obj->mtime = 0; + obj->md = S_IFREG | 0644; + } else { + obj->uid = sb.st_uid; + obj->gid = sb.st_gid; + obj->mtime = sb.st_mtime; + obj->md = sb.st_mode; + } obj->size = sb.st_size; - obj->mtime = sb.st_mtime; obj->dev = sb.st_dev; obj->ino = sb.st_ino; @@ -621,7 +634,8 @@ write_objs(struct bsdar *bsdar) bsdar->options & AR_S) { entry = archive_entry_new(); archive_entry_copy_pathname(entry, "/"); - archive_entry_set_mtime(entry, time(NULL), 0); + if ((bsdar->options & AR_D) == 0) + archive_entry_set_mtime(entry, time(NULL), 0); archive_entry_set_size(entry, (bsdar->s_cnt + 1) * sizeof(uint32_t) + bsdar->s_sn_sz); AC(archive_write_header(a, entry)); From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 05:43:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC6CF106564A; Sat, 9 Oct 2010 05:43:23 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 622248FC13; Sat, 9 Oct 2010 05:43:23 +0000 (UTC) Received: by vws1 with SMTP id 1so328230vws.13 for ; Fri, 08 Oct 2010 22:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+/KxIBXMBnUFBapzilZUjm0LzpnXZ2vfcyRQ2zD+QrA=; b=Jr0K78wA7HcUpOsD7txBOI1k1FtprNglMzyvZh/x7zxIxhFKpmmk2Bi6XLBlVXJpiD rki/DwP8xhzlPRAo+8rCybCBkBAl3iu7D74Zs6xmvXzbl4yIGI77HwTErbg3UWN0x2+l pmFsoJUflYjc2NGab5LI97TaksmJBLFxLUBu8= 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=byvnzaR18qQe4J+heZvKquzCP7IVvle1lSpYKxHZ3H/zZXK7TpmtoY2JAqskykf04r WNF5GSVQbnYZpGGCyfzjrfvnFvDk78jen+lHQvVO7bbNyWPRTC0l+sX/OzxiVZjqxJ07 V0WqGxWU2LlBXL/tQTRxbE23z8AuiqU6H64pU= MIME-Version: 1.0 Received: by 10.220.200.4 with SMTP id eu4mr987996vcb.278.1286603001021; Fri, 08 Oct 2010 22:43:21 -0700 (PDT) Received: by 10.220.192.196 with HTTP; Fri, 8 Oct 2010 22:43:20 -0700 (PDT) In-Reply-To: <201010090531.o995V8n3026865@svn.freebsd.org> References: <201010090531.o995V8n3026865@svn.freebsd.org> Date: Sat, 9 Oct 2010 01:43:20 -0400 Message-ID: From: Ben Kaduk To: Tim Kientzle 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: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 05:43:24 -0000 On Sat, Oct 9, 2010 at 1:31 AM, Tim Kientzle wrote: > Author: kientzle > Date: Sat Oct =A09 05:31:08 2010 > New Revision: 213643 > URL: http://svn.freebsd.org/changeset/base/213643 > > Log: > =A0Add -D (deterministic) option to ar. > =A0When set, it forces all timestamps and owners to zero and > =A0modes to 0644. =A0Useful for producing libraries that are > =A0bitwise identical across multiple build runs. Thanks! Has anyone looked at the feasibility of setting AR?=3Dar -D in sys.mk? I will probably try this when I get my scratch box up again. -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 05:50:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 659F1106564A; Sat, 9 Oct 2010 05:50:05 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 407F98FC1C; Sat, 9 Oct 2010 05:50: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 o995o51T027375; Sat, 9 Oct 2010 05:50:05 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o995o5oq027373; Sat, 9 Oct 2010 05:50:05 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010090550.o995o5oq027373@svn.freebsd.org> From: Gordon Tetlow Date: Sat, 9 Oct 2010 05:50: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: r213644 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 05:50:05 -0000 Author: gordon Date: Sat Oct 9 05:50:04 2010 New Revision: 213644 URL: http://svn.freebsd.org/changeset/base/213644 Log: Add entries to remove manpath.config from etc and the examples directory. Approved by: wes (mentor implicit) Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Oct 9 05:31:08 2010 (r213643) +++ head/ObsoleteFiles.inc Sat Oct 9 05:50:04 2010 (r213644) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101002: removed manpath.config +OLD_FILES+=etc/manpath.config +OLD_FILES+=usr/share/examples/etc/manpath.config # 20100910: renamed sbuf_overflowed to sbuf_error OLD_FILES+=usr/share/man/man9/sbuf_overflowed.9.gz # 20100815: retired last traces of chooseproc(9) From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 05:57:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED22106566C; Sat, 9 Oct 2010 05:57:23 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2688FC0A; Sat, 9 Oct 2010 05:57: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 o995vNvX027580; Sat, 9 Oct 2010 05:57:23 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o995vNVr027578; Sat, 9 Oct 2010 05:57:23 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201010090557.o995vNVr027578@svn.freebsd.org> From: Gordon Tetlow Date: Sat, 9 Oct 2010 05:57: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: r213645 - head/share/examples/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 05:57:23 -0000 Author: gordon Date: Sat Oct 9 05:57:23 2010 New Revision: 213645 URL: http://svn.freebsd.org/changeset/base/213645 Log: Remove the manpath.config entry now that it's no longer installed. Submitted by: b. f. Approved by: wes (mentor implicit) Modified: head/share/examples/etc/README.examples Modified: head/share/examples/etc/README.examples ============================================================================== --- head/share/examples/etc/README.examples Sat Oct 9 05:50:04 2010 (r213644) +++ head/share/examples/etc/README.examples Sat Oct 9 05:57:23 2010 (r213645) @@ -35,7 +35,6 @@ login.conf - login class capabilities da mac.conf - TrustedBSD MAC userland policy configuration file mail.rc - systemwide initialization files for mail(1) make.conf - example configuration variables for system builds -manpath.config - configuration file for man(1) motd - sample Message of the Day netconfig - network configuration data base netstart - network startup script run from /etc/rc From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 07:29:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A303106564A; Sat, 9 Oct 2010 07:29:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AAB98FC1B; Sat, 9 Oct 2010 07:29:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o997TDDV029961; Sat, 9 Oct 2010 07:29:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o997TDRN029959; Sat, 9 Oct 2010 07:29:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201010090729.o997TDRN029959@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Oct 2010 07:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213646 - head/sbin/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 07:29:13 -0000 Author: imp Date: Sat Oct 9 07:29:13 2010 New Revision: 213646 URL: http://svn.freebsd.org/changeset/base/213646 Log: Allow the kernel to generate more spacy things and still have devd cope. Skip multiple spaces in a few contexts. PR: 96854 Submitted by: Shin'ya Kumabuchi MFC after: 1 week Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Sat Oct 9 05:57:23 2010 (r213645) +++ head/sbin/devd/devd.cc Sat Oct 9 07:29:13 2010 (r213646) @@ -749,9 +749,13 @@ process_event(char *buffer) if (sp == NULL) return; /* Can't happen? */ *sp++ = '\0'; + while (isspace(*sp)) + sp++; if (strncmp(sp, "at ", 3) == 0) sp += 3; sp = cfg.set_vars(sp); + while (isspace(*sp)) + sp++; if (strncmp(sp, "on ", 3) == 0) cfg.set_variable("bus", sp + 3); break; @@ -762,9 +766,13 @@ process_event(char *buffer) return; /* Can't happen? */ *sp++ = '\0'; cfg.set_variable("device-name", buffer); + while (isspace(*sp)) + sp++; if (strncmp(sp, "at ", 3) == 0) sp += 3; sp = cfg.set_vars(sp); + while (isspace(*sp)) + sp++; if (strncmp(sp, "on ", 3) == 0) cfg.set_variable("bus", sp + 3); break; From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 07:45:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 451711065670; Sat, 9 Oct 2010 07:45: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 346B38FC13; Sat, 9 Oct 2010 07:45: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 o997jPtg030371; Sat, 9 Oct 2010 07:45:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o997jPM6030365; Sat, 9 Oct 2010 07:45:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201010090745.o997jPM6030365@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Oct 2010 07:45: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: r213647 - in head/usr.sbin/pc-sysinstall: backend examples X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 07:45:25 -0000 Author: imp Date: Sat Oct 9 07:45:24 2010 New Revision: 213647 URL: http://svn.freebsd.org/changeset/base/213647 Log: Enable softupdate + journals support. PR: 150862 Submitted by: Kris Moore Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh head/usr.sbin/pc-sysinstall/examples/README Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sat Oct 9 07:29:13 2010 (r213646) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sat Oct 9 07:45:24 2010 (r213647) @@ -217,7 +217,7 @@ setup_mbr_partitions() # Now check that these values are sane case $FS in - UFS|UFS+S|UFS+J|ZFS|SWAP) ;; + UFS|UFS+S|UFS+J||UFS+SUJ|ZFS|SWAP) ;; *) exit_err "ERROR: Invalid file system specified on $line" ;; esac @@ -261,7 +261,7 @@ setup_mbr_partitions() check_for_mount "${MNT}" "/boot" if [ "${?}" = "0" ] ; then USINGBOOTPART="0" ; export USINGBOOTPART - if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" ] + if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" -a "${FS}" != "UFS+SUJ" ] then exit_err "/boot partition must be formatted with UFS" fi @@ -401,7 +401,7 @@ setup_gpt_partitions() # Now check that these values are sane case $FS in - UFS|UFS+S|UFS+J|ZFS|SWAP) ;; + UFS|UFS+S|UFS+J|UFS+SUJ|ZFS|SWAP) ;; *) exit_err "ERROR: Invalid file system specified on $line" ;; esac @@ -438,7 +438,7 @@ setup_gpt_partitions() if [ "${?}" = "0" ] ; then if [ "${CURPART}" = "2" ] ; then USINGBOOTPART="0" ; export USINGBOOTPART - if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" ] + if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" -a "${FS}" != "UFS+SUJ" ] then exit_err "/boot partition must be formatted with UFS" fi Modified: head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Sat Oct 9 07:29:13 2010 (r213646) +++ head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Sat Oct 9 07:45:24 2010 (r213647) @@ -124,6 +124,7 @@ mount_all_filesystems() case ${PARTFS} in UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;; UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;; + UFS+SUJ) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;; UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" ;; ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} ;; *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; @@ -158,6 +159,7 @@ mount_all_filesystems() case ${PARTFS} in UFS) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;; UFS+S) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;; + UFS+SUJ) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;; UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" ;; ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} ;; SWAP) Modified: head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Sat Oct 9 07:29:13 2010 (r213646) +++ head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Sat Oct 9 07:45:24 2010 (r213647) @@ -154,6 +154,25 @@ setup_filesystems() sleep 2 ;; + UFS+SUJ) + echo_log "NEWFS: /dev/${PART} - ${PARTFS}" + sleep 2 + rc_halt "newfs -U /dev/${PART}${EXT}" + sleep 2 + rc_halt "sync" + rc_halt "tunefs -j enable /dev/${PART}${EXT}" + sleep 2 + rc_halt "sync" + rc_halt "glabel label ${PARTLABEL} /dev/${PART}${EXT}" + rc_halt "sync" + # Set flag that we've found a boot partition + if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then + HAVEBOOT="YES" + fi + sleep 2 + ;; + + UFS+J) echo_log "NEWFS: /dev/${PART} - ${PARTFS}" sleep 2 Modified: head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh Sat Oct 9 07:29:13 2010 (r213646) +++ head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh Sat Oct 9 07:45:24 2010 (r213647) @@ -99,6 +99,7 @@ unmount_all_filesystems() case ${PARTFS} in UFS) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; UFS+S) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; + UFS+SUJ) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; UFS+J) glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal ;; *) ;; esac @@ -113,6 +114,7 @@ unmount_all_filesystems() case ${PARTFS} in UFS) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; UFS+S) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; + UFS+SUJ) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; UFS+J) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal" ;; *) ;; esac Modified: head/usr.sbin/pc-sysinstall/examples/README ============================================================================== --- head/usr.sbin/pc-sysinstall/examples/README Sat Oct 9 07:29:13 2010 (r213646) +++ head/usr.sbin/pc-sysinstall/examples/README Sat Oct 9 07:45:24 2010 (r213647) @@ -189,13 +189,14 @@ The notation is as follows: Available FileSystems: UFS - Standard UFS2 FileSystem UFS+S - UFS2 + Softupdates enabled +UFS+SUJ - UFS2 + Soft Updates + Journaling enabled UFS+J - UFS2 + Journaling through gjournal ZFS - Z File System, pools / mounts created automatically SWAP - BSD Swap space partition, mountpoint should be set to "none" Adding the ".eli" extension to any of the above file systems will enable disk encryption via geli -(UFS.eli, UFS+S.eli, UFS+J.eli, ZFS.eli, SWAP.eli) +(UFS.eli, UFS+S.eli, UFS+SUJ.eli, UFS+J.eli, ZFS.eli, SWAP.eli) If you with to use a passphrase with this encrypted partition, on the next line the flag "encpass=" should be entered: From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 08:07:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07B1A1065673; Sat, 9 Oct 2010 08:07: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 EC3E58FC23; Sat, 9 Oct 2010 08:07: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 o9987nZ9030941; Sat, 9 Oct 2010 08:07:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9987nG0030939; Sat, 9 Oct 2010 08:07:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010090807.o9987nG0030939@svn.freebsd.org> From: Andriy Gapon Date: Sat, 9 Oct 2010 08:07: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: r213648 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 08:07:50 -0000 Author: avg Date: Sat Oct 9 08:07:49 2010 New Revision: 213648 URL: http://svn.freebsd.org/changeset/base/213648 Log: panic_cpu variable should be volatile This is to prevent caching of its value in a register when it is checked and modified by multiple CPUs in parallel. Also, move the variable into the scope of the only function that uses it. Reviewed by: jhb Hint from: mdf MFC after: 1 week Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Oct 9 07:45:24 2010 (r213647) +++ head/sys/kern/kern_shutdown.c Sat Oct 9 08:07:49 2010 (r213648) @@ -513,10 +513,6 @@ shutdown_reset(void *junk, int howto) /* NOTREACHED */ /* assuming reset worked */ } -#ifdef SMP -static u_int panic_cpu = NOCPU; -#endif - /* * Panic is called on unresolvable fatal errors. It prints "panic: mesg", * and then reboots. If we are called twice, then we avoid trying to sync @@ -525,6 +521,9 @@ static u_int panic_cpu = NOCPU; void panic(const char *fmt, ...) { +#ifdef SMP + static volatile u_int panic_cpu = NOCPU; +#endif struct thread *td = curthread; int bootopt, newpanic; va_list ap; From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 08:39:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EBE2106566B; Sat, 9 Oct 2010 08:39:14 +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 8F0078FC14; Sat, 9 Oct 2010 08:39: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 o998dE0D031821; Sat, 9 Oct 2010 08:39:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o998dEYq031819; Sat, 9 Oct 2010 08:39:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201010090839.o998dEYq031819@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Oct 2010 08:39: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: r213649 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 08:39:14 -0000 Author: imp Date: Sat Oct 9 08:39:14 2010 New Revision: 213649 URL: http://svn.freebsd.org/changeset/base/213649 Log: Fix typo: thanks Kris for pointing this out. Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sat Oct 9 08:07:49 2010 (r213648) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sat Oct 9 08:39:14 2010 (r213649) @@ -217,7 +217,7 @@ setup_mbr_partitions() # Now check that these values are sane case $FS in - UFS|UFS+S|UFS+J||UFS+SUJ|ZFS|SWAP) ;; + UFS|UFS+S|UFS+J|UFS+SUJ|ZFS|SWAP) ;; *) exit_err "ERROR: Invalid file system specified on $line" ;; esac From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 08:52:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39169106564A; Sat, 9 Oct 2010 08:52:10 +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 27EDD8FC0A; Sat, 9 Oct 2010 08:52: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 o998qAbV032215; Sat, 9 Oct 2010 08:52:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o998qAnY032205; Sat, 9 Oct 2010 08:52:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201010090852.o998qAnY032205@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Oct 2010 08:52: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: r213650 - in head/usr.sbin/pc-sysinstall: backend conf examples X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 08:52:10 -0000 Author: imp Date: Sat Oct 9 08:52:09 2010 New Revision: 213650 URL: http://svn.freebsd.org/changeset/base/213650 Log: Initial patches to install images... PR: 150921 Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh head/usr.sbin/pc-sysinstall/backend/functions-disk.sh head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh head/usr.sbin/pc-sysinstall/backend/functions.sh head/usr.sbin/pc-sysinstall/backend/parseconfig.sh head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf head/usr.sbin/pc-sysinstall/examples/README Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Sat Oct 9 08:52:09 2010 (r213650) @@ -165,7 +165,6 @@ setup_mbr_partitions() WRKSLICE="$2" FOUNDPARTS="1" - # Lets setup the BSDLABEL BSDLABEL="${TMPDIR}/bsdLabel-${WRKSLICE}" export BSDLABEL @@ -193,6 +192,11 @@ setup_mbr_partitions() SIZE=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 2` MNT=`echo $STRING | tr -s '\t' ' ' | cut -d ' ' -f 3` + if echo $STRING | grep -E '^/.+' >/dev/null 2>&1 + then + IMAGE=`echo ${STRING} | cut -f1 -d' '` + fi + # Check if we have a .eli extension on this FS echo ${FS} | grep ".eli" >/dev/null 2>/dev/null if [ "$?" = "0" ] @@ -254,7 +258,7 @@ setup_mbr_partitions() # Check if we found a valid root partition check_for_mount "${MNT}" "/" if [ "$?" = "0" ] ; then - FOUNDROOT="0" ; export FOUNDROOT + FOUNDROOT="0" ; export FOUNDROOT fi # Check if we have a "/boot" instead @@ -267,7 +271,7 @@ setup_mbr_partitions() fi fi - else + else # Done with the a: partitions # Check if we found a valid root partition not on a: @@ -306,7 +310,7 @@ setup_mbr_partitions() fi # Save this data to our partition config dir - echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}" >${PARTDIR}/${WRKSLICE}${PARTLETTER} + echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}:${IMAGE}" >${PARTDIR}/${WRKSLICE}${PARTLETTER} # If we have a enc password, save it as well if [ ! -z "${ENCPASS}" ] ; then @@ -327,6 +331,8 @@ setup_mbr_partitions() *) exit_err "ERROR: bsdlabel only supports up to letter h for partitions." ;; esac + unset IMAGE + fi # End of subsection locating a slice in config echo $line | grep "^commitDiskLabel" >/dev/null 2>/dev/null @@ -567,7 +573,7 @@ setup_disk_label() { # We are ready to start setting up the label, lets read the config and do the actions # First confirm that we have a valid WORKINGSLICES - if [ -z "${WORKINGSLICES}" -a -z "${WORKINGIMAGES}" ]; then + if [ -z "${WORKINGSLICES}" ]; then exit_err "ERROR: No slices were setup! Please report this to the maintainers" fi @@ -612,12 +618,6 @@ setup_disk_label() populate_disk_label "${i}" done - for i in $WORKINGIMAGES - do - image=`echo "${i}"|cut -f2 -d:` - check_image_layout "${image}" - done - # Check if we made a root partition if [ "$FOUNDROOT" = "-1" ] then @@ -653,7 +653,7 @@ check_fstab_mbr() then PARTLETTER=`echo "$SLICE" | sed -E 's|^.+([a-h])$|\1|'` - grep -E '^.+ +/ +' "${FSTAB}" >/dev/null 2>&1 + cat "${FSTAB}" | awk '{ print $2 }' | grep -E '^/$' >/dev/null 2>&1 if [ "$?" = "0" ] then if [ "${PARTLETTER}" = "a" ] @@ -662,10 +662,14 @@ check_fstab_mbr() else FOUNDROOT="1" fi + + ROOTIMAGE="1" + export FOUNDROOT + export ROOTIMAGE fi - grep -E '^.+ +/boot +' "${FSTAB}" >/dev/null 2>&1 + cat "${FSTAB}" | awk '{ print $2 }' | grep -E '^/boot$' >/dev/null 2>&1 if [ "$?" = "0" ] then if [ "${PARTLETTER}" = "a" ] @@ -700,7 +704,7 @@ check_fstab_gpt() then PARTNUMBER=`echo "${SLICE}" | sed -E 's|^.+p([0-9]*)$|\1|'` - grep -E '^.+ +/ +' "${FSTAB}" >/dev/null 2>&1 + cat "${FSTAB}" | awk '{ print $2 }' | grep -E '^/$' >/dev/null 2>&1 if [ "$?" = "0" ] then if [ "${PARTNUMBER}" = "2" ] @@ -709,10 +713,14 @@ check_fstab_gpt() else FOUNDROOT="1" fi + + ROOTIMAGE="1" + export FOUNDROOT + export ROOTIMAGE fi - grep -E '^.+ +/boot +' "${FSTAB}" >/dev/null 2>&1 + cat "${FSTAB}" | awk '{ print $2 }' | grep -E '^/boot$' >/dev/null 2>&1 if [ "$?" = "0" ] then if [ "${PARTNUMBER}" = "2" ] @@ -731,42 +739,45 @@ check_fstab_gpt() return 1 }; -check_image_layout() +check_disk_layout() { local SLICES - local IMAGE local TYPE + local DISK local RES - local MD local F - IMAGE="$1" + DISK="$1" TYPE="MBR" - if [ -z "${IMAGE}" ] + if [ -z "${DISK}" ] then return 1 fi - MD=`mdconfig -af "${IMAGE}"` - if [ "$?" != "0" ] + SLICES_MBR=`ls /dev/${DISK}s[1-4]*[a-h]* 2>/dev/null` + SLICES_GPT=`ls /dev/${DISK}p[0-9]* 2>/dev/null` + SLICES_SLICE=`ls /dev/${DISK}[a-h]* 2>/dev/null` + + if [ -n "${SLICES_MBR}" ] then - return 1 + SLICES="${SLICES_MBR}" + TYPE="MBR" + RES=0 fi - - SLICES=`ls /dev/${MD}s[1-4]*[a-h]* 2>/dev/null` - if [ "$?" != "0" ] + if [ -n "${SLICES_GPT}" ] then - SLICES=`ls /dev/${MD}p[0-9]* 2>/dev/null` - if [ -n "${SLICES}" ] - then - TYPE="GPT" - RES=0 - fi - else + SLICES="${SLICES_GPT}" + TYPE="GPT" RES=0 fi - + if [ -n "${SLICES_SLICE}" ] + then + SLICES="${SLICES_SLICE}" + TYPE="MBR" + RES=0 + fi + for slice in ${SLICES} do F=1 @@ -796,6 +807,5 @@ check_image_layout() umount /mnt done - mdconfig -d -u "${MD}" return ${RES} }; Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Sat Oct 9 08:52:09 2010 (r213650) @@ -400,12 +400,12 @@ setup_disk_slice() then # Lets figure out what number this slice will be LASTSLICE="`gpart show ${DISK} \ - | grep -v ${DISK} \ - | grep -v ' free' \ - | tr -s '\t' ' ' \ - | cut -d ' ' -f 4 \ - | sed '/^$/d' \ - | tail -n 1`" + | grep -v ${DISK} \ + | grep -v ' free' \ + | tr -s '\t' ' ' \ + | cut -d ' ' -f 4 \ + | sed '/^$/d' \ + | tail -n 1`" if [ -z "${LASTSLICE}" ] then @@ -466,7 +466,7 @@ setup_disk_slice() if [ "$PSCHEME" = "MBR" -o -z "$PSCHEME" ] ; then PSCHEME="MBR" tmpSLICE="${DISK}s1" - else + else tmpSLICE="${DISK}p1" fi @@ -486,29 +486,44 @@ setup_disk_slice() ;; image) - if [ -n "${IMAGE}" ] + if [ -z "${IMAGE}" ] then - write_image "${IMAGE}" "${DISK}" - else - exit_err "ERROR: partition type image specified with no image!" + exit_err "ERROR: partition type image specified with no image!" fi - - IMAGE="${DISK}:${IMAGE}" - if [ -z "${WORKINGIMAGES}" ] - then - WORKINGIMAGES="${IMAGE}" - else - WORKINGIMAGES="${WORKINGIMAGES} ${IMAGE}" - fi - - export WORKINGIMAGES ;; *) exit_err "ERROR: Unknown PTYPE: $PTYPE" ;; esac + + + if [ -n "${IMAGE}" ] + then + local DEST + + if [ -n "${tmpSLICE}" ] + then + DEST="${tmpSLICE}" + else + DEST="${DISK}" + fi + + if iscompressed "${IMAGE}" + then + local COMPRESSION + + get_compression_type "${IMAGE}" + COMPRESSION="${VAL}" + + decompress_file "${IMAGE}" "${COMPRESSION}" + IMAGE="${VAL}" + fi + + write_image "${IMAGE}" "${DEST}" + check_disk_layout "${DEST}" + fi # Now save which disk this is, so we can parse it later during slice partition setup - if [ -n "${tmpSLICE}" ] + if [ -z "${IMAGE}" ] then echo "disk${disknum}" >${SLICECFGDIR}/$tmpSLICE fi @@ -524,7 +539,6 @@ setup_disk_slice() echo "$MIRRORDISK:$MIRRORBAL" >${MIRRORCFGDIR}/$DISK fi - # Increment our disk counter to look for next disk and unset unset BMANAGER PTYPE DISK MIRRORDISK MIRRORBAL PSCHEME IMAGE disknum="`expr $disknum + 1`" Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh Sat Oct 9 08:52:09 2010 (r213650) @@ -147,6 +147,7 @@ start_extract_split() then exit_err "ERROR: Failed extracting ${KERNELS}" fi + rm -rf "${FSMNT}/boot/kernel" mv "${FSMNT}/boot/GENERIC" "${FSMNT}/boot/kernel" else exit_err "ERROR: ${KERNELS}/install.sh does not exist" @@ -328,6 +329,46 @@ start_rsync_copy() }; +start_image_install() +{ + if [ -z "${IMAGE_FILE}" ] + then + exit_err "ERROR: installMedium set to image but no image file specified!" + fi + + # We are ready to start mounting, lets read the config and do it + while read line + do + echo $line | grep "^disk0=" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found a disk= entry, lets get the disk we are working on + get_value_from_string "${line}" + strip_white_space "$VAL" + DISK="$VAL" + fi + + echo $line | grep "^commitDiskPart" >/dev/null 2>/dev/null + if [ "$?" = "0" ] + then + # Found our flag to commit this disk setup / lets do sanity check and do it + if [ ! -z "${DISK}" ] + then + + # Write the image + write_image "${IMAGE_FILE}" "${DISK}" + + # Increment our disk counter to look for next disk and unset + unset DISK + break + + else + exit_err "ERROR: commitDiskPart was called without procceding disk= and partition= entries!!!" + fi + fi + + done <${CFGF} +}; # Entrance function, which starts the installation process init_extraction() @@ -393,6 +434,7 @@ init_extraction() sftp) ;; rsync) start_rsync_copy ;; + image) start_image_install ;; *) exit_err "ERROR: Unknown install medium" ;; esac Modified: head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh Sat Oct 9 08:52:09 2010 (r213650) @@ -127,6 +127,7 @@ mount_all_filesystems() UFS+SUJ) mount_partition ${PART}${EXT} ${PARTFS} ${PARTMNT} "noatime" ;; UFS+J) mount_partition ${PART}${EXT}.journal ${PARTFS} ${PARTMNT} "async,noatime" ;; ZFS) mount_partition ${PART} ${PARTFS} ${PARTMNT} ;; + IMAGE) mount_partition ${PART} ${PARTFS} ${PARTMNT} ;; *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; esac fi @@ -176,7 +177,14 @@ mount_all_filesystems() rc_halt "swapon /dev/${PART}" fi ;; - *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; + IMAGE) + if [ ! -d "${PARTMNT}" ] + then + mkdir -p "${PARTMNT}" + fi + mount_partition ${PART} ${PARTFS} ${PARTMNT} + ;; + *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; esac fi done Modified: head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh Sat Oct 9 08:52:09 2010 (r213650) @@ -100,6 +100,7 @@ setup_filesystems() PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`" PARTGEOM="`cat ${PARTDIR}/${PART} | cut -d ':' -f 5`" PARTXTRAOPTS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 6`" + PARTIMAGE="`cat ${PARTDIR}/${PART} | cut -d ':' -f 7`" # Make sure journaling isn't enabled on this device if [ -e "/dev/${PART}.journal" ] @@ -204,6 +205,11 @@ setup_filesystems() sleep 2 ;; + IMAGE) + write_image "${PARTIMAGE}" "${PART}" + sleep 2 + ;; + *) exit_err "ERROR: Got unknown file-system type $PARTFS" ;; esac Modified: head/usr.sbin/pc-sysinstall/backend/functions.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions.sh Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/backend/functions.sh Sat Oct 9 08:52:09 2010 (r213650) @@ -284,27 +284,123 @@ get_zpool_name() fi }; +iscompressed() +{ + local FILE + local RES + + FILE="$1" + RES=1 + + if echo "${FILE}" | \ + grep -iE '\.(Z|lzo|lzw|lzma|gz|bz2|xz|zip)$' >/dev/null 2>&1 + then + RES=0 + fi + + return ${RES} +} + +get_compression_type() +{ + local FILE + local SUFFIX + + FILE="$1" + SUFFIX=`echo "${FILE}" | sed -E 's|^(.+)\.(.+)$|\2|'` + + VAL="" + SUFFIX=`echo "${SUFFIX}" | tr A-Z a-z` + case "${SUFFIX}" in + z) VAL="lzw" ;; + lzo) VAL="lzo" ;; + lzw) VAL="lzw" ;; + lzma) VAL="lzma" ;; + gz) VAL="gzip" ;; + bz2) VAL="bzip2" ;; + xz) VAL="xz" ;; + zip) VAL="zip" ;; + esac + + export VAL +} + +decompress_file() +{ + local FILE + local COMPRESSION + + FILE="$1" + COMPRESSION="$2" + + if [ -n "${COMPRESSION}" ] + then + case "${COMPRESSION}" in + lzw) + rc_halt "uncompress ${FILE}" + VAL="${FILE%.Z}" + ;; + + lzo) + rc_halt "lzop -d ${FILE}" + VAL="${FILE%.lzo}" + ;; + + lzma) + rc_halt "lzma -d ${FILE}" + VAL="${FILE%.lzma}" + ;; + + gzip) + rc_halt "gunzip ${FILE}" + VAL="${FILE%.gz}" + ;; + + bzip2) + rc_halt "bunzip2 ${FILE}" + VAL="${FILE%.bz2}" + ;; + + xz) + rc_halt "xz -d ${FILE}" + VAL="${FILE%.xz}" + ;; + + zip) + rc_halt "unzip ${FILE}" + VAL="${FILE%.zip}" + ;; + + *) + exit_err "ERROR: ${COMPRESSION} compression is not supported" + ;; + esac + fi + + export VAL +} + write_image() { + local IMAGE_FILE + local DEVICE_FILE + IMAGE_FILE="$1" DEVICE_FILE="$2" if [ -z "${IMAGE_FILE}" ] then - echo "ERROR: Image file not specified!" - exit 1 + exit_err "ERROR: Image file not specified!" fi if [ -z "${DEVICE_FILE}" ] then - echo "ERROR: Device file not specified!" - exit 1 + exit_err "ERROR: Device file not specified!" fi if [ ! -f "${IMAGE_FILE}" ] then - echo "ERROR: '${IMAGE_FILE}' does not exist!" - exit 1 + exit_err "ERROR: '${IMAGE_FILE}' does not exist!" fi DEVICE_FILE="${DEVICE_FILE#/dev/}" @@ -312,16 +408,21 @@ write_image() if [ ! -c "${DEVICE_FILE}" ] then - echo "ERROR: '${DEVICE_FILE}' is not a character device!" - exit 1 + exit_err "ERROR: '${DEVICE_FILE}' is not a character device!" fi - if [ "${RES}" = "0" ] + if iscompressed "${IMAGE_FILE}" then - rc_halt "dd if=${IMAGE_FILE} of=${DEVICE_FILE} ibs=16k obs=16k" + local COMPRESSION + + get_compression_type "${IMAGE_FILE}" + COMPRESSION="${VAL}" + + decompress_file "${IMAGE_FILE}" "${COMPRESSION}" + IMAGE_FILE="${VAL}" fi - return 0 + rc_halt "dd if=${IMAGE_FILE} of=${DEVICE_FILE} bs=128k" }; install_fresh() @@ -329,45 +430,57 @@ install_fresh() # Lets start setting up the disk slices now setup_disk_slice - # Disk setup complete, now lets parse WORKINGSLICES and setup the bsdlabels - setup_disk_label + if [ -z "${ROOTIMAGE}" ] + then + + # Disk setup complete, now lets parse WORKINGSLICES and setup the bsdlabels + setup_disk_label - # Now we've setup the bsdlabels, lets go ahead and run newfs / zfs - # to setup the filesystems - setup_filesystems + # Now we've setup the bsdlabels, lets go ahead and run newfs / zfs + # to setup the filesystems + setup_filesystems - # Lets mount the partitions now - mount_all_filesystems + # Lets mount the partitions now + mount_all_filesystems - # We are ready to begin extraction, lets start now - init_extraction + # We are ready to begin extraction, lets start now + init_extraction - # Check if we have any optional modules to load - install_components + # Check if we have any optional modules to load + install_components - # Check if we have any packages to install - install_packages + # Check if we have any packages to install + install_packages - # Do any localization in configuration - run_localize + # Do any localization in configuration + run_localize - # Save any networking config on the installed system - save_networking_install + # Save any networking config on the installed system + save_networking_install - # Now add any users - setup_users + # Now add any users + setup_users - # Now run any commands specified - run_commands + # Now run any commands specified + run_commands - # Do any last cleanup / setup before unmounting - run_final_cleanup + # Do any last cleanup / setup before unmounting + run_final_cleanup - # Unmount and finish up - unmount_all_filesystems + # Unmount and finish up + unmount_all_filesystems + fi echo_log "Installation finished!" -} +}; + +install_image() +{ + # We are ready to begin extraction, lets start now + init_extraction + + echo_log "Installation finished!" +}; install_upgrade() { @@ -397,4 +510,4 @@ install_upgrade() unmount_upgrade echo_log "Upgrade finished!" -} +}; Modified: head/usr.sbin/pc-sysinstall/backend/parseconfig.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Sat Oct 9 08:52:09 2010 (r213650) @@ -73,7 +73,7 @@ file_sanity_check "installMode disk0 ins check_value installMode "fresh upgrade" check_value bootManager "bsd none" check_value installType "PCBSD FreeBSD" -check_value installMedium "dvd usb ftp rsync" +check_value installMedium "dvd usb ftp rsync image" check_value packageType "uzip tar rsync split" if_check_value_exists partition "all s1 s2 s3 s4 free image" if_check_value_exists mirrorbal "load prefer round-robin split" @@ -100,7 +100,12 @@ start_networking # If we are not doing an upgrade, lets go ahead and setup the disk case "${INSTALLMODE}" in fresh) - install_fresh + if [ "${INSTALLMEDIUM}" = "image" ] + then + install_image + else + install_fresh + fi ;; upgrade) @@ -108,7 +113,7 @@ case "${INSTALLMODE}" in ;; *) - exit 1 + exit 1 ;; esac Modified: head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf ============================================================================== --- head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf Sat Oct 9 08:52:09 2010 (r213650) @@ -68,6 +68,10 @@ FBSD_BRANCH_DIR="${FBSD_BRANCH}" FBSD_ARCH=`uname -m` export FBSD_UZIP_FILE FBSD_TAR_FILE FBSD_BRANCH FBSD_BRANCH_DIR FBSD_ARCH +# Location of image file +IMAGE_FILE="/home/john/tmp/PCBSD8.1-x86-USB.img" +export IMAGE_FILE + # Our internet mirror listing file location NETSERVER="http://updates.pcbsd.org" ARCH="`uname -m`" Modified: head/usr.sbin/pc-sysinstall/examples/README ============================================================================== --- head/usr.sbin/pc-sysinstall/examples/README Sat Oct 9 08:39:14 2010 (r213649) +++ head/usr.sbin/pc-sysinstall/examples/README Sat Oct 9 08:52:09 2010 (r213650) @@ -153,7 +153,7 @@ specified this defaults to "round-robin" Setting this option will instruct pc-sysinstall to install the BSD boot Manager, or leave it empty -# image=(/path/to/image/file) +# image=(/path/to/image/file) (/mountpoint) Setting this option will instruct pc-sysinstall to write the image file specified by the path to the disk. @@ -218,7 +218,7 @@ If you with to just include the disk int The following settings specify the type, locations and sources for this installation -# installMedium=(dvd, usb, ftp, rsync) +# installMedium=(dvd, usb, ftp, rsync, image) Set installMedium= to the source type we will be using for this install. @@ -227,6 +227,7 @@ Available Types: usb - Search for and mount the USB drive which contains the install archive ftp - The install archive will be fetched from a FTP / HTTP server before install rsync - Pull the system data from a ssh + rsync server, specified with variables below +image - Install system from an image # installType=(PCBSD, FreeBSD) From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 09:03:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73FDB106564A; Sat, 9 Oct 2010 09:03:17 +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 643408FC15; Sat, 9 Oct 2010 09:03: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 o9993HpQ032537; Sat, 9 Oct 2010 09:03:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9993H7Z032535; Sat, 9 Oct 2010 09:03:17 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010090903.o9993H7Z032535@svn.freebsd.org> From: Andriy Gapon Date: Sat, 9 Oct 2010 09:03: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: r213651 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 09:03:18 -0000 Author: avg Date: Sat Oct 9 09:03:17 2010 New Revision: 213651 URL: http://svn.freebsd.org/changeset/base/213651 Log: add kmem_map_free sysctl: query largest contiguous free range in kmem_map Suggested by: alc Reviewed by: alc MFC after: 1 week Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sat Oct 9 08:52:09 2010 (r213650) +++ head/sys/kern/kern_malloc.c Sat Oct 9 09:03:17 2010 (r213651) @@ -207,6 +207,11 @@ SYSCTL_PROC(_vm, OID_AUTO, kmem_map_size CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, sysctl_kmem_map_size, "LU", "Current kmem_map allocation size"); +static int sysctl_kmem_map_free(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vm, OID_AUTO, kmem_map_free, + CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kmem_map_free, "LU", "Largest contiguous free range in kmem_map"); + /* * The malloc_mtx protects the kmemstatistics linked list. */ @@ -254,6 +259,18 @@ sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS return (sysctl_handle_long(oidp, &size, 0, req)); } +static int +sysctl_kmem_map_free(SYSCTL_HANDLER_ARGS) +{ + u_long size; + + vm_map_lock_read(kmem_map); + size = kmem_map->root != NULL ? + kmem_map->root->max_free : kmem_map->size; + vm_map_unlock_read(kmem_map); + return (sysctl_handle_long(oidp, &size, 0, req)); +} + /* * malloc(9) uma zone separation -- sub-page buffer overruns in one * malloc type will affect only a subset of other malloc types. From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 09:24:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1D701065670; Sat, 9 Oct 2010 09:24:16 +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 96AAD8FC0C; Sat, 9 Oct 2010 09:24: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 o999OGn1033084; Sat, 9 Oct 2010 09:24:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o999OGYj033082; Sat, 9 Oct 2010 09:24:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010090924.o999OGYj033082@svn.freebsd.org> From: Andriy Gapon Date: Sat, 9 Oct 2010 09:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213652 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 09:24:17 -0000 Author: avg Date: Sat Oct 9 09:24:16 2010 New Revision: 213652 URL: http://svn.freebsd.org/changeset/base/213652 Log: MFC r210782,210837: Update the "desiredvnodes" calculation. On behalf of: alc Modified: stable/7/sys/kern/vfs_subr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Sat Oct 9 09:03:17 2010 (r213651) +++ stable/7/sys/kern/vfs_subr.c Sat Oct 9 09:24:16 2010 (r213652) @@ -281,23 +281,34 @@ SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhe /* * Initialize the vnode management data structures. + * + * Reevaluate the following cap on the number of vnodes after the physical + * memory size exceeds 512GB. In the limit, as the physical memory size + * grows, the ratio of physical pages to vnodes approaches sixteen to one. */ #ifndef MAXVNODES_MAX -#define MAXVNODES_MAX 100000 +#define MAXVNODES_MAX (512 * (1024 * 1024 * 1024 / (int)PAGE_SIZE / 16)) #endif static void vntblinit(void *dummy __unused) { + int physvnodes, virtvnodes; /* - * Desiredvnodes is a function of the physical memory size and - * the kernel's heap size. Specifically, desiredvnodes scales - * in proportion to the physical memory size until two fifths - * of the kernel's heap size is consumed by vnodes and vm - * objects. - */ - desiredvnodes = min(maxproc + cnt.v_page_count / 4, 2 * vm_kmem_size / - (5 * (sizeof(struct vm_object) + sizeof(struct vnode)))); + * Desiredvnodes is a function of the physical memory size and the + * kernel's heap size. Generally speaking, it scales with the + * physical memory size. The ratio of desiredvnodes to physical pages + * is one to four until desiredvnodes exceeds 98,304. Thereafter, the + * marginal ratio of desiredvnodes to physical pages is one to + * sixteen. However, desiredvnodes is limited by the kernel's heap + * size. The memory required by desiredvnodes vnodes and vm objects + * may not exceed one seventh of the kernel's heap size. + */ + physvnodes = maxproc + cnt.v_page_count / 16 + 3 * min(98304 * 4, + cnt.v_page_count) / 16; + virtvnodes = vm_kmem_size / (7 * (sizeof(struct vm_object) + + sizeof(struct vnode))); + desiredvnodes = min(physvnodes, virtvnodes); if (desiredvnodes > MAXVNODES_MAX) { if (bootverbose) printf("Reducing kern.maxvnodes %d -> %d\n", From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 09:33:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8DC106564A; Sat, 9 Oct 2010 09:33:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id A05348FC0C; Sat, 9 Oct 2010 09:33:12 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o999X8Tm011920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Oct 2010 20:33:10 +1100 Date: Sat, 9 Oct 2010 20:33:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <201010090807.o9987nG0030939@svn.freebsd.org> Message-ID: <20101009191600.N3531@besplex.bde.org> References: <201010090807.o9987nG0030939@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213648 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 09:33:13 -0000 On Sat, 9 Oct 2010, Andriy Gapon wrote: > Log: > panic_cpu variable should be volatile > > This is to prevent caching of its value in a register when it is checked > and modified by multiple CPUs in parallel. > Also, move the variable into the scope of the only function that uses it. > > Reviewed by: jhb > Hint from: mdf > MFC after: 1 week I doubt that this is either necessary or sufficient. Most variables aren't volatile while they are locked by a mutex. But panic() cannot use normal mutex locking, so it should access this variable using atomic ops with memory barriers. The compiler part of the memory barriers effectively make _all_ variables temporily volatile. However, 2 of the the 4 accesses to this variable doesn't use an atomic op. % #ifdef SMP % /* % * We don't want multiple CPU's to panic at the same time, so we % * use panic_cpu as a simple spinlock. We have to keep checking % * panic_cpu if we are spinning in case the panic on the first % * CPU is canceled. % */ % if (panic_cpu != PCPU_GET(cpuid)) This access doesn't use an atomic op. % while (atomic_cmpset_int(&panic_cpu, NOCPU, % PCPU_GET(cpuid)) == 0) This access uses an atomic op. Not all atomic ops use memory barriers, at least on i386. However, this one does, at least on i386. (I'm always confused about what atomic_any() without acq or release means. Do they mean that you don't want a memory barrier (this is what the mostly give, at least on i386), and if so, what use are they? There are far too many atomic ops, for far too many never-used widths, with alternative spellings to encourage using a wrong one. cmpset is is especially confusing since it you can spell it as cmpset, cmpset_acq or compset_rel and always get the barrier, at least on i386. At least cmpset only supports 1 width, at least on i386.) % while (panic_cpu != NOCPU) This access doesn't use an atomic op. % ; /* nothing */ % #endif % ... % #ifdef RESTARTABLE_PANICS % /* See if the user aborted the panic, in which case we continue. */ % if (panicstr == NULL) { % #ifdef SMP % atomic_store_rel_int(&panic_cpu, NOCPU); This access uses an atomic op with a memory barrier, at least on i386. Now its rel semantics are clear. panicstr is non-volatile and never accessed by an atomic op, so it probably strictly needs to be declared volatile even more than panic_cpu. I think the only thing that makes it work now is that it is bogusly pubic, and compilers can't analyze the whole program yet -- if they could, then they would see that it is only set in panic(). % #endif % return; % } % #endif % #endif Now, why don't the partial memory barriers prevent caching the variable? % if (panic_cpu != PCPU_GET(cpuid)) % while (atomic_cmpset_int(&panic_cpu, NOCPU, % PCPU_GET(cpuid)) == 0) % while (panic_cpu != NOCPU) % ; /* nothing */ The very first access can't reasonably use a cachec value. atomic_cmpset() can change panic_cpu, so even without the memory barrier, panic_cpu must be reloaded for the third access the first time. But then when the third access is repeated in the second while loop, the missing atomic op with barrier makes things very broken. panic_cpu isn't changed by the loop, and the compiler thinks that it isn't changed by anything else either, so the compiler may reduce the loop to: % if (panic_cpu != NOCPU) % for (;;) % ; /* nothing */ except I've seen claims that even an endless for loop can be optimized to nothing. Declaring panic_cpu as volatile prevents the compiler doing this, but I think it is insufficient. We really do want to see panic_cpu changed by other CPUs, and what is the point of atomic_load_acq*() if not to use for this -- if declaring things volatile were sufficient, then we could just use *(volatile *)&var. atomic_load/store_acq/rel*() on i386 used to do exactly that for the UP case, but use a lock prefix and also a memory barrier for the SMP case. Current versions also use the memory barrier in the UP case, and have a relevant comment aboat this: % Index: atomic.h % =================================================================== % RCS file: /home/ncvs/src/sys/i386/include/atomic.h,v % retrieving revision 1.32.2.1 % retrieving revision 1.55 % diff -u -1 -r1.32.2.1 -r1.55 % --- atomic.h 24 Nov 2004 18:10:02 -0000 1.32.2.1 % +++ atomic.h 20 May 2010 06:18:03 -0000 1.55 % @@ -181,5 +207,5 @@ % * SMP kernels. For UP kernels, however, the cache of the single processor % - * is always consistent, so we don't need any memory barriers. % + * is always consistent, so we only need to take care of compiler. % */ i386 doesn't really have memory barriers (maybe l/s/mfence are, but we don't use them even on amd64), but we have to use "memoy" clobbers to take care of the compiler, or we would have to declare too many things as volatile. % -#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ % +#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ % static __inline u_##TYPE \ % @@ -187,3 +213,7 @@ % { \ % - return (*p); \ % + u_##TYPE tmp; \ % + \ % + tmp = *p; \ % + __asm __volatile("" : : : "memory"); \ % + return (tmp); \ % } \ % @@ -193,2 +223,3 @@ % { \ % + __asm __volatile("" : : : "memory"); \ % *p = v; \ 5-STABLE is still missing the memory clobber, so a newer compiler on it might compile away the while loop even when it is fixed to use atomic_load_acq_int(). % ... % if (panicstr == NULL) { % atomic_store_rel_int(&panic_cpu, NOCPU); Smaller problems with this. Just the unlocked access to panicstr. Maybe not a problem, except to understand why it isn't one. I think the earlier while loops prevent concurrent modification of panicstr. Recursive panics are possible, but since they are possible the compiler should see that they are possible even if it analyzes the whole program, and thus know that it cannot cache panicstr. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 09:49:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76E081065672; Sat, 9 Oct 2010 09:49:02 +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 6D54D8FC1B; Sat, 9 Oct 2010 09:49:00 +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 MAA21122; Sat, 09 Oct 2010 12:48:51 +0300 (EEST) (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 1P4W2t-000ETF-1W; Sat, 09 Oct 2010 12:48:51 +0300 Message-ID: <4CB03A82.6040701@freebsd.org> Date: Sat, 09 Oct 2010 12:48:50 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100918 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: Bruce Evans References: <201010090807.o9987nG0030939@svn.freebsd.org> <20101009191600.N3531@besplex.bde.org> In-Reply-To: <20101009191600.N3531@besplex.bde.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213648 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 09:49:02 -0000 on 09/10/2010 12:33 Bruce Evans said the following: > On Sat, 9 Oct 2010, Andriy Gapon wrote: > >> Log: >> panic_cpu variable should be volatile >> >> This is to prevent caching of its value in a register when it is checked >> and modified by multiple CPUs in parallel. >> Also, move the variable into the scope of the only function that uses it. >> >> Reviewed by: jhb >> Hint from: mdf >> MFC after: 1 week > > I doubt that this is either necessary or sufficient. Most variables > aren't volatile while they are locked by a mutex. But panic() cannot use > normal mutex locking, so it should access this variable using atomic > ops with memory barriers. The compiler part of the memory barriers > effectively make _all_ variables temporily volatile. However, 2 of the > the 4 accesses to this variable doesn't use an atomic op. > > % #ifdef SMP > % /* > % * We don't want multiple CPU's to panic at the same time, so we > % * use panic_cpu as a simple spinlock. We have to keep checking > % * panic_cpu if we are spinning in case the panic on the first > % * CPU is canceled. > % */ > % if (panic_cpu != PCPU_GET(cpuid)) > > This access doesn't use an atomic op. > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > % PCPU_GET(cpuid)) == 0) > > This access uses an atomic op. Not all atomic ops use memory barriers, > at least on i386. However, this one does, at least on i386. > > (I'm always confused about what atomic_any() without acq or release > means. Do they mean that you don't want a memory barrier (this is > what the mostly give, at least on i386), and if so, what use are > they? There are far too many atomic ops, for far too many never-used > widths, with alternative spellings to encourage using a wrong one. > cmpset is is especially confusing since it you can spell it as cmpset, > cmpset_acq or compset_rel and always get the barrier, at least on > i386. At least cmpset only supports 1 width, at least on i386.) > > % while (panic_cpu != NOCPU) > > This access doesn't use an atomic op. > > % ; /* nothing */ > % #endif > % ... > % #ifdef RESTARTABLE_PANICS > % /* See if the user aborted the panic, in which case we continue. */ > % if (panicstr == NULL) { > % #ifdef SMP > % atomic_store_rel_int(&panic_cpu, NOCPU); > > This access uses an atomic op with a memory barrier, at least on i386. > Now its rel semantics are clear. > > panicstr is non-volatile and never accessed by an atomic op, so it probably > strictly needs to be declared volatile even more than panic_cpu. I think I agree about panicstr. But I am not sure if we have places in code (beyond panic function) itself where volatile vs. non-volatile would make any actual difference. But still. > the only thing that makes it work now is that it is bogusly pubic, and > compilers can't analyze the whole program yet -- if they could, then they > would see that it is only set in panic(). > > % #endif > % return; > % } > % #endif > % #endif > > Now, why don't the partial memory barriers prevent caching the variable? > > % if (panic_cpu != PCPU_GET(cpuid)) > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > % PCPU_GET(cpuid)) == 0) > % while (panic_cpu != NOCPU) > % ; /* nothing */ > > The very first access can't reasonably use a cachec value. atomic_cmpset() > can change panic_cpu, so even without the memory barrier, panic_cpu must > be reloaded for the third access the first time. But then when the third > access is repeated in the second while loop, the missing atomic op with > barrier makes things very broken. panic_cpu isn't changed by the loop, > and the compiler thinks that it isn't changed by anything else either, so > the compiler may reduce the loop to: > > % if (panic_cpu != NOCPU) > % for (;;) > % ; /* nothing */ Yes, it's exactly the last loop that had the problem. On amd64 with -O2: .loc 1 544 0 movl panic_cpu(%rip), %eax .LVL134: .p2align 4,,7 .L210: cmpl $255, %eax jne .L210 jmp .L225 > except I've seen claims that even an endless for loop can be optimized > to nothing. Declaring panic_cpu as volatile prevents the compiler doing > this, but I think it is insufficient. We really do want to see panic_cpu > changed by other CPUs, and what is the point of atomic_load_acq*() if not > to use for this -- if declaring things volatile were sufficient, then we > could just use *(volatile *)&var. atomic_load/store_acq/rel*() on i386 I discussed this with kib and the idea is that atomic operation is not needed in that place and volatile is sufficient, because we don't need barrier semantics there and only want to ensure that variable is reloaded from memory. atomic_store_rel at the end seems to be needed because of inter-dependency between panicstr and panic_cpu. That is we want changes to panicstr to becomes visible at the same time (before actually) changes to panic_cpu are visible. > used to do exactly that for the UP case, but use a lock prefix and also > a memory barrier for the SMP case. Current versions also use the memory > barrier in the UP case, and have a relevant comment aboat this: > > % Index: atomic.h > % =================================================================== > % RCS file: /home/ncvs/src/sys/i386/include/atomic.h,v > % retrieving revision 1.32.2.1 > % retrieving revision 1.55 > % diff -u -1 -r1.32.2.1 -r1.55 > % --- atomic.h 24 Nov 2004 18:10:02 -0000 1.32.2.1 > % +++ atomic.h 20 May 2010 06:18:03 -0000 1.55 > % @@ -181,5 +207,5 @@ > % * SMP kernels. For UP kernels, however, the cache of the single processor > % - * is always consistent, so we don't need any memory barriers. > % + * is always consistent, so we only need to take care of compiler. > % */ > > i386 doesn't really have memory barriers (maybe l/s/mfence are, but we > don't use them even on amd64), but we have to use "memoy" clobbers to > take care of the compiler, or we would have to declare too many things > as volatile. > > % -#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ > % +#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ > % static __inline u_##TYPE \ > % @@ -187,3 +213,7 @@ > % { \ > % - return (*p); \ > % + u_##TYPE tmp; \ > % + \ > % + tmp = *p; \ > % + __asm __volatile("" : : : "memory"); \ > % + return (tmp); \ > % } \ > % @@ -193,2 +223,3 @@ > % { \ > % + __asm __volatile("" : : : "memory"); \ > % *p = v; \ > > 5-STABLE is still missing the memory clobber, so a newer compiler on it > might compile away the while loop even when it is fixed to use > atomic_load_acq_int(). > > % ... > % if (panicstr == NULL) { > % atomic_store_rel_int(&panic_cpu, NOCPU); > > Smaller problems with this. Just the unlocked access to panicstr. > Maybe not a problem, except to understand why it isn't one. I think > the earlier while loops prevent concurrent modification of panicstr. > Recursive panics are possible, but since they are possible the compiler > should see that they are possible even if it analyzes the whole program, > and thus know that it cannot cache panicstr. > > Bruce -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 11:43:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56332106566C; Sat, 9 Oct 2010 11:43:01 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B2B58FC20; Sat, 9 Oct 2010 11:43: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 o99Bh18K038316; Sat, 9 Oct 2010 11:43:01 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99Bh1uA038313; Sat, 9 Oct 2010 11:43:01 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201010091143.o99Bh1uA038313@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 9 Oct 2010 11:43: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: r213653 - in head: share/man/man4 usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 11:43:01 -0000 Author: uqs Date: Sat Oct 9 11:43:00 2010 New Revision: 213653 URL: http://svn.freebsd.org/changeset/base/213653 Log: mdoc: drop redundant .Pp calls, kill EOL whitespace Modified: head/share/man/man4/pci.4 head/usr.sbin/config/config.5 Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Sat Oct 9 09:24:16 2010 (r213652) +++ head/share/man/man4/pci.4 Sat Oct 9 11:43:00 2010 (r213653) @@ -55,8 +55,8 @@ device. If used improperly, this driver can allow userland applications to crash a machine or cause data loss. .Pp -The -.Nm +The +.Nm driver implements the .Tn PCI bus in the kernel. @@ -74,7 +74,7 @@ children when client drivers are dynamically loaded at runtime. .Sh KERNEL CONFIGURATION -The +The .Nm device is included in the kernel as described in the SYNOPSIS section. The @@ -90,7 +90,6 @@ driver. They are defined in the header file .In sys/pciio.h . .Bl -tag -width 012345678901234 -.Pp .It PCIOCGETCONF This .Xr ioctl 2 Modified: head/usr.sbin/config/config.5 ============================================================================== --- head/usr.sbin/config/config.5 Sat Oct 9 09:24:16 2010 (r213652) +++ head/usr.sbin/config/config.5 Sat Oct 9 11:43:00 2010 (r213653) @@ -86,9 +86,9 @@ Directives are processed in order of app directive lines overriding the effect of prior ones. .Pp The list of keywords and their meanings are as follows: +.Pp .Bl -tag -width indent -compact .\" -------- CPU -------- -.Pp .It Ic cpu Ar cputype Specify the CPU this kernel will run on. There can be more than one @@ -208,9 +208,9 @@ When .Ar cpuarch is not specified, it is assumed to be the same as .Ar arch . -.Ar arch +.Ar arch corresponds to MACHINE. -.Ar cpuarch +.Ar cpuarch corresponds to MACHINE_ARCH. .Pp A kernel configuration file may have only one @@ -351,7 +351,6 @@ option to The following kernel configuration directives are obsolete. .Bl -tag -width indent .\" -------- CONFIG -------- -.Pp .It Ic config This directive was used to specify the device to be used for the root file system. From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 12:00:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3259E1065742; Sat, 9 Oct 2010 12:00:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9AAF18FC15; Sat, 9 Oct 2010 12:00:39 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 15DAE46B2E; Sat, 9 Oct 2010 08:00:39 -0400 (EDT) Date: Sat, 9 Oct 2010 13:00:38 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: David Xu In-Reply-To: <201010090250.o992oNw0022369@svn.freebsd.org> Message-ID: References: <201010090250.o992oNw0022369@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213642 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 12:00:40 -0000 On Sat, 9 Oct 2010, David Xu wrote: > Create a global thread hash table to speed up thread lookup, use > rwlock to protect the table. In old code, thread lookup is done with > process lock held, to find a thread, kernel has to iterate through > process and thread list, this is quite inefficient. > With this change, test shows in extreme case performance is > dramatically improved. Could you say a little more about which workloads this helps with? Obviously, things that look up thread IDs, but since I'm less familiar with the threading code, a hand-wave would give me useful intuitions! BTW, my experience with switching to read-write locking in the pcbinfo hash lookup is that it made a huge difference, and that I experience only fairly incremental performance changes on <= 8 cores by trying to go to more refined models (such as encouraging CPU affinity for table entries, etc). Robert > > Earlier patch was reviewed by: jhb, julian > > Modified: > head/sys/kern/init_main.c > head/sys/kern/kern_exit.c > head/sys/kern/kern_fork.c > head/sys/kern/kern_kthread.c > head/sys/kern/kern_resource.c > head/sys/kern/kern_sig.c > head/sys/kern/kern_thr.c > head/sys/kern/kern_thread.c > head/sys/kern/kern_time.c > head/sys/kern/kern_umtx.c > head/sys/kern/sys_process.c > head/sys/kern/uipc_mqueue.c > head/sys/kern/vfs_aio.c > head/sys/sys/proc.h > head/sys/sys/signalvar.h > > Modified: head/sys/kern/init_main.c > ============================================================================== > --- head/sys/kern/init_main.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/init_main.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -443,6 +443,7 @@ proc0_init(void *dummy __unused) > */ > LIST_INSERT_HEAD(&allproc, p, p_list); > LIST_INSERT_HEAD(PIDHASH(0), p, p_hash); > + LIST_INSERT_HEAD(TIDHASH(0), td, td_hash); > mtx_init(&pgrp0.pg_mtx, "process group", NULL, MTX_DEF | MTX_DUPOK); > p->p_pgrp = &pgrp0; > LIST_INSERT_HEAD(PGRPHASH(0), &pgrp0, pg_hash); > > Modified: head/sys/kern/kern_exit.c > ============================================================================== > --- head/sys/kern/kern_exit.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_exit.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -403,6 +403,8 @@ exit1(struct thread *td, int rv) > PROC_UNLOCK(p); > lim_free(plim); > > + tidhash_remove(td); > + > /* > * Remove proc from allproc queue and pidhash chain. > * Place onto zombproc. Unlink from parent's child list. > > Modified: head/sys/kern/kern_fork.c > ============================================================================== > --- head/sys/kern/kern_fork.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_fork.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -456,7 +456,7 @@ again: > AUDIT_ARG_PID(p2->p_pid); > LIST_INSERT_HEAD(&allproc, p2, p_list); > LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); > - > + tidhash_add(td2); > PROC_LOCK(p2); > PROC_LOCK(p1); > > > Modified: head/sys/kern/kern_kthread.c > ============================================================================== > --- head/sys/kern/kern_kthread.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_kthread.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -295,6 +295,7 @@ kthread_add(void (*func)(void *), void * > thread_unlock(oldtd); > PROC_UNLOCK(p); > > + tidhash_add(newtd); > > /* Delay putting it on the run queue until now. */ > if (!(flags & RFSTOPPED)) { > @@ -314,6 +315,8 @@ kthread_exit(void) > > p = curthread->td_proc; > > + tidhash_remove(curthread); > + > /* A module may be waiting for us to exit. */ > wakeup(curthread); > PROC_LOCK(p); > > Modified: head/sys/kern/kern_resource.c > ============================================================================== > --- head/sys/kern/kern_resource.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_resource.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -295,25 +295,23 @@ rtprio_thread(struct thread *td, struct > else > cierror = 0; > > - /* > - * Though lwpid is unique, only current process is supported > - * since there is no efficient way to look up a LWP yet. > - */ > - p = td->td_proc; > - PROC_LOCK(p); > + if (uap->lwpid == 0 || uap->lwpid == td->td_tid) { > + p = td->td_proc; > + td1 = td; > + PROC_LOCK(p); > + } else { > + /* Only look up thread in current process */ > + td1 = tdfind(uap->lwpid, curproc->p_pid); > + if (td1 == NULL) > + return (ESRCH); > + p = td1->td_proc; > + } > > switch (uap->function) { > case RTP_LOOKUP: > if ((error = p_cansee(td, p))) > break; > - if (uap->lwpid == 0 || uap->lwpid == td->td_tid) > - td1 = td; > - else > - td1 = thread_find(p, uap->lwpid); > - if (td1 != NULL) > - pri_to_rtp(td1, &rtp); > - else > - error = ESRCH; > + pri_to_rtp(td1, &rtp); > PROC_UNLOCK(p); > return (copyout(&rtp, uap->rtp, sizeof(struct rtprio))); > case RTP_SET: > @@ -337,15 +335,7 @@ rtprio_thread(struct thread *td, struct > if (error) > break; > } > - > - if (uap->lwpid == 0 || uap->lwpid == td->td_tid) > - td1 = td; > - else > - td1 = thread_find(p, uap->lwpid); > - if (td1 != NULL) > - error = rtp_to_pri(&rtp, td1); > - else > - error = ESRCH; > + error = rtp_to_pri(&rtp, td1); > break; > default: > error = EINVAL; > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_sig.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -107,8 +107,6 @@ static int killpg1(struct thread *td, in > ksiginfo_t *ksi); > static int issignal(struct thread *td, int stop_allowed); > static int sigprop(int sig); > -static int tdsendsignal(struct proc *p, struct thread *td, int sig, > - ksiginfo_t *ksi); > static void tdsigwakeup(struct thread *, int, sig_t, int); > static void sig_suspend_threads(struct thread *, struct proc *, int); > static int filt_sigattach(struct knote *kn); > @@ -1974,27 +1972,22 @@ pksignal(struct proc *p, int sig, ksigin > return (tdsendsignal(p, NULL, sig, ksi)); > } > > +/* Utility function for finding a thread to send signal event to. */ > int > -psignal_event(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi) > +sigev_findtd(struct proc *p ,struct sigevent *sigev, struct thread **ttd) > { > - struct thread *td = NULL; > - > - PROC_LOCK_ASSERT(p, MA_OWNED); > - > - KASSERT(!KSI_ONQ(ksi), ("psignal_event: ksi on queue")); > + struct thread *td; > > - /* > - * ksi_code and other fields should be set before > - * calling this function. > - */ > - ksi->ksi_signo = sigev->sigev_signo; > - ksi->ksi_value = sigev->sigev_value; > if (sigev->sigev_notify == SIGEV_THREAD_ID) { > - td = thread_find(p, sigev->sigev_notify_thread_id); > + td = tdfind(sigev->sigev_notify_thread_id, p->p_pid); > if (td == NULL) > return (ESRCH); > + *ttd = td; > + } else { > + *ttd = NULL; > + PROC_LOCK(p); > } > - return (tdsendsignal(p, td, ksi->ksi_signo, ksi)); > + return (0); > } > > void > @@ -2015,7 +2008,7 @@ tdksignal(struct thread *td, int sig, ks > (void) tdsendsignal(td->td_proc, td, sig, ksi); > } > > -static int > +int > tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) > { > sig_t action; > @@ -2026,6 +2019,7 @@ tdsendsignal(struct proc *p, struct thre > int ret = 0; > int wakeup_swapper; > > + MPASS(td == NULL || p == td->td_proc); > PROC_LOCK_ASSERT(p, MA_OWNED); > > if (!_SIG_VALID(sig)) > > Modified: head/sys/kern/kern_thr.c > ============================================================================== > --- head/sys/kern/kern_thr.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_thr.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -240,6 +241,9 @@ create_thread(struct thread *td, mcontex > if (P_SHOULDSTOP(p)) > newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; > PROC_UNLOCK(p); > + > + tidhash_add(newtd); > + > thread_lock(newtd); > if (rtp != NULL) { > if (!(td->td_pri_class == PRI_TIMESHARE && > @@ -281,6 +285,8 @@ thr_exit(struct thread *td, struct thr_e > kern_umtx_wake(td, uap->state, INT_MAX, 0); > } > > + tidhash_remove(td); > + > PROC_LOCK(p); > tdsigcleanup(td); > PROC_SLOCK(p); > @@ -309,18 +315,17 @@ thr_kill(struct thread *td, struct thr_k > int error; > > p = td->td_proc; > - error = 0; > ksiginfo_init(&ksi); > ksi.ksi_signo = uap->sig; > ksi.ksi_code = SI_LWP; > ksi.ksi_pid = p->p_pid; > ksi.ksi_uid = td->td_ucred->cr_ruid; > - PROC_LOCK(p); > if (uap->id == -1) { > if (uap->sig != 0 && !_SIG_VALID(uap->sig)) { > error = EINVAL; > } else { > error = ESRCH; > + PROC_LOCK(p); > FOREACH_THREAD_IN_PROC(p, ttd) { > if (ttd != td) { > error = 0; > @@ -329,22 +334,21 @@ thr_kill(struct thread *td, struct thr_k > tdksignal(ttd, uap->sig, &ksi); > } > } > + PROC_UNLOCK(p); > } > } else { > - if (uap->id != td->td_tid) > - ttd = thread_find(p, uap->id); > - else > - ttd = td; > + error = 0; > + ttd = tdfind((lwpid_t)uap->id, p->p_pid); > if (ttd == NULL) > - error = ESRCH; > - else if (uap->sig == 0) > + return (ESRCH); > + if (uap->sig == 0) > ; > else if (!_SIG_VALID(uap->sig)) > error = EINVAL; > - else > + else > tdksignal(ttd, uap->sig, &ksi); > + PROC_UNLOCK(ttd->td_proc); > } > - PROC_UNLOCK(p); > return (error); > } > > @@ -359,51 +363,49 @@ thr_kill2(struct thread *td, struct thr_ > > AUDIT_ARG_SIGNUM(uap->sig); > > - if (uap->pid == td->td_proc->p_pid) { > - p = td->td_proc; > - PROC_LOCK(p); > - } else if ((p = pfind(uap->pid)) == NULL) { > - return (ESRCH); > - } > - AUDIT_ARG_PROCESS(p); > - > - error = p_cansignal(td, p, uap->sig); > - if (error == 0) { > - ksiginfo_init(&ksi); > - ksi.ksi_signo = uap->sig; > - ksi.ksi_code = SI_LWP; > - ksi.ksi_pid = td->td_proc->p_pid; > - ksi.ksi_uid = td->td_ucred->cr_ruid; > - if (uap->id == -1) { > - if (uap->sig != 0 && !_SIG_VALID(uap->sig)) { > - error = EINVAL; > - } else { > - error = ESRCH; > - FOREACH_THREAD_IN_PROC(p, ttd) { > - if (ttd != td) { > - error = 0; > - if (uap->sig == 0) > - break; > - tdksignal(ttd, uap->sig, &ksi); > - } > + ksiginfo_init(&ksi); > + ksi.ksi_signo = uap->sig; > + ksi.ksi_code = SI_LWP; > + ksi.ksi_pid = td->td_proc->p_pid; > + ksi.ksi_uid = td->td_ucred->cr_ruid; > + if (uap->id == -1) { > + if ((p = pfind(uap->pid)) == NULL) > + return (ESRCH); > + AUDIT_ARG_PROCESS(p); > + error = p_cansignal(td, p, uap->sig); > + if (error) { > + PROC_UNLOCK(p); > + return (error); > + } > + if (uap->sig != 0 && !_SIG_VALID(uap->sig)) { > + error = EINVAL; > + } else { > + error = ESRCH; > + FOREACH_THREAD_IN_PROC(p, ttd) { > + if (ttd != td) { > + error = 0; > + if (uap->sig == 0) > + break; > + tdksignal(ttd, uap->sig, &ksi); > } > } > - } else { > - if (uap->id != td->td_tid) > - ttd = thread_find(p, uap->id); > - else > - ttd = td; > - if (ttd == NULL) > - error = ESRCH; > - else if (uap->sig == 0) > - ; > - else if (!_SIG_VALID(uap->sig)) > - error = EINVAL; > - else > - tdksignal(ttd, uap->sig, &ksi); > } > + PROC_UNLOCK(p); > + } else { > + ttd = tdfind((lwpid_t)uap->id, uap->pid); > + if (ttd == NULL) > + return (ESRCH); > + p = ttd->td_proc; > + AUDIT_ARG_PROCESS(p); > + error = p_cansignal(td, p, uap->sig); > + if (uap->sig == 0) > + ; > + else if (!_SIG_VALID(uap->sig)) > + error = EINVAL; > + else > + tdksignal(ttd, uap->sig, &ksi); > + PROC_UNLOCK(p); > } > - PROC_UNLOCK(p); > return (error); > } > > @@ -485,12 +487,9 @@ thr_wake(struct thread *td, struct thr_w > } > > p = td->td_proc; > - PROC_LOCK(p); > - ttd = thread_find(p, uap->id); > - if (ttd == NULL) { > - PROC_UNLOCK(p); > + ttd = tdfind((lwpid_t)uap->id, p->p_pid); > + if (ttd == NULL) > return (ESRCH); > - } > thread_lock(ttd); > ttd->td_flags |= TDF_THRWAKEUP; > thread_unlock(ttd); > @@ -502,7 +501,7 @@ thr_wake(struct thread *td, struct thr_w > int > thr_set_name(struct thread *td, struct thr_set_name_args *uap) > { > - struct proc *p = td->td_proc; > + struct proc *p; > char name[MAXCOMLEN + 1]; > struct thread *ttd; > int error; > @@ -515,15 +514,11 @@ thr_set_name(struct thread *td, struct t > if (error) > return (error); > } > - PROC_LOCK(p); > - if (uap->id == td->td_tid) > - ttd = td; > - else > - ttd = thread_find(p, uap->id); > - if (ttd != NULL) > - strcpy(ttd->td_name, name); > - else > - error = ESRCH; > + p = td->td_proc; > + ttd = tdfind((lwpid_t)uap->id, p->p_pid); > + if (ttd == NULL) > + return (ESRCH); > + strcpy(ttd->td_name, name); > PROC_UNLOCK(p); > return (error); > } > > Modified: head/sys/kern/kern_thread.c > ============================================================================== > --- head/sys/kern/kern_thread.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_thread.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #ifdef HWPMC_HOOKS > @@ -83,6 +84,12 @@ static void thread_zombie(struct thread > struct mtx tid_lock; > static struct unrhdr *tid_unrhdr; > > +static MALLOC_DEFINE(M_TIDHASH, "tidhash", "thread hash"); > + > +struct tidhashhead *tidhashtbl; > +u_long tidhash; > +struct rwlock tidhash_lock; > + > /* > * Prepare a thread for use. > */ > @@ -230,6 +237,8 @@ threadinit(void) > thread_zone = uma_zcreate("THREAD", sched_sizeof_thread(), > thread_ctor, thread_dtor, thread_init, thread_fini, > 16 - 1, 0); > + tidhashtbl = hashinit(maxproc / 2, M_TIDHASH, &tidhash); > + rw_init(&tidhash_lock, "tidhash"); > } > > /* > @@ -748,8 +757,14 @@ thread_suspend_check(int return_instead) > * this thread should just suicide. > * Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE. > */ > - if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) > + if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { > + PROC_SUNLOCK(p); > + PROC_UNLOCK(p); > + tidhash_remove(td); > + PROC_LOCK(p); > + PROC_SLOCK(p); > thread_exit(); > + } > if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { > if (p->p_numthreads == p->p_suspcount + 1) { > thread_lock(p->p_singlethread); > @@ -923,3 +938,57 @@ thread_find(struct proc *p, lwpid_t tid) > } > return (td); > } > + > +/* Locate a thread by number; return with proc lock held. */ > +struct thread * > +tdfind(lwpid_t tid, pid_t pid) > +{ > +#define RUN_THRESH 16 > + struct thread *td; > + int run = 0; > + > + rw_rlock(&tidhash_lock); > + LIST_FOREACH(td, TIDHASH(tid), td_hash) { > + if (td->td_tid == tid) { > + if (pid != -1 && td->td_proc->p_pid != pid) { > + td = NULL; > + break; > + } > + if (td->td_proc->p_state == PRS_NEW) { > + td = NULL; > + break; > + } > + if (run > RUN_THRESH) { > + if (rw_try_upgrade(&tidhash_lock)) { > + LIST_REMOVE(td, td_hash); > + LIST_INSERT_HEAD(TIDHASH(td->td_tid), > + td, td_hash); > + PROC_LOCK(td->td_proc); > + rw_wunlock(&tidhash_lock); > + return (td); > + } > + } > + PROC_LOCK(td->td_proc); > + break; > + } > + run++; > + } > + rw_runlock(&tidhash_lock); > + return (td); > +} > + > +void > +tidhash_add(struct thread *td) > +{ > + rw_wlock(&tidhash_lock); > + LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); > + rw_wunlock(&tidhash_lock); > +} > + > +void > +tidhash_remove(struct thread *td) > +{ > + rw_wlock(&tidhash_lock); > + LIST_REMOVE(td, td_hash); > + rw_wunlock(&tidhash_lock); > +} > > Modified: head/sys/kern/kern_time.c > ============================================================================== > --- head/sys/kern/kern_time.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_time.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -1402,28 +1402,22 @@ void > itimer_fire(struct itimer *it) > { > struct proc *p = it->it_proc; > - int ret; > + struct thread *td; > > if (it->it_sigev.sigev_notify == SIGEV_SIGNAL || > it->it_sigev.sigev_notify == SIGEV_THREAD_ID) { > - PROC_LOCK(p); > + if (sigev_findtd(p, &it->it_sigev, &td) != 0) { > + ITIMER_LOCK(it); > + timespecclear(&it->it_time.it_value); > + timespecclear(&it->it_time.it_interval); > + callout_stop(&it->it_callout); > + ITIMER_UNLOCK(it); > + return; > + } > if (!KSI_ONQ(&it->it_ksi)) { > it->it_ksi.ksi_errno = 0; > - ret = psignal_event(p, &it->it_sigev, &it->it_ksi); > - if (__predict_false(ret != 0)) { > - it->it_overrun++; > - /* > - * Broken userland code, thread went > - * away, disarm the timer. > - */ > - if (ret == ESRCH) { > - ITIMER_LOCK(it); > - timespecclear(&it->it_time.it_value); > - timespecclear(&it->it_time.it_interval); > - callout_stop(&it->it_callout); > - ITIMER_UNLOCK(it); > - } > - } > + ksiginfo_set_sigev(&it->it_ksi, &it->it_sigev); > + tdsendsignal(p, td, it->it_ksi.ksi_signo, &it->it_ksi); > } else { > if (it->it_overrun < INT_MAX) > it->it_overrun++; > > Modified: head/sys/kern/kern_umtx.c > ============================================================================== > --- head/sys/kern/kern_umtx.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/kern_umtx.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -1588,20 +1588,15 @@ umtxq_sleep_pi(struct umtx_q *uq, struct > umtxq_insert(uq); > mtx_lock_spin(&umtx_lock); > if (pi->pi_owner == NULL) { > - /* XXX > - * Current, We only support process private PI-mutex, > - * we need a faster way to find an owner thread for > - * process-shared mutex (not available yet). > - */ > mtx_unlock_spin(&umtx_lock); > - PROC_LOCK(curproc); > - td1 = thread_find(curproc, owner); > + /* XXX Only look up thread in current process. */ > + td1 = tdfind(owner, curproc->p_pid); > mtx_lock_spin(&umtx_lock); > if (td1 != NULL && pi->pi_owner == NULL) { > uq1 = td1->td_umtxq; > umtx_pi_setowner(pi, td1); > } > - PROC_UNLOCK(curproc); > + PROC_UNLOCK(td1->td_proc); > } > > TAILQ_FOREACH(uq1, &pi->pi_blocked, uq_lockq) { > > Modified: head/sys/kern/sys_process.c > ============================================================================== > --- head/sys/kern/sys_process.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/sys_process.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -721,24 +721,13 @@ kern_ptrace(struct thread *td, int req, > return (ESRCH); > } > } else { > - /* this is slow, should be optimized */ > - sx_slock(&allproc_lock); > - FOREACH_PROC_IN_SYSTEM(p) { > - PROC_LOCK(p); > - FOREACH_THREAD_IN_PROC(p, td2) { > - if (td2->td_tid == pid) > - break; > - } > - if (td2 != NULL) > - break; /* proc lock held */ > - PROC_UNLOCK(p); > - } > - sx_sunlock(&allproc_lock); > - if (p == NULL) { > + td2 = tdfind(pid, -1); > + if (td2 == NULL) { > if (proctree_locked) > sx_xunlock(&proctree_lock); > return (ESRCH); > } > + p = td2->td_proc; > tid = pid; > pid = p->p_pid; > } > > Modified: head/sys/kern/uipc_mqueue.c > ============================================================================== > --- head/sys/kern/uipc_mqueue.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/uipc_mqueue.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -1747,15 +1747,23 @@ static void > mqueue_send_notification(struct mqueue *mq) > { > struct mqueue_notifier *nt; > + struct thread *td; > struct proc *p; > + int error; > > mtx_assert(&mq->mq_mutex, MA_OWNED); > nt = mq->mq_notifier; > if (nt->nt_sigev.sigev_notify != SIGEV_NONE) { > p = nt->nt_proc; > - PROC_LOCK(p); > - if (!KSI_ONQ(&nt->nt_ksi)) > - psignal_event(p, &nt->nt_sigev, &nt->nt_ksi); > + error = sigev_findtd(p, &nt->nt_sigev, &td); > + if (error) { > + mq->mq_notifier = NULL; > + return; > + } > + if (!KSI_ONQ(&nt->nt_ksi)) { > + ksiginfo_set_sigev(&nt->nt_ksi, &nt->nt_sigev); > + tdsendsignal(p, td, nt->nt_ksi.ksi_signo, &nt->nt_ksi); > + } > PROC_UNLOCK(p); > } > mq->mq_notifier = NULL; > > Modified: head/sys/kern/vfs_aio.c > ============================================================================== > --- head/sys/kern/vfs_aio.c Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/kern/vfs_aio.c Sat Oct 9 02:50:23 2010 (r213642) > @@ -609,16 +609,20 @@ aio_init_aioinfo(struct proc *p) > static int > aio_sendsig(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi) > { > - int ret = 0; > + struct thread *td; > + int error; > > - PROC_LOCK(p); > + error = sigev_findtd(p, sigev, &td); > + if (error) > + return (error); > if (!KSI_ONQ(ksi)) { > + ksiginfo_set_sigev(ksi, sigev); > ksi->ksi_code = SI_ASYNCIO; > ksi->ksi_flags |= KSI_EXT | KSI_INS; > - ret = psignal_event(p, sigev, ksi); > + tdsendsignal(p, td, ksi->ksi_signo, ksi); > } > PROC_UNLOCK(p); > - return (ret); > + return (error); > } > > /* > > Modified: head/sys/sys/proc.h > ============================================================================== > --- head/sys/sys/proc.h Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/sys/proc.h Sat Oct 9 02:50:23 2010 (r213642) > @@ -205,6 +205,7 @@ struct thread { > TAILQ_ENTRY(thread) td_runq; /* (t) Run queue. */ > TAILQ_ENTRY(thread) td_slpq; /* (t) Sleep queue. */ > TAILQ_ENTRY(thread) td_lockq; /* (t) Lock queue. */ > + LIST_ENTRY(thread) td_hash; /* (d) Hash chain. */ > struct cpuset *td_cpuset; /* (t) CPU affinity mask. */ > struct seltd *td_sel; /* Select queue/channel. */ > struct sleepqueue *td_sleepqueue; /* (k) Associated sleep queue. */ > @@ -766,6 +767,10 @@ MALLOC_DECLARE(M_ZOMBIE); > #define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) > extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; > extern u_long pidhash; > +#define TIDHASH(tid) (&tidhashtbl[(tid) & tidhash]) > +extern LIST_HEAD(tidhashhead, thread) *tidhashtbl; > +extern u_long tidhash; > +extern struct rwlock tidhash_lock; > > #define PGRPHASH(pgid) (&pgrphashtbl[(pgid) & pgrphash]) > extern LIST_HEAD(pgrphashhead, pgrp) *pgrphashtbl; > @@ -837,7 +842,10 @@ void setsugid(struct proc *p); > int sigonstack(size_t sp); > void sleepinit(void); > void stopevent(struct proc *, u_int, u_int); > +struct thread *tdfind(lwpid_t, pid_t); > void threadinit(void); > +void tidhash_add(struct thread *); > +void tidhash_remove(struct thread *); > void cpu_idle(int); > int cpu_idle_wakeup(int); > extern void (*cpu_idle_hook)(void); /* Hook to machdep CPU idler. */ > > Modified: head/sys/sys/signalvar.h > ============================================================================== > --- head/sys/sys/signalvar.h Sat Oct 9 00:36:32 2010 (r213641) > +++ head/sys/sys/signalvar.h Sat Oct 9 02:50:23 2010 (r213642) > @@ -294,6 +294,13 @@ ksiginfo_copy(ksiginfo_t *src, ksiginfo_ > (dst)->ksi_flags = (src->ksi_flags & KSI_COPYMASK); > } > > +static __inline void > +ksiginfo_set_sigev(ksiginfo_t *dst, struct sigevent *sigev) > +{ > + dst->ksi_signo = sigev->sigev_signo; > + dst->ksi_value = sigev->sigev_value; > +} > + > struct pgrp; > struct proc; > struct sigio; > @@ -331,7 +338,6 @@ void pgsigio(struct sigio **sigiop, int > void pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi); > int postsig(int sig); > void psignal(struct proc *p, int sig); > -int psignal_event(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi); > int ptracestop(struct thread *td, int sig); > void sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *retmask); > struct sigacts *sigacts_alloc(void); > @@ -340,6 +346,7 @@ void sigacts_free(struct sigacts *ps); > struct sigacts *sigacts_hold(struct sigacts *ps); > int sigacts_shared(struct sigacts *ps); > void sigexit(struct thread *td, int sig) __dead2; > +int sigev_findtd(struct proc *p, struct sigevent *sigev, struct thread **); > int sig_ffs(sigset_t *set); > void siginit(struct proc *p); > void signotify(struct thread *td); > @@ -349,6 +356,8 @@ void sigqueue_flush(struct sigqueue *que > void sigqueue_init(struct sigqueue *queue, struct proc *p); > void sigqueue_take(ksiginfo_t *ksi); > void tdksignal(struct thread *td, int sig, ksiginfo_t *ksi); > +int tdsendsignal(struct proc *p, struct thread *td, int sig, > + ksiginfo_t *ksi); > void tdsigcleanup(struct thread *td); > void tdsignal(struct thread *td, int sig); > void trapsignal(struct thread *td, ksiginfo_t *ksi); > From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 12:15:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from alona.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 97C99106564A; Sat, 9 Oct 2010 12:15:18 +0000 (UTC) (envelope-from davidxu@freebsd.org) Message-ID: <4CB05CC7.6050901@freebsd.org> Date: Sat, 09 Oct 2010 20:15:03 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.21 (X11/20090522) MIME-Version: 1.0 To: Robert Watson References: <201010090250.o992oNw0022369@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-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213642 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 12:15:22 -0000 Robert Watson wrote: > On Sat, 9 Oct 2010, David Xu wrote: > >> Create a global thread hash table to speed up thread lookup, use >> rwlock to protect the table. In old code, thread lookup is done with >> process lock held, to find a thread, kernel has to iterate through >> process and thread list, this is quite inefficient. >> With this change, test shows in extreme case performance is >> dramatically improved. > > Could you say a little more about which workloads this helps with? > Obviously, things that look up thread IDs, but since I'm less familiar > with the threading code, a hand-wave would give me useful intuitions! > > BTW, my experience with switching to read-write locking in the pcbinfo > hash lookup is that it made a huge difference, and that I experience > only fairly incremental performance changes on <= 8 cores by trying to > go to more refined models (such as encouraging CPU affinity for table > entries, etc). > > Robert > I have tested it with my simple benchmark program: http://people.freebsd.org/~davidxu/tidhash/sigperf.c run it with following command: /usr/bin/time ./sigperf 150 20000 result before the change: http://people.freebsd.org/~davidxu/tidhash/thread_find.txt after the change: http://people.freebsd.org/~davidxu/tidhash/tfind.txt From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 12:57:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5C63106566B; Sat, 9 Oct 2010 12:57:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4AF08FC19; Sat, 9 Oct 2010 12:57: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 o99Cv6Ka040227; Sat, 9 Oct 2010 12:57:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99Cv6q6040225; Sat, 9 Oct 2010 12:57:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010091257.o99Cv6q6040225@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 9 Oct 2010 12:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213654 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 12:57:07 -0000 Author: jilles Date: Sat Oct 9 12:57:06 2010 New Revision: 213654 URL: http://svn.freebsd.org/changeset/base/213654 Log: MFC r209653: sh: Use $PWD instead of getcwd() for \w \W prompt expansions. This ensures that the logical working directory (which may include symlinks) is shown and is similar to the default behaviour of the pwd builtin. Modified: stable/8/bin/sh/parser.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/parser.c ============================================================================== --- stable/8/bin/sh/parser.c Sat Oct 9 11:43:00 2010 (r213653) +++ stable/8/bin/sh/parser.c Sat Oct 9 12:57:06 2010 (r213654) @@ -1583,7 +1583,8 @@ getprompt(void *unused __unused) { static char ps[PROMPTLEN]; char *fmt; - int i, j, trim; + const char *pwd; + int i, trim; static char internal_error[] = ""; /* @@ -1634,17 +1635,15 @@ getprompt(void *unused __unused) */ case 'W': case 'w': - ps[i] = '\0'; - getcwd(&ps[i], PROMPTLEN - i); - if (*fmt == 'W' && ps[i + 1] != '\0') { - /* Final path component only. */ - trim = 1; - for (j = i; ps[j] != '\0'; j++) - if (ps[j] == '/') - trim = j + 1; - memmove(&ps[i], &ps[trim], - j - trim + 1); - } + pwd = lookupvar("PWD"); + if (pwd == NULL) + pwd = "?"; + if (*fmt == 'W' && + *pwd == '/' && pwd[1] != '\0') + strlcpy(&ps[i], strrchr(pwd, '/') + 1, + PROMPTLEN - i); + else + strlcpy(&ps[i], pwd, PROMPTLEN - i); /* Skip to end of path. */ while (ps[i + 1] != '\0') i++; From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 13:01:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E391065693; Sat, 9 Oct 2010 13:01:25 +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 5511E8FC1B; Sat, 9 Oct 2010 13:01: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 o99D1PDV040424; Sat, 9 Oct 2010 13:01:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99D1P3l040422; Sat, 9 Oct 2010 13:01:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010091301.o99D1P3l040422@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 9 Oct 2010 13:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213655 - stable/8/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 13:01:25 -0000 Author: jilles Date: Sat Oct 9 13:01:25 2010 New Revision: 213655 URL: http://svn.freebsd.org/changeset/base/213655 Log: MFC r211980: Correct value for _POSIX_AIO_LISTIO_MAX in . All the "Minimum Values" (POSIX.1-2008 XBD 13 Headers ) are now correct. These should all be exactly as they are in the specification; the possibly higher values we support are announced differently. PR: standards/104743 Modified: stable/8/include/limits.h Directory Properties: stable/8/include/ (props changed) Modified: stable/8/include/limits.h ============================================================================== --- stable/8/include/limits.h Sat Oct 9 12:57:06 2010 (r213654) +++ stable/8/include/limits.h Sat Oct 9 13:01:25 2010 (r213655) @@ -74,7 +74,7 @@ #endif #if __POSIX_VISIBLE >= 199309 -#define _POSIX_AIO_LISTIO_MAX 16 +#define _POSIX_AIO_LISTIO_MAX 2 #define _POSIX_AIO_MAX 1 #define _POSIX_DELAYTIMER_MAX 32 #define _POSIX_MQ_OPEN_MAX 8 From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 13:03:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77F3D1065674; Sat, 9 Oct 2010 13:03:33 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6713D8FC16; Sat, 9 Oct 2010 13:03: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 o99D3XDV040508; Sat, 9 Oct 2010 13:03:33 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99D3XV4040506; Sat, 9 Oct 2010 13:03:33 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201010091303.o99D3XV4040506@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 9 Oct 2010 13:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213656 - stable/8/share/dict X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 13:03:33 -0000 Author: gavin Date: Sat Oct 9 13:03:32 2010 New Revision: 213656 URL: http://svn.freebsd.org/changeset/base/213656 Log: Merge r213061 from head: Various changes from various sources: - Add "children" [1] - Add "acknowledgement", "acknowledgment", "Austria" and "haunted" [2] - Add "near", "antidisestablishmentarianism" and "Persephone" [2] - "Transvaal" should be capitalized [2] - Correct spelling of "structurelessness" and "Athena" [2] - Add missing atomic elements [3] - Add various words from "word of the day" lists [3] PR: conf/149756 [1] Submitted by: Nick Johnson [1] Obtained from: NetBSD [2], OpenBSD [3] Modified: stable/8/share/dict/web2 Directory Properties: stable/8/share/dict/ (props changed) Modified: stable/8/share/dict/web2 ============================================================================== --- stable/8/share/dict/web2 Sat Oct 9 13:01:25 2010 (r213655) +++ stable/8/share/dict/web2 Sat Oct 9 13:03:32 2010 (r213656) @@ -1545,9 +1545,11 @@ ackman acknow acknowledge acknowledgeable +acknowledgement acknowledged acknowledgedly acknowledger +acknowledgment aclastic acle acleidian @@ -3875,6 +3877,7 @@ agee Agelacrinites Agelacrinitidae Agelaius +agelast Agelaus ageless agelessness @@ -3995,6 +3998,7 @@ agist agistator agistment agistor +agita agitable agitant agitate @@ -4298,7 +4302,6 @@ Ahriman Ahrimanian ahsan Aht -Ahtena ahu ahuatle ahuehuete @@ -10059,6 +10062,7 @@ antidiphtheric antidiphtherin antidiphtheritic antidisciplinarian +antidisestablishmentarianism antidivine antidivorce antidogmatic @@ -15091,6 +15095,7 @@ atheizer athelia atheling athematic +Athena Athenaea athenaeum athenee @@ -15891,6 +15896,7 @@ australopithecine Australopithecus Australorp Austrasian +Austria Austrian Austrianize Austric @@ -21543,6 +21549,7 @@ betinge betipple betire betis +betise betitle betocsin betoil @@ -21833,6 +21840,7 @@ bibble bibbler bibbons bibcock +bibelot bibenzyl bibi Bibio @@ -24298,6 +24306,7 @@ bohereen bohireen boho bohor +bohrium bohunk boid Boidae @@ -24606,6 +24615,7 @@ boo boob boobery boobily +booboisie boobook booby boobyalla @@ -25158,6 +25168,7 @@ bouldery boule boulevard boulevardize +bouleversement boultel boulter boulterer @@ -28540,6 +28551,7 @@ caesaropopism Caesarotomy Caesarship caesious +caesium caesura caesural caesuric @@ -34554,6 +34566,7 @@ childlike childlikeness childly childness +children childrenite childridden childship @@ -41256,6 +41269,7 @@ congenitally congenitalness conger congeree +congeries congest congested congestible @@ -57000,6 +57014,7 @@ dopebook doper dopester dopey +doppelganger doppelkummel Dopper dopper @@ -58202,6 +58217,7 @@ dubitatingly dubitation dubitative dubitatively +dubnium Duboisia duboisin duboisine @@ -58916,6 +58932,7 @@ dysphagic dysphasia dysphasic dysphemia +dysphemism dysphonia dysphonic dysphoria @@ -60001,6 +60018,7 @@ eimer Eimeria einkorn Einsteinian +einsteinium Eireannach Eirene eiresione @@ -65389,6 +65407,7 @@ eudaimonia eudaimonism eudaimonist Eudemian +eudemonia Eudendrium Eudeve eudiagnostic @@ -69151,6 +69170,7 @@ fermentum fermerer fermery fermila +fermium fermorite fern fernandinite @@ -81692,6 +81712,7 @@ hagworm hah Hahnemannian Hahnemannism +hahnium Haiathalah Haida Haidan @@ -82659,6 +82680,7 @@ Hasmonaean hasp hassar hassel +hassium hassle hassock hassocky @@ -82789,6 +82811,7 @@ haunching haunchless haunchy haunt +haunted haunter hauntingly haunty @@ -87139,6 +87162,7 @@ homuncular homunculus homy Hon +honcho honda hondo Honduran @@ -100289,6 +100313,7 @@ jokish jokist jokul joky +joliotium joll jolleyman jollier @@ -101349,6 +101374,7 @@ katun katurai Katy katydid +katzenjammer Kauravas kauri kava @@ -103074,6 +103100,7 @@ kuphar kupper Kuranko kurbash +kurchatovium kurchicine kurchine Kurd @@ -104905,6 +104932,7 @@ lawny lawproof Lawrence lawrencite +lawrencium Lawrie lawrightman Lawson @@ -106402,6 +106430,7 @@ Lide lidflower lidgate lidless +lido lie liebenerite Liebfraumilch @@ -113271,6 +113300,7 @@ Meissa Meistersinger meith Meithei +meitnerium meizoseismal meizoseismic mejorana @@ -113726,6 +113756,7 @@ mendacity Mendaite Mende mendee +mendelevium Mendelian Mendelianism Mendelianist @@ -114040,6 +114071,7 @@ Mercurochrome mercurophen mercurous Mercury +mercury mercy mercyproof merdivorous @@ -122874,6 +122906,7 @@ neanthropic neap neaped Neapolitan +near nearable nearabout nearabouts @@ -124384,6 +124417,7 @@ nielled niellist niello Niels +nielsbohrium niepa Nierembergia Niersteiner @@ -124791,6 +124825,7 @@ nobble nobbler nobbut nobby +nobelium nobiliary nobilify nobilitate @@ -143300,6 +143335,7 @@ perseitol perseity persentiscency Persephassa +Persephone Persepolitan perseverance perseverant @@ -159782,6 +159818,7 @@ pukeweed Pukhtun pukish pukishness +pukka pukras puku puky @@ -171927,6 +171964,7 @@ ruther rutherford rutherfordine rutherfordite +rutherfordium ruthful ruthfully ruthfulness @@ -176364,6 +176402,7 @@ Seabee seaberry seaboard seaborderer +seaborgium seabound seacannie seacatch @@ -176891,6 +176930,7 @@ segregational segregationist segregative segregator +segue Sehyo seiche Seid @@ -182225,6 +182265,7 @@ situational situla situlae situs +sitzmark Sium Siusi Siuslaw @@ -191094,6 +191135,7 @@ structuration structure structured structureless +structurelessness structurely structurist strudel @@ -191192,7 +191234,6 @@ stuccoworker stuccoyer stuck stuckling -stucturelessness stud studbook studder @@ -206199,7 +206240,7 @@ transuranian transuranic transuranium transuterine -transvaal +Transvaal Transvaaler Transvaalian transvaluate From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 13:07:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24EBF106566C; Sat, 9 Oct 2010 13:07:22 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13DF68FC13; Sat, 9 Oct 2010 13:07: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 o99D7Lu0040626; Sat, 9 Oct 2010 13:07:21 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99D7L3g040624; Sat, 9 Oct 2010 13:07:21 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201010091307.o99D7L3g040624@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 9 Oct 2010 13:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213657 - stable/7/share/dict X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 13:07:22 -0000 Author: gavin Date: Sat Oct 9 13:07:21 2010 New Revision: 213657 URL: http://svn.freebsd.org/changeset/base/213657 Log: Merge r213061 from head: Various changes from various sources: - Add "children" [1] - Add "acknowledgement", "acknowledgment", "Austria" and "haunted" [2] - Add "near", "antidisestablishmentarianism" and "Persephone" [2] - "Transvaal" should be capitalized [2] - Correct spelling of "structurelessness" and "Athena" [2] - Add missing atomic elements [3] - Add various words from "word of the day" lists [3] Also, set fbsd:nokeywords on web2, to allow checkin. PR: conf/149756 [1] Submitted by: Nick Johnson [1] Obtained from: NetBSD [2], OpenBSD [3] Modified: stable/7/share/dict/web2 (contents, props changed) Directory Properties: stable/7/share/dict/ (props changed) Modified: stable/7/share/dict/web2 ============================================================================== --- stable/7/share/dict/web2 Sat Oct 9 13:03:32 2010 (r213656) +++ stable/7/share/dict/web2 Sat Oct 9 13:07:21 2010 (r213657) @@ -1545,9 +1545,11 @@ ackman acknow acknowledge acknowledgeable +acknowledgement acknowledged acknowledgedly acknowledger +acknowledgment aclastic acle acleidian @@ -3875,6 +3877,7 @@ agee Agelacrinites Agelacrinitidae Agelaius +agelast Agelaus ageless agelessness @@ -3995,6 +3998,7 @@ agist agistator agistment agistor +agita agitable agitant agitate @@ -4298,7 +4302,6 @@ Ahriman Ahrimanian ahsan Aht -Ahtena ahu ahuatle ahuehuete @@ -10059,6 +10062,7 @@ antidiphtheric antidiphtherin antidiphtheritic antidisciplinarian +antidisestablishmentarianism antidivine antidivorce antidogmatic @@ -15091,6 +15095,7 @@ atheizer athelia atheling athematic +Athena Athenaea athenaeum athenee @@ -15891,6 +15896,7 @@ australopithecine Australopithecus Australorp Austrasian +Austria Austrian Austrianize Austric @@ -21543,6 +21549,7 @@ betinge betipple betire betis +betise betitle betocsin betoil @@ -21833,6 +21840,7 @@ bibble bibbler bibbons bibcock +bibelot bibenzyl bibi Bibio @@ -24298,6 +24306,7 @@ bohereen bohireen boho bohor +bohrium bohunk boid Boidae @@ -24606,6 +24615,7 @@ boo boob boobery boobily +booboisie boobook booby boobyalla @@ -25158,6 +25168,7 @@ bouldery boule boulevard boulevardize +bouleversement boultel boulter boulterer @@ -28540,6 +28551,7 @@ caesaropopism Caesarotomy Caesarship caesious +caesium caesura caesural caesuric @@ -34554,6 +34566,7 @@ childlike childlikeness childly childness +children childrenite childridden childship @@ -41256,6 +41269,7 @@ congenitally congenitalness conger congeree +congeries congest congested congestible @@ -57000,6 +57014,7 @@ dopebook doper dopester dopey +doppelganger doppelkummel Dopper dopper @@ -58202,6 +58217,7 @@ dubitatingly dubitation dubitative dubitatively +dubnium Duboisia duboisin duboisine @@ -58916,6 +58932,7 @@ dysphagic dysphasia dysphasic dysphemia +dysphemism dysphonia dysphonic dysphoria @@ -60001,6 +60018,7 @@ eimer Eimeria einkorn Einsteinian +einsteinium Eireannach Eirene eiresione @@ -65389,6 +65407,7 @@ eudaimonia eudaimonism eudaimonist Eudemian +eudemonia Eudendrium Eudeve eudiagnostic @@ -69151,6 +69170,7 @@ fermentum fermerer fermery fermila +fermium fermorite fern fernandinite @@ -81692,6 +81712,7 @@ hagworm hah Hahnemannian Hahnemannism +hahnium Haiathalah Haida Haidan @@ -82659,6 +82680,7 @@ Hasmonaean hasp hassar hassel +hassium hassle hassock hassocky @@ -82789,6 +82811,7 @@ haunching haunchless haunchy haunt +haunted haunter hauntingly haunty @@ -87139,6 +87162,7 @@ homuncular homunculus homy Hon +honcho honda hondo Honduran @@ -100289,6 +100313,7 @@ jokish jokist jokul joky +joliotium joll jolleyman jollier @@ -101349,6 +101374,7 @@ katun katurai Katy katydid +katzenjammer Kauravas kauri kava @@ -103074,6 +103100,7 @@ kuphar kupper Kuranko kurbash +kurchatovium kurchicine kurchine Kurd @@ -104905,6 +104932,7 @@ lawny lawproof Lawrence lawrencite +lawrencium Lawrie lawrightman Lawson @@ -106402,6 +106430,7 @@ Lide lidflower lidgate lidless +lido lie liebenerite Liebfraumilch @@ -113271,6 +113300,7 @@ Meissa Meistersinger meith Meithei +meitnerium meizoseismal meizoseismic mejorana @@ -113726,6 +113756,7 @@ mendacity Mendaite Mende mendee +mendelevium Mendelian Mendelianism Mendelianist @@ -114040,6 +114071,7 @@ Mercurochrome mercurophen mercurous Mercury +mercury mercy mercyproof merdivorous @@ -122874,6 +122906,7 @@ neanthropic neap neaped Neapolitan +near nearable nearabout nearabouts @@ -124384,6 +124417,7 @@ nielled niellist niello Niels +nielsbohrium niepa Nierembergia Niersteiner @@ -124791,6 +124825,7 @@ nobble nobbler nobbut nobby +nobelium nobiliary nobilify nobilitate @@ -143300,6 +143335,7 @@ perseitol perseity persentiscency Persephassa +Persephone Persepolitan perseverance perseverant @@ -159782,6 +159818,7 @@ pukeweed Pukhtun pukish pukishness +pukka pukras puku puky @@ -171927,6 +171964,7 @@ ruther rutherford rutherfordine rutherfordite +rutherfordium ruthful ruthfully ruthfulness @@ -176364,6 +176402,7 @@ Seabee seaberry seaboard seaborderer +seaborgium seabound seacannie seacatch @@ -176891,6 +176930,7 @@ segregational segregationist segregative segregator +segue Sehyo seiche Seid @@ -182225,6 +182265,7 @@ situational situla situlae situs +sitzmark Sium Siusi Siuslaw @@ -191094,6 +191135,7 @@ structuration structure structured structureless +structurelessness structurely structurist strudel @@ -191192,7 +191234,6 @@ stuccoworker stuccoyer stuck stuckling -stucturelessness stud studbook studder @@ -206199,7 +206240,7 @@ transuranian transuranic transuranium transuterine -transvaal +Transvaal Transvaaler Transvaalian transvaluate From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 14:00:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5388E106566B; Sat, 9 Oct 2010 14:00:51 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 432088FC0A; Sat, 9 Oct 2010 14:00:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o99E0p2S041971; Sat, 9 Oct 2010 14:00:51 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99E0pF6041969; Sat, 9 Oct 2010 14:00:51 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201010091400.o99E0pF6041969@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sat, 9 Oct 2010 14:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213658 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 14:00:51 -0000 Author: simon Date: Sat Oct 9 14:00:50 2010 New Revision: 213658 URL: http://svn.freebsd.org/changeset/base/213658 Log: Lock out access to 'access' for now while trying to fix the CVS ,v. Approved by: core (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Sat Oct 9 13:07:21 2010 (r213657) +++ svnadmin/conf/approvers Sat Oct 9 14:00:50 2010 (r213658) @@ -27,5 +27,5 @@ ^releng/4.1[01]/ (security-officer|so) ^CVSROOT/avail core ^svnadmin/conf/approvers (core|re) -^svnadmin/conf/access core +^svnadmin/conf/access clusteradm ^head/LOCKS core From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 15:17:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 551AB106566B; Sat, 9 Oct 2010 15:17:41 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44ADB8FC14; Sat, 9 Oct 2010 15:17: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 o99FHf56043904; Sat, 9 Oct 2010 15:17:41 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99FHfuG043902; Sat, 9 Oct 2010 15:17:41 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201010091517.o99FHfuG043902@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sat, 9 Oct 2010 15:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213659 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 15:17:41 -0000 Author: simon Date: Sat Oct 9 15:17:40 2010 New Revision: 213659 URL: http://svn.freebsd.org/changeset/base/213659 Log: Test commit to test that access,v works now. Approved by: clusteradm Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sat Oct 9 14:00:50 2010 (r213658) +++ svnadmin/conf/access Sat Oct 9 15:17:40 2010 (r213659) @@ -6,6 +6,7 @@ # KEEP ALPHABETICALLY SORTED!!! # KEEP ALPHABETICALLY SORTED!!! # KEEP ALPHABETICALLY SORTED!!! +# KEEP ALPHABETICALLY SORTED!!! # # When adding a new committer to this file, please make sure to # include the following information in the commit message: From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 15:54:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57FE6106566C; Sat, 9 Oct 2010 15:54:13 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 475B38FC1C; Sat, 9 Oct 2010 15:54: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 o99FsDEi044710; Sat, 9 Oct 2010 15:54:13 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99FsDU3044708; Sat, 9 Oct 2010 15:54:13 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201010091554.o99FsDU3044708@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sat, 9 Oct 2010 15:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213660 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 15:54:13 -0000 Author: simon Date: Sat Oct 9 15:54:12 2010 New Revision: 213660 URL: http://svn.freebsd.org/changeset/base/213660 Log: Re-enable access to 'access' now that it seems access,v is fixed. Approved by: core (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Sat Oct 9 15:17:40 2010 (r213659) +++ svnadmin/conf/approvers Sat Oct 9 15:54:12 2010 (r213660) @@ -27,5 +27,5 @@ ^releng/4.1[01]/ (security-officer|so) ^CVSROOT/avail core ^svnadmin/conf/approvers (core|re) -^svnadmin/conf/access clusteradm +^svnadmin/conf/access core ^head/LOCKS core From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 20:06:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E56871065674; Sat, 9 Oct 2010 20:06:35 +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 D3E638FC12; Sat, 9 Oct 2010 20:06: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 o99K6ZKb051109; Sat, 9 Oct 2010 20:06:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99K6ZVs051107; Sat, 9 Oct 2010 20:06:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201010092006.o99K6ZVs051107@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 9 Oct 2010 20:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213661 - in stable/8/sbin/geom/class: part sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 20:06:36 -0000 Author: ae Date: Sat Oct 9 20:06:35 2010 New Revision: 213661 URL: http://svn.freebsd.org/changeset/base/213661 Log: MFC r212608 (by pjd): All gpart(8) subcommands apart from the 'bootcode' subcommand handle given geom/provider names with and without /dev/ prefix. Teach the 'bootcode' subcommand to handle /dev/ names as well. Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/geom_part.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Sat Oct 9 15:54:12 2010 (r213660) +++ stable/8/sbin/geom/class/part/geom_part.c Sat Oct 9 20:06:35 2010 (r213661) @@ -178,6 +178,8 @@ find_geom(struct gclass *classp, const c { struct ggeom *gp; + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { if (strcmp(gp->lg_name, name) == 0) return (gp); From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 20:08:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 916971065696; Sat, 9 Oct 2010 20:08:51 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp2.one.com (csmtp2.one.com [91.198.169.22]) by mx1.freebsd.org (Postfix) with ESMTP id 37A178FC12; Sat, 9 Oct 2010 20:08:51 +0000 (UTC) Received: from [192.168.10.202] (0x573b9942.cpe.ge-1-2-0-1101.ronqu1.customer.tele.dk [87.59.153.66]) by csmtp2.one.com (Postfix) with ESMTPA id 58941ECBA45BF; Sat, 9 Oct 2010 19:58:23 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: multipart/signed; boundary=Apple-Mail-2022--890542142; protocol="application/pkcs7-signature"; micalg=sha1 From: Erik Cederstrand In-Reply-To: Date: Sat, 9 Oct 2010 21:58:22 +0200 Message-Id: <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> References: <201010090531.o995V8n3026865@svn.freebsd.org> To: Ben Kaduk X-Mailer: Apple Mail (2.1081) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tim Kientzle , src-committers@freebsd.org Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 20:08:51 -0000 --Apple-Mail-2022--890542142 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Den 09/10/2010 kl. 07.43 skrev Ben Kaduk: > On Sat, Oct 9, 2010 at 1:31 AM, Tim Kientzle = wrote: >> Author: kientzle >> Date: Sat Oct 9 05:31:08 2010 >> New Revision: 213643 >> URL: http://svn.freebsd.org/changeset/base/213643 >>=20 >> Log: >> Add -D (deterministic) option to ar. >> When set, it forces all timestamps and owners to zero and >> modes to 0644. Useful for producing libraries that are >> bitwise identical across multiple build runs. >=20 >=20 > Thanks! Has anyone looked at the feasibility of setting AR?=3Dar -D = in > sys.mk? I will probably try this when I get my scratch box up again. I'm looking into this now, as I needed the patch to do binary diffs on = builds. One problem is that ARFLAGS is overridden a lot of places in = contrib/ code: contrib/cvs/lib/Makefile.in:67:ARFLAGS=3Dcru contrib/cvs/diff/Makefile.in:45:ARFLAGS=3Dcru contrib/ntp/libntp/Makefile.in:55:ARFLAGS=3Dcru contrib/ntp/libparse/Makefile.in:55:ARFLAGS=3Dcru contrib/ntp/arlib/Makefile.in:54:ARFLAGS=3Dcru contrib/ntp/ntpd/Makefile.in:61:ARFLAGS=3Dcru contrib/tcp_wrappers/Makefile:95:ARFLAGS=3Drv contrib/tcp_wrappers/Makefile:101:ARFLAGS=3Drv [...] contrib/tcp_wrappers/Makefile:404:ARFLAGS=3Drv contrib/bind9/configure.in:73:ARFLAGS=3Dcruv contrib/gcclibs/libcpp/Makefile.in:30:ARFLAGS=3Dcru contrib/gcclibs/libdecnumber/Makefile.in:30:ARFLAGS=3Dcru contrib/dtc/Makefile:49:ARFLAGS=3Drc crypto/heimdal/appl/ftp/common/Makefile.in:93:ARFLAGS=3Dcru crypto/heimdal/appl/telnet/libtelnet/Makefile.in:93:ARFLAGS=3Dcru crypto/heimdal/lib/45/Makefile.in:101:ARFLAGS=3Dcru crypto/openssl/Makefile.org:66:ARFLAGS=3D crypto/openssl/Makefile:68:ARFLAGS=3D share/mk/sys.mk:36:ARFLAGS?=3D-rv share/mk/sys.mk:38:ARFLAGS?=3Drl usr.bin/make/PSD.doc/tutorial.ms:2968:ARFLAGS?=3Dcrl Thanks, Erik= --Apple-Mail-2022--890542142-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 20:20:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78D14106566B; Sat, 9 Oct 2010 20:20:28 +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 642E38FC13; Sat, 9 Oct 2010 20:20: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 o99KKSHe051482; Sat, 9 Oct 2010 20:20:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99KKSYW051470; Sat, 9 Oct 2010 20:20:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201010092020.o99KKSYW051470@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 9 Oct 2010 20:20: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: r213662 - in head: sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/mirror sbin/geom/class/part sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geom/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 20:20:28 -0000 Author: ae Date: Sat Oct 9 20:20:27 2010 New Revision: 213662 URL: http://svn.freebsd.org/changeset/base/213662 Log: Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1. Suggested by: kib Approved by: kib (mentor) MFC after: 5 days Modified: head/sbin/geom/class/concat/geom_concat.c head/sbin/geom/class/eli/geom_eli.c head/sbin/geom/class/journal/geom_journal.c head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/part/geom_part.c head/sbin/geom/class/raid3/geom_raid3.c head/sbin/geom/class/shsec/geom_shsec.c head/sbin/geom/class/stripe/geom_stripe.c head/sbin/geom/class/virstor/geom_virstor.c head/sys/geom/part/g_part.c head/sys/geom/virstor/g_virstor.c Modified: head/sbin/geom/class/concat/geom_concat.c ============================================================================== --- head/sbin/geom/class/concat/geom_concat.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/concat/geom_concat.c Sat Oct 9 20:20:27 2010 (r213662) @@ -153,8 +153,8 @@ concat_label(struct gctl_req *req) if (!hardcode) bzero(md.md_provider, sizeof(md.md_provider)); else { - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + name += sizeof(_PATH_DEV) - 1; strlcpy(md.md_provider, name, sizeof(md.md_provider)); } md.md_provsize = g_get_mediasize(name); Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/eli/geom_eli.c Sat Oct 9 20:20:27 2010 (r213662) @@ -776,8 +776,8 @@ eli_init(struct gctl_req *req) const char *p = prov; unsigned int i; - if (strncmp(p, _PATH_DEV, strlen(_PATH_DEV)) == 0) - p += strlen(_PATH_DEV); + if (strncmp(p, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + p += sizeof(_PATH_DEV) - 1; snprintf(backfile, sizeof(backfile), "%s%s.eli", GELI_BACKUP_DIR, p); /* Replace all / with _. */ Modified: head/sbin/geom/class/journal/geom_journal.c ============================================================================== --- head/sbin/geom/class/journal/geom_journal.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/journal/geom_journal.c Sat Oct 9 20:20:27 2010 (r213662) @@ -269,8 +269,8 @@ journal_label(struct gctl_req *req) if (!hardcode) bzero(md.md_provider, sizeof(md.md_provider)); else { - if (strncmp(str, _PATH_DEV, strlen(_PATH_DEV)) == 0) - str += strlen(_PATH_DEV); + if (strncmp(str, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + str += sizeof(_PATH_DEV) - 1; strlcpy(md.md_provider, str, sizeof(md.md_provider)); } journal_metadata_encode(&md, sector); Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/mirror/geom_mirror.c Sat Oct 9 20:20:27 2010 (r213662) @@ -247,8 +247,8 @@ mirror_label(struct gctl_req *req) if (!hardcode) bzero(md.md_provider, sizeof(md.md_provider)); else { - if (strncmp(str, _PATH_DEV, strlen(_PATH_DEV)) == 0) - str += strlen(_PATH_DEV); + if (strncmp(str, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + str += sizeof(_PATH_DEV) - 1; strlcpy(md.md_provider, str, sizeof(md.md_provider)); } mirror_metadata_encode(&md, sector); Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/part/geom_part.c Sat Oct 9 20:20:27 2010 (r213662) @@ -187,8 +187,8 @@ find_geom(struct gclass *classp, const c { struct ggeom *gp; - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + name += sizeof(_PATH_DEV) - 1; LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { if (strcmp(gp->lg_name, name) == 0) return (gp); Modified: head/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- head/sbin/geom/class/raid3/geom_raid3.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/raid3/geom_raid3.c Sat Oct 9 20:20:27 2010 (r213662) @@ -244,8 +244,8 @@ raid3_label(struct gctl_req *req) if (!hardcode) bzero(md.md_provider, sizeof(md.md_provider)); else { - if (strncmp(str, _PATH_DEV, strlen(_PATH_DEV)) == 0) - str += strlen(_PATH_DEV); + if (strncmp(str, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + str += sizeof(_PATH_DEV) - 1; strlcpy(md.md_provider, str, sizeof(md.md_provider)); } if (verify && md.md_no == md.md_all - 1) { Modified: head/sbin/geom/class/shsec/geom_shsec.c ============================================================================== --- head/sbin/geom/class/shsec/geom_shsec.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/shsec/geom_shsec.c Sat Oct 9 20:20:27 2010 (r213662) @@ -172,8 +172,8 @@ shsec_label(struct gctl_req *req) if (!hardcode) bzero(md.md_provider, sizeof(md.md_provider)); else { - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + name += sizeof(_PATH_DEV) - 1; strlcpy(md.md_provider, name, sizeof(md.md_provider)); } shsec_metadata_encode(&md, sector); Modified: head/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- head/sbin/geom/class/stripe/geom_stripe.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/stripe/geom_stripe.c Sat Oct 9 20:20:27 2010 (r213662) @@ -197,8 +197,8 @@ stripe_label(struct gctl_req *req) if (!hardcode) bzero(md.md_provider, sizeof(md.md_provider)); else { - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + name += sizeof(_PATH_DEV) - 1; strlcpy(md.md_provider, name, sizeof(md.md_provider)); } stripe_metadata_encode(&md, sector); Modified: head/sbin/geom/class/virstor/geom_virstor.c ============================================================================== --- head/sbin/geom/class/virstor/geom_virstor.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sbin/geom/class/virstor/geom_virstor.c Sat Oct 9 20:20:27 2010 (r213662) @@ -144,7 +144,7 @@ static void pathgen(const char *name, char *path, size_t size) { - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) != 0) + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) != 0) snprintf(path, size, "%s%s", _PATH_DEV, name); else strlcpy(path, name, size); @@ -375,7 +375,7 @@ virstor_label(struct gctl_req *req) fflush(stdout); } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) fd = open(name, O_RDWR); else { sprintf(param, "%s%s", _PATH_DEV, name); @@ -453,8 +453,8 @@ virstor_label(struct gctl_req *req) bzero(md.provider, sizeof(md.provider)); else { /* convert "/dev/something" to "something" */ - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) { - strlcpy(md.provider, name + strlen(_PATH_DEV), + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) { + strlcpy(md.provider, name + sizeof(_PATH_DEV) - 1, sizeof(md.provider)); } else strlcpy(md.provider, name, sizeof(md.provider)); @@ -509,7 +509,7 @@ virstor_clear(struct gctl_req *req) "Not fully done (can't clear metadata)."); continue; } - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + if (strncmp(name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) fd = open(name, O_RDWR); else { sprintf(param, "%s%s", _PATH_DEV, name); Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sys/geom/part/g_part.c Sat Oct 9 20:20:27 2010 (r213662) @@ -305,8 +305,8 @@ g_part_parm_geom(struct gctl_req *req, c gname = gctl_get_asciiparam(req, name); if (gname == NULL) return (ENOATTR); - if (strncmp(gname, _PATH_DEV, strlen(_PATH_DEV)) == 0) - gname += strlen(_PATH_DEV); + 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; @@ -329,8 +329,8 @@ g_part_parm_provider(struct gctl_req *re pname = gctl_get_asciiparam(req, name); if (pname == NULL) return (ENOATTR); - if (strncmp(pname, _PATH_DEV, strlen(_PATH_DEV)) == 0) - pname += strlen(_PATH_DEV); + if (strncmp(pname, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + pname += sizeof(_PATH_DEV) - 1; pp = g_provider_by_name(pname); if (pp == NULL) { gctl_error(req, "%d %s '%s'", EINVAL, name, pname); Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Sat Oct 9 20:06:35 2010 (r213661) +++ head/sys/geom/virstor/g_virstor.c Sat Oct 9 20:20:27 2010 (r213662) @@ -316,8 +316,8 @@ virstor_ctl_add(struct gctl_req *req, st g_topology_unlock(); return; } - if (strncmp(prov_name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - prov_name += strlen(_PATH_DEV); + if (strncmp(prov_name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + prov_name += sizeof(_PATH_DEV) - 1; pp = g_provider_by_name(prov_name); if (pp == NULL) { @@ -574,8 +574,8 @@ virstor_ctl_remove(struct gctl_req *req, gctl_error(req, "Error fetching argument '%s'", param); return; } - if (strncmp(prov_name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - prov_name += strlen(_PATH_DEV); + if (strncmp(prov_name, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + prov_name += sizeof(_PATH_DEV) - 1; found = -1; for (j = 0; j < sc->n_components; j++) { From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 20:52:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13F741065670; Sat, 9 Oct 2010 20:52:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02D808FC13; Sat, 9 Oct 2010 20:52: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 o99KqaWO052273; Sat, 9 Oct 2010 20:52:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o99Kqalq052271; Sat, 9 Oct 2010 20:52:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010092052.o99Kqalq052271@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Oct 2010 20:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213663 - stable/7/sys/dev/sf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 20:52:37 -0000 Author: yongari Date: Sat Oct 9 20:52:36 2010 New Revision: 213663 URL: http://svn.freebsd.org/changeset/base/213663 Log: Fix build breakage introducted in r213604. Modified: stable/7/sys/dev/sf/if_sf.c Modified: stable/7/sys/dev/sf/if_sf.c ============================================================================== --- stable/7/sys/dev/sf/if_sf.c Sat Oct 9 20:20:27 2010 (r213662) +++ stable/7/sys/dev/sf/if_sf.c Sat Oct 9 20:52:36 2010 (r213663) @@ -1824,7 +1824,7 @@ sf_poll(struct ifnet *ifp, enum poll_cmd ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sf_init_locked(sc); SF_UNLOCK(sc); - return (rx_npkts); + return; } else if ((status & SF_ISR_NO_TX_CSUM) != 0) { sc->sf_statistics.sf_tx_gfp_stall++; #ifdef SF_GFP_DEBUG From owner-svn-src-all@FreeBSD.ORG Sat Oct 9 22:12:06 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09AB5106564A; Sat, 9 Oct 2010 22:12:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 93CF38FC16; Sat, 9 Oct 2010 22:12:05 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o99MBwi0009798 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 10 Oct 2010 09:11:59 +1100 Date: Sun, 10 Oct 2010 09:11:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Erik Cederstrand In-Reply-To: <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> Message-ID: <20101010083725.S3587@besplex.bde.org> References: <201010090531.o995V8n3026865@svn.freebsd.org> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tim Kientzle , Ben Kaduk , src-committers@FreeBSD.org Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 22:12:06 -0000 On Sat, 9 Oct 2010, Erik Cederstrand wrote: > Den 09/10/2010 kl. 07.43 skrev Ben Kaduk: > >> On Sat, Oct 9, 2010 at 1:31 AM, Tim Kientzle wrote: >>> Log: >>> Add -D (deterministic) option to ar. >>> When set, it forces all timestamps and owners to zero and >>> modes to 0644. Useful for producing libraries that are >>> bitwise identical across multiple build runs. >> >> Thanks! Has anyone looked at the feasibility of setting AR?=ar -D in >> sys.mk? I will probably try this when I get my scratch box up again. I hope not. The default behaviour should not be changed by default. > I'm looking into this now, as I needed the patch to do binary diffs on builds. One problem is that ARFLAGS is overridden a lot of places in contrib/ code: > > contrib/cvs/lib/Makefile.in:67:ARFLAGS=cru > contrib/cvs/diff/Makefile.in:45:ARFLAGS=cru > contrib/ntp/libntp/Makefile.in:55:ARFLAGS=cru > contrib/ntp/libparse/Makefile.in:55:ARFLAGS=cru > contrib/ntp/arlib/Makefile.in:54:ARFLAGS=cru > contrib/ntp/ntpd/Makefile.in:61:ARFLAGS=cru > contrib/tcp_wrappers/Makefile:95:ARFLAGS=rv > contrib/tcp_wrappers/Makefile:101:ARFLAGS=rv > [...] > contrib/tcp_wrappers/Makefile:404:ARFLAGS=rv > contrib/bind9/configure.in:73:ARFLAGS=cruv > contrib/gcclibs/libcpp/Makefile.in:30:ARFLAGS=cru > contrib/gcclibs/libdecnumber/Makefile.in:30:ARFLAGS=cru > contrib/dtc/Makefile:49:ARFLAGS=rc > crypto/heimdal/appl/ftp/common/Makefile.in:93:ARFLAGS=cru > crypto/heimdal/appl/telnet/libtelnet/Makefile.in:93:ARFLAGS=cru > crypto/heimdal/lib/45/Makefile.in:101:ARFLAGS=cru > crypto/openssl/Makefile.org:66:ARFLAGS= > crypto/openssl/Makefile:68:ARFLAGS= Something like this seems to be needed, since the default flags in sys.mk of: > share/mk/sys.mk:36:ARFLAGS?=-rv > share/mk/sys.mk:38:ARFLAGS?=rl > usr.bin/make/PSD.doc/tutorial.ms:2968:ARFLAGS?=crl are almost as bad as -D there. -rv is for the %POSIX case. The -v in it makes it wrong for most uses, especially when make output is supposed to be quieted by -s. At least it uses the newfangled option syntax (starting with a '-'). rl is for the usual case. The `l' flag is bogus since it was documented as accepted but not used. Now it seems to be undocumented, but still accepted but not used. The `r' flag is normally wanted, but most places also want 'c' and possibly 'u'. Having anything in the default ARFLAGS is bad since (except in the %POSIX case) its contents is undocumented so it is hard to tell what precautions should be taken to avoid bad things in it. There seems to be no way to cancel bad things in it by adding to it, so makefiles wanting to use the default would have to use something like substitutions in it. E.g.: %%% ARFLAGS:= ${ARFLAGS:S/l//} # remove nonsense flag 'l' ARFLAGS:= ${ARFLAGS:S/D//} # remove unwanted flag 'v' foo: echo ${ARFLAGS} %%% But it is easier to blow away the garbage using ARFLAGS=cru. There were few or no flags like -D that could reasonably set outside of sys.mk, according to user or system preferences, so that no Makefile should touch them. Perhaps -v is another one -- setting this wouldn't change the created archives, but might be useful for debugging. The primary user of ${AR} for FreeBSD builds, namely bsd.lib.mk, doesn't even use ${ARFLAGS}, so it is missing from the above list. It uses the literal `cq' whenever it uses the non-literal ${AR}. Perhaps ar is often spelled `ar' too. Bruce