From owner-svn-src-stable-6@FreeBSD.ORG Mon Jan 11 21:32:39 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFBB31065670; Mon, 11 Jan 2010 21:32:39 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E2518FC1D; Mon, 11 Jan 2010 21:32:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0BLWd3M082284; Mon, 11 Jan 2010 21:32:39 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BLWdcr082281; Mon, 11 Jan 2010 21:32:39 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001112132.o0BLWdcr082281@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 11 Jan 2010 21:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202118 - stable/6/sys/dev/mxge X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 21:32:39 -0000 Author: gallatin Date: Mon Jan 11 21:32:39 2010 New Revision: 202118 URL: http://svn.freebsd.org/changeset/base/202118 Log: MFC: Merge older mxge(4) fixes/improvements from head: r193250: Set an rx jumbo cluster to the correct size for bus_dmamap_load_mbuf_sg() r194836: Initial mtu r195818: Rename hw.mxge.rss_hash_type -> hw.mxge.rss_hashtype r197391: Add support for TX throttling. Modified: stable/6/sys/dev/mxge/if_mxge.c stable/6/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/6/sys/dev/mxge/if_mxge.c Mon Jan 11 21:23:59 2010 (r202117) +++ stable/6/sys/dev/mxge/if_mxge.c Mon Jan 11 21:32:39 2010 (r202118) @@ -99,6 +99,8 @@ static int mxge_ticks; static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; static int mxge_always_promisc = 0; +static int mxge_initial_mtu = ETHERMTU_JUMBO; +static int mxge_throttle = 0; static char *mxge_fw_unaligned = "mxge_ethp_z8e"; static char *mxge_fw_aligned = "mxge_eth_z8e"; static char *mxge_fw_rss_aligned = "mxge_rss_eth_z8e"; @@ -589,10 +591,13 @@ static int mxge_select_firmware(mxge_softc_t *sc) { int aligned = 0; + int force_firmware = mxge_force_firmware; + if (sc->throttle) + force_firmware = sc->throttle; - if (mxge_force_firmware != 0) { - if (mxge_force_firmware == 1) + if (force_firmware != 0) { + if (force_firmware == 1) aligned = 1; else aligned = 0; @@ -1300,10 +1305,48 @@ mxge_reset(mxge_softc_t *sc, int interru mxge_change_promisc(sc, sc->ifp->if_flags & IFF_PROMISC); mxge_change_pause(sc, sc->pause); mxge_set_multicast_list(sc); + if (sc->throttle) { + cmd.data0 = sc->throttle; + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, + &cmd)) { + device_printf(sc->dev, + "can't enable throttle\n"); + } + } return status; } static int +mxge_change_throttle(SYSCTL_HANDLER_ARGS) +{ + mxge_cmd_t cmd; + mxge_softc_t *sc; + int err; + unsigned int throttle; + + sc = arg1; + throttle = sc->throttle; + err = sysctl_handle_int(oidp, &throttle, arg2, req); + if (err != 0) { + return err; + } + + if (throttle == sc->throttle) + return 0; + + if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) + return EINVAL; + + mtx_lock(&sc->driver_mtx); + cmd.data0 = throttle; + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, &cmd); + if (err == 0) + sc->throttle = throttle; + mtx_unlock(&sc->driver_mtx); + return err; +} + +static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { mxge_softc_t *sc; @@ -1495,6 +1538,12 @@ mxge_add_sysctls(mxge_softc_t *sc) "I", "interrupt coalescing delay in usecs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + "throttle", + CTLTYPE_INT|CTLFLAG_RW, sc, + 0, mxge_change_throttle, + "I", "transmit throttling"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "flow_control_enabled", CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, @@ -2206,7 +2255,7 @@ mxge_get_buf_big(struct mxge_slice_state err = ENOBUFS; goto done; } - m->m_len = rx->cl_size; + m->m_len = rx->mlen; err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, seg, &cnt, BUS_DMA_NOWAIT); if (err != 0) { @@ -3240,6 +3289,8 @@ mxge_slice_open(struct mxge_slice_state } ss->rx_big.nbufs = nbufs; ss->rx_big.cl_size = cl_size; + ss->rx_big.mlen = ss->sc->ifp->if_mtu + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + MXGEFW_PAD; for (i = 0; i <= ss->rx_big.mask; i += ss->rx_big.nbufs) { map = ss->rx_big.info[i].map; err = mxge_get_buf_big(ss, map, i); @@ -3840,6 +3891,9 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH("hw.mxge.lro_cnt", &sc->lro_cnt); TUNABLE_INT_FETCH("hw.mxge.always_promisc", &mxge_always_promisc); TUNABLE_INT_FETCH("hw.mxge.rss_hash_type", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.rss_hashtype", &mxge_rss_hash_type); + TUNABLE_INT_FETCH("hw.mxge.initial_mtu", &mxge_initial_mtu); + TUNABLE_INT_FETCH("hw.mxge.throttle", &mxge_throttle); if (sc->lro_cnt != 0) mxge_lro_cnt = sc->lro_cnt; @@ -3854,6 +3908,15 @@ mxge_fetch_tunables(mxge_softc_t *sc) || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; } + if (mxge_initial_mtu > ETHERMTU_JUMBO || + mxge_initial_mtu < ETHER_MIN_LEN) + mxge_initial_mtu = ETHERMTU_JUMBO; + + if (mxge_throttle && mxge_throttle > MXGE_MAX_THROTTLE) + mxge_throttle = MXGE_MAX_THROTTLE; + if (mxge_throttle && mxge_throttle < MXGE_MIN_THROTTLE) + mxge_throttle = MXGE_MIN_THROTTLE; + sc->throttle = mxge_throttle; } @@ -4414,9 +4477,9 @@ mxge_attach(device_t dev) mxge_media_probe(sc); sc->dying = 0; ether_ifattach(ifp, sc->mac_addr); - /* ether_ifattach sets mtu to 1500 */ - if (ifp->if_capabilities & IFCAP_JUMBO_MTU) - ifp->if_mtu = 9000; + /* ether_ifattach sets mtu to ETHERMTU */ + if (mxge_initial_mtu != ETHERMTU) + mxge_change_mtu(sc, mxge_initial_mtu); mxge_add_sysctls(sc); callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc); Modified: stable/6/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/6/sys/dev/mxge/if_mxge_var.h Mon Jan 11 21:23:59 2010 (r202117) +++ stable/6/sys/dev/mxge/if_mxge_var.h Mon Jan 11 21:32:39 2010 (r202118) @@ -119,6 +119,7 @@ typedef struct int cl_size; int alloc_fail; int mask; /* number of rx slots -1 */ + int mlen; } mxge_rx_ring_t; typedef struct @@ -242,6 +243,7 @@ struct mxge_softc { int fw_multicast_support; int link_width; int max_mtu; + int throttle; int tx_defrag; int media_flags; int need_media_probe; @@ -270,6 +272,8 @@ struct mxge_softc { #define MXGE_PCI_REV_Z8ES 1 #define MXGE_XFP_COMPLIANCE_BYTE 131 #define MXGE_SFP_COMPLIANCE_BYTE 3 +#define MXGE_MIN_THROTTLE 416 +#define MXGE_MAX_THROTTLE 4096 #define MXGE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((uint32_t)((uint64_t)(X) >> 32)) : (0) From owner-svn-src-stable-6@FreeBSD.ORG Wed Jan 13 20:35:43 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E028106584B; Wed, 13 Jan 2010 20:35:43 +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 4B7658FC18; Wed, 13 Jan 2010 20:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DKZhxx016766; Wed, 13 Jan 2010 20:35:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKZhfb016764; Wed, 13 Jan 2010 20:35:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132035.o0DKZhfb016764@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202236 - stable/6/sys/sparc64/isa X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:35:43 -0000 Author: marius Date: Wed Jan 13 20:35:43 2010 New Revision: 202236 URL: http://svn.freebsd.org/changeset/base/202236 Log: MFC: r200880 - Correct an off-by-one error when calculating the end of a child range. - Spell the PCI TLA in uppercase. Modified: stable/6/sys/sparc64/isa/ofw_isa.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/sparc64/isa/ofw_isa.c ============================================================================== --- stable/6/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:37 2010 (r202235) +++ stable/6/sys/sparc64/isa/ofw_isa.c Wed Jan 13 20:35:43 2010 (r202236) @@ -79,11 +79,11 @@ ofw_isa_range_map(struct isa_ranges *ran for (i = 0; i < nrange; i++) { r = &range[i]; cstart = ISA_RANGE_CHILD(r); - cend = cstart + r->size; + cend = cstart + r->size - 1; if (*start < cstart || *start > cend) continue; if (*end < cstart || *end > cend) { - panic("ofw_isa_map_iorange: iorange crosses pci " + panic("ofw_isa_map_iorange: iorange crosses PCI " "ranges (%#lx not in %#lx - %#lx)", *end, cstart, cend); } From owner-svn-src-stable-6@FreeBSD.ORG Wed Jan 13 20:41:28 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 311341065670; Wed, 13 Jan 2010 20:41:28 +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 1F6138FC1C; Wed, 13 Jan 2010 20:41: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 o0DKfSfH018216; Wed, 13 Jan 2010 20:41:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKfSx7018214; Wed, 13 Jan 2010 20:41:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132041.o0DKfSx7018214@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202239 - stable/6/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:41:28 -0000 Author: marius Date: Wed Jan 13 20:41:27 2010 New Revision: 202239 URL: http://svn.freebsd.org/changeset/base/202239 Log: MFC: r200914 Don't use an out register to hold the vector number across the call of the interrupt handler in intr_fast() as the handler might clobber it (no in-tree handler currently does but an upcoming one will). While at it, tidy the register usage in the interrupt counting code. Modified: stable/6/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/6/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:40:51 2010 (r202238) +++ stable/6/sys/sparc64/sparc64/interrupt.S Wed Jan 13 20:41:27 2010 (r202239) @@ -175,7 +175,7 @@ ENTRY(intr_fast) 3: ldx [%l0 + IR_FUNC], %o0 ldx [%l0 + IR_ARG], %o1 - lduw [%l0 + IR_VEC], %o2 + lduw [%l0 + IR_VEC], %l2 ldx [PCPU(IRFREE)], %l1 stx %l1, [%l0 + IR_NEXT] @@ -187,17 +187,17 @@ ENTRY(intr_fast) call %o0 mov %o1, %o0 - /* intrcnt[intr_countp[%o2]]++ */ - SET(intrcnt, %l7, %l2) /* %l2 = intrcnt */ - prefetcha [%l2] ASI_N, 1 - SET(intr_countp, %l7, %l3) /* %l3 = intr_countp */ - sllx %o2, 1, %l4 /* %l4 = vec << 1 */ - lduh [%l4 + %l3], %l5 /* %l5 = intr_countp[%o2] */ - sllx %l5, 3, %l6 /* %l6 = intr_countp[%o2] << 3 */ - add %l6, %l2, %l7 /* %l7 = intrcnt[intr_countp[%o2]] */ - ldx [%l7], %l2 + /* intrcnt[intr_countp[%l2]]++ */ + SET(intrcnt, %l7, %l3) /* %l3 = intrcnt */ + prefetcha [%l3] ASI_N, 1 + SET(intr_countp, %l7, %l4) /* %l4 = intr_countp */ + sllx %l2, 1, %l2 /* %l2 = vec << 1 */ + lduh [%l4 + %l2], %l4 /* %l4 = intr_countp[%l2] */ + sllx %l4, 3, %l4 /* %l4 = intr_countp[%l2] << 3 */ + add %l4, %l3, %l4 /* %l4 = intrcnt[intr_countp[%l2]] */ + ldx [%l4], %l2 inc %l2 - stx %l2, [%l7] + stx %l2, [%l4] ba,a %xcc, 1b nop From owner-svn-src-stable-6@FreeBSD.ORG Wed Jan 13 20:48:43 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF901065676; Wed, 13 Jan 2010 20:48:43 +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 EFFB98FC18; Wed, 13 Jan 2010 20:48:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DKmgAT019920; Wed, 13 Jan 2010 20:48:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKmg1a019912; Wed, 13 Jan 2010 20:48:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001132048.o0DKmg1a019912@svn.freebsd.org> From: Marius Strobl Date: Wed, 13 Jan 2010 20:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202240 - in stable/6/sys: dev/auxio sparc64/central sparc64/fhc sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:48:43 -0000 Author: marius Date: Wed Jan 13 20:48:42 2010 New Revision: 202240 URL: http://svn.freebsd.org/changeset/base/202240 Log: MFC: r200815, r200816 Provide and consume missing module dependency information. Modified: stable/6/sys/dev/auxio/auxio.c stable/6/sys/sparc64/central/central.c stable/6/sys/sparc64/fhc/fhc_nexus.c stable/6/sys/sparc64/pci/apb.c stable/6/sys/sparc64/pci/ofw_pcib.c stable/6/sys/sparc64/sbus/sbus.c stable/6/sys/sparc64/sparc64/nexus.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/dev/auxio/auxio.c ============================================================================== --- stable/6/sys/dev/auxio/auxio.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/dev/auxio/auxio.c Wed Jan 13 20:48:42 2010 (r202240) @@ -56,7 +56,7 @@ */ /* - * AUXIO registers support on the sbus & ebus2, used for the floppy driver + * AUXIO registers support on the SBus & EBus2, used for the floppy driver * and to control the system LED, for the BLINK option. */ @@ -85,8 +85,8 @@ __FBSDID("$FreeBSD$"); #include /* - * on sun4u, auxio exists with one register (LED) on the sbus, and 5 - * registers on the ebus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI + * On sun4u, auxio exists with one register (LED) on the SBus, and 5 + * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI * OSCILLATOR, and TEMP SENSE. */ @@ -142,6 +142,7 @@ static driver_t auxio_sbus_driver = { static devclass_t auxio_devclass; DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, sbus, 1, 1, 1); /* EBus */ static device_method_t auxio_ebus_methods[] = { @@ -158,6 +159,7 @@ static driver_t auxio_ebus_driver = { }; DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0); +MODULE_DEPEND(auxio, ebus, 1, 1, 1); MODULE_VERSION(auxio, 1); #define AUXIO_LOCK_INIT(sc) \ Modified: stable/6/sys/sparc64/central/central.c ============================================================================== --- stable/6/sys/sparc64/central/central.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/central/central.c Wed Jan 13 20:48:42 2010 (r202240) @@ -112,6 +112,7 @@ static driver_t central_driver = { static devclass_t central_devclass; DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); MODULE_VERSION(central, 1); static int Modified: stable/6/sys/sparc64/fhc/fhc_nexus.c ============================================================================== --- stable/6/sys/sparc64/fhc/fhc_nexus.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/fhc/fhc_nexus.c Wed Jan 13 20:48:42 2010 (r202240) @@ -89,6 +89,7 @@ static driver_t fhc_nexus_driver = { static devclass_t fhc_nexus_devclass; DRIVER_MODULE(fhc, nexus, fhc_nexus_driver, fhc_nexus_devclass, 0, 0); +MODULE_DEPEND(fhc, nexus, 1, 1, 1); static int fhc_nexus_probe(device_t dev) Modified: stable/6/sys/sparc64/pci/apb.c ============================================================================== --- stable/6/sys/sparc64/pci/apb.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/pci/apb.c Wed Jan 13 20:48:42 2010 (r202240) @@ -116,6 +116,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc)); DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(apb, pci, 1, 1, 1); /* APB specific registers */ #define APBR_IOMAP 0xde Modified: stable/6/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/6/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/pci/ofw_pcib.c Wed Jan 13 20:48:42 2010 (r202240) @@ -97,6 +97,7 @@ static devclass_t pcib_devclass; DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods, sizeof(struct ofw_pcib_gen_softc)); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0); +MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); static int ofw_pcib_probe(device_t dev) Modified: stable/6/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/6/sys/sparc64/sbus/sbus.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/sbus/sbus.c Wed Jan 13 20:48:42 2010 (r202240) @@ -261,6 +261,7 @@ static driver_t sbus_driver = { static devclass_t sbus_devclass; DRIVER_MODULE(sbus, nexus, sbus_driver, sbus_devclass, 0, 0); +MODULE_DEPEND(sbus, nexus, 1, 1, 1); MODULE_VERSION(sbus, 1); #define OFW_SBUS_TYPE "sbus" Modified: stable/6/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/6/sys/sparc64/sparc64/nexus.c Wed Jan 13 20:41:27 2010 (r202239) +++ stable/6/sys/sparc64/sparc64/nexus.c Wed Jan 13 20:48:42 2010 (r202240) @@ -131,6 +131,7 @@ static driver_t nexus_driver = { static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +MODULE_VERSION(nexus, 1); static char *nexus_excl_name[] = { "aliases", From owner-svn-src-stable-6@FreeBSD.ORG Fri Jan 15 03:07:42 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B91AB1065672; Fri, 15 Jan 2010 03:07:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A66AA8FC1C; Fri, 15 Jan 2010 03:07:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0F37gvq027899; Fri, 15 Jan 2010 03:07:42 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F37g4K027897; Fri, 15 Jan 2010 03:07:42 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150307.o0F37g4K027897@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202335 - stable/6/etc/rc.d X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:07:42 -0000 Author: dougb Date: Fri Jan 15 03:07:42 2010 New Revision: 202335 URL: http://svn.freebsd.org/changeset/base/202335 Log: MFC r201367, r201370: Virtualize the location of "the configuration directory" instead of hard-coding it to be /etc/namedb Modified: stable/6/etc/rc.d/named Directory Properties: stable/6/etc/ (props changed) Modified: stable/6/etc/rc.d/named ============================================================================== --- stable/6/etc/rc.d/named Fri Jan 15 03:06:39 2010 (r202334) +++ stable/6/etc/rc.d/named Fri Jan 15 03:07:42 2010 (r202335) @@ -44,19 +44,19 @@ chroot_autoupdate() warn "chroot directory structure not updated" fi - # Create /etc/namedb symlink + # Create (or update) the configuration directory symlink # - if [ ! -L /etc/namedb ]; then - if [ -d /etc/namedb ]; then - warn "named chroot: /etc/namedb is a directory!" - elif [ -e /etc/namedb ]; then - warn "named chroot: /etc/namedb exists!" + if [ ! -L "${named_conf%/*}" ]; then + if [ -d "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} is a directory!" + elif [ -e "${named_conf%/*}" ]; then + warn "named chroot: ${named_conf%/*} exists!" else - ln -s ${named_chrootdir}/etc/namedb /etc/namedb + ln -s ${named_confdir} ${named_conf%/*} fi else # Make sure it points to the right place. - ln -shf ${named_chrootdir}/etc/namedb /etc/namedb + ln -shf ${named_confdir} ${named_conf%/*} fi # Mount a devfs in the chroot directory if needed @@ -180,12 +180,12 @@ named_prestart() # Create an rndc.key file for the user if none exists # confgen_command="${command%/named}/rndc-confgen -a -b256 -u $named_uid \ - -c ${named_chrootdir}/etc/namedb/rndc.key" - if [ -s "${named_chrootdir}/etc/namedb/rndc.conf" ]; then + -c ${named_confdir}/rndc.key" + if [ -s "${named_confdir}/rndc.conf" ]; then unset confgen_command fi - if [ -s "${named_chrootdir}/etc/namedb/rndc.key" ]; then - case `stat -f%Su ${named_chrootdir}/etc/namedb/rndc.key` in + if [ -s "${named_confdir}/rndc.key" ]; then + case `stat -f%Su ${named_confdir}/rndc.key` in root|$named_uid) ;; *) $confgen_command ;; esac @@ -199,8 +199,8 @@ named_prestart() warn "named_auto_forward enabled, but no /etc/resolv.conf" # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf ${command%/named}/named-checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' @@ -249,19 +249,19 @@ named_prestart() mv /var/run/naf-resolv.conf /etc/resolv.conf fi - if cmp -s ${named_chrootdir}/etc/namedb/auto_forward.conf \ + if cmp -s ${named_confdir}/auto_forward.conf \ /var/run/auto_forward.conf; then unlink /var/run/auto_forward.conf else - [ -e "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - unlink ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -e "${named_confdir}/auto_forward.conf" ] && + unlink ${named_confdir}/auto_forward.conf mv /var/run/auto_forward.conf \ - ${named_chrootdir}/etc/namedb/auto_forward.conf + ${named_confdir}/auto_forward.conf fi else # Empty the file in case it is included in named.conf - [ -s "${named_chrootdir}/etc/namedb/auto_forward.conf" ] && - create_file ${named_chrootdir}/etc/namedb/auto_forward.conf + [ -s "${named_confdir}/auto_forward.conf" ] && + create_file ${named_confdir}/auto_forward.conf fi ${command%/named}/named-checkconf $named_conf || @@ -275,5 +275,6 @@ load_rc_config $name required_dirs="$named_chrootdir" # if it is set, it must exist required_files="${named_conf:=/etc/namedb/named.conf}" pidfile="${named_pidfile:-/var/run/named/pid}" +named_confdir="${named_chrootdir}${named_conf%/*}" run_rc_command "$1" From owner-svn-src-stable-6@FreeBSD.ORG Fri Jan 15 03:10:09 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E690C106566B; Fri, 15 Jan 2010 03:10:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D48AF8FC16; Fri, 15 Jan 2010 03:10:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0F3A935028647; Fri, 15 Jan 2010 03:10:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F3A9JF028645; Fri, 15 Jan 2010 03:10:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150310.o0F3A9JF028645@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202336 - stable/6/etc/defaults X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:10:10 -0000 Author: dougb Date: Fri Jan 15 03:10:09 2010 New Revision: 202336 URL: http://svn.freebsd.org/changeset/base/202336 Log: MFC r201368: Update named_flags comment regarding not using it for -u and -c Modified: stable/6/etc/defaults/rc.conf Directory Properties: stable/6/etc/ (props changed) Modified: stable/6/etc/defaults/rc.conf ============================================================================== --- stable/6/etc/defaults/rc.conf Fri Jan 15 03:07:42 2010 (r202335) +++ stable/6/etc/defaults/rc.conf Fri Jan 15 03:10:09 2010 (r202336) @@ -222,7 +222,7 @@ inetd_flags="-wW -C 60" # Optional flag named_enable="NO" # Run named, the DNS server (or NO). named_program="/usr/sbin/named" # Path to named, if you want a different one. named_conf="/etc/namedb/named.conf" # Path to the configuration file -#named_flags="-c /etc/namedb/named.conf" # Uncomment for named not in /usr/sbin +#named_flags="" # Use this for flags OTHER than -u and -c named_pidfile="/var/run/named/pid" # Must set this in named.conf as well named_uid="bind" # User to run named as named_chrootdir="/var/named" # Chroot directory (or "" not to auto-chroot it) From owner-svn-src-stable-6@FreeBSD.ORG Fri Jan 15 11:32:52 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEA9106566C; Fri, 15 Jan 2010 11:32:52 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A828C8FC14; Fri, 15 Jan 2010 11:32: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 o0FBWq6F058317; Fri, 15 Jan 2010 11:32:52 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FBWqmM058310; Fri, 15 Jan 2010 11:32:52 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151132.o0FBWqmM058310@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 11:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202345 - in stable/6/sys/boot: common pc98 pc98/libpc98 pc98/loader X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 11:32:52 -0000 Author: nyan Date: Fri Jan 15 11:32:52 2010 New Revision: 202345 URL: http://svn.freebsd.org/changeset/base/202345 Log: MFC: revision 201339 and 201340 - Add setting machine type support to the loader. - Don't use 15M-16M area on pc98. It's reserved for some devices. Added: stable/6/sys/boot/pc98/libpc98/libpc98.h - copied unchanged from r201339, head/sys/boot/pc98/libpc98/libpc98.h stable/6/sys/boot/pc98/libpc98/pc98_sys.c - copied unchanged from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c Modified: stable/6/sys/boot/common/module.c stable/6/sys/boot/pc98/Makefile.inc stable/6/sys/boot/pc98/libpc98/Makefile stable/6/sys/boot/pc98/loader/main.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/common/module.c ============================================================================== --- stable/6/sys/boot/common/module.c Fri Jan 15 11:28:36 2010 (r202344) +++ stable/6/sys/boot/common/module.c Fri Jan 15 11:32:52 2010 (r202345) @@ -313,6 +313,9 @@ file_loadraw(char *type, char *name) char *cp; int fd, got; vm_offset_t laddr; +#ifdef PC98 + struct stat st; +#endif /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { @@ -334,6 +337,14 @@ file_loadraw(char *type, char *name) return(CMD_ERROR); } +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + if (loadaddr < 0x1000000 && + fstat(fd, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif + laddr = loadaddr; for (;;) { /* read in 4k chunks; size is not really important */ @@ -439,6 +450,14 @@ mod_loadkld(const char *kldname, int arg ; do { +#ifdef PC98 + /* We cannot use 15M-16M area on pc98. */ + struct stat st; + if (loadaddr < 0x1000000 && + stat(filename, &st) == 0 && + (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) + loadaddr = 0x1000000; +#endif err = file_load(filename, loadaddr, &fp); if (err) break; Modified: stable/6/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/6/sys/boot/pc98/Makefile.inc Fri Jan 15 11:28:36 2010 (r202344) +++ stable/6/sys/boot/pc98/Makefile.inc Fri Jan 15 11:32:52 2010 (r202345) @@ -7,7 +7,7 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -Os + -Os -DPC98 LDFLAGS+= -nostdlib # BTX components Modified: stable/6/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/6/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:28:36 2010 (r202344) +++ stable/6/sys/boot/pc98/libpc98/Makefile Fri Jan 15 11:32:52 2010 (r202345) @@ -7,7 +7,7 @@ INTERNALLIB= SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c biospci.c biossmap.c \ bootinfo.c bootinfo32.c comconsole.c devicename.c elf32_freebsd.c \ - i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ + i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c BOOT_COMCONSOLE_PORT?= 0x238 Copied: stable/6/sys/boot/pc98/libpc98/libpc98.h (from r201339, head/sys/boot/pc98/libpc98/libpc98.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/6/sys/boot/pc98/libpc98/libpc98.h Fri Jan 15 11:32:52 2010 (r202345, copy of r201339, head/sys/boot/pc98/libpc98/libpc98.h) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +void set_machine_type(void); Copied: stable/6/sys/boot/pc98/libpc98/pc98_sys.c (from r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/6/sys/boot/pc98/libpc98/pc98_sys.c Fri Jan 15 11:32:52 2010 (r202345, copy of r201339, head/sys/boot/pc98/libpc98/pc98_sys.c) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2009 TAKAHASHI Yoshihiro + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#define _KERNEL +#include + +/* + * Set machine type to PC98_SYSTEM_PARAMETER. + */ +void +set_machine_type(void) +{ + int i; + u_long ret, data; + + /* PC98_SYSTEM_PARAMETER (0x501) */ + ret = ((*(u_char *)PTOV(0xA1501)) & 0x08) >> 3; + + /* Wait V-SYNC */ + while (inb(0x60) & 0x20) {} + while (!(inb(0x60) & 0x20)) {} + + /* ANK 'A' font */ + outb(0xa1, 0x00); + outb(0xa3, 0x41); + + /* M_NORMAL, use CG window (all NEC OK) */ + for (i = data = 0; i < 4; i++) + data += *((u_long *)PTOV(0xA4000) + i); /* 0xa4000 */ + if (data == 0x6efc58fc) /* DA data */ + ret |= M_NEC_PC98; + else + ret |= M_EPSON_PC98; + ret |= (inb(0x42) & 0x20) ? M_8M : 0; + + /* PC98_SYSTEM_PARAMETER(0x400) */ + if ((*(u_char *)PTOV(0xA1400)) & 0x80) + ret |= M_NOTE; + if (ret & M_NEC_PC98) { + /* PC98_SYSTEM_PARAMETER(0x458) */ + if ((*(u_char *)PTOV(0xA1458)) & 0x80) + ret |= M_H98; + else + ret |= M_NOT_H98; + } else + ret |= M_NOT_H98; + + (*(u_long *)PTOV(0xA1620)) = ret; +} Modified: stable/6/sys/boot/pc98/loader/main.c ============================================================================== --- stable/6/sys/boot/pc98/loader/main.c Fri Jan 15 11:28:36 2010 (r202344) +++ stable/6/sys/boot/pc98/loader/main.c Fri Jan 15 11:32:52 2010 (r202345) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386/libi386.h" +#include "libpc98/libpc98.h" #include "btxv86.h" #define KARGS_FLAGS_CD 0x1 @@ -81,6 +82,9 @@ main(void) { int i; + /* Set machine type to PC98_SYSTEM_PARAMETER. */ + set_machine_type(); + /* Pick up arguments */ kargs = (void *)__args; initial_howto = kargs->howto; From owner-svn-src-stable-6@FreeBSD.ORG Fri Jan 15 12:52:46 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6898E1065670; Fri, 15 Jan 2010 12:52:46 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54D9C8FC15; Fri, 15 Jan 2010 12:52: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 o0FCqkGH076814; Fri, 15 Jan 2010 12:52:46 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FCqkDT076805; Fri, 15 Jan 2010 12:52:46 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001151252.o0FCqkDT076805@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 15 Jan 2010 12:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202356 - stable/6/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:52:46 -0000 Author: nyan Date: Fri Jan 15 12:52:45 2010 New Revision: 202356 URL: http://svn.freebsd.org/changeset/base/202356 Log: MFC: revision 200407 Cleanups the boot2 for pc98. There is no functional change. - Make setting machine type and getting geom conditional for future. - Remove unused RAWBOOT and CDBOOT supports. - Remove unneeded include. - Fix warnings. This change is directly merged into stable/6 because stable/[78] have new boot2. Modified: stable/6/sys/boot/pc98/boot2/Makefile stable/6/sys/boot/pc98/boot2/bios.S stable/6/sys/boot/pc98/boot2/boot.c stable/6/sys/boot/pc98/boot2/boot.h stable/6/sys/boot/pc98/boot2/disk.c stable/6/sys/boot/pc98/boot2/io.c stable/6/sys/boot/pc98/boot2/serial_16550.S stable/6/sys/boot/pc98/boot2/sys.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/6/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/Makefile Fri Jan 15 12:52:45 2010 (r202356) @@ -29,6 +29,12 @@ CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_ BOOT_COMCONSOLE_SPEED?=9600 CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} +# Set machine type to PC98_SYSTEM_PARAMETER +CFLAGS+= -DSET_MACHINE_TYPE + +# Initialize the bi_bios_geom using the BIOS geometry +CFLAGS+= -DGET_BIOSGEOM + # Enable code to take the default boot string from a fixed location on the # disk. See nextboot(8) and README.386BSD for more info. #CFLAGS+= -DNAMEBLOCK Modified: stable/6/sys/boot/pc98/boot2/bios.S ============================================================================== --- stable/6/sys/boot/pc98/boot2/bios.S Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/bios.S Fri Jan 15 12:52:45 2010 (r202356) @@ -91,8 +91,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFT #include "asm.h" .text -#ifndef CDBOOT - /* * PC-9801/PC-9821 SCSI MO booting * 2002/06/05-07/03 Kawanobe Koh @@ -198,98 +196,6 @@ read_end: ret -#else /* CDBOOT */ - - -/* - * int - * getbootspec(struct specpacket *offset) - * - * Read CD-ROM boot specification packet to "offset". - */ -ENTRY(getbootspec) - push %ebp - mov %esp, %ebp - - push %esi - push %ebx - - movw 0x8(%ebp), %si - mov $0x7f, %edx - - /* prot_to_real will set %es to BOOTSEG */ - call EXT(prot_to_real) /* enter real mode */ - movw $0x4b01, %ax /* (do not) terminate disk emulation */ - movb $0x7f, %dl /* any drive */ - - sti - int $0x13 - cli - - /* save return value (actually movw %ax, %bx) */ - mov %eax, %ebx - - data32 - call EXT(real_to_prot) /* back to protected mode */ - - xor %eax, %eax - movb %bh, %al /* return value in %ax */ - - pop %ebx - pop %esi - pop %ebp - - ret - - -/* - * int - * biosreadlba(struct daddrpacket *daddr) - * Read sectors using the BIOS "read extended" function - * BIOS call "INT 0x13 Function 0x42" to read sectors from disk into memory - * Call with %ah = 0x42 - * %dl = drive (0x0 for floppy disk, or emulated CD) - * %ds:%si = ptr to disk address packet - * Return: - * %ah = 0x0 on success; err code on failure - */ - -ENTRY(biosreadlba) - push %ebp - mov %esp, %ebp - - push %ebx - push %esi - - movw 8(%ebp), %si - movl $0, %edx /* emulated CD is always drive 0 */ - - /* prot_to_real will set %es to BOOTSEG */ - call EXT(prot_to_real) /* enter real mode */ - movw $0x4200, %ax /* subfunction */ - movb $0, %dl - - sti - int $0x13 - cli - - /* save return value (actually movw %ax, %bx) */ - mov %eax, %ebx - - data32 - call EXT(real_to_prot) /* back to protected mode */ - - xor %eax, %eax - movb %bh, %al /* return value in %ax */ - - pop %esi - pop %ebx - pop %ebp - - ret - -#endif /* !CDBOOT */ - /* * getc() * BIOS call "INT 18H Function 00H" to read character from keyboard Modified: stable/6/sys/boot/pc98/boot2/boot.c ============================================================================== --- stable/6/sys/boot/pc98/boot2/boot.c Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/boot.c Fri Jan 15 12:52:45 2010 (r202356) @@ -85,12 +85,13 @@ boot(int drive) unsigned char disk_equips; /* Pick up the story from the Bios on geometry of disks */ - +#ifdef GET_BIOSGEOM for(ret = 0; ret < 2; ret ++) { if (*(unsigned char*)V(0xA155d) & (1 << ret)) { bootinfo.bi_bios_geom[ret] = get_diskinfo(ret + 0x80); } } +#endif bootinfo.bi_basemem = memsize(0); bootinfo.bi_extmem = memsize(1); @@ -98,8 +99,10 @@ boot(int drive) gateA20(); +#ifdef SET_MACHINE_TYPE /* set machine type to PC98_SYSTEM_PARAMETER */ machine_check(); +#endif /* * The default boot device is the first partition in the Modified: stable/6/sys/boot/pc98/boot2/boot.h ============================================================================== --- stable/6/sys/boot/pc98/boot2/boot.h Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/boot.h Fri Jan 15 12:52:45 2010 (r202356) @@ -51,7 +51,7 @@ extern int loadflags; extern struct disklabel disklabel; /* asm.S */ -#if ASM_ONLY +#ifdef ASM_ONLY void real_to_prot(void); void prot_to_real(void); #endif @@ -84,9 +84,6 @@ void putchar(int c); void delay1ms(void); int gets(char *buf); int strcmp(const char *s1, const char *s2); -#ifdef CDBOOT -int strcasecmp(const char *s1, const char *s2); -#endif /* !CDBOOT */ void memcpy(const void *from, void *to, size_t len); void twiddle(void); void machine_check(void); Modified: stable/6/sys/boot/pc98/boot2/disk.c ============================================================================== --- stable/6/sys/boot/pc98/boot2/disk.c Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/disk.c Fri Jan 15 12:52:45 2010 (r202356) @@ -87,7 +87,6 @@ devopen(void) di = get_diskinfo(dosdev_copy); spc = (spt = SPT(di)) * HEADS(di); -#ifndef RAWBOOT if ((dosdev_copy & 0xf0) == 0x90) { boff = 0; @@ -119,7 +118,7 @@ devopen(void) boff = dl->d_partitions[part].p_offset - dl->d_partitions[2].p_offset + sector; } -#endif /* RAWBOOT */ + return 0; } Modified: stable/6/sys/boot/pc98/boot2/io.c ============================================================================== --- stable/6/sys/boot/pc98/boot2/io.c Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/io.c Fri Jan 15 12:52:45 2010 (r202356) @@ -162,7 +162,7 @@ delay1ms(void) (void)outb(0x5f,0); /* about 600ns */ } -static __inline int +static int isch(void) { int isc; @@ -182,7 +182,7 @@ isch(void) return (serial_ischar()); } -static __inline unsigned +static unsigned pword(unsigned physaddr) { static int counter = 0; @@ -246,24 +246,6 @@ strcmp(const char *s1, const char *s2) return 1; } -#ifdef CDBOOT -int -strcasecmp(const char *s1, const char *s2) -{ - /* - * We only consider ASCII chars and don't anticipate - * control characters (they are invalid in filenames - * anyway). - */ - while ((*s1 & 0x5f) == (*s2 & 0x5f)) { - if (!*s1++) - return 0; - s2++; - } - return 1; -} -#endif /* !CDBOOT */ - void memcpy(const void *from, void *to, size_t len) { @@ -349,6 +331,7 @@ void putc(int c) outb(0x60, pos >> 8); } +#ifdef SET_MACHINE_TYPE void machine_check(void) { int ret; @@ -394,3 +377,4 @@ void machine_check(void) (*(unsigned long *)V(0xA1620)) = ret; } +#endif Modified: stable/6/sys/boot/pc98/boot2/serial_16550.S ============================================================================== --- stable/6/sys/boot/pc98/boot2/serial_16550.S Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/serial_16550.S Fri Jan 15 12:52:45 2010 (r202356) @@ -67,7 +67,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFT .file "serial.S" -#include #include "asm.h" .text Modified: stable/6/sys/boot/pc98/boot2/sys.c ============================================================================== --- stable/6/sys/boot/pc98/boot2/sys.c Fri Jan 15 12:45:23 2010 (r202355) +++ stable/6/sys/boot/pc98/boot2/sys.c Fri Jan 15 12:52:45 2010 (r202356) @@ -53,10 +53,6 @@ static int mapblock; int poff; -#ifdef RAWBOOT -#define STARTBYTE 8192 /* Where on the media the kernel starts */ -#endif - static int block_map(int file_block); static int find(char *path); @@ -74,7 +70,6 @@ xread(char *addr, int size) } } -#ifndef RAWBOOT void read(char *buffer, int count) { @@ -102,40 +97,6 @@ read(char *buffer, int count) poff += size; } } -#else -void -read(char *buffer, int count) -{ - int cnt, bnum, off, size; - - off = STARTBYTE + poff; - poff += count; - - /* Read any unaligned bit at the front */ - cnt = off & 511; - if (cnt) { - size = 512-cnt; - if (count < size) - size = count; - devread(iobuf, off >> 9, 512); - memcpy(iobuf+cnt, buffer, size); - count -= size; - off += size; - buffer += size; - } - size = count & (~511); - if (size && (off & (~511))) { - devread(buffer, off >> 9, size); - off += size; - count -= size; - buffer += size; - } - if (count) { - devread(iobuf, off >> 9, 512); - memcpy(iobuf, buffer, count); - } -} -#endif static int find(char *path) @@ -263,7 +224,7 @@ openrd(void) biosdrive = biosdrivedigit - '0'; if (biosdrivedigit == '\0') { biosdrive = dosdev & 0x0f; -#if BOOT_HD_BIAS > 0 +#if defined(BOOT_HD_BIAS) && (BOOT_HD_BIAS > 0) /* XXX */ if (maj == 4) biosdrive += BOOT_HD_BIAS; @@ -299,7 +260,6 @@ openrd(void) if (devopen()) return 1; -#ifndef RAWBOOT /***********************************************\ * Load Filesystem info (mount the device) * \***********************************************/ @@ -316,6 +276,6 @@ openrd(void) return -1; } poff = 0; -#endif /* RAWBOOT */ + return 0; } From owner-svn-src-stable-6@FreeBSD.ORG Fri Jan 15 19:48:14 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649CC106566B; Fri, 15 Jan 2010 19:48:14 +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 52DFB8FC16; Fri, 15 Jan 2010 19:48: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 o0FJmEbf072517; Fri, 15 Jan 2010 19:48:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJmEOX072515; Fri, 15 Jan 2010 19:48:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151948.o0FJmEOX072515@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202415 - stable/6/lib/libc/stdio X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:48:14 -0000 Author: brueffer Date: Fri Jan 15 19:48:14 2010 New Revision: 202415 URL: http://svn.freebsd.org/changeset/base/202415 Log: MFC: r201836 Remove unnecessary quoting and markup, add missing punctuation. Modified: stable/6/lib/libc/stdio/getc.3 Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/stdio/getc.3 ============================================================================== --- stable/6/lib/libc/stdio/getc.3 Fri Jan 15 19:44:40 2010 (r202414) +++ stable/6/lib/libc/stdio/getc.3 Fri Jan 15 19:48:14 2010 (r202415) @@ -60,7 +60,7 @@ .Ft int .Fn getchar .Ft int -.Fn getchar_unlocked "void" +.Fn getchar_unlocked void .Ft int .Fn getw "FILE *stream" .Sh DESCRIPTION @@ -145,7 +145,7 @@ until the condition is cleared with .Sh STANDARDS The .Fn fgetc , -.Fn getc +.Fn getc , and .Fn getchar functions @@ -171,4 +171,3 @@ The size and byte order of an varies from one machine to another, and .Fn getw is not recommended for portable applications. -.Pp From owner-svn-src-stable-6@FreeBSD.ORG Sat Jan 16 09:25:25 2010 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E4361065672; Sat, 16 Jan 2010 09:25:25 +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 EFC058FC18; Sat, 16 Jan 2010 09:25: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 o0G9POta053158; Sat, 16 Jan 2010 09:25:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G9PO8w053156; Sat, 16 Jan 2010 09:25:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001160925.o0G9PO8w053156@svn.freebsd.org> From: Christian Brueffer Date: Sat, 16 Jan 2010 09:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202436 - stable/6/share/man/man4 X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 09:25:25 -0000 Author: brueffer Date: Sat Jan 16 09:25:24 2010 New Revision: 202436 URL: http://svn.freebsd.org/changeset/base/202436 Log: MFC: r201888 bridge(4) acts like a switch, not like a hub. Modified: stable/6/share/man/man4/if_bridge.4 Directory Properties: stable/6/share/man/man4/ (props changed) Modified: stable/6/share/man/man4/if_bridge.4 ============================================================================== --- stable/6/share/man/man4/if_bridge.4 Sat Jan 16 09:24:12 2010 (r202435) +++ stable/6/share/man/man4/if_bridge.4 Sat Jan 16 09:25:24 2010 (r202436) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2007 +.Dd January 9, 2010 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -94,7 +94,7 @@ The address can be changed by assigning A bridge can be used to provide several services, such as a simple 802.11-to-Ethernet bridge for wireless hosts, and traffic isolation. .Pp -A bridge works like a hub, forwarding traffic from one interface +A bridge works like a switch, forwarding traffic from one interface to another. Multicast and broadcast packets are always forwarded to all interfaces that are part of the bridge.