From owner-svn-src-head@FreeBSD.ORG Sun Oct 3 00:04:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 04:33:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 08:12:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 13:13:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 13:52:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 15:10:04 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2010 15:10:04 -0000 great stuff!!! can't wait to add "device xhci" to my KERNCONF. :) -- a13x From owner-svn-src-head@FreeBSD.ORG Sun Oct 3 16:02:53 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 17:00:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 17:05:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 17:50:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 18:24:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 18:49:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 20:04:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 20:09:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 21:18:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 22:24:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Oct 3 22:59:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Mon Oct 4 01:07:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 01:08:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 06:17:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 08:57:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 09:26:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 09:58:45 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 10:29:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 10:43:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 10:47:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 10:48:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 11:42:48 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 11:42:50 -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-head@FreeBSD.ORG Mon Oct 4 12:36:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 14:32:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 15:28:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 15:30:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 15:39:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 16:02:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 16:07:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 16:34:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 16:49:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 17:22:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 17:41:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 18:01:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 18:09:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 18:16:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 20:00:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 20:49:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 21:01:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 21:24:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 21:30:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 21:38:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 21:41:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 21:42:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 21:43:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 21:44:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 22:04:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 22:21:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 22:45:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 22:50:08 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 23:18:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 23:19:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 23:22:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 23:25:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Oct 4 23:30:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Tue Oct 5 05:15:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 05:49:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 06:31:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 06:44:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 07:11:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 07:23:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 07:24:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 07:42:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 15:27:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 15:31:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 15:40:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 15:44:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 15:48:51 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 15:48:51 -0000 thanks a lot. :) -- a13x From owner-svn-src-head@FreeBSD.ORG Tue Oct 5 15:52:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 16:14:08 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 17:06:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 18:08:08 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 18:38:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 18:44:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 18:47:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 19:04:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 20:39:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 20:56:08 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 21:19:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 21:42:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 21:53:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 22:26:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 23:03:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Oct 5 23:24:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Wed Oct 6 00:03:08 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 01:23:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 04:30:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 06:39:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 07:22:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 07:34:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 07:49:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 08:09:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 08:15:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 09:05:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 09:24:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 12:41:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 14:29:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 14:29:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 14:43:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 15:01:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 15:37:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 17:35:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 17:47:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 18:14:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC5D11065673 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 55BD28FC17 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 18:14:56 -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-head@FreeBSD.ORG Wed Oct 6 18:20:08 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 18:20:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 18:36:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 18:51:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 19:07:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 20:35:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 20:49:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 20:54:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 21:23:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 22:25:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 22:32:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 22:40:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Oct 6 22:41:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Thu Oct 7 06:34:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 08:36:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 09:03:43 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 09:07:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 09:30:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 09:58:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 10:57:17 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 12:58:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 17:14:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 17:26:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:00:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:03:48 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 211311065679 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 A0D5C8FC2A 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:11:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:16:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:16:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:19:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:20:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:20:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 18:23:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 20:31:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Oct 7 21:56:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Fri Oct 8 00:44:53 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 01:03:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 01:47:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 01:53:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 01:58:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 06:58:10 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 07:17:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 07:18:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 07:19:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 09:17:46 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 09:43:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 10:27:53 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 11:34:49 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 12:39:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 12:40:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 13:48:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 14:31:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 14:50:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 14:59:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 15:02:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 15:05:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 15:20:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 15:41:57 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 17:42:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 17:58:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 18:13:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 19:08:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 20:13:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 20:17:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 20:40:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 21:29:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 21:37:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Oct 8 23:01:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Sat Oct 9 02:50:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 05:31:08 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 05:43:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 05:50:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 05:57:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 07:29:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 07:45:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 08:07:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 08:39:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 08:52:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 09:03:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 09:33:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 09:49:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 11:43:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 12:00:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 12:15:22 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 20:08:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 20:20:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Oct 9 22:12:06 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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